/* Existing editor and permission layouts; shared appearance lives in app.css. */
/* ---------------------------------------------------------------- editor */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.preview-pane {
  position: sticky;
  top: 88px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto auto;
  gap: 9px;
  align-items: start;
  margin-bottom: 9px;
}
.field-row input,
.field-row textarea {
  margin: 0;
}

/* Discord-accurate preview -------------------------------------------- */

.discord {
  background: #313338;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 15px;
  line-height: 1.375;
  font-family: "gg sans", system-ui, sans-serif;
}
.msg {
  display: flex;
  gap: 15px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: var(--amber);
  color: #17130a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}
.msg-body {
  min-width: 0;
  flex: 1;
}
.msg-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}
.bot-name {
  color: #f2f3f5;
  font-weight: 500;
  font-size: 15px;
}
.bot-tag {
  background: #5865f2;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}
.msg-content {
  color: #dbdee1;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 5px;
}
.msg-content:empty {
  display: none;
}

.embed {
  border-left: 4px solid var(--amber);
  background: #2b2d31;
  border-radius: 4px;
  padding: 13px 16px 15px;
  max-width: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}
.embed:empty {
  display: none;
}
.embed-main {
  min-width: 0;
}
.e-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #f2f3f5;
}
.e-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.e-title {
  color: #00a8fc;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}
.e-title.plain {
  color: #f2f3f5;
}
.e-desc {
  color: #dbdee1;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.e-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.e-field {
  grid-column: span 3;
  min-width: 0;
}
.e-field.inline {
  grid-column: span 1;
}
.e-field b {
  display: block;
  color: #f2f3f5;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.e-field span {
  color: #dbdee1;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.e-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}
.e-image {
  width: 100%;
  border-radius: 4px;
  margin-top: 12px;
}
.e-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #949ba4;
  font-size: 12px;
}
.e-footer img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.embed b.md,
.e-desc b {
  font-weight: 700;
}
.e-desc code,
.e-field span code {
  background: #1e1f22;
  color: #dbdee1;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12.5px;
}

/* ------------------------------------------------- permissions + structure */

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px 18px;
}
.perm {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--tx);
  cursor: pointer;
}
.perm:hover {
  background: var(--bg-2);
}
.perm input {
  width: auto;
  margin: 0;
  accent-color: var(--amber);
}
.perm input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.perm.danger span {
  color: #ff9d95;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 7px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.swatch.big {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline-form input {
  margin: 0;
}
.inline-form + .inline-form {
  margin-top: 6px;
}
td .inline-form {
  display: inline-flex;
  margin-left: 6px;
}

/* ---------------------------------------------------------------- commands */

.cmd-form {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.policy-select {
  width: auto;
  min-width: 168px;
}

.role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 320px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}
.role-picker.hidden {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 9px;
  border-radius: 20px;
  cursor: pointer;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--tx-2);
}
.chip:hover {
  border-color: var(--amber);
}
.chip input {
  width: auto;
  margin: 0;
  accent-color: var(--amber);
}
.chip input:checked + span {
  color: var(--amber);
  font-weight: 600;
}

/* ============================================================ permissions */

.filter-input {
  width: 260px;
  padding: 8px 12px;
  font-size: 13.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filter-input::placeholder {
  color: var(--tx-3);
}
.empty-note {
  color: var(--tx-3);
  font-size: 13px;
  padding: 24px 4px;
}

/* ---- role list ---- */

.role-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.role-row {
  display: grid;
  grid-template-columns: 4px minmax(180px, 1.2fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
a.role-row:hover {
  background: var(--bg-2);
  border-color: var(--line);
  text-decoration: none;
}
a.role-row:hover .role-go {
  color: var(--amber);
  transform: translateX(2px);
}
.role-row.locked {
  opacity: 0.5;
}

.role-bar {
  align-self: stretch;
  width: 4px;
  border-radius: 0;
}
.role-bar.tall {
  width: 5px;
  height: 44px;
  border-radius: 3px;
}

.role-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.role-name {
  font-weight: 600;
  font-size: 14.5px;
}
.role-meta {
  color: var(--tx-3);
  font-size: 12px;
}

.role-power {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.role-power .dim {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-pill {
  flex: none;
  min-width: 26px;
  text-align: center;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.role-go {
  min-width: 26px;
  text-align: right;
  white-space: nowrap;
  font-size: 20px;
  color: var(--tx-3);
  transition:
    transform 0.12s,
    color 0.12s;
}

/* .role-row and .bot-line both set display, which outranks the [hidden]
 * default — without these the filter would set hidden and nothing would go. */
.role-row[hidden],
.bot-line[hidden] {
  display: none;
}

.bot-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 2px 6px;
  color: var(--tx-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bot-line::before,
.bot-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---- edit page ---- */

.perm-head {
  margin-bottom: 20px;
}
.perm-head .back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--tx-2);
  font-size: 13px;
}
.perm-head .back:hover {
  color: var(--amber);
  text-decoration: none;
}
.perm-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.perm-title h1 {
  margin: 0 0 2px;
}

.perm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-banner {
  border-radius: 10px;
  padding: 13px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #ff9d95;
}
.admin-banner.hidden {
  display: none;
}

.perm-group {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 18px 14px;
  margin-bottom: 14px;
}
.perm-group > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.perm-group h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tx-2);
}

.perm-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 20px;
}

.perm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 9px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--tx);
  font-weight: 400;
}
.perm-row:hover {
  background: var(--bg-2);
}
.perm-row[hidden] {
  display: none;
}

/* The whole row is the label, so the switch needs no separate hit area. */
.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.track {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transition:
    background 0.14s,
    border-color 0.14s;
}
.knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tx-3);
  transition:
    transform 0.14s,
    background 0.14s;
}
.switch input:checked + .track {
  background: var(--amber-dim);
  border-color: var(--amber);
}
.switch input:checked + .track .knob {
  transform: translateX(16px);
  background: var(--amber);
}
.switch input:disabled + .track {
  opacity: 0.45;
}
.switch input:focus-visible + .track {
  box-shadow: 0 0 0 3px var(--amber-dim);
}

.perm-row.danger .perm-label {
  color: #ffb4ac;
}
.danger-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bad);
  margin-left: 6px;
  vertical-align: middle;
}
/* Administrator wins, so everything else is visibly inert. Dim the rows
 * individually — opacity on the group would composite the whole subtree and
 * the Administrator row could not opt back out of it. */
.admin-on .perm-row:not([data-key="ADMINISTRATOR"]) {
  opacity: 0.4;
}
.admin-on .perm-group > header {
  opacity: 0.4;
}

/* ---- save bar ---- */

.save-bar {
  position: sticky;
  bottom: 18px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 13px 18px;
  background: var(--bg-2);
  border: 1px solid var(--amber);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.save-bar.hidden {
  display: none;
}
.save-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.save-summary strong {
  font-size: 14px;
  color: var(--amber);
}
.save-summary .dim {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-actions {
  display: flex;
  gap: 10px;
  flex: none;
}

@media (max-width: 720px) {
  .role-row {
    grid-template-columns: 4px 1fr 24px;
  }
  .role-power {
    display: none;
  }
  .filter-input {
    width: 100%;
  }
  .perm-rows {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------- permissions sub-navigation */

/* Four pages that are all "who may do what". They used to be separate
 * top-level tabs, which is why nobody could find any of them. */
.subnav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin: -4px 0 22px;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.subnav a {
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tx-2);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.12s,
    color 0.12s;
}
.subnav a:hover {
  background: var(--bg-2);
  color: var(--tx);
  text-decoration: none;
}
.subnav a.on {
  background: var(--amber-dim);
  color: var(--amber);
  font-weight: 600;
}

/* ------------------------------------------------------- channel permissions */

.zone-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 18px 8px;
  margin-bottom: 14px;
}
.zone-card > header {
  padding: 15px 0 12px;
  border-bottom: 1px solid var(--line-soft);
}
.zone-card > header h2 {
  margin: 0 0 3px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tx-2);
}

.chan-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 130px minmax(0, 2fr);
  align-items: start;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.chan-row:last-child {
  border-bottom: 0;
}
.chan-row.ok {
  opacity: 0.62;
} /* nothing to do here — recede */

.chan-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chan-name {
  font-weight: 500;
  font-size: 13.5px;
  word-break: break-word;
}
.chan-state {
  padding-top: 1px;
}
.chan-diffs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.diff {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.diff-role {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx-2);
  background: var(--bg-2);
  border-radius: 5px;
  padding: 1px 7px;
}

ul.tight {
  margin: 8px 0 0;
  padding-left: 18px;
}
ul.tight li {
  margin: 3px 0;
}
.warn-tx {
  color: var(--warn);
}

@media (max-width: 720px) {
  .chan-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .subnav {
    width: 100%;
  }
  .subnav a {
    flex: 1;
    text-align: center;
  }
}

/* ---------------------------------------------------------- rank authority */

.rank-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 18px 16px;
  margin-bottom: 12px;
}
.rank-card.custom {
  border-color: var(--amber-line, var(--amber));
}
.rank-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0 13px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.rank-card > header h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.rank-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.rank-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  font-weight: 400;
}
.field-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx-3);
}
.rank-form select,
.rank-form input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--tx);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.rank-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 12px 0 0;
}

@media (max-width: 720px) {
  .rank-form {
    grid-template-columns: 1fr;
  }
  .rank-actions {
    justify-content: flex-end;
  }
}

/* ------------------------------------------------------------ ally members */

.member-block {
  margin-top: 16px;
}
.member-block .field-label {
  display: block;
  margin-bottom: 8px;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Each chip is its own form so removal is a POST with CSRF, not a link. */
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 6px 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.member-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  color: var(--tx-3);
  font-size: 16px;
}
.member-chip button:hover {
  background: var(--bad);
  color: #fff;
}

.rank-form input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--tx);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---------------------------------------------------------- pillar picker */

.assign-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12px;
  color: var(--tx-2);
  font-weight: 400;
  cursor: pointer;
}
.toggle-line input {
  accent-color: var(--amber);
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px 14px;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--tx);
}
.pick-row:hover {
  background: var(--bg-2);
}
.pick-row input {
  accent-color: var(--amber);
  flex: none;
}
.pick-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-row .pill.tiny {
  flex: none;
  font-size: 12px;
  padding: 1px 7px;
}

/* People already in a pillar hide until the toggle asks for them. Pure CSS:
 * the checkbox state drives visibility, so the CSP needs no script for it. */
.pick-row.assigned {
  display: none;
}
.assign-form:has(.show-assigned:checked) .pick-row.assigned {
  display: flex;
}

/* Checkboxes and radios are not text fields. The broad input rule above gives
 * every input a 41px bordered well, which turns a native checkbox into a giant
 * grey box and starves its flex siblings of width — the pillar picker rendered
 * with huge squares and no names because of exactly that. */
input[type="checkbox"],
input[type="radio"] {
  min-height: 0;
  width: 15px;
  height: 15px;
  padding: 0;
  margin: 0;
  box-shadow: none;
  accent-color: var(--amber);
}

/* Embed editor ------------------------------------------------------------ */

.editor {
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  gap: 34px;
}
.editor > .pane:first-child fieldset {
  position: relative;
  overflow: hidden;
}
.editor > .pane:first-child fieldset::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 173, 85, 0.45));
}

.preview-pane {
  top: 92px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #34382f;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.007) 0 1px,
      transparent 1px 10px
    ),
    #0e110e;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.26);
}
.preview-pane > h3,
.preview-pane > form,
.preview-pane > .live-list,
.preview-pane > .fine:not(.preview-note) {
  margin-left: 18px;
  margin-right: 18px;
}
.preview-pane > h3 {
  margin-top: 24px;
}
.preview-pane > h3.danger-head {
  margin-top: 28px;
}
.preview-pane > form:last-child {
  margin-bottom: 20px;
}

.preview-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: 14px 16px;
  border-bottom: 1px solid #34382f;
  background:
    linear-gradient(90deg, rgba(245, 173, 85, 0.08), transparent 38%), #131612;
}
.preview-titlebar .eyebrow {
  margin: 0 0 6px;
}
.preview-titlebar h3 {
  margin: 0;
  color: #dcd8cc;
  font: 760 14px/1.1 var(--condensed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.preview-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.preview-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 5px 7px;
  border: 1px solid #30352d;
  border-radius: 2px;
  background: #0b0e0b;
  color: #666f65;
  font: 8.5px/1 var(--mono);
  letter-spacing: 0.035em;
  white-space: nowrap;
}
.preview-metrics b {
  color: var(--tx-3);
  font-size: 12px;
}
.preview-metrics span.over {
  border-color: rgba(185, 76, 63, 0.45);
  background: rgba(185, 76, 63, 0.08);
  color: #c36559;
}
.preview-metrics span.over b {
  color: #e27b6d;
}

.discord-shell {
  margin: 16px;
  overflow: hidden;
  border: 1px solid #3a3d42;
  border-radius: 7px;
  background: #313338;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}
.discord-channelbar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid #25272b;
  background: #2b2d31;
  color: #b5bac1;
  font:
    12px/1 "gg sans",
    system-ui,
    sans-serif;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.018) inset;
}
.discord-channelbar strong {
  color: #f2f3f5;
  font-weight: 650;
}
.discord-channelbar > span:last-child {
  margin-left: auto;
  color: #6f747c;
  font-size: 12px;
  letter-spacing: 0.03em;
}
.discord-hash {
  color: #80848e;
  font-size: 18px;
  font-weight: 350;
}

.discord {
  padding: 18px 14px 20px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.msg {
  align-items: flex-start;
}
.avatar {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 35% 28%,
      rgba(255, 255, 255, 0.14),
      transparent 26%
    ),
    linear-gradient(145deg, #d67039, #9f4828);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.26),
    inset 0 1px rgba(255, 255, 255, 0.13);
}
.avatar-mark {
  position: absolute;
  inset: 9px 10px 8px;
  color: #1a110d;
}
.msg-head {
  min-height: 20px;
  gap: 6px;
}
.bot-name {
  color: #f2f3f5;
  font-weight: 650;
}
.msg-time {
  color: #949ba4;
  font-size: 12px;
  font-weight: 400;
}
.msg-content {
  margin: 1px 0 7px;
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.42;
}

.embed {
  position: relative;
  max-width: 540px;
  min-width: 0;
  padding: 13px 16px 14px;
  border-left-width: 4px;
  border-radius: 4px;
  background: #2b2d31;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.012) inset;
}
.embed::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.018);
  border-left: 0;
  border-radius: 0 4px 4px 0;
}
.e-author {
  margin-bottom: 9px;
  font-size: 13px;
}
.e-author img {
  width: 22px;
  height: 22px;
}
.e-title {
  margin-bottom: 7px;
  color: #00a8fc;
  font-size: 15.5px;
  line-height: 1.25;
}
a.e-title:hover {
  text-decoration: underline;
}
.e-desc {
  color: #dbdee1;
  font-size: 13.5px;
  line-height: 1.42;
}
.e-fields {
  gap: 9px 12px;
  margin-top: 11px;
}
.e-field b {
  margin-bottom: 3px;
  color: #f2f3f5;
  font-size: 13px;
}
.e-field span {
  color: #dbdee1;
  font-size: 13px;
  line-height: 1.4;
}
.e-thumb {
  width: 76px;
  height: 76px;
  border-radius: 4px;
  background: #1e1f22;
}
.e-image {
  display: block;
  max-height: 360px;
  margin-top: 13px;
  object-fit: cover;
  border-radius: 4px;
  background: #1e1f22;
}
.e-footer {
  margin-top: 11px;
  color: #949ba4;
  font-size: 12px;
}
.e-footer img {
  width: 18px;
  height: 18px;
}
.preview-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -2px 16px 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid #2c312a;
  color: #656d64;
  font: 9px/1.45 var(--mono);
  letter-spacing: 0.025em;
}
.preview-note .signal-dot {
  flex: none;
}

.field-row {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.55fr) auto auto;
  gap: 8px;
  padding: 9px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.field-row:focus-within {
  border-color: rgba(245, 173, 85, 0.36);
  background: rgba(245, 173, 85, 0.025);
}

/* Small refinements shared across the library and publish controls. */
.live-list {
  overflow: hidden;
  border: 1px solid #2d322b;
  background: #0c0f0c;
}
.live-list li {
  padding: 8px 10px;
}
.live-list li:last-child {
  border-bottom: 0;
}

@media (max-width: 1100px) {
  .editor {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.85fr);
    gap: 24px;
  }
}

@media (max-width: 980px) {
  .editor {
    grid-template-columns: 1fr;
  }
  .preview-pane {
    position: static;
  }
  .discord-shell {
    max-width: 650px;
  }
}

@media (max-width: 640px) {
  .head-actions {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .preview-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }
  .preview-metrics {
    justify-content: flex-start;
  }
  .discord-shell {
    margin: 12px;
  }
  .discord-channelbar > span:last-child {
    display: none;
  }
  .discord {
    padding: 16px 11px 18px;
  }
  .msg {
    gap: 10px;
  }
  .avatar {
    width: 36px;
    height: 36px;
  }
  .avatar-mark {
    inset: 8px 9px 7px;
  }
  .msg-time {
    display: none;
  }
  .embed {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px 13px;
  }
  .e-fields {
    grid-template-columns: 1fr;
  }
  .e-field,
  .e-field.inline {
    grid-column: 1;
  }
  .e-thumb {
    width: 62px;
    height: 62px;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------- */
/* Banner management                                                          */
/* -------------------------------------------------------------------------- */

/* ======================================================================== */
/* Banners workbench — master/detail. One sidebar, one editor, one preview. */
/* ======================================================================== */

.bw-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  width: min(1480px, 100%);
  margin: 0 auto 18px;
}
.bw-head h1 {
  margin: 5px 0 6px;
}
.bw-head .sub {
  max-width: 760px;
  margin: 0;
}

.bw-repost {
  display: flex;
  max-width: 300px;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  text-align: right;
}
.bw-repost small {
  color: var(--tx-3);
  font: 500 12px/1.45 var(--mono);
  letter-spacing: 0.03em;
}

.bw-alert {
  width: min(1480px, 100%);
  margin: 0 auto 14px;
}

.bw {
  display: grid;
  width: min(1480px, 100%);
  margin-inline: auto;
  align-items: start;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

/* ------------------------------------------------------------- sidebar */

.bw-nav {
  position: sticky;
  top: 74px;
  display: grid;
  gap: 16px;
  padding: 14px 12px 12px;
  border: 1px solid var(--panel-edge);
  background:
    linear-gradient(180deg, rgba(23, 30, 33, 0.96), rgba(23, 30, 33, 0.96)),
    repeating-linear-gradient(
      0deg,
      transparent 0 5px,
      rgba(255, 255, 255, 0.006) 5px 6px
    );
  box-shadow:
    inset 0 1px var(--panel-hi),
    0 12px 30px rgba(0, 0, 0, 0.16);
  clip-path: polygon(
    8px 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0 calc(100% - 8px),
    0 8px
  );
}

.bw-group {
  display: grid;
  gap: 3px;
}
.bw-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 6px;
  color: var(--tx-3);
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.bw-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 173, 85, 0.35), transparent);
}
.bw-empty {
  margin: 2px 4px 4px;
  color: var(--tx-3);
  font: 500 12px/1.4 var(--mono);
}

.bw-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid transparent;
  color: var(--tx-2);
}
.bw-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(126, 137, 134, 0.14);
  text-decoration: none;
}
.bw-item.on {
  background: rgba(245, 173, 85, 0.08);
  border-color: rgba(245, 173, 85, 0.38);
  box-shadow:
    inset 2px 0 var(--oxide),
    0 0 14px rgba(245, 173, 85, 0.05);
}
.bw-thumb {
  display: block;
  width: 46px;
  height: 25px;
  object-fit: cover;
  border: 1px solid rgba(126, 137, 134, 0.22);
  filter: saturate(0.78) brightness(0.82);
}
.bw-item.on .bw-thumb {
  border-color: rgba(245, 173, 85, 0.55);
  filter: saturate(1) brightness(0.95);
}
.bw-item-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.bw-item-text strong {
  overflow: hidden;
  color: #d9ded9;
  font: 650 12px/1.25 var(--mono);
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.bw-item.on .bw-item-text strong {
  color: #ecd9c8;
}
.bw-item-text small {
  overflow: hidden;
  color: var(--tx-3);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bw-dot {
  width: 10px;
  height: 10px;
  filter: drop-shadow(0 0 6px rgba(245, 173, 85, 0.45));
}

.bw-new .bw-plus {
  display: grid;
  width: 46px;
  height: 25px;
  place-items: center;
  border: 1px dashed rgba(126, 137, 134, 0.35);
  color: var(--oxide-hot);
  font: 700 14px/1 var(--mono);
}
.bw-new {
  border-top: 1px solid rgba(126, 137, 134, 0.14);
  padding-top: 10px;
}

/* -------------------------------------------------------------- editor */

.bw-editor {
  display: grid;
  gap: 16px;
  padding: 18px 18px 20px;
  border: 1px solid var(--panel-edge);
  background:
    linear-gradient(180deg, rgba(23, 30, 33, 0.96), rgba(23, 30, 33, 0.96)),
    repeating-linear-gradient(
      0deg,
      transparent 0 5px,
      rgba(255, 255, 255, 0.006) 5px 6px
    );
  box-shadow:
    inset 0 1px var(--panel-hi),
    0 12px 30px rgba(0, 0, 0, 0.16);
  clip-path: polygon(
    8px 0,
    calc(100% - 8px) 0,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    8px 100%,
    0 calc(100% - 8px),
    0 8px
  );
}

.bw-editor-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}
.bw-editor-head h2 {
  margin: 0;
  color: #e5e5de;
  font: 700 17px/1.2 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.bw-status {
  margin: 5px 0 0;
  color: var(--tx-3);
  font-size: 12px;
}

.bw-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1240 / 300;
  border: 1px solid rgba(126, 137, 134, 0.2);
  background: #020403;
}
.bw-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bw-preview.is-loading::after {
  content: "RENDERING //";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 3, 0.55);
  color: var(--oxide-hot);
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.22em;
  animation: bw-pulse 1.1s ease-in-out infinite;
}
@keyframes bw-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.bw-form {
  display: grid;
  gap: 15px;
}

.bw-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(240px, 1.7fr) 110px;
  gap: 12px;
}
.bw-fields label,
.bw-accent {
  display: grid;
  gap: 6px;
  align-content: start;
}
.bw-fields label > span,
.bw-copy-grid label > span {
  color: #818b86;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.bw-accent input[type="color"] {
  width: 100%;
  min-height: 39px;
  padding: 3px;
}

.bw-lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #747e79;
  font: 650 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bw-copy,
.bw-scenes {
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid rgba(126, 137, 134, 0.14);
  background: rgba(6, 9, 8, 0.5);
}
.bw-copy legend,
.bw-scenes legend {
  padding: 0 7px;
  color: #98a29b;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bw-copy legend span {
  color: #626d67;
  letter-spacing: 0.06em;
  text-transform: none;
}

.bw-copy-grid {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.7fr) 90px;
  gap: 12px;
}
.bw-copy-grid label {
  display: grid;
  gap: 6px;
}

/* ------------------------------------------------------- scene gallery */

.scene-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.scene-card {
  position: relative;
  display: grid;
  min-width: 0;
  cursor: pointer;
  border: 1px solid rgba(126, 137, 134, 0.16);
  background: rgba(12, 16, 15, 0.9);
  transition:
    border-color 0.14s ease,
    transform 0.14s ease;
}
.scene-card:hover {
  transform: translateY(-1px);
  border-color: rgba(205, 215, 208, 0.3);
}
.scene-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.scene-card img {
  display: block;
  width: 100%;
  height: 64px;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.05) brightness(0.8);
}
.scene-card .scene-name {
  overflow: hidden;
  padding: 7px 8px 8px;
  color: #89938e;
  font: 650 12px/1.2 var(--mono);
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.scene-card:has(input:checked) {
  border-color: var(--oxide-hot);
  background: rgba(245, 173, 85, 0.07);
  box-shadow:
    inset 0 0 0 1px rgba(245, 173, 85, 0.14),
    0 0 18px rgba(245, 173, 85, 0.06);
}
.scene-card:has(input:checked) img {
  filter: saturate(1) contrast(1.08) brightness(0.95);
}
.scene-card:has(input:checked) .scene-name {
  color: #dbb29c;
}
.scene-card:has(input:focus-visible) {
  outline: 2px solid var(--oxide-hot);
  outline-offset: 2px;
}

/* The description of whichever scene is checked, pure CSS — no JS needed. */
.scene-desc {
  display: none;
  margin: 10px 2px 0;
  color: #8d968f;
  font-size: 12px;
  line-height: 1.45;
}
.scene-desc em {
  margin-left: 6px;
  color: var(--oxide-hot);
  font: 700 12px/1.3 var(--mono);
  font-style: normal;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.bw-scenes:has(input[value="city17-citadel"]:checked)
  .scene-desc--city17-citadel,
.bw-scenes:has(input[value="city17-street"]:checked) .scene-desc--city17-street,
.bw-scenes:has(input[value="sewer-network"]:checked) .scene-desc--sewer-network,
.bw-scenes:has(input[value="resistance-cell"]:checked)
  .scene-desc--resistance-cell,
.bw-scenes:has(input[value="checkpoint"]:checked) .scene-desc--checkpoint,
.bw-scenes:has(input[value="city17-rooftops"]:checked)
  .scene-desc--city17-rooftops,
.bw-scenes:has(input[value="rail-depot"]:checked) .scene-desc--rail-depot,
.bw-scenes:has(input[value="canal-network"]:checked) .scene-desc--canal-network,
.bw-scenes:has(input[value="old-town"]:checked) .scene-desc--old-town,
.bw-scenes:has(input[value="rebel-workshop"]:checked)
  .scene-desc--rebel-workshop {
  display: block;
}

.bw-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.bw-actions small {
  color: var(--tx-3);
  font: 500 12px/1.45 var(--mono);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .bw {
    grid-template-columns: 1fr;
  }
  .bw-nav {
    position: static;
  }
  .scene-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .bw-head {
    flex-direction: column;
    align-items: stretch;
  }
  .bw-repost {
    max-width: none;
    align-items: stretch;
    text-align: left;
  }
  .bw-fields,
  .bw-copy-grid {
    grid-template-columns: 1fr;
  }
  .scene-picker {
    grid-template-columns: 1fr 1fr;
  }
  .bw-actions {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
}
@media (max-width: 480px) {
  .scene-picker {
    grid-template-columns: 1fr;
  }
}

.bw-maint {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(248, 81, 73, 0.22);
}
.bw-maint .bw-group-label::after {
  background: linear-gradient(90deg, rgba(248, 81, 73, 0.4), transparent);
}
.bw-maint small {
  color: #6a7570;
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.02em;
}
.bw-maint .btn {
  width: 100%;
}

@media (max-width: 1100px) {
  .bw-nav {
    order: 2;
  }
  .bw-editor {
    order: 1;
  }
}

/* ======================================================================== */
/* Structure workbench — tabbed: pillars / roster / ranks / branches.       */
/* ======================================================================== */

.st-head {
  margin-bottom: 16px;
}
.st-head h1 {
  margin: 5px 0 6px;
}
.st-head .sub {
  max-width: 780px;
  margin: 0;
}

.st-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid var(--panel-edge);
  background: linear-gradient(
    180deg,
    rgba(23, 30, 33, 0.96),
    rgba(23, 30, 33, 0.96)
  );
  clip-path: polygon(
    6px 0,
    calc(100% - 6px) 0,
    100% 6px,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    6px 100%,
    0 calc(100% - 6px),
    0 6px
  );
}
.st-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--tx-2);
  font: 650 12px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.st-tabs a:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--tx);
  text-decoration: none;
}
.st-tabs a.on {
  color: #ecd9c8;
  background: rgba(245, 173, 85, 0.09);
  border-color: rgba(245, 173, 85, 0.4);
  box-shadow: inset 0 -2px var(--oxide);
}
.st-count {
  min-width: 20px;
  padding: 3px 6px;
  text-align: center;
  color: #8b958f;
  font: 700 12px/1 var(--mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(126, 137, 134, 0.2);
}
.st-tabs a.on .st-count {
  color: var(--oxide-hot);
  border-color: rgba(245, 173, 85, 0.4);
}

.st-blurb {
  max-width: 760px;
  margin: 0 0 16px;
}

.st-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
}
.st-toolbar .st-blurb {
  margin: 0;
}

.st-filter {
  min-width: 230px;
  padding: 8px 11px;
  color: var(--tx);
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.st-filter:focus {
  outline: none;
  border-color: rgba(245, 173, 85, 0.55);
}
.st-hidden {
  display: none !important;
}

/* -------------------------------------------------------------- pillars */

.st-pillar-body {
  display: grid;
  gap: 14px;
}

.st-pillar-settings {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.3fr) 96px auto;
  gap: 12px;
  align-items: end;
}
.st-pillar-settings label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  font-weight: 400;
}
.st-pillar-settings input[type="text"],
.st-pillar-settings select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--tx);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.st-pillar-settings input[type="color"] {
  width: 100%;
  min-height: 37px;
  padding: 3px;
}
.st-pillar-settings .btn {
  margin-bottom: 1px;
}

.assign-head {
  flex-wrap: wrap;
  row-gap: 8px;
}
.st-assign-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.st-pillar-remove {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(248, 81, 73, 0.18);
}

.st-add-card {
  margin-top: 4px;
}
.st-add-card h2:first-child {
  margin-top: 0;
}

/* ------------------------------------------------- roster/ranks tables */

.st-roster td,
.st-ranks td,
.st-branches td {
  vertical-align: middle;
}

.st-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  color: #cfd6d0;
  font: 650 12px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(126, 137, 134, 0.28);
}

.st-note-form {
  display: flex;
  width: 100%;
}
.st-note-form input[name="note"] {
  flex: 1;
  min-width: 140px;
}
/* With JS the Save button appears only once the text differs from what is
   stored — 27 rows read as text, not as a wall of buttons. */
.st-note-form.js-dirty-ui button {
  display: none;
}
.st-note-form.js-dirty-ui.is-dirty button {
  display: inline-flex;
}

.st-move-col {
  width: 190px;
}
.st-move-form select {
  max-width: 150px;
  padding: 6px 8px;
  font-size: 12.5px;
}

.st-editing td {
  background: rgba(245, 173, 85, 0.06);
}

@media (max-width: 900px) {
  .st-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .st-pillar-settings {
    grid-template-columns: 1fr 1fr;
  }
  .st-roster,
  .st-ranks,
  .st-branches {
    display: block;
    overflow-x: auto;
  }
}
@media (max-width: 640px) {
  .st-pillar-settings {
    grid-template-columns: 1fr;
  }
}

/* CSP utilities. style-src 'self' silently drops every inline style
   attribute, so the one-off margins and widths the views used to inline
   live here as classes instead. Keep this block last: utilities must win
   specificity ties against the components they adjust. */
.u-m0 {
  margin: 0;
}
.u-mb14 {
  margin: 0 0 14px;
}
.u-mt4 {
  margin-top: 4px;
}
.u-mt8 {
  margin: 8px 0 0;
}
.u-mt10 {
  margin-top: 10px;
}
.u-mt12 {
  margin-top: 12px;
}
.u-mt14 {
  margin-top: 14px;
}
.u-max160 {
  max-width: 160px;
}
.u-max720 {
  max-width: 720px;
}
.u-max760 {
  max-width: 760px;
}
.u-w90 {
  width: 90px;
}
.u-w96 {
  width: 96px;
}
.u-w150 {
  width: 150px;
}
.u-w190 {
  width: 190px;
}
.u-w210 {
  width: 210px;
}

/* ======================================================================== */
/* Minecraft server console                                                  */
/* ======================================================================== */
.mc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.mc-stat { display: grid; gap: 6px; padding: 16px 18px; }
.mc-stat strong { font-family: var(--head); font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.02em; }
.mc-stat small { color: var(--tx-3); font-size: 0.8125rem; }
.mc-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.mc-controls, .mc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.mc-controls form, .mc-actions form { margin: 0; }
.mc-rcon { display: flex; gap: 8px; margin-top: 6px; }
.mc-rcon input { flex: 1; font-family: var(--mono); }
.mc-linkform { display: grid; gap: 12px; }
.mc-linkform label { display: grid; gap: 6px; }
.mc-files-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 14px; }
.mc-fileselect { display: flex; gap: 8px; margin-bottom: 12px; }
.mc-fileselect select { flex: 1; }
.mc-editor textarea { width: 100%; min-height: 480px; padding: 12px; font: 13px/1.45 var(--mono); color: var(--tx); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.mc-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.mc-log { max-height: 70vh; overflow: auto; padding: 14px; font: 12px/1.5 var(--mono); color: var(--tx-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-links td, .mc-listing td { vertical-align: middle; }
@media (max-width: 1100px) { .mc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mc-two, .mc-files-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .mc-grid { grid-template-columns: 1fr; } }
/* file manager */
.mc-editor-panel { margin-bottom: 14px; }
.mc-fm .panel-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.mc-crumbs { font-family: var(--mono); font-size: 0.95rem; font-weight: 500; }
.mc-crumbs a { color: var(--tx); }
.mc-fm-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.mc-fm-tools input[type="text"] { width: 150px; }
.mc-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.mc-drop { flex: 1; min-width: 260px; display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--tx-3); font-size: 0.85rem; cursor: pointer; }
.mc-drop.is-over { border-color: var(--amber); color: var(--tx); background: var(--amber-dim); }
.mc-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mc-progress { position: relative; flex-basis: 100%; height: 22px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.mc-progress-bar { height: 100%; width: 0; background: var(--amber); transition: width .2s ease; }
.mc-progress-text { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px; font: 500 0.75rem var(--mono); color: var(--tx); }
.mc-name { min-width: 260px; }
.mc-rename { display: inline-block; margin-left: 8px; }
.mc-rename summary { display: inline; cursor: pointer; color: var(--tx-3); font-size: 0.75rem; }
.mc-rename summary::-webkit-details-marker { display: none; }
.mc-rename form { margin-top: 6px; }
.mc-rename input[type="text"] { width: 220px; }
.mc-actions { white-space: nowrap; }
.mc-actions .inline-form, .mc-actions .btn { margin: 0 0 0 6px; }
