/* Theme */

:root {
  --bg: #0b0a09;
  --ink: #f3efe6;
  --muted: #9c9388;
  --line: #2c2622;
  --red: #b71b1c;
  --red-hot: #9d1618;
  --red-deep: #7a1612;
  --second: #c4b49a;
  --field: #141211;
  --raised: #1a1714;
  --panel: #100e0c;
  --on-red: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body.is-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 56% 34% at 50% 40%, rgba(120, 18, 14, 0.62), transparent 70%),
    radial-gradient(ellipse 36% 22% at 78% 18%, rgba(138, 120, 96, 0.28), transparent 64%),
    radial-gradient(ellipse 140% 80% at 50% 120%, #000, transparent 55%),
    var(--bg);
}

body.is-gate .hero {
  width: 100%;
  flex: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 40% at 50% 10%, rgba(92, 16, 12, 0.48), transparent 62%),
    radial-gradient(ellipse 46% 26% at 82% 0%, rgba(138, 120, 96, 0.28), transparent 62%),
    radial-gradient(ellipse 140% 70% at 50% 120%, #000, transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.embers {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 42dvh;
  overflow: hidden;
  pointer-events: none;
  background: none;
}

.embers span {
  position: absolute;
  bottom: -6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8ec 0%, #ffc56a 32%, #e25816 58%, rgba(183, 27, 28, 0) 74%);
  box-shadow:
    0 0 3px 1px rgba(255, 244, 220, 0.95),
    0 8px 11px 1px rgba(183, 27, 28, 0.55);
  opacity: 0;
  --sway: 6s;
  --life: 12s;
  --glow: 2.6s;
  --lag: -2s;
  animation-name: ember-sway, ember-rise, ember-glow;
  animation-duration: var(--sway), var(--life), var(--glow);
  animation-delay: 0s, var(--lag), calc(var(--lag) * 0.25);
  animation-timing-function: ease-in-out, linear, ease-in-out;
  animation-iteration-count: infinite;
}

.embers span:nth-child(4n + 1) {
  width: 2px;
  height: 2px;
  box-shadow:
    0 0 3px 0 rgba(255, 236, 200, 1),
    0 5px 7px 1px rgba(183, 27, 28, 0.45);
}

.embers span:nth-child(4n) {
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #fff 0%, #ffd18a 26%, #c43712 52%, rgba(122, 22, 18, 0) 74%);
  box-shadow:
    0 0 4px 2px rgba(255, 220, 160, 0.9),
    0 12px 16px 2px rgba(183, 27, 28, 0.55);
  --life: 16s;
  --sway: 8s;
  animation-name: ember-sway-wide, ember-rise, ember-glow;
}

.embers span:nth-child(3n) {
  animation-name: ember-sway-alt, ember-rise, ember-glow;
}

.embers span:nth-child(4n + 2) {
  animation-name: ember-sway, ember-die, ember-glow;
}

.embers span:nth-child(1) { left: 3%; --sway: 6.4s; --life: 11s; --glow: 2.4s; --lag: -1s; }
.embers span:nth-child(2) { left: 8%; --sway: 7s; --life: 14s; --glow: 3.1s; --lag: -6s; }
.embers span:nth-child(3) { left: 14%; --sway: 5.6s; --life: 9s; --glow: 2.2s; --lag: -3s; }
.embers span:nth-child(4) { left: 19%; --sway: 8.2s; --life: 17s; --glow: 3.4s; --lag: -9s; }
.embers span:nth-child(5) { left: 26%; --sway: 6s; --life: 12s; --glow: 2.6s; --lag: -2s; }
.embers span:nth-child(6) { left: 33%; --sway: 7.4s; --life: 15s; --glow: 2.9s; --lag: -8s; }
.embers span:nth-child(7) { left: 39%; --sway: 5.2s; --life: 10s; --glow: 2.1s; --lag: -4s; }
.embers span:nth-child(8) { left: 45%; --sway: 8.6s; --life: 18s; --glow: 3.6s; --lag: -11s; }
.embers span:nth-child(9) { left: 51%; --sway: 6.8s; --life: 13s; --glow: 2.5s; --lag: -5s; }
.embers span:nth-child(10) { left: 57%; --sway: 5.8s; --life: 9.5s; --glow: 2.8s; --lag: -7s; }
.embers span:nth-child(11) { left: 63%; --sway: 7.8s; --life: 16s; --glow: 2.3s; --lag: -1.5s; }
.embers span:nth-child(12) { left: 69%; --sway: 6.2s; --life: 11.5s; --glow: 3.2s; --lag: -10s; }
.embers span:nth-child(13) { left: 74%; --sway: 7.2s; --life: 14.5s; --glow: 2s; --lag: -3.5s; }
.embers span:nth-child(14) { left: 80%; --sway: 5.4s; --life: 8.5s; --glow: 2.7s; --lag: -6.5s; }
.embers span:nth-child(15) { left: 86%; --sway: 8.4s; --life: 17.5s; --glow: 3.3s; --lag: -12s; }
.embers span:nth-child(16) { left: 91%; --sway: 6.6s; --life: 12.5s; --glow: 2.35s; --lag: -2.5s; }
.embers span:nth-child(17) { left: 95%; --sway: 5.9s; --life: 10.5s; --glow: 3s; --lag: -8.5s; }
.embers span:nth-child(18) { left: 98%; --sway: 7.6s; --life: 15.5s; --glow: 2.45s; --lag: -4.5s; }

@keyframes ember-sway {
  0%, 100% { translate: -11px 0; }
  50% { translate: 13px 0; }
}

@keyframes ember-sway-alt {
  0%, 100% { translate: 12px 0; }
  50% { translate: -14px 0; }
}

@keyframes ember-sway-wide {
  0%, 100% { translate: -18px 0; }
  50% { translate: 16px 0; }
}

@keyframes ember-rise {
  0% { transform: translateY(0) scale(0.45); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(-42dvh) scale(0.2); opacity: 0; }
}

@keyframes ember-die {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  12% { opacity: 1; }
  58% { transform: translateY(-20dvh) scale(0.4); opacity: 0.35; }
  74% { transform: translateY(-26dvh) scale(0.2); opacity: 0; }
  100% { transform: translateY(-26dvh) scale(0.2); opacity: 0; }
}

@keyframes ember-glow {
  0%, 100% { filter: brightness(0.9); }
  42% { filter: brightness(1.65); }
  68% { filter: brightness(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .embers {
    display: none;
  }
}

/* Welcome bar */

.welcome {
  position: sticky;
  top: 0;
  z-index: 4;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1.25rem;
  width: 100%;
  margin: 0;
  min-height: 2.15rem;
  padding: 0.2rem 1.25rem;
  background: var(--panel);
  font-size: 0.85rem;
}

.welcome::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--second));
}

.welcome-id {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.welcome p {
  margin: 0;
}

.welcome .welcome-tag {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}

nav.welcome a,
nav.welcome a:hover,
nav.welcome a:focus-visible {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.welcome .welcome-tag a.welcome-place,
nav.welcome a.welcome-place:hover,
nav.welcome a.welcome-place:focus-visible {
  color: var(--red);
}

.welcome a:hover,
.welcome a:focus-visible,
.welcome a.is-on {
  border-bottom-color: var(--red);
}

.welcome .welcome-brand,
.welcome .welcome-brand:hover,
.welcome .welcome-brand:focus-visible,
.welcome .mark-home,
.welcome .mark-home:hover,
.welcome .mark-home:focus-visible {
  border-bottom-color: transparent;
}

.welcome a.has-notice {
  position: relative;
}

.welcome a.has-notice::after {
  content: "";
  position: absolute;
  top: -0.15rem;
  right: -0.65rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--red);
}

.welcome .mark-home {
  display: flex;
  flex: none;
  line-height: 0;
}

.welcome .mark-home img {
  width: 1.5rem;
  height: 1.5rem;
  mix-blend-mode: lighten;
}

.petition-call {
  position: relative;
  z-index: 3;
  padding: 0.7rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.petition-call p {
  margin: 0;
}

.petition-call a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.petition-call a:hover,
.petition-call a:focus-visible {
  color: var(--on-red);
}

.welcome-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.35rem 1.25rem;
}

.welcome-links form {
  margin: 0;
}

body:has(.welcome) .toast {
  top: 2.15rem;
}

/* Home hero */

.hero {
  position: relative;
  z-index: 0;
  flex-shrink: 0;
  height: 42dvh;
  overflow: hidden;
  background: var(--bg);
}

.hero-art {
  position: absolute;
  left: 0;
  right: 0;
  top: -25%;
  height: 150%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 10, 9, 0.22), rgba(11, 10, 9, 0.08) 42%, var(--bg));
  pointer-events: none;
}

.hero-slot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  width: min(72rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 0 0 1.1rem;
}

body.is-admin .hero-slot {
  width: min(110rem, calc(100% - 4rem));
}

.hero-offset {
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
  text-shadow: 0 1px 2px #000;
}

.hero-picks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-picks li {
  position: relative;
  min-width: 0;
}

.hero-picks button {
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
}

.hero-picks img {
  display: block;
  width: 100%;
  height: 7rem;
  object-fit: cover;
  object-position: center;
}

.hero-picks button.is-on {
  border-color: var(--red);
}

.hero-picks li.is-off img {
  opacity: 0.38;
}

.hero-picks .hero-toggle {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: auto;
  padding: 0.12rem 0.4rem;
  color: var(--ink);
  background: rgba(7, 6, 5, 0.82);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.hero-picks .hero-toggle[aria-pressed="false"] {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .hero-art {
    top: 0;
    height: 100%;
    transform: none !important;
  }
}

main {
  position: relative;
  z-index: 2;
  width: min(86rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 4.5rem 0 5rem;
}

body:has(.hero) main {
  padding-top: 1.75rem;
}

body.is-home main {
  width: min(86rem, calc(100% - 2.5rem));
  margin-top: 0;
  padding: 1.15rem 0 2.5rem;
}

body:not(.is-gate):not(.is-admin) main {
  width: min(86rem, calc(100% - 2.5rem));
}

body.is-profile:not(.is-gate) main,
body.is-census:not(.is-gate) main,
body.is-database:not(.is-gate) main {
  width: min(86rem, calc(100% - 2.5rem));
}

body.is-guild main,
body.is-applications main {
  width: min(42rem, calc(100% - 2.5rem));
}

.footer-credit {
  position: relative;
  z-index: 4;
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: 0;
  padding: 0 1.25rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
}

.footer-credit-link {
  color: var(--second);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.18em;
}

.footer-credit-link:hover,
.footer-credit-link:focus-visible {
  color: var(--ink);
}

.forazeroth {
  display: inline-block;
  background-image: linear-gradient(
    90deg,
    #b71b1c 0%,
    #a32238 16%,
    #8c2a52 32%,
    #6e336e 48%,
    #503b88 64%,
    #3244a2 80%,
    #1a4fad 100%
  );
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 800% 100%;
  animation: forazerothGlow 3s ease-in-out infinite, forazerothShimmer 8s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(183, 27, 28, 0.45)) drop-shadow(0 0 15px rgba(26, 79, 173, 0.35));
}

@keyframes forazerothGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(183, 27, 28, 0.45)) drop-shadow(0 0 15px rgba(26, 79, 173, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(183, 27, 28, 0.7)) drop-shadow(0 0 20px rgba(26, 79, 173, 0.55));
  }
}

@keyframes forazerothShimmer {
  0% { background-position: 0% center; }
  100% { background-position: 100% center; }
}

@media (prefers-reduced-motion: reduce) {
  .forazeroth { animation: none; }
}

.guild-petition textarea {
  min-height: 9rem;
}

.application-flow .guild-open,
.application-flow .guild-closed {
  display: none;
}

.application-flow.is-guild-open .guild-open,
.application-flow.is-block-in .guild-closed[data-block="in"],
.application-flow.is-block-armory .guild-closed[data-block="armory"],
.application-flow.is-block-held .guild-closed[data-block="held"] {
  display: block;
}

/* Census */

.census-tabs {
  margin-top: 1.75rem;
}

.census-tabs .tabs {
  margin-bottom: 1.35rem;
}

.census-tabs #tab-guild[aria-selected="true"] {
  color: var(--red);
}

.census-side {
  margin-top: 2.5rem;
}

.census-tabs .census-side {
  margin-top: 0;
}

.census-side > h2 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.census-side > .empty {
  margin: 0;
}

.census-side .guild-census {
  margin-top: 1.35rem;
}

.census-side .guild-census h3 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.guild-census {
  margin-top: 2.5rem;
}

.guild-census ul,
.character-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.character-cards {
  margin-top: 1.75rem;
}

.guild-census a,
.character-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.guild-census a > span,
.character-card > span {
  min-width: 0;
}

.guild-census img,
.guild-census .no-face,
.guild-census .mark-face,
.character-card img,
.character-card .no-face,
.character-card .mark-face {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.guild-census .mark-face,
.character-card .mark-face {
  display: block;
  overflow: hidden;
  background: var(--field);
}

.guild-census .mark-face img,
.character-card .mark-face img {
  width: 100%;
  height: 100%;
  padding: 0.45rem;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
  mix-blend-mode: lighten;
}

.guild-census .no-face,
.character-card .no-face {
  background: var(--field);
}

.guild-census .nameplate,
.character-card .nameplate {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.guild-census .name,
.character-card .name {
  display: inline;
  font-weight: 600;
  border-bottom: 1px solid var(--second);
  text-align: center;
}

.guild-census .guild-tag,
.character-card .guild-tag {
  display: block;
  margin-top: 0.05rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
  text-align: center;
}

.guild-census .meta,
.character-card .meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

header {
  text-align: center;
}

header img {
  display: block;
  width: 7.5rem;
  height: auto;
  margin: 0 auto;
}

h1 {
  margin: 1.25rem 0 0;
  color: var(--second);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

/* Sign-in gate */

.gate {
  margin-top: 1.5rem;
  text-align: center;
}

.gate::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 1px;
  margin: 0 auto 1rem;
  background: var(--red-deep);
}

.gate-note {
  margin: 0 0 1.25rem;
  color: var(--ink);
}

body.is-database .gate-note + p {
  text-align: center;
}

.copy,
.ranks {
  margin-top: 2.15rem;
}

.copy h2,
.ranks h2 {
  margin-bottom: 0.6rem;
}

.copy p,
.ranks p {
  margin-top: 0.55rem;
}

.copy a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.copy a:hover,
.copy a:focus-visible {
  color: var(--on-red);
}

.ranks ol {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.ranks li {
  margin-top: 0.85rem;
}

.ranks li span:not(.tip, .tip *) {
  display: block;
  font-weight: 600;
}

/* Founder tree */

.tree {
  margin-top: 1.75rem;
  text-align: center;
}

.ranks .tree + h2 {
  margin-top: 2.5rem;
}

.tree-root {
  display: inline-block;
  position: relative;
  padding-bottom: 1.35rem;
}

.tree-root::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 1.35rem;
  border-left: 1px solid var(--red-deep);
}

.tree span:not(.tip, .tip *) {
  display: block;
  font-weight: 600;
}

.ranks .tree p {
  margin: 0.3rem 0 0;
  color: var(--ink);
}

.tree .vacant {
  color: var(--muted);
  font-style: italic;
}

.tree-person {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.tree-person img,
.tree-person .no-face {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.tree-person .no-face {
  background: var(--field);
}

.tree a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.tree ul {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree ul ul {
  position: relative;
  margin-top: 1.35rem;
}

.tree ul ul::before {
  content: "";
  position: absolute;
  top: -1.35rem;
  left: 50%;
  height: 1.35rem;
  border-left: 1px solid var(--red-deep);
}

.tree ul > li {
  position: relative;
  flex: 1;
  max-width: 14rem;
  padding: 1.35rem 0.75rem 0;
}

.tree ul > li:has(> ul) {
  max-width: 32rem;
}

.tree ul > li.tree-council {
  flex: 0 1 auto;
  max-width: none;
}

.tree-council .tree-people {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}

.ranks .tree-council .tree-people .tree-person {
  margin: 0;
}

.tree ul > li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--red-deep);
}

.tree ul > li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 1.35rem;
  border-left: 1px solid var(--red-deep);
}

.tree ul > li:first-child::before {
  left: 50%;
}

.tree ul > li:last-child::before {
  right: 50%;
}

@media (max-width: 40rem) {
  .tree ul {
    flex-direction: column;
    align-items: center;
  }

  .tree ul > li {
    width: 100%;
    max-width: none;
    padding-top: 1rem;
  }

  .tree ul > li::before,
  .tree ul ul::before {
    display: none;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
}

.tabs button {
  margin: 0;
  padding: 0 0 0.15rem;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--red);
}

.is-tabbed .tab-panel {
  display: none;
}

.is-tabbed .tab-panel.is-active {
  display: block;
}

.denials {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.denials li {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  align-items: baseline;
  margin-top: 0.85rem;
  color: var(--muted);
}

.denials span {
  color: var(--ink);
  font-weight: 600;
}

.denials .applicant {
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.denials p {
  margin: 0;
  color: var(--ink);
  text-align: right;
}

@media (max-width: 40rem) {
  .denials li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .denials .applicant,
  .denials p {
    text-align: left;
  }
}

h2 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

form {
  display: flex;
  flex-direction: column;
}

label {
  margin: 0.85rem 0 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 0;
}

textarea {
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--second);
  outline: none;
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

form button {
  margin-top: 1.15rem;
  padding: 0.65rem 0.8rem;
  color: var(--on-red);
  background: var(--red);
  border: 0;
  cursor: pointer;
}

form button:hover,
form button:focus-visible {
  background: var(--red-hot);
}

form button:disabled {
  opacity: 0.45;
  cursor: default;
}

form button:disabled:hover,
form button:disabled:focus-visible {
  background: var(--red);
}

#character-check.is-found {
  color: var(--ink);
}

.prose-tools {
  display: flex;
  align-items: stretch;
  margin-top: 0.85rem;
  background: var(--raised);
  border: 1px solid var(--line);
  border-bottom: 0;
}

label + .prose-tools {
  margin-top: 0;
}

.prose-tools button,
.story-form .wiki-body .prose-tools button {
  width: auto;
  margin: 0;
  padding: 0.4rem 0.75rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
}

.prose-tools button:last-child {
  border-right: 0;
}

.prose-tools button:hover,
.prose-tools button:focus-visible {
  color: var(--ink);
  background: transparent;
}

.prose-tools button:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: -1px;
}

.prose-tools button.is-on {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--red);
}

.prose-tools button[data-prose="bold"] {
  font-weight: 600;
}

.prose-tools button[data-prose="italic"] {
  font-style: italic;
}

.prose-tools button[data-prose="heading"] {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.prose-tools + textarea,
.story-form .wiki-body .prose-tools + textarea,
.prose-tools + .mention-field textarea,
.story-form .wiki-body .prose-tools + .mention-field textarea {
  padding: 0.7rem 0.75rem;
  background: var(--field);
  border: 1px solid var(--line);
  border-top: 0;
}

.prose-tools + .mention-field textarea,
.story-form .wiki-body .prose-tools + .mention-field textarea {
  background: transparent;
}

.mention-field {
  position: relative;
  width: 100%;
  background: var(--field);
}

.mention-field textarea {
  position: relative;
  z-index: 1;
  background: transparent;
}

.mention-mirror {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  color: transparent;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.mention-ghost {
  color: var(--muted);
}

.mention-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--field);
}

.mention-list[hidden] {
  display: none;
}

.mention-list button {
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.7rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.mention-list button:last-child {
  border-bottom: 0;
}

.mention-list button.is-on,
.mention-list button:hover {
  color: var(--on-red);
  background: var(--red);
}

.mention-list .mention-side {
  margin-left: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.mention-list button.is-on .mention-side,
.mention-list button:hover .mention-side {
  color: var(--on-red);
}

a.signin,
button.signin,
a.download {
  display: inline-block;
  min-width: 14rem;
  padding: 0.8rem 1.25rem;
  color: var(--on-red);
  background: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  letter-spacing: 0.03em;
  text-decoration: none;
  text-align: center;
}

a.signin:hover,
a.signin:focus-visible,
button.signin:hover,
button.signin:focus-visible,
a.download:hover,
a.download:focus-visible {
  background: var(--red-hot);
}

.empty a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.toast {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 50%;
  width: min(32rem, calc(100% - 2rem));
  margin: 0;
  padding: 0.9rem 1.15rem;
  color: var(--ink);
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
  border-bottom: 2px solid var(--red);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -100%);
  animation: toast-in 0.35s ease forwards;
}

@keyframes toast-in {
  to {
    transform: translate(-50%, 0);
  }
}

.toast.is-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  from {
    transform: translate(-50%, 0);
  }

  to {
    transform: translate(-50%, -100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-out {
    animation: none;
    transform: translate(-50%, 0);
  }
}

::selection {
  background: var(--red);
  color: var(--on-red);
}

body.is-admin main {
  width: min(110rem, calc(100% - 4rem));
}

body.is-admin h1,
.page-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: 0;
}

.admin-head,
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.admin-head a,
.page-head a {
  margin-left: auto;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.page-head .head-links {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-left: auto;
}

.page-head .head-links a,
.page-head .head-links button {
  margin-top: 0;
  margin-left: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--red);
  cursor: pointer;
}

.page-head .head-links form {
  display: block;
  margin: 0;
}

.page-head .visibility {
  display: flex;
  margin: 0;
}

.page-head .visibility button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.page-head .visibility button:hover,
.page-head .visibility button:focus-visible {
  color: var(--ink);
  background: transparent;
}

.page-head .visibility .switch {
  position: relative;
  width: 1.7rem;
  height: 0.95rem;
  border-radius: 999px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line);
}

.page-head .visibility .switch::after {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--muted);
}

.page-head .visibility button[aria-pressed="true"] {
  color: var(--ink);
}

.page-head .visibility button[aria-pressed="true"] .switch {
  background: var(--red);
  box-shadow: none;
}

.page-head .visibility button[aria-pressed="true"] .switch::after {
  left: 0.88rem;
  background: var(--on-red);
}

.admin-head .admin-links {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-left: auto;
}

.admin-head .admin-links a {
  margin-left: 0;
}

nav a:hover,
nav a:focus-visible,
.admin-head a:hover,
.admin-head a:focus-visible,
.page-head a:hover,
.page-head a:focus-visible,
.page-head .head-links button:hover,
.page-head .head-links button:focus-visible {
  color: var(--on-red);
}

.empty {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.75rem;
}

#portrait-file,
#face-file {
  margin-top: 0.75rem;
}

/* Character page */

.wiki {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  column-gap: 2rem;
  align-items: start;
  margin-top: 0.5rem;
}

.wiki-heading,
.gallery {
  grid-column: 1 / -1;
}

.wiki > .wiki-body,
.profile-tabs {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.wiki-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.wiki-heading h1 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0;
}

.wiki-heading h1 span {
  overflow-wrap: anywhere;
}

.wiki-heading .import {
  align-self: end;
  margin: 0 0 0.15rem;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--red);
  font: inherit;
  cursor: pointer;
}

.wiki-heading .import:hover,
.wiki-heading .import:focus-visible {
  color: var(--ink);
}

.wiki-heading:has(.heading-notes) {
  flex-wrap: wrap;
}

.wiki-heading .heading-notes {
  display: flex;
  flex: 1 0 100%;
  align-items: baseline;
  justify-content: flex-end;
  gap: 1rem;
  margin: 0.15rem 0 0;
}

.wiki-heading .import-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.profile-updated {
  margin: 0.15rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.45;
}

.character-cards .card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0.35rem 0 0 5.4rem;
  color: var(--muted);
}

.character-cards .card-actions form {
  display: flex;
  margin: 0;
}

.character-cards .card-actions button {
  width: auto;
  margin: 0;
  padding: 0.28rem 0.6rem;
}

.wiki-heading .import-note {
  text-align: right;
}

.import-note a {
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--red);
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  text-decoration: none;
}

.import-note form {
  display: inline;
}

.import-note form button {
  width: auto;
  margin: 0;
}

.wiki-face {
  position: relative;
  flex: none;
}

.wiki-face img,
.wiki-face .no-face {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.wiki-face .edit {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 1.35rem;
  height: 1.35rem;
  background: var(--panel);
  border-color: var(--red-deep);
}

.wiki-heading h1 .edit {
  width: 1.35rem;
  height: 1.35rem;
}

.wiki-face .edit svg,
.wiki-heading h1 .edit svg {
  width: 0.7rem;
  height: 0.7rem;
}

.wiki-face .no-face {
  background: var(--field);
}

.wiki-face.is-mark {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--field);
  border: 2px solid #241c18;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    0 0 0 1px var(--red-deep),
    0 0 0 3px #14110f;
}

.wiki-face.is-mark img {
  width: 100%;
  height: 100%;
  padding: 0.45rem;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
  mix-blend-mode: lighten;
}

.wiki-face img,
.wiki-face .no-face,
.guild-census img,
.guild-census .no-face,
.guild-census .mark-face,
.character-card img,
.character-card .no-face,
.character-card .mark-face {
  border: 2px solid #241c18;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    0 0 0 1px var(--red-deep),
    0 0 0 3px #14110f;
}

.tree-person img,
.tree-person .no-face,
.person img {
  border: 1px solid #241c18;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    0 0 0 1px var(--red-deep),
    0 0 0 2px #14110f;
}

button.edit {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

button.edit svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

button.edit:hover,
button.edit:focus-visible {
  color: var(--ink);
  border-color: var(--red);
}

.infobox {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.appearance {
  position: relative;
}

.appearance .portrait,
.appearance-empty {
  display: block;
  width: 100%;
  margin: 0;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--raised);
}

.appearance .edit {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
}

.appearance-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--raised);
}

.appearance-stage {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.appearance-stage .portrait,
.appearance-view .appearance-frame .portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  aspect-ratio: auto;
  object-fit: cover;
}

.appearance-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0 0 0.12rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.appearance-prev {
  left: 0.45rem;
}

.appearance-next {
  right: 0.45rem;
}

.appearance-arrow:hover,
.appearance-arrow:focus-visible {
  background: var(--red);
}

.appearance-more {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr));
  gap: 0.35rem;
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.appearance-more button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.appearance-more button.is-on,
.appearance-more button.is-target {
  border-color: var(--red);
}

.appearance-more button[draggable="true"] {
  cursor: grab;
}

.appearance-more button.is-dragging {
  opacity: 0.45;
}

.appearance-more img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

dialog.appearance-view:not([open]) {
  display: none;
}

dialog.appearance-view[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.5rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: auto;
}

dialog.appearance-view::backdrop {
  background: rgba(0, 0, 0, 0.84);
}

.appearance-view-frame {
  position: relative;
  width: min(32rem, calc((100dvh - 9rem) * 0.75), 100%);
}

.appearance-view .portrait {
  display: block;
  background: var(--raised);
}

.appearance-view .appearance-more {
  grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr));
  margin-top: 0.55rem;
}

.appearance-view-frame .appearance-frame > button[data-close] {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 1;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.appearance-view-frame .appearance-frame > button[data-close]:hover,
.appearance-view-frame .appearance-frame > button[data-close]:focus-visible {
  background: var(--red);
}

.infobox .sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem 1rem;
  margin: 0;
  padding: 0.85rem 0.9rem 1rem;
}

.infobox .sheet .wide {
  grid-column: 1 / -1;
}

.infobox .sheet > div > span.rank-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.infobox .sheet > div > span.rank-label .edit {
  margin-left: auto;
}

.infobox .sheet > div > span,
.infobox .sheet .sheet-character > div > span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.1;
}

.infobox .sheet p {
  margin: 0.08rem 0 0;
  font-weight: 600;
  line-height: 1.15;
}

.sheet-character {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem 1rem;
}

.infobox .sheet #relations {
  grid-column: 1 / -1;
}

.infobox .sheet .professions {
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.relations {
  padding: 0.95rem 0 0;
  border-top: 1px solid var(--line);
}

.relations h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.relations h2 .edit {
  margin: 0;
}

.infobox .sheet p.relation-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.4rem;
  row-gap: 0.08rem;
  margin: 0.95rem 0 0;
  line-height: 1.15;
}

.relation-line > span,
.relation-current li > span:first-child {
  flex: 1 0 100%;
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.1;
}

.relation-line em,
.relation-current em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
  font-size: 0.75rem;
}

.wiki .infobox .sheet .relations a.char-link,
.relation-current a.char-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.wiki .infobox .sheet .relations a.char-link:hover,
.wiki .infobox .sheet .relations a.char-link:focus-visible,
.relation-current a.char-link:hover,
.relation-current a.char-link:focus-visible {
  color: var(--on-red);
}

.relation-current {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.relation-current li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.75rem;
  row-gap: 0.08rem;
  margin-top: 0.95rem;
}

.relation-current form {
  margin-left: auto;
}

.relation-current button {
  width: auto;
  margin: 0;
  padding: 0.28rem 0.6rem;
}

.relation-matches {
  display: flex;
  flex-direction: column;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
}

.relation-matches button {
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  color: var(--ink);
  background: var(--field);
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.relation-matches button:last-child {
  border-bottom: 0;
}

.relation-matches button:hover,
.relation-matches button:focus-visible {
  color: var(--on-red);
  background: var(--red);
}

.relation-requests {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.relation-requests p {
  margin: 0;
}

.relation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.45rem;
}

.relation-actions form {
  display: flex;
  margin: 0;
}

.relation-actions button {
  width: auto;
  margin: 0;
  padding: 0.28rem 0.6rem;
}

.profile-tabs {
  display: flow-root;
}

.profile-tabs .tabs {
  margin-bottom: 1.1rem;
}

.profile-tabs .armory {
  clear: none;
  margin-top: 0;
}

.profile-tabs .armory-grid {
  margin-top: 0;
}

/* Posts */

.feed-compose,
.feed-card {
  margin: 0 0 0.85rem;
  padding: 0.85rem 0.9rem 0.75rem;
  background: var(--raised);
  border: 1px solid var(--line);
}

.feed-compose {
  position: relative;
}

.feed-compose textarea {
  min-height: 4.2rem;
}

.feed-compose input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.updates {
  padding: 0.95rem 1.1rem 1.1rem;
  background: var(--field);
  border: 1px solid var(--line);
}

.updates .feed-card:last-child {
  margin-bottom: 0;
}

.view-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.wiki-body .view-head h2 {
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0;
}

.view-head button {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.75rem;
  color: var(--on-red);
  background: var(--red);
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
}

.view-head button:hover,
.view-head button:focus-visible {
  color: var(--on-red);
  background: var(--red-hot);
}

.updates-more {
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--red);
  font: inherit;
  cursor: pointer;
}

.updates-more:hover,
.updates-more:focus-visible {
  color: var(--on-red);
  background: transparent;
}

.updates-more {
  margin-top: 0.35rem;
}

.character-details {
  margin-top: 2.25rem;
}

.character-details h2 .profile-updated {
  margin: 0 0 0 auto;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.character-details h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.character-details h3 .edit {
  margin-left: auto;
}

#post-dialog {
  width: min(40rem, calc(100% - 2rem));
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--raised);
  border-color: #3a322c;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

#post-dialog h2 {
  margin: 0 0 1rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#post-dialog .feed-compose {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

#post-dialog textarea {
  width: 100%;
  min-height: 9rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  resize: vertical;
}

#post-dialog textarea:focus-visible {
  border-color: #5c5048;
  outline: none;
}

#post-dialog .feed-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 0.85rem;
}

#post-dialog .feed-slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #4a433c;
  background: transparent;
}

#post-dialog .feed-slot.is-locked {
  border-color: #2a2623;
  opacity: 0.38;
}

#post-dialog .feed-add,
#post-dialog .feed-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  color: #6f675f;
  background: transparent;
  border: 0;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
}

#post-dialog .feed-slot.is-locked .feed-plus {
  cursor: default;
}

#post-dialog .feed-slot.is-open .feed-add {
  color: #b7aea4;
  cursor: pointer;
}

#post-dialog .feed-slot.is-open:hover,
#post-dialog .feed-slot.is-open:focus-within,
#post-dialog .feed-slot.is-over {
  border-color: #8a8178;
}

#post-dialog .feed-view {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000;
  border: 0;
  cursor: zoom-in;
}

#post-dialog .feed-view img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#post-dialog .feed-remove {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  z-index: 1;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

#post-dialog .feed-remove:hover,
#post-dialog .feed-remove:focus-visible,
#edit-dialog .feed-remove:hover,
#edit-dialog .feed-remove:focus-visible {
  background: var(--red);
}

#edit-dialog input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

#edit-dialog .face-slots,
#edit-dialog .picture-slots {
  display: grid;
  gap: 0.65rem;
}

#edit-dialog .face-slots {
  grid-template-columns: repeat(5, 1fr);
}

.face-crop-frame {
  height: min(22rem, 60vh);
  overflow: hidden;
  background: #000;
}

.face-crop-frame img {
  display: block;
  max-width: 100%;
}

.face-crop .modal-actions {
  margin-top: 1rem;
}

#edit-dialog .picture-slots {
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
}

#edit-dialog .feed-slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #4a433c;
  background: transparent;
}

#edit-dialog .face-slots .feed-slot,
#edit-dialog .face-slots .feed-view,
#edit-dialog .face-slots .feed-view img,
#edit-dialog .face-slots .feed-add,
#edit-dialog .face-slots .feed-plus {
  border-radius: 50%;
}

#edit-dialog .feed-slot.is-locked {
  border-color: #2a2623;
  opacity: 0.38;
}

#edit-dialog .feed-slot.is-current {
  border-color: #b7aea4;
}

#edit-dialog .feed-add,
#edit-dialog .feed-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  color: #6f675f;
  background: transparent;
  border: 0;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1;
}

#edit-dialog .feed-slot.is-locked .feed-plus {
  cursor: default;
}

#edit-dialog .feed-slot.is-open .feed-add {
  color: #b7aea4;
  cursor: pointer;
}

#edit-dialog .feed-slot.is-open:hover,
#edit-dialog .feed-slot.is-open:focus-within,
#edit-dialog .feed-slot.is-over {
  border-color: #8a8178;
}

#edit-dialog .feed-view {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000;
  border: 0;
  cursor: pointer;
}

#edit-dialog .face-slots .feed-view {
  cursor: pointer;
}

#edit-dialog .picture-slots .feed-view {
  cursor: grab;
}

#edit-dialog .appearance-note {
  margin: -0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

#edit-dialog .picture-slots .feed-slot.is-lead,
#edit-dialog .picture-slots .feed-slot.is-target {
  border-color: var(--red);
}

#edit-dialog .picture-slots .feed-slot.is-dragging {
  opacity: 0.45;
}

#edit-dialog .picture-slots .feed-remove {
  cursor: pointer;
}

#edit-dialog .feed-view img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#edit-dialog .feed-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 1;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

dialog.feed-preview:not([open]) {
  display: none;
}

dialog.feed-preview[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.5rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}

dialog.feed-preview::backdrop {
  background: rgba(0, 0, 0, 0.84);
}

.feed-preview-frame {
  position: relative;
  max-width: min(72rem, 100%);
  max-height: 100%;
}

.feed-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 3rem);
  object-fit: contain;
}

.feed-preview button {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.feed-preview button:hover,
.feed-preview button:focus-visible {
  background: var(--red);
}

#post-dialog .modal-actions {
  margin-top: 1rem;
}

#post-dialog .modal-actions button {
  margin-top: 0;
  min-width: 5.5rem;
}

.feed-card header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.feed-card header form {
  display: block;
  margin: 0 0 0 auto;
}

.feed-card header button,
.feed-card .honor button {
  width: auto;
  margin: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.feed-card header button:hover,
.feed-card header button:focus-visible,
.feed-card .honor button:hover,
.feed-card .honor button:focus-visible {
  color: var(--ink);
  background: transparent;
  border-bottom-color: var(--red);
}

.feed-card .honor {
  display: block;
  margin: 0.75rem 0 0;
}

.feed-card .honor button.is-honored,
.feed-card .honor button.is-honored span {
  color: var(--red);
}

.feed-card p {
  margin: 0.55rem 0 0;
}

.feed-pics {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.7rem;
  overflow: hidden;
}

.feed-pics img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.feed-pics-1 {
  display: block;
}

.feed-pics-1 img {
  width: 100%;
  height: auto;
  max-height: 36rem;
  object-fit: contain;
  background: #000;
}

.feed-pics-2,
.feed-pics-3,
.feed-pics-4 {
  aspect-ratio: 16 / 10;
}

.feed-pics-2,
.feed-pics-4 {
  grid-template-columns: 1fr 1fr;
}

.feed-pics-4 {
  grid-template-rows: 1fr 1fr;
}

.feed-pics-3 {
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.feed-pics-3 img:first-child {
  grid-row: span 2;
}

.honor-count {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.wiki-body {
  overflow: visible;
  line-height: 1.65;
}

.wiki-body h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.wiki-body > h2:first-child {
  margin-top: 0;
}

.wiki-body h2 .edit,
.wiki-body h2 form {
  margin-left: auto;
}

.wiki-body h2 form {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
}

.wiki-body p {
  margin: 1rem 0 0;
  overflow-wrap: break-word;
}

.wiki-body > :first-child {
  margin-top: 0;
}

.wiki-body strong {
  font-weight: 600;
}

.wiki-body em {
  font-style: italic;
}

.wiki .wiki-body a,
.wiki .infobox .sheet a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 0;
}

.wiki .wiki-body a:hover,
.wiki .wiki-body a:focus-visible,
.wiki .infobox .sheet a:hover,
.wiki .infobox .sheet a:focus-visible {
  color: var(--second);
}

.wiki .wiki-body a:hover .tip,
.wiki .wiki-body a:focus-visible .tip,
.wiki .infobox .sheet a:hover .tip,
.wiki .infobox .sheet a:focus-visible .tip {
  color: var(--ink);
}

.story-form .wiki-heading h1 input,
.story-form .wiki-body textarea {
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
}

.story-form .wiki-heading:focus-within {
  border-bottom-color: var(--red);
}

.story-form .wiki-heading h1 input {
  font-size: 2rem;
  font-weight: 600;
}

.story-form .wiki-body textarea {
  min-height: 16rem;
  line-height: 1.45;
}

.story-form .wiki-body > button {
  width: 100%;
  margin-top: 1.25rem;
}

.people-picks p {
  color: var(--muted);
}

.people-picks ul {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.people-picks label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.people-picks input {
  width: auto;
  margin: 0;
  padding: 0;
}

.gallery {
  clear: both;
  margin-top: 2.5rem;
}

.gallery h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gallery h2 .edit {
  margin-left: auto;
}

.gallery ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.gallery figure:hover,
.gallery figure:focus-within {
  border-color: var(--red);
}

.gallery a {
  color: inherit;
  text-decoration: none;
}

.gallery a:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: -1px;
}

.gallery img {
  display: block;
  width: 100%;
  height: 9rem;
  object-fit: cover;
}

.gallery figcaption {
  margin: 0;
  padding: 0.55rem 0.7rem 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.gallery figure:has(form) figcaption {
  padding-bottom: 0;
}

.gallery form {
  display: block;
}

.gallery form button,
.wiki-body h2 form button {
  margin: 0.4rem 0.6rem 0.55rem;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.wiki-body h2 form button {
  margin: 0;
}

.gallery form button:hover,
.gallery form button:focus-visible,
.wiki-body h2 form button:hover,
.wiki-body h2 form button:focus-visible {
  color: var(--ink);
  background: transparent;
  border-bottom-color: var(--red);
}

/* Armory tab */

.armory {
  clear: both;
  margin-top: 2.5rem;
}

.armory h2 {
  margin-top: 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.armory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1.5rem;
  margin-top: 0.85rem;
}

.armory-slot {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  margin-top: 0.35rem;
}

.armory-slot .mark {
  display: block;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background-color: var(--field);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.armory-slot .q,
.armory-slot .meta,
.armory-slot .enchant {
  display: block;
}

.armory-slot .q {
  overflow-wrap: anywhere;
}

.armory-slot .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.armory-slot .enchant {
  color: #8fbf8f;
  font-size: 0.78rem;
}

.armory-slot.is-empty .mark {
  opacity: 0.45;
}

.armory-weapons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.armory-weapons .armory-slot {
  flex: 1 1 14rem;
}

.armory-layout {
  display: grid;
  gap: 1.5rem;
}

.armory-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem 1.75rem;
  margin-top: 0.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.armory-stats h2 {
  margin-bottom: 0;
}

.armory-stats dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.28rem 0.85rem;
  margin: 0.45rem 0 0;
}

.armory-stats dt {
  color: var(--muted);
}

.armory-stats dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 68rem) {
  .armory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .armory-grid,
  .armory-stats {
    grid-template-columns: 1fr;
  }
}

.moderate {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.moderate article {
  border: 1px solid var(--line);
  background: var(--panel);
}

.moderate article > a {
  display: block;
  border-bottom: 0;
}

.moderate .meta a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.moderate .meta a:hover,
.moderate .meta a:focus-visible {
  color: var(--on-red);
}

.moderate img {
  display: block;
  width: 100%;
  height: 14rem;
  object-fit: contain;
  background: #000;
  border-bottom: 0;
}

.moderate .meta {
  padding: 0.65rem 0.75rem 0.8rem;
}

.moderate .meta p {
  margin: 0.2rem 0 0;
}

.moderate .kind {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.moderate form button {
  margin-top: 0.75rem;
  padding: 0.35rem 0.7rem;
}

dialog {
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1.5rem 1.5rem 1.25rem;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid #3a322c;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  overflow: auto;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

dialog form[hidden] {
  display: none;
}

dialog h2 {
  margin: 0 0 1rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

dialog textarea {
  width: 100%;
  min-height: 9rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  resize: vertical;
}

dialog textarea:focus-visible {
  border-color: #5c5048;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

dialog .modal-actions button {
  margin-top: 0;
  min-width: 5.5rem;
}

dialog .modal-actions button[data-close] {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

dialog .modal-actions button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 52rem) {
  .wiki,
  .wiki.story-form {
    grid-template-columns: 1fr;
  }

  .wiki > .wiki-body,
  .profile-tabs,
  .infobox {
    grid-column: 1;
    grid-row: auto;
  }

  .infobox {
    width: min(18rem, 100%);
    margin-bottom: 1.5rem;
  }
}

/* Admin tables */

.sheet {
  margin-top: 2.5rem;
}

.sheet h2 {
  margin-bottom: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.7rem 1.25rem 0.7rem 0;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.person img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
}

.person a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.person a:hover,
.person a:focus-visible {
  color: var(--on-red);
}

td.note,
td.decision {
  white-space: normal;
}

td.note {
  min-width: 16rem;
  white-space: pre-wrap;
}

td.decision p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

td.petition-cell {
  white-space: normal;
  vertical-align: top;
}

td .petition {
  margin: 0.45rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.deny-form {
  margin-top: 0.45rem;
}

.deny-form input {
  width: 14rem;
  padding: 0.35rem 0.5rem;
}

.rank-form {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.rank-form select {
  width: auto;
  min-width: 9.5rem;
  padding: 0.35rem 0.5rem;
}

.rank-form button {
  margin-top: 0;
  padding: 0.35rem 0.7rem;
}

.member-add {
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}

.member-add label {
  margin: 0;
}

.member-add input {
  width: 14rem;
}

.password-once {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--red);
}

.password-once strong {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.catalog-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  margin: 0.85rem 0 0;
}

.catalog-picks a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.catalog-picks a.is-on {
  color: var(--ink);
  border-bottom-color: var(--red);
}

.catalog-picks a:hover,
.catalog-picks a:focus-visible {
  color: var(--on-red);
}

form.catalog-find {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 1.15rem;
}

form.catalog-find label {
  display: flex;
  flex-direction: column;
  width: auto;
  margin: 0;
}

form.catalog-find input,
form.catalog-find select {
  width: 14rem;
}

form.catalog-find .level-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

form.catalog-find .level-range input {
  width: 4.25rem;
}

form.catalog-find a.usable,
form.catalog-find a.clear {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.55rem;
}

form.catalog-find a.usable.is-on {
  color: var(--ink);
  border-bottom-color: var(--red);
}

form.catalog-find a.usable:hover,
form.catalog-find a.usable:focus-visible,
form.catalog-find a.clear:hover,
form.catalog-find a.clear:focus-visible {
  color: var(--on-red);
}

form.catalog-find button {
  width: auto;
  margin-top: 0;
}

.catalog {
  margin-top: 0.35rem;
}

.catalog .mark {
  display: inline-block;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  background-color: var(--field);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.catalog th a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.catalog th a.is-on {
  color: var(--ink);
  border-bottom-color: var(--red);
}

.catalog th a:hover,
.catalog th a:focus-visible {
  color: var(--on-red);
}

.catalog td.item-name {
  white-space: normal;
  min-width: 14rem;
}

.catalog td.item-name span {
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.catalog-pages {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.catalog-pages a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
}

.catalog-pages a:hover,
.catalog-pages a:focus-visible {
  color: var(--on-red);
}

.catalog-pages .is-on {
  color: var(--ink);
  border-bottom: 1px solid var(--red);
}

.catalog-pages .gap {
  color: var(--muted);
}

.table-wrap:has(.catalog) {
  overflow: visible;
}

.item-hover {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  outline: none;
}

.item-hover:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.armory-slot .item-hover {
  display: block;
  flex: none;
}

/* Name and item tips */

.item-hover .tip,
.char-link .tip {
  display: none;
  position: absolute;
  z-index: 5;
  left: 0;
  bottom: calc(100% + 0.35rem);
  width: 16.5rem;
  max-width: 16.5rem;
  padding: 0.55rem 0.7rem 0.65rem;
  color: var(--ink);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  background: #070605;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: none;
}

.item-hover:hover .tip,
.item-hover:focus-visible .tip,
.item-hover .tip.is-open,
.char-link:hover .tip,
.char-link:focus-visible .tip {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.armory-grid > div:nth-child(2) .tip {
  left: auto;
  right: 0;
}

.tip-name {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
}

.char-link .tip-portrait {
  display: block;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  margin-top: 0.45rem;
  object-fit: contain;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.tip-line,
.tip-pair,
.tip-dps,
.tip-stat,
.tip-ilvl {
  font-size: 0.82rem;
  line-height: 1.35;
}

.item-hover .tip > span {
  min-width: 0;
  max-width: 100%;
}

.char-link {
  position: relative;
}

.welcome .char-link .tip {
  bottom: auto;
  top: calc(100% + 0.35rem);
}

.tip-pair {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.tip-dps {
  color: var(--muted);
}

.tip-stat {
  color: #1eff00;
}

.tip-ilvl {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.item-sheet {
  margin-top: 1.5rem;
}

.item-sheet .item-hover {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.item-sheet .mark {
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  background-color: var(--field);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.item-sheet .tip.is-open {
  position: static;
  width: 18rem;
  pointer-events: auto;
}

.catalog td.item-name a,
.armory-slot a.q {
  color: inherit;
  text-decoration: none;
}

.catalog td.item-name a:hover,
.catalog td.item-name a:focus-visible,
.armory-slot a.q:hover,
.armory-slot a.q:focus-visible {
  text-decoration: underline;
}

.armory-slot .meta .item-hover,
.armory-slot .meta a.q {
  display: inline;
}
