/* Ellen Studio: the site's iron, wax and flame (web/site/assets/css/site.css), set dense for
   a working tool. Text and hairlines; the only filled shape is the torn banner. */

@font-face {
  font-family: "Grenze Gotisch";
  src: url("/assets/fonts/grenze-gotisch/grenze-gotisch-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans/alegreya-sans-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans/alegreya-sans-latin-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans/alegreya-sans-latin-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/alegreya-sans/alegreya-sans-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --iron-0: #08090c;
  --iron-1: #111419;
  --iron-2: #1a1e25;
  --iron-3: #282d36;
  --iron-4: #3a414c;
  --steel: #7f8a96;
  --wax: #ddd3b8;
  --wax-dim: #9a937f;
  --ash: #5e5f66;
  --parchment: #cdbf9b;
  --ink: #231c14;
  --lit: #ffe0a3;
  --flame: #ff9a3c;
  --flame-hot: #ffd27f;
  --flame-dim: #a8561c;
  --cold: #8fcfe6;
  --heal: #9fd6b0;
  --sheet: #040405;
  --error: #e3898d;

  --aspect-flame: #e3843a;
  --aspect-tide: #3f8f8c;
  --aspect-ash: #6e5b7e;
  --aspect-iron: #7d8794;
  --aspect-wild: #5f8045;
  --aspect-neutral: #a39b85;
  --rarity-common: #565b64;
  --rarity-uncommon: #6f9e88;
  --rarity-rare: #5d88c2;
  --rarity-epic: #9064bd;
  --rarity-legendary: #e2a548;
  --rarity-unique: #e0dacb;

  --hair: rgba(154, 147, 127, 0.22);
  --hair-strong: rgba(154, 147, 127, 0.42);
  --font-head: "Grenze Gotisch", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --top-h: 2.9rem;
  --list-w: 21rem;

  color-scheme: dark;
}

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

html {
  background: var(--iron-0);
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--iron-0);
  color: var(--wax);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--lit);
  text-decoration: none;
}
a:hover {
  color: var(--flame-hot);
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.45rem;
  margin-top: 2rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--hair);
}
h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
}
h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wax-dim);
}

p {
  margin: 0.4rem 0;
}
code {
  font-family: var(--font-code);
  font-size: 0.86em;
  color: var(--parchment);
}
.quiet {
  color: var(--wax-dim);
}
.measure {
  max-width: 44rem;
}
.ok {
  color: var(--heal);
}
.bad {
  color: var(--error);
}

:focus-visible {
  outline: 1px solid var(--flame);
  outline-offset: 2px;
}

.banner {
  display: inline-block;
  position: relative;
  padding: 0.3em 2.4em 0.36em 0.9em;
  margin-left: -0.9em;
  isolation: isolate;
}
.banner::before {
  content: "";
  position: absolute;
  inset: -0.15em -0.5em -0.2em 0;
  z-index: -1;
  background: url("/assets/img/torn-banner.svg") center / 100% 100% no-repeat;
}

/* ---------- Controls ---------- */

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.22rem 0.1rem;
  border: 0;
  border-bottom: 1px solid var(--hair-strong);
  border-radius: 0;
  background: transparent;
  color: var(--wax);
}
select {
  appearance: none;
  padding-right: 1rem;
  background: linear-gradient(45deg, transparent 50%, var(--wax-dim) 50%) right 0.45rem center / 0.32rem 0.32rem no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--wax-dim) 50%) right 0.13rem center / 0.32rem 0.32rem no-repeat;
}
select option {
  background: var(--iron-1);
}
textarea {
  display: block;
  resize: vertical;
  padding: 0.3rem 0.5rem;
  border-bottom: 0;
  border-left: 1px solid var(--hair-strong);
  background: var(--iron-1);
  line-height: 1.4;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--flame);
}
input[readonly] {
  color: var(--wax-dim);
  border-bottom-style: dotted;
}
input::placeholder,
textarea::placeholder {
  color: var(--ash);
}
input[type="checkbox"] {
  accent-color: var(--flame);
  margin: 0 0.35rem 0 0;
}
.code {
  font-family: var(--font-code);
  font-size: 0.84rem;
}
.code--full {
  min-height: 24rem;
}

.btn {
  display: inline-block;
  padding: 0.24rem 0.85rem;
  border: 1px solid var(--hair-strong);
  border-radius: 0;
  background: transparent;
  color: var(--wax);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--wax-dim);
  color: var(--lit);
  text-decoration: none;
}
.btn:disabled {
  color: var(--ash);
  border-color: var(--hair);
  cursor: default;
}
.btn--flame {
  border-color: var(--flame-dim);
  color: var(--flame-hot);
}
.btn--flame:hover:not(:disabled) {
  border-color: var(--flame);
}
.btn--quiet {
  border-color: transparent;
  color: var(--wax-dim);
}
.btn--danger:hover:not(:disabled) {
  color: var(--error);
  border-color: var(--error);
}
.btn--sm {
  padding: 0.1rem 0.6rem;
  font-size: 0.9rem;
}
.mini,
.linkish {
  padding: 0 0.3rem;
  border: 0;
  background: none;
  color: var(--wax-dim);
  font-size: 0.82rem;
  cursor: pointer;
}
.linkish {
  font-size: inherit;
  color: var(--lit);
}
.mini:hover:not(:disabled),
.linkish:hover {
  color: var(--flame-hot);
}
.mini:disabled {
  color: var(--iron-4);
  cursor: default;
}
.mini--add {
  color: var(--lit);
  padding: 0.2rem 0;
}

.chip {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wax-dim);
  white-space: nowrap;
}
.chip--draft {
  color: var(--flame);
}
.chip--ready {
  color: var(--heal);
}
.chip--taken {
  color: var(--cold);
}
.chip--deletes,
.chip--bad {
  color: var(--error);
}
.chip--voice {
  color: var(--cold);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translate(-50%, 1rem);
  padding: 0.4rem 1.1rem;
  background: var(--sheet);
  border-bottom: 1px solid var(--heal);
  color: var(--wax);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 20;
}
.toast--bad {
  border-color: var(--error);
}
.toast--on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Sign in ---------- */

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.boot__line {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--wax-dim);
}
.signin {
  width: min(24rem, 100%);
  display: grid;
  gap: 0.9rem;
}
.signin .banner {
  justify-self: start;
}

/* ---------- Shell ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  height: var(--top-h);
  padding: 0 1.1rem;
  background: var(--iron-0);
  border-bottom: 1px solid var(--hair);
}
.top__brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--wax);
}
.top__brand span {
  margin-left: 0.35rem;
  color: var(--flame);
}
.top__brand:hover {
  text-decoration: none;
  color: var(--lit);
}
.top__nav {
  display: flex;
  gap: 1.2rem;
  flex: 1;
}
.top__nav a {
  padding: 0.1rem 0;
  color: var(--wax-dim);
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.top__nav a.on {
  color: var(--wax);
  border-bottom-color: var(--flame);
}
.top__nav a:hover {
  color: var(--lit);
  text-decoration: none;
}
.top__right {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.92rem;
}

.shell {
  display: grid;
  grid-template-columns: var(--list-w) minmax(0, 1fr);
}
.wide .shell {
  grid-template-columns: minmax(0, 1fr);
}
.wide .list {
  display: none;
}
.main {
  padding: 1.1rem 1.6rem 5rem;
  min-width: 0;
}
.wide .main {
  max-width: 74rem;
}
.main__empty {
  margin-top: 3rem;
}

/* ---------- List ---------- */

.list {
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hair);
}
.list__head {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.8rem 0.3rem;
}
.list__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.7rem;
  align-items: center;
  padding: 0 0.8rem 0.5rem;
  border-bottom: 1px solid var(--hair);
  font-size: 0.86rem;
}
.list__filters select {
  width: auto;
  max-width: 9.5rem;
  border-bottom-color: transparent;
  color: var(--wax-dim);
}
.list__count {
  margin-left: auto;
  color: var(--ash);
}
.list__rows {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 2rem;
}
.list__file {
  margin: 0.7rem 0.8rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}
.list__row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.14rem 0.8rem 0.14rem 0.7rem;
  border-left: 2px solid transparent;
  color: var(--wax);
  white-space: nowrap;
}
.list__row:hover,
.list__row:focus-visible {
  background: var(--iron-1);
  color: var(--lit);
  text-decoration: none;
  outline: none;
}
.list__row.on {
  border-left-color: var(--flame);
  background: var(--iron-1);
}
.list__row--gone .list__name {
  text-decoration: line-through;
  color: var(--wax-dim);
}
.list__name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.list__meta {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ash);
  font-size: 0.84rem;
}
.list__badges {
  flex: none;
}
.list__none {
  padding: 1rem 0.8rem;
}
.dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ash);
  transform: translateY(-0.05rem);
}
.dot--flame {
  background: var(--aspect-flame);
}
.dot--tide {
  background: var(--aspect-tide);
}
.dot--ash {
  background: var(--aspect-ash);
}
.dot--iron {
  background: var(--aspect-iron);
}
.dot--wild {
  background: var(--aspect-wild);
}
.dot--neutral {
  background: var(--aspect-neutral);
}
.dot--story {
  background: var(--flame);
}
.dot--side {
  background: var(--steel);
}
.dot--party {
  background: var(--cold);
}
.dot--voiced {
  background: var(--wax-dim);
}
.dot--thing {
  background: var(--iron-4);
}

/* ---------- Editor ---------- */

.ed__meta {
  margin: 0.5rem 0 0;
  color: var(--wax-dim);
  font-size: 0.92rem;
}
.ed__note {
  font-style: italic;
}
.ed__bar {
  position: sticky;
  top: var(--top-h);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.7rem -0.4rem 0;
  padding: 0.45rem 0.4rem;
  background: var(--iron-0);
  border-bottom: 1px solid var(--hair);
}
.ed__noteinput {
  flex: 1 1 14rem;
  width: auto;
}
.ed__dirty {
  color: var(--flame);
  font-size: 0.88rem;
}
.ed__alerts {
  margin-top: 0.6rem;
}
.alert {
  margin: 0.6rem 0;
  padding: 0.1rem 0 0.1rem 0.8rem;
  border-left: 2px solid var(--wax-dim);
}
.alert--bad {
  border-left-color: var(--error);
}
.alert--bad h3 {
  color: var(--error);
}
.alert--warn {
  border-left-color: var(--flame);
  color: var(--lit);
}
.alert--voice {
  border-left-color: var(--cold);
}
.alert summary {
  cursor: pointer;
  font-weight: 700;
}
.findings,
.voice,
.history {
  margin: 0.3rem 0;
  padding: 0;
  list-style: none;
}
.findings li,
.voice li,
.history li {
  padding: 0.1rem 0;
}
.token {
  font-size: 1rem;
  color: var(--flame-hot);
  user-select: all;
  word-break: break-all;
}

.tabs {
  display: flex;
  gap: 1.3rem;
  margin-top: 0.9rem;
  border-bottom: 1px solid var(--hair);
}
.tab {
  padding: 0.25rem 0;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--wax-dim);
  cursor: pointer;
}
.tab:hover {
  color: var(--lit);
}
.tab--on {
  color: var(--wax);
  border-bottom-color: var(--flame);
}
.ed__body {
  padding-top: 0.9rem;
}
.ed__split--side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19.5rem;
  gap: 2rem;
  align-items: start;
}

.form--narrow {
  max-width: 30rem;
  display: grid;
  gap: 0.9rem;
}
.form--narrow .banner {
  justify-self: start;
}
.group {
  margin: 0 0 1.1rem;
  padding: 0.55rem 0 0;
  border: 0;
  border-top: 1px solid var(--hair);
  min-width: 0;
}
.group > legend {
  padding: 0 0.7rem 0 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wax-dim);
}
.group > legend::before {
  content: "";
  display: inline-block;
  width: 1.2rem;
  height: 1px;
  margin-right: 0.6rem;
  vertical-align: middle;
  background: var(--flame);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  align-items: flex-start;
  margin: 0.3rem 0;
}
.row > .check,
.row > .mover,
.reply > .check,
.reply > .mover,
.bark > .mover {
  margin-top: 1.05rem;
}
.row > .btn,
.row > .mini {
  align-self: center;
}
.row--add input {
  width: 14rem;
}
.field {
  display: block;
  flex: 1 1 9rem;
  min-width: 0;
  margin: 0.25rem 0;
}
.field--wide {
  flex: 3 1 18rem;
}
.field--narrow {
  flex: 0 0 5.2rem;
}
.field__label {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--wax-dim);
}
.field__hint {
  display: block;
  font-size: 0.82rem;
  color: var(--ash);
}
.field__error {
  display: block;
  font-size: 0.86rem;
  color: var(--error);
}
.field__count {
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}
.field__count--over {
  color: var(--error);
}
.has-problem > .field__label,
.has-problem > legend {
  color: var(--error);
}
.has-problem input,
.has-problem select,
.has-problem textarea {
  border-color: var(--error);
}
.check {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  white-space: nowrap;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
}
.mover {
  display: inline-flex;
  margin-left: auto;
  flex: none;
}
.ro {
  color: var(--wax-dim);
}

.effect,
.objective,
.node,
.reply,
.bark,
.steptalk {
  margin: 0.5rem 0;
  padding-left: 0.8rem;
  border-left: 1px solid var(--hair-strong);
}
.reply {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  align-items: flex-start;
  margin-left: 1.6rem;
  border-left-style: dotted;
}
.bark {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  align-items: flex-start;
}
.talk,
.lines {
  margin: 0.5rem 0;
}
.line {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) 5.4rem;
  gap: 0.4rem;
  align-items: start;
  margin: 0.2rem 0;
}
.line__n {
  color: var(--ash);
  font-size: 0.82rem;
  padding-top: 0.3rem;
  text-align: right;
}
.line__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 0.8rem;
}
.chain {
  margin: 0.3rem 0;
  padding-left: 1.5rem;
}
.chain li {
  padding: 0.12rem 0;
}
.chain li > * {
  margin-right: 0.6rem;
}
.chain .mover {
  float: right;
}

/* ---------- Script ---------- */

.script {
  max-width: 46rem;
}
.script__part {
  margin: 1.1rem 0 0.4rem;
}
.script__who {
  margin-left: 0.7rem;
  color: var(--flame);
  letter-spacing: 0.06em;
}
.script__step {
  margin-top: 1.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--hair);
  color: var(--wax);
}
.script__objective {
  color: var(--wax-dim);
  padding-left: 1rem;
}
.script__objective::before {
  content: "- ";
}
.script__node {
  margin: 0.5rem 0 0;
  font-family: var(--font-code);
  font-size: 0.78rem;
  color: var(--ash);
}
.script__line,
.script__reply {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.8rem;
  margin: 0.15rem 0;
}
.script__speaker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wax-dim);
  text-align: right;
  padding-top: 0.2rem;
}
.script__text {
  font-size: 1.08rem;
}
.script__reply .script__text {
  color: var(--wax-dim);
  font-style: italic;
  font-size: 1rem;
}
.script__to {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ash);
}
.script__line--new .script__text,
.script__line--changed .script__text {
  color: var(--cold);
}

/* ---------- Diff ---------- */

.diff__legend {
  font-family: var(--font-code);
  font-size: 0.8rem;
}
.diff__body {
  margin: 0.3rem 0;
  padding: 0.3rem 0 0.3rem 0.7rem;
  border-left: 1px solid var(--hair-strong);
  font-family: var(--font-code);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--wax-dim);
}
.diff__add {
  color: var(--heal);
}
.diff__del {
  color: var(--error);
}
.diff__skip {
  color: var(--ash);
}

/* ---------- Dashboard ---------- */

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.8rem;
  align-items: baseline;
  margin: 0.9rem 0 0.6rem;
}
.counts b {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 500;
  margin-right: 0.3rem;
  color: var(--lit);
}
.counts .bad b {
  color: var(--error);
}
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4rem 0;
}
.table th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ash);
  font-weight: 700;
  padding: 0.2rem 0.8rem 0.2rem 0;
  border-bottom: 1px solid var(--hair-strong);
}
.table td {
  padding: 0.2rem 0.8rem 0.2rem 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: baseline;
}
.table select,
.row > select,
.row > input[type="text"] {
  width: auto;
  min-width: 9rem;
}
form.row > input[type="text"],
.row--wide > input[type="text"] {
  flex: 0 1 24rem;
}
.voiceblock {
  margin: 0.7rem 0;
}

/* ---------- Card preview: 140 by 196 units, as client/ui/cards/card_view.gd lays it out ---------- */

.preview {
  position: sticky;
  top: calc(var(--top-h) + 3.6rem);
}
.preview__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.cv__rarity {
  width: auto;
  font-size: 0.86rem;
  border-bottom-color: transparent;
  color: var(--wax-dim);
}
.cv {
  --rarity: var(--rarity-common);
  --aspect: var(--aspect-neutral);
  position: relative;
  width: calc(var(--u) * 140);
  height: calc(var(--u) * 196);
  --u: 2px;
  background: #141211;
  border-radius: calc(var(--u) * 5);
  box-shadow: inset 0 0 0 calc(var(--u) * 1) #000, inset 0 0 0 calc(var(--u) * 1.6) var(--rarity);
  overflow: hidden;
}
.cv--uncommon {
  --rarity: var(--rarity-uncommon);
}
.cv--rare {
  --rarity: var(--rarity-rare);
}
.cv--epic {
  --rarity: var(--rarity-epic);
}
.cv--legendary {
  --rarity: var(--rarity-legendary);
}
.cv--unique {
  --rarity: var(--rarity-unique);
}
.cv--flame {
  --aspect: var(--aspect-flame);
}
.cv--tide {
  --aspect: var(--aspect-tide);
}
.cv--ash {
  --aspect: var(--aspect-ash);
}
.cv--iron {
  --aspect: var(--aspect-iron);
}
.cv--wild {
  --aspect: var(--aspect-wild);
}
.cv > * {
  position: absolute;
}
.cv__art {
  left: calc(var(--u) * 6);
  top: calc(var(--u) * 17);
  width: calc(var(--u) * 128);
  height: calc(var(--u) * 80);
  background: linear-gradient(160deg, var(--iron-2), var(--iron-0));
  border-bottom: calc(var(--u) * 1) solid var(--aspect);
  overflow: hidden;
}
.cv__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cv__noart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--u) * 5.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
}
.cv__name {
  left: calc(var(--u) * 30);
  top: calc(var(--u) * 2.5);
  width: calc(var(--u) * 94);
  height: calc(var(--u) * 14);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-family: var(--font-head);
  line-height: calc(var(--u) * 14);
  color: var(--wax);
}
.cv__name {
  font-size: calc(var(--u) * 10.5);
}
.cv__cost,
.cv__atk,
.cv__hp {
  width: calc(var(--u) * 21);
  height: calc(var(--u) * 21);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0b0b0d;
  box-shadow: inset 0 0 0 calc(var(--u) * 0.8) var(--wax-dim);
  font-family: var(--font-head);
  color: var(--lit);
}
.cv__cost,
.cv__atk,
.cv__hp {
  font-size: calc(var(--u) * 13);
}
.cv__cost {
  left: calc(var(--u) * 5);
  top: calc(var(--u) * 5);
  box-shadow: inset 0 0 0 calc(var(--u) * 0.8) var(--flame-dim);
}
.cv__extra {
  left: calc(var(--u) * 28);
  top: calc(var(--u) * 18.5);
  padding: 0 calc(var(--u) * 2);
  background: rgba(4, 4, 5, 0.82);
  color: var(--cold);
  line-height: calc(var(--u) * 8);
}
.cv__extra {
  font-size: calc(var(--u) * 5.5);
}
.cv__gem {
  left: calc(var(--u) * 126);
  top: calc(var(--u) * 5.5);
  width: calc(var(--u) * 7);
  height: calc(var(--u) * 7);
  transform: rotate(45deg);
  background: var(--rarity);
}
.cv__type {
  left: calc(var(--u) * 40);
  top: calc(var(--u) * 98);
  width: calc(var(--u) * 60);
  height: calc(var(--u) * 11.5);
  text-align: center;
  line-height: calc(var(--u) * 11.5);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--aspect);
  filter: brightness(1.35);
}
.cv__type {
  font-size: calc(var(--u) * 5.6);
}
.cv__plate {
  left: calc(var(--u) * 6.5);
  top: calc(var(--u) * 109.5);
  width: calc(var(--u) * 127);
  height: calc(var(--u) * 73);
  padding: calc(var(--u) * 4) calc(var(--u) * 4.5);
  background: var(--parchment);
  color: var(--ink);
  overflow: hidden;
}
.cv__plate--creature {
  height: calc(var(--u) * 63);
}
.cv__plate p {
  margin: 0;
  font-size: calc(var(--u) * 6.4);
  line-height: 1.22;
}
.cv__keys {
  font-weight: 700;
}
.cv__bad {
  color: #8a2e35;
}
.cv__atk {
  left: calc(var(--u) * 5.5);
  top: calc(var(--u) * 169.75);
}
.cv__hp {
  left: calc(var(--u) * 113.5);
  top: calc(var(--u) * 169.5);
  box-shadow: inset 0 0 0 calc(var(--u) * 0.8) #8a2e35;
}
.cv__count {
  left: calc(var(--u) * 50);
  top: calc(var(--u) * 176);
  width: calc(var(--u) * 40);
  text-align: center;
  color: var(--wax-dim);
}
.cv__count {
  font-size: calc(var(--u) * 7);
}
.cv__caption {
  width: 280px;
  margin-top: 0.6rem;
  font-style: italic;
  color: var(--wax-dim);
}

@media (max-width: 70rem) {
  .ed__split--side {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview {
    position: static;
  }
}
@media (max-width: 52rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .list {
    position: static;
    height: auto;
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }
  .top__nav {
    gap: 0.8rem;
    overflow-x: auto;
  }
}

/* ---------- Maps ---------- */

.maps .main {
  padding: 0;
}
.map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26rem;
  height: calc(100vh - var(--top-h));
}
.maps.maps-nolist .shell,
.maps.maps-nopanel .map {
  grid-template-columns: minmax(0, 1fr);
}
.maps.maps-nolist .list,
.maps.maps-nopanel .map__panel {
  display: none;
}
.map__stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--iron-0);
}
.map__gl,
.map__over {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.map__over {
  cursor: grab;
  touch-action: none;
}
.map__over:focus-visible {
  outline: none;
}
.map__tools {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  display: flex;
  gap: 0.2rem;
  padding: 0.1rem 0.3rem;
  background: rgba(8, 9, 12, 0.82);
}
.map__tools .mini {
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}
.map__looks {
  top: 2.4rem;
}
.map__looks:empty {
  display: none;
}
.mini--on {
  color: var(--wax);
  border-bottom-color: var(--flame) !important;
}
.map__note,
.map__read {
  position: absolute;
  left: 0.6rem;
  margin: 0;
  padding: 0.1rem 0.5rem;
  background: rgba(8, 9, 12, 0.82);
  font-size: 0.86rem;
  pointer-events: none;
}
.map__note {
  top: 0.5rem;
  max-width: min(36rem, calc(100% - 24rem));
  color: var(--wax-dim);
}
.map__read {
  bottom: 0.5rem;
  color: var(--wax);
}
.map__read:empty {
  display: none;
}
.map__panel {
  min-width: 0;
  overflow-y: auto;
  padding: 0.9rem 1.1rem 4rem;
  border-left: 1px solid var(--hair);
}
.map__panel h1 {
  font-size: 1.6rem;
}
.map__panel h4 {
  margin-top: 1.2rem;
}
.map__panel .ed__bar {
  position: static;
}
.map__panel .tabs {
  gap: 0.9rem;
  flex-wrap: wrap;
}
.map__panel .ed__noteinput {
  flex-basis: 100%;
}
.map__derived {
  margin: 0 0 0.7rem;
  font-size: 0.88rem;
  color: var(--wax-dim);
}
.map__derived:empty {
  display: none;
}
.map__layers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.6rem;
  padding: 0 0.8rem 0.3rem;
  font-size: 0.86rem;
}
.map__layers .check {
  padding: 0.08rem 0;
  overflow: hidden;
}
.map__panel .form .check {
  align-items: flex-start;
  white-space: normal;
}
.map__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  font-size: 0.9rem;
}
.map__key {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.map__swatch {
  width: 0.8rem;
  height: 0.8rem;
  border: 1px solid var(--hair-strong);
}
.dot--npc {
  background: #ddd3b8;
}
.dot--board {
  background: #e2a548;
}
.dot--box,
.dot--house {
  background: #8fcfe6;
}
.dot--brazier {
  background: #ff9a3c;
}
.dot--start {
  background: #9fd6b0;
}
.dot--door {
  background: #b592e0;
}
.dot--pack {
  background: #e3898d;
}
.dot--calm {
  background: #b9a27c;
}
.dot--area {
  background: #cdbf9b;
}
.dot--area,
.dot--house,
.dot--building,
.dot--prop,
.dot--blockrect,
.dot--walkrect,
.dot--water,
.dot--ground,
.dot--scene {
  border-radius: 0;
}
.dot--building {
  background: #d3a86a;
}
.dot--prop {
  background: #aab4c0;
}
.dot--nature {
  background: #86b58a;
}
.dot--light {
  background: #ffd27a;
}
.dot--blockrect {
  background: #d7dce4;
}
.dot--walkrect {
  background: #9fd6b0;
}
.dot--water {
  background: #5fb3dc;
}
.dot--ground {
  background: #cdbf9b;
}
.dot--scene {
  background: #b3a6d6;
}
.dot--scatter {
  background: #c39a72;
}
.dot--fx {
  background: #7fc4ba;
}
.dot--bad {
  background: var(--error);
}
.list__fold {
  display: block;
  width: calc(100% - 1.6rem);
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.list__fold:hover {
  color: var(--wax);
}
.list__file--bad {
  color: var(--error);
}
.list__row--problem {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: none;
  font: inherit;
  text-align: left;
  white-space: normal;
  font-size: 0.86rem;
  line-height: 1.25;
  cursor: pointer;
}
.map__now {
  display: block;
  margin-top: 0.25rem;
}
.map__palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.3rem;
  margin: 0.4rem 0 0.7rem;
}
.map__palette .mini {
  border-bottom: 1px solid transparent;
}
.swatch {
  flex: none;
  width: 2.4rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--hair-strong);
  background: none;
  cursor: pointer;
}
.row--swatch,
.row--point {
  align-items: center;
}
.picker__rows {
  max-height: 17rem;
  margin-top: 0.3rem;
  overflow-y: auto;
  border: 1px solid var(--hair);
}
.picker__rows .list__file {
  margin: 0.5rem 0.5rem 0.1rem;
}
.picker__row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.1rem 0.5rem;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  color: var(--wax);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.picker__row:hover {
  background: var(--iron-1);
  color: var(--lit);
}
.picker__row.on {
  border-left-color: var(--flame);
  background: var(--iron-1);
}

@media (max-width: 70rem) {
  .map {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 60vh auto;
    height: auto;
  }
  .map__panel {
    border-left: 0;
    border-top: 1px solid var(--hair);
  }
}
