:root {
  color-scheme: dark;
  --ink: #0b0d10;
  --ink-2: #121716;
  --panel: rgba(10, 16, 15, 0.86);
  --panel-strong: rgba(7, 11, 11, 0.94);
  --line: rgba(226, 197, 141, 0.22);
  --line-strong: rgba(239, 159, 70, 0.5);
  --text: #fff2d2;
  --muted: #b9c0ad;
  --ember: #f39b31;
  --ember-2: #d34724;
  --teal: #357f73;
  --pine: #193b2f;
  --moon: #a6b4d9;
  --violet: #5b517c;
  --parchment: #efd49b;
  --danger: #e16d5c;
  --success: #8bc47c;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 104%, rgba(243, 155, 49, 0.58) 0 8%, rgba(211, 71, 36, 0.24) 18%, transparent 42%),
    radial-gradient(circle at 82% 10%, rgba(166, 180, 217, 0.42) 0 5%, transparent 15%),
    linear-gradient(180deg, rgba(23, 18, 38, 0.72) 0%, rgba(7, 14, 17, 0.94) 42%, rgba(7, 9, 8, 0.98) 100%),
    url("/assets/archive-backdrop.webp") center / cover fixed;
  background-blend-mode: screen, normal, normal, multiply;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: 0;
  opacity: 0.92;
  background:
    linear-gradient(140deg, transparent 0 63%, rgba(4, 12, 10, 0.95) 63% 66%, transparent 66%) 0 0 / 160px 100%,
    linear-gradient(220deg, transparent 0 61%, rgba(6, 18, 14, 0.98) 61% 64%, transparent 64%) 40px 0 / 190px 100%,
    radial-gradient(ellipse at 50% 110%, rgba(11, 7, 4, 0.2), rgba(3, 6, 6, 0.76) 70%);
  clip-path: polygon(0 18%, 5% 32%, 9% 20%, 14% 42%, 19% 16%, 26% 39%, 31% 22%, 37% 44%, 43% 18%, 49% 38%, 56% 14%, 62% 40%, 69% 20%, 75% 45%, 82% 16%, 89% 40%, 95% 25%, 100% 38%, 100% 100%, 0 100%);
}

body::after {
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 101%, rgba(255, 207, 116, 0.58) 0 4%, rgba(243, 155, 49, 0.38) 11%, rgba(211, 71, 36, 0.2) 24%, transparent 48%),
    radial-gradient(circle at 18% 28%, rgba(239, 212, 155, 0.25) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 24%, rgba(239, 212, 155, 0.2) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 17%, rgba(239, 212, 155, 0.18) 0 1px, transparent 2px),
    linear-gradient(180deg, transparent 0%, rgba(2, 4, 4, 0.42) 100%);
  background-size: auto, 220px 180px, 260px 220px, 310px 210px, auto;
}

[hidden] {
  display: none !important;
}

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

@keyframes stokePulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(243, 155, 49, 0);
    border-color: rgba(232, 183, 91, 0.22);
  }

  50% {
    box-shadow: 0 0 28px rgba(243, 155, 49, 0.22);
    border-color: rgba(255, 210, 126, 0.58);
  }
}

@keyframes emberTurn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes statusDots {
  0%,
  20% {
    content: "";
  }

  40% {
    content: ".";
  }

  60% {
    content: "..";
  }

  80%,
  100% {
    content: "...";
  }
}

@keyframes phraseFloat {
  0% {
    opacity: 0;
    transform: translateY(7px);
  }

  14%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes warmupVeil {
  0% {
    opacity: 1;
    background: rgba(3, 5, 6, 0.86);
  }

  58% {
    opacity: 0.48;
    background: rgba(10, 8, 5, 0.44);
  }

  100% {
    opacity: 0;
    background: rgba(3, 5, 6, 0);
  }
}

@keyframes warmupMark {
  0% {
    opacity: 0;
    filter: brightness(0.52) drop-shadow(0 0 0 rgba(243, 155, 49, 0));
    transform: translateY(18px) scale(0.78);
  }

  38% {
    opacity: 1;
    filter: brightness(1.22) drop-shadow(0 0 34px rgba(243, 155, 49, 0.68));
    transform: translateY(0) scale(1.04);
  }

  100% {
    opacity: 0;
    filter: brightness(1.44) drop-shadow(0 0 52px rgba(255, 210, 126, 0.78));
    transform: translateY(-18px) scale(1.18);
  }
}

@keyframes shellWarmup {
  0% {
    filter: brightness(0.58) saturate(0.72);
    transform: translateY(10px);
  }

  46% {
    filter: brightness(1.13) saturate(1.08);
  }

  100% {
    filter: none;
    transform: translateY(0);
  }
}

@keyframes extinguishVeil {
  0% {
    opacity: 0;
    background: rgba(3, 5, 6, 0);
  }

  34% {
    opacity: 1;
    background: rgba(6, 8, 9, 0.34);
  }

  100% {
    opacity: 1;
    background: rgba(2, 4, 5, 0.96);
  }
}

@keyframes extinguishMark {
  0% {
    opacity: 1;
    filter: brightness(1.3) saturate(1.2) drop-shadow(0 0 38px rgba(255, 190, 92, 0.72));
    transform: translateY(0) scale(1);
  }

  62% {
    opacity: 0.72;
    filter: brightness(0.72) saturate(0.78) drop-shadow(0 0 12px rgba(211, 71, 36, 0.34));
    transform: translateY(10px) scale(0.9);
  }

  100% {
    opacity: 0;
    filter: brightness(0.24) saturate(0.35) drop-shadow(0 0 0 rgba(0, 0, 0, 0));
    transform: translateY(24px) scale(0.72);
  }
}

@keyframes shellExtinguish {
  0% {
    filter: none;
    transform: translateY(0);
  }

  100% {
    filter: brightness(0.42) saturate(0.56);
    transform: translateY(8px);
  }
}

.login-veil {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 56px);
  background:
    radial-gradient(ellipse at 50% 74%, rgba(4, 7, 10, 0.04), rgba(1, 3, 6, 0.36) 58%, rgba(1, 2, 4, 0.72) 100%),
    linear-gradient(180deg, rgba(3, 6, 12, 0.24), rgba(1, 3, 5, 0.72)),
    url("/assets/login-cold-campfire.webp") center / cover;
}

.login-veil.is-lit {
  background:
    radial-gradient(ellipse at 50% 74%, rgba(255, 168, 72, 0.08), rgba(12, 5, 3, 0.24) 56%, rgba(1, 2, 4, 0.58) 100%),
    linear-gradient(180deg, rgba(18, 7, 3, 0.08), rgba(1, 3, 5, 0.58)),
    url("/assets/login-warm-campfire.webp") center / cover;
}

.login-veil[hidden] {
  display: none;
}

.login-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(560px, 100%);
  padding: 0;
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: translateY(8vh);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 0 24px rgba(166, 180, 217, 0.22);
}

.login-panel h1 {
  max-width: 11ch;
  color: #f3f0e7;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
  line-height: 0.96;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  width: min(620px, 100%);
  padding: 10px;
  border: 1px solid rgba(186, 201, 232, 0.22);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.54);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
}

.invite-form {
  grid-template-columns: 1fr;
  width: min(460px, 100%);
}

.login-presence {
  display: grid;
  gap: 6px;
  width: min(360px, 100%);
  color: rgba(255, 241, 204, 0.86);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.86);
}

.login-presence[hidden] {
  display: none;
}

.login-presence ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-presence li {
  padding: 3px 7px;
  border: 1px solid rgba(255, 196, 95, 0.34);
  border-radius: 999px;
  background: rgba(22, 10, 4, 0.42);
  color: rgba(255, 241, 204, 0.9);
  font-size: 0.78rem;
  box-shadow: 0 0 18px rgba(255, 139, 43, 0.14);
}

.login-presence li.is-dm {
  border-color: rgba(255, 210, 120, 0.72);
  color: #ffe2a4;
  text-shadow: 0 0 10px rgba(255, 147, 54, 0.88), 0 0 22px rgba(255, 87, 34, 0.5);
  box-shadow: 0 0 20px rgba(255, 145, 45, 0.28);
}

.login-warning {
  margin: 0;
  color: #f7d5ca;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.invite-panel {
  display: grid;
  gap: 10px;
  width: min(520px, 100%);
  padding: 12px;
  border: 1px solid rgba(232, 183, 91, 0.28);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.62);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.invite-panel[hidden] {
  display: none;
}

.invite-panel h2,
.invite-panel p {
  margin: 0;
}

.invite-panel h2 {
  color: var(--parchment);
  font-size: 1.2rem;
  letter-spacing: 0;
}

.invite-panel p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.operator-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px;
}

.operator-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 25, 22, 0.9), rgba(7, 12, 12, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.operator-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226, 197, 141, 0.16);
}

.operator-header h1,
.operator-header p {
  margin: 0;
}

.operator-header h1 {
  color: #fff4d8;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.operator-header p {
  margin-top: 5px;
  color: var(--muted);
}

.operator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.operator-actions[hidden] {
  display: none;
}

#operatorManagement {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#operatorManagement[hidden] {
  display: none;
}

#operatorManagement h2 {
  margin: 6px 0 0;
  font-size: 1rem;
  color: #ffe6ad;
}

.operator-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(226, 197, 141, 0.14);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.46);
}

.operator-tabs[hidden] {
  display: none;
}

.operator-tab {
  border: 1px solid rgba(255, 184, 77, 0.22);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.operator-tab.active {
  color: #10100c;
  border-color: rgba(255, 209, 115, 0.8);
  background: linear-gradient(180deg, #ffd878, #f0a53a);
  box-shadow: 0 0 18px rgba(255, 180, 72, 0.22);
}

.operator-tab-panel {
  display: grid;
  gap: 12px;
}

.operator-tab-panel[hidden] {
  display: none;
}

.operator-section-head {
  display: grid;
  gap: 4px;
}

.operator-section-head h2,
.operator-section-head p {
  margin: 0;
}

.operator-section-head p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

#operatorTenantList {
  display: grid;
  gap: 8px;
}

.operator-account-picker {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(186, 201, 232, 0.18);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.54);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.operator-account-picker label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.operator-account-picker input,
.operator-account-picker select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 1px solid rgba(255, 184, 77, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  padding: 9px 10px;
}

.operator-account-picker small {
  color: var(--muted);
  white-space: nowrap;
  padding-bottom: 10px;
}

.operator-selected-account {
  padding-right: 12px;
}

.operator-selected-account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.operator-selected-account-header span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.operator-selected-account-header small {
  color: var(--muted);
}

.operator-delete-account-button {
  align-self: start;
  white-space: nowrap;
}

.operator-danger-note {
  margin: 8px 0 0;
  max-width: 760px;
  color: #ffb0a3;
  font-size: 0.82rem;
  line-height: 1.35;
}

.operator-support-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.4fr) minmax(190px, 0.8fr);
  gap: 8px;
  align-items: stretch;
}

.operator-support-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(255, 184, 77, 0.18);
  border-radius: 8px;
  background: rgba(4, 9, 9, 0.54);
}

.operator-support-card code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-2);
  font-size: 0.82rem;
}

.operator-support-card small {
  color: var(--muted);
}

.operator-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(186, 201, 232, 0.18);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.54);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.operator-form input,
.operator-form select {
  width: 100%;
  min-width: 0;
}

.operator-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.operator-form h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: #ffe6ad;
  font-size: 0.95rem;
}

.operator-form-stacked {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operator-form-stacked > button {
  justify-self: start;
}

.operator-form.wide {
  grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(3, minmax(0, 1fr)) auto;
}

.operator-form.operator-support-card {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operator-form.operator-support-card button {
  grid-column: 1 / -1;
}

.history-item {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: stretch;
  padding: 10px 54px 10px 12px;
  text-align: left;
  border: 1px solid rgba(226, 197, 141, 0.22);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.54);
}

.history-item > .icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
}

.operator-entitlements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}

.operator-entitlement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(186, 201, 232, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(7, 12, 13, 0.66);
}

.operator-entitlement.enabled {
  color: var(--text);
  border-color: rgba(139, 196, 124, 0.42);
  background: rgba(25, 59, 47, 0.52);
}

.operator-entitlement input {
  width: 16px;
  height: 16px;
  accent-color: var(--ember);
}

.operator-entitlement span {
  display: grid;
  min-width: 0;
}

.operator-entitlement small {
  color: var(--muted);
}

.operator-app-toggle-set {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(255, 184, 77, 0.18);
  border-radius: 8px;
  background: rgba(4, 9, 9, 0.54);
}

.operator-app-toggle-set legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 6px;
}

.operator-app-toggle-set label,
.operator-app-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: none;
}

.operator-app-toggle-set input {
  width: 16px;
  height: 16px;
  accent-color: var(--ember);
}

.operator-usage-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 197, 141, 0.22);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.54);
}

.operator-usage-card span,
.operator-usage-row span {
  color: var(--muted);
}

.operator-usage-list {
  display: grid;
  gap: 5px;
  margin-top: 4px;
}

.operator-usage-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 6px 8px;
  border: 1px solid rgba(186, 201, 232, 0.12);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
}

.operator-subscription-editor {
  display: grid;
  gap: 10px;
}

.operator-section-head.compact {
  margin-top: 2px;
}

.subscription-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.subscription-preset-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(226, 197, 141, 0.2);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.58);
}

.subscription-preset-head {
  display: grid;
  gap: 2px;
}

.subscription-preset-head h4 {
  margin: 0;
  color: var(--parchment);
}

.subscription-preset-head small {
  color: var(--muted);
}

.subscription-preset-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.subscription-preset-numbers.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.operator-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: none;
}

.operator-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ember);
}

.operator-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.operator-frame-actions {
  justify-content: flex-end;
  padding: 8px;
  border: 1px solid rgba(226, 197, 141, 0.14);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.46);
}

.operator-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 8px;
}

.operator-status-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(226, 197, 141, 0.18);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.54);
}

.operator-status-card[data-state="ok"] {
  border-color: rgba(139, 196, 124, 0.34);
}

.operator-status-card[data-state="warn"] {
  border-color: rgba(255, 190, 92, 0.34);
}

.operator-status-card[data-state="busy"] {
  border-color: rgba(114, 181, 255, 0.36);
  box-shadow: 0 0 18px rgba(114, 181, 255, 0.1);
}

.operator-status-card h3 {
  margin: 0;
  color: var(--parchment);
  font-size: 0.92rem;
}

.operator-status-card dl {
  display: grid;
  gap: 5px;
  margin: 0;
}

.operator-status-card dl div {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.operator-status-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.operator-status-card dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-size: 0.86rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.operator-model-card {
  align-content: start;
}

.operator-model-list {
  display: grid;
  gap: 5px;
}

.operator-model-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(186, 201, 232, 0.12);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
}

.operator-model-row strong,
.operator-model-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-model-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.74rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #756b59;
}

.status-dot.ok {
  background: #9ee281;
  box-shadow: 0 0 10px rgba(158, 226, 129, 0.58);
}

.status-dot.idle {
  background: #8d8068;
}

.operator-error-log-list {
  max-height: 68dvh;
}

.operator-admin-frame {
  width: 100%;
  min-height: 74dvh;
  border: 1px solid rgba(255, 184, 77, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.operator-limit-editor {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 184, 77, 0.18);
  border-radius: 8px;
  background: rgba(4, 9, 9, 0.54);
}

.operator-limit-editor label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.operator-limit-editor textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  color: var(--text);
  border: 1px solid rgba(255, 184, 77, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  font: 0.78rem/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 8px;
}

.dm-usage-limits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.dm-usage-limit {
  padding: 8px 10px;
  border: 1px solid rgba(255, 184, 77, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 13, 0.58);
}

.dm-usage-limit strong,
.dm-usage-limit small {
  display: block;
}

.dm-usage-limit small {
  color: var(--muted);
}

.dm-usage-limit.conservation {
  border-color: rgba(255, 184, 77, 0.5);
  box-shadow: 0 0 14px rgba(255, 148, 54, 0.12);
}

.dm-usage-limit.overage,
.dm-usage-limit.blocked {
  border-color: rgba(255, 92, 77, 0.58);
  box-shadow: 0 0 14px rgba(255, 72, 58, 0.14);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  grid-template-rows: minmax(0, 1fr);
  gap: 18px;
  width: min(1420px, 100%);
  height: 100dvh;
  min-height: 640px;
  margin: 0 auto;
  padding: 18px;
}

.app-shell.warming {
  animation: shellWarmup 2.4s ease-out both;
}

.app-shell.extinguishing {
  pointer-events: none;
  animation: shellExtinguish 1.25s ease-in forwards;
}

.campfire-warmup {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.campfire-warmup[hidden] {
  display: none;
}

.campfire-warmup.playing {
  animation: warmupVeil 2.6s ease-out forwards;
}

.campfire-warmup.extinguishing {
  animation: extinguishVeil 1.25s ease-in forwards;
}

.campfire-warmup-mark {
  display: grid;
  place-items: center;
  width: clamp(118px, 18vw, 220px);
  aspect-ratio: 1;
}

.campfire-warmup-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: warmupMark 2.6s ease-out forwards;
}

.campfire-warmup.extinguishing .campfire-warmup-mark img {
  animation: extinguishMark 1.25s ease-in forwards;
}

.archive-panel,
.chat-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(17, 28, 23, 0.88), rgba(7, 12, 12, 0.9)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.archive-panel {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  padding: 20px;
  border-radius: 8px;
}

.chat-panel {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) max-content;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  overflow: hidden;
}

.chat-scroll,
.image-panel,
.scry-panel,
.audio-panel,
.discord-panel,
.account-panel {
  grid-row: 4;
}

.composer {
  grid-row: 5;
}

.archive-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 0;
  min-width: 0;
}

.archive-view-tab {
  min-height: 34px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--muted);
  background: rgba(6, 10, 10, 0.5);
  cursor: pointer;
}

.archive-view-tab.active,
.archive-view-tab:hover {
  color: #2a170b;
  border-color: rgba(255, 210, 126, 0.52);
  background: linear-gradient(180deg, #ffdc88, var(--ember));
}

.brand-lockup {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 5px 0 0;
  padding: 4px 8px;
  border: 1px solid rgba(255, 203, 122, 0.42);
  border-radius: 6px;
  background: rgba(255, 177, 67, 0.1);
  color: #ffd98d;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 0 14px rgba(255, 177, 67, 0.08);
}

.mode-badge[hidden] {
  display: none;
}

.mode-badge-user {
  border-color: rgba(117, 178, 255, 0.4);
  background: rgba(61, 115, 180, 0.16);
  color: #b9d9ff;
}

.mode-badge-dm {
  border-color: rgba(106, 209, 151, 0.42);
  background: rgba(32, 116, 73, 0.18);
  color: #baf1cf;
}

.mode-badge-server-admin {
  border-color: rgba(255, 185, 72, 0.5);
  background: rgba(181, 79, 31, 0.2);
  color: #ffe1a3;
}

.configured-secret-status {
  display: block;
  margin-top: 4px;
  color: rgba(255, 218, 151, 0.78);
  font-size: 0.76rem;
  line-height: 1.25;
}

.brand-status {
  align-self: start;
}

.dm-config-button {
  color: #baf1cf;
  font-size: 0.72rem;
  font-weight: 900;
  border-color: rgba(106, 209, 151, 0.34);
  background: rgba(24, 82, 54, 0.34);
  box-shadow: inset 0 0 16px rgba(106, 209, 151, 0.08), 0 0 12px rgba(106, 209, 151, 0.12);
}

.dm-config-button:hover {
  color: #f4fff7;
  border-color: rgba(106, 209, 151, 0.62);
  box-shadow: inset 0 0 16px rgba(106, 209, 151, 0.16), 0 0 18px rgba(106, 209, 151, 0.2);
}

.brand-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  align-items: center;
}

.presence-rail {
  margin-top: 14px;
  padding: 8px;
  border: 1px solid rgba(255, 184, 77, 0.18);
  border-radius: 8px;
  background: rgba(4, 9, 9, 0.54);
}

.presence-rail[hidden] {
  display: none;
}

.presence-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.presence-rail-head p {
  margin: 0;
}

.presence-rail-head span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 203, 122, 0.32);
  border-radius: 999px;
  color: #ffdc88;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(255, 177, 67, 0.12);
}

.presence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.presence-list li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(255, 241, 204, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.presence-list li.is-dm {
  border-color: rgba(255, 210, 120, 0.58);
  background: rgba(73, 35, 8, 0.28);
  box-shadow: 0 0 16px rgba(255, 145, 45, 0.2);
}

.presence-list span {
  overflow: hidden;
  color: rgba(255, 241, 204, 0.9);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-list li.is-dm span {
  color: #ffe0a0;
  text-shadow: 0 0 10px rgba(255, 147, 54, 0.86), 0 0 22px rgba(255, 87, 34, 0.44);
}

.ember-gate-button img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  object-position: 36% 74%;
  filter: brightness(0.9) saturate(0.72) drop-shadow(0 0 8px rgba(166, 180, 217, 0.28));
}

.ember-gate-button:hover img {
  filter: brightness(1.06) saturate(0.82) drop-shadow(0 0 12px rgba(166, 180, 217, 0.48));
}

.sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 70%, rgba(255, 207, 116, 0.28), transparent 58%),
    linear-gradient(180deg, rgba(27, 59, 47, 0.92), rgba(7, 13, 12, 0.96));
  box-shadow: 0 12px 38px rgba(243, 155, 49, 0.36);
  overflow: hidden;
}

.sigil-img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(243, 155, 49, 0.42));
}

.kicker,
.panel-label {
  margin: 0;
  color: var(--parchment);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  font-size: 2.15rem;
  line-height: 0.96;
}

.pin-rail h2 {
  margin-top: 4px;
  font-size: 1.45rem;
  line-height: 1;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.status-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(226, 197, 141, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(2, 7, 7, 0.34);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.good {
  background: var(--success);
  box-shadow: 0 0 18px rgba(132, 196, 125, 0.6);
}

.status-dot.warn {
  background: var(--ember);
  box-shadow: 0 0 18px rgba(240, 161, 58, 0.55);
}

.status-dot.bad {
  background: var(--danger);
  box-shadow: 0 0 18px rgba(224, 109, 94, 0.55);
}

.model-chip {
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(53, 127, 115, 0.45);
  border-radius: 8px;
  color: #daf0e2;
  background: rgba(25, 59, 47, 0.62);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.pin-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.sidebar-panel[hidden] {
  display: none;
}

.image-rail {
  display: grid;
  grid-template-rows: minmax(148px, auto) minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.vision-rail-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.vision-rail-section:first-child {
  min-height: 148px;
  max-height: none;
}

.vision-rail-section:first-child[data-empty="true"] {
  min-height: 104px;
}

.vision-rail-section:first-child[data-empty="false"] .generated-image-list {
  min-height: 104px;
}

.scry-rail,
.audio-rail,
.discord-rail {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.discord-rail-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
}

.alchemy-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.pin-panel-head.compact {
  gap: 6px;
}

.alchemy-rail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alchemy-rail-title-row h2 {
  min-width: 0;
}

.alchemy-book-toggle {
  flex: 0 0 auto;
}

.alchemy-book-toggle.active {
  border-color: rgba(125, 219, 124, 0.5);
  color: #dfffd7;
  background: rgba(47, 70, 37, 0.42);
}

.generated-image-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
}

.generated-image-item {
  position: relative;
  min-width: 0;
}

.generated-image-open {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: rgba(8, 12, 14, 0.5);
  cursor: pointer;
  overflow: hidden;
}

.generated-image-open:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(244, 166, 63, 0.14);
}

.generated-image-open img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: inherit;
  object-fit: cover;
  background: rgba(2, 4, 5, 0.62);
}

.uploaded-image-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
}

.uploaded-image-item {
  position: relative;
  min-width: 0;
}

.uploaded-image-open {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 0;
  background: rgba(8, 12, 14, 0.5);
  cursor: pointer;
  overflow: hidden;
}

.uploaded-image-open:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(244, 166, 63, 0.14);
}

.uploaded-image-open img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: inherit;
  object-fit: cover;
  background: rgba(2, 4, 5, 0.62);
}

.uploaded-image-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 180, 148, 0.45);
  border-radius: 50%;
  color: #ffd8c8;
  background: rgba(58, 13, 11, 0.82);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.uploaded-image-delete:hover {
  border-color: rgba(255, 218, 177, 0.85);
  color: #fff5dd;
  box-shadow: 0 0 14px rgba(219, 67, 44, 0.28);
}

.uploaded-audio-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
}

.uploaded-audio-item {
  position: relative;
  min-width: 0;
}

.uploaded-audio-open {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 7px 34px 7px 7px;
  color: var(--text);
  background: rgba(8, 12, 14, 0.5);
  cursor: pointer;
  text-align: left;
}

.uploaded-audio-open:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 18px rgba(244, 166, 63, 0.14);
}

.uploaded-audio-icon {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  color: #2a170b;
  background: linear-gradient(180deg, #ffdc88, var(--ember));
  font-size: 0.82rem;
  font-weight: 800;
}

.uploaded-audio-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.uploaded-audio-text strong,
.uploaded-audio-text small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-audio-text strong {
  font-size: 0.86rem;
}

.uploaded-audio-text small {
  color: var(--muted);
  font-size: 0.74rem;
}

.uploaded-audio-delete {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 22px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 180, 148, 0.45);
  border-radius: 50%;
  color: #ffd8c8;
  background: rgba(58, 13, 11, 0.82);
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  transform: translateY(-50%);
}

.uploaded-audio-delete:hover {
  border-color: rgba(255, 218, 177, 0.85);
  color: #fff5dd;
  box-shadow: 0 0 14px rgba(219, 67, 44, 0.28);
}

.vision-pending-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 58%, rgba(248, 184, 78, 0.24), transparent 44%),
    rgba(20, 13, 8, 0.78);
  box-shadow: inset 0 0 22px rgba(244, 166, 63, 0.16);
}

.vision-failed-thumb {
  display: inline-grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  color: #ffd4bf;
  background:
    radial-gradient(circle at 50% 48%, rgba(183, 38, 24, 0.24), transparent 48%),
    rgba(23, 9, 8, 0.84);
  box-shadow: inset 0 0 24px rgba(183, 38, 24, 0.18);
  font-size: 1.25rem;
  font-weight: 900;
}

.potion-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 5px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.potion-list-item {
  margin: 0;
}

.potion-open {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 5px;
  color: var(--text);
  background: rgba(8, 12, 14, 0.5);
  cursor: pointer;
  text-align: left;
}

.potion-open:hover {
  border-color: var(--line-strong);
}

.potion-open.bookmarked {
  border-color: rgba(125, 219, 124, 0.42);
  box-shadow: inset 0 0 0 1px rgba(125, 219, 124, 0.12);
}

.potion-open img {
  grid-row: 1 / span 2;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(2, 4, 5, 0.62);
}

.potion-open span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.potion-open small {
  grid-column: 2;
  min-width: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vision-pending-thumb span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffc65f;
  box-shadow: 0 0 12px rgba(255, 198, 95, 0.72);
  animation: pulse 1s ease-in-out infinite;
}

.vision-pending-thumb span:nth-child(2) {
  animation-delay: 0.15s;
}

.vision-pending-thumb span:nth-child(3) {
  animation-delay: 0.3s;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(245, 236, 215, 0.18);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(4, 7, 9, 0.58);
  outline: none;
}

input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(240, 161, 58, 0.12);
}

input::placeholder {
  color: rgba(245, 236, 215, 0.48);
}

.pin-panel-head {
  display: grid;
  gap: 12px;
}

.pin-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-button {
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  border: 1px solid rgba(232, 183, 91, 0.36);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--parchment);
  background: rgba(8, 12, 14, 0.58);
  cursor: pointer;
  line-height: 1.15;
}

.text-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.text-button.small {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 0.8rem;
}

.text-button.stoke-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff1c8;
  border-color: rgba(255, 190, 92, 0.44);
  background: rgba(73, 42, 17, 0.62);
}

.text-button.stoke-button:hover {
  border-color: rgba(255, 212, 126, 0.72);
}

.text-button.stoke-button:disabled {
  opacity: 0.86;
}

.stoke-loader {
  width: 13px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 229, 171, 0.34);
  border-top-color: #ffcf74;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(243, 155, 49, 0.34);
  animation: emberTurn 0.9s linear infinite;
}

.text-button.danger {
  color: #ffe5df;
  border-color: rgba(224, 109, 94, 0.52);
  background: rgba(94, 35, 34, 0.62);
}

.text-button:disabled {
  cursor: default;
  opacity: 0.64;
}

.pin-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.pin-list-button {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 68px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(8, 12, 14, 0.5);
  cursor: pointer;
  text-align: left;
}

.pin-list-button.wide {
  min-height: 84px;
}

.pin-list-button:hover {
  border-color: var(--line-strong);
}

.ember-list-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ember-search,
.ember-mode-filter {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(232, 183, 91, 0.26);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(8, 12, 14, 0.68);
}

.ember-list-count {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.live-update-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 205, 122, 0.34);
  border-radius: 8px;
  color: #ffe6ac;
  background: rgba(73, 42, 17, 0.48);
}

.pin-title {
  font-size: 0.92rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pin-meta {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pin-preview {
  color: #f3e2bd;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pin-empty {
  padding: 10px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(8, 12, 14, 0.4);
  font-size: 0.9rem;
}

.chat-scroll {
  position: relative;
  min-height: 0;
  padding: 28px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.image-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 18px 22px 22px;
  overflow: hidden;
}

.image-panel[hidden] {
  display: none;
}

.image-settings,
.image-stage {
  border: 1px solid rgba(232, 183, 91, 0.22);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.62);
}

.image-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.image-settings {
  display: block;
  padding: 10px 12px;
}

.image-settings[hidden] {
  display: none;
}

.image-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.image-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.image-empty[hidden] {
  display: none;
}

.image-empty h3 {
  color: var(--text);
  font-size: 1.35rem;
}

.image-empty p {
  max-width: 34rem;
  margin: 0;
}

.campfire-mark.small {
  width: 96px;
  height: 84px;
}

.image-loading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, 100%);
  padding: 14px 16px;
  border: 1px solid rgba(255, 205, 122, 0.36);
  border-radius: 8px;
  color: #ffe1a0;
  background: rgba(73, 42, 17, 0.36);
  box-shadow: 0 0 26px rgba(243, 155, 49, 0.18);
}

.image-loading[hidden] {
  display: none;
}

.image-loading p {
  margin: 0;
  min-height: 1.35em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.image-result {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  min-height: 0;
}

.image-result[hidden] {
  display: none;
}

.image-summary {
  max-width: min(720px, 100%);
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  color: #ffe8b6;
  background: rgba(8, 12, 14, 0.56);
  text-align: center;
  overflow-wrap: anywhere;
}

.image-summary:empty {
  display: none;
}

.image-result img {
  width: auto;
  max-width: 100%;
  max-height: min(58dvh, 720px);
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  background: rgba(2, 4, 5, 0.62);
  object-fit: contain;
}

.image-result-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.scry-panel {
  display: grid;
  min-height: 0;
  padding: 18px 22px 22px;
  overflow: hidden;
}

.scry-panel[hidden] {
  display: none;
}

.scry-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.scry-upload-card,
.scry-empty,
.scry-result {
  border: 1px solid rgba(232, 183, 91, 0.22);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.62);
}

.scry-upload-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.scry-upload-card h2,
.scry-description-card h2 {
  margin-top: 4px;
  font-size: 1.35rem;
  line-height: 1;
}

.scry-upload-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.scry-file-field {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
  cursor: pointer;
  overflow: hidden;
}

.scry-file-field:hover {
  border-color: rgba(255, 210, 126, 0.48);
}

.scry-file-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scry-analyze-button {
  min-height: 42px;
  white-space: nowrap;
}

.scry-panel.scry-busy .scry-upload-card {
  border-color: rgba(255, 205, 122, 0.38);
  box-shadow: 0 0 28px rgba(243, 155, 49, 0.16);
}

.scry-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.scry-empty[hidden] {
  display: none;
}

.scry-empty h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
}

.scry-empty p {
  max-width: 34rem;
  margin: 0;
}

.account-panel {
  display: grid;
  min-height: 0;
  padding: 18px 22px 22px;
  overflow: auto;
}

.account-panel[hidden] {
  display: none;
}

.account-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  min-height: 0;
}

.account-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid rgba(232, 183, 91, 0.22);
  border-radius: 8px;
  padding: 16px;
  background: rgba(7, 12, 12, 0.62);
}

.account-card h2 {
  margin-top: 4px;
  font-size: 1.35rem;
  line-height: 1;
}

.account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.account-meta div {
  min-width: 0;
  border: 1px solid rgba(232, 183, 91, 0.16);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(2, 5, 5, 0.42);
}

.account-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.account-meta dd {
  margin: 3px 0 0;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-form {
  display: grid;
  gap: 8px;
}

.account-form label {
  color: var(--muted);
  font-size: 0.9rem;
}

.account-form input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
}

.account-form input:focus {
  outline: none;
  border-color: rgba(255, 210, 126, 0.56);
  box-shadow: 0 0 0 3px rgba(243, 155, 49, 0.14);
}

.account-inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.account-password-form {
  grid-template-columns: 1fr;
}

.account-notice {
  grid-column: 1 / -1;
}

.account-notice[data-state="good"] {
  color: #d8f3cb;
}

.account-notice[data-state="bad"] {
  color: #ffd2c7;
}

.scry-result {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.scry-result[hidden] {
  display: none;
}

.scry-result img {
  width: 100%;
  max-height: 100%;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  background: rgba(2, 4, 5, 0.62);
  object-fit: contain;
}

.scry-description-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  border: 1px solid rgba(232, 183, 91, 0.2);
  border-radius: 8px;
  padding: 14px;
  color: #ffe8b6;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 179, 71, 0.12), transparent 34%),
    rgba(8, 12, 14, 0.62);
}

.scry-description-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.audio-panel {
  display: grid;
  min-height: 0;
  padding: 18px 22px 22px;
  overflow: hidden;
}

.audio-panel[hidden] {
  display: none;
}

.audio-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.audio-upload-card,
.audio-empty,
.audio-result {
  border: 1px solid rgba(232, 183, 91, 0.22);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.62);
}

.audio-upload-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.audio-upload-card h2,
.audio-player-card h2,
.audio-description-card h2 {
  margin-top: 4px;
  font-size: 1.35rem;
  line-height: 1;
}

.audio-upload-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.audio-file-field {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
  cursor: pointer;
  overflow: hidden;
}

.audio-file-field:hover {
  border-color: rgba(255, 210, 126, 0.48);
}

.audio-file-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.audio-transcribe-button {
  min-height: 42px;
  white-space: nowrap;
}

.audio-panel.audio-busy .audio-upload-card {
  border-color: rgba(255, 205, 122, 0.38);
  box-shadow: 0 0 28px rgba(243, 155, 49, 0.16);
}

.audio-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.audio-empty[hidden],
.audio-result[hidden] {
  display: none;
}

.audio-empty h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
}

.audio-empty p {
  max-width: 34rem;
  margin: 0;
}

.audio-result {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.audio-player-card,
.audio-description-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  border: 1px solid rgba(232, 183, 91, 0.2);
  border-radius: 8px;
  padding: 14px;
  color: #ffe8b6;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 179, 71, 0.12), transparent 34%),
    rgba(8, 12, 14, 0.62);
}

.audio-player-card audio {
  width: 100%;
  align-self: start;
}

.audio-description-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.audio-description-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.discord-panel {
  display: grid;
  min-height: 0;
  padding: 18px 22px 22px;
}

.discord-panel[hidden] {
  display: none;
}

.discord-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
}

.discord-header-card,
.discord-activity-card {
  border: 1px solid rgba(232, 183, 91, 0.22);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 231, 176, 0.04);
}

.discord-header-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
}

.discord-status-card,
.discord-bot-status-panel {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 180px;
  border: 1px solid rgba(232, 183, 91, 0.18);
  border-radius: 8px;
  padding: 9px 10px;
  color: #ffe7b4;
  background: rgba(8, 13, 13, 0.58);
}

.discord-status-card[data-transcription="warming"] {
  border-color: rgba(255, 180, 64, 0.42);
  box-shadow: 0 0 20px rgba(255, 130, 32, 0.16);
}

.discord-status-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discord-status-card strong::before {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #7f1d1d;
  box-shadow: 0 0 10px rgba(127, 29, 29, 0.42);
}

.discord-status-card[data-transcription="warming"] strong::before {
  background: #ffb547;
  box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.6);
  animation: discord-status-pulse 1.3s ease-in-out infinite;
}

.discord-status-card[data-recording="recording"] strong::before {
  background: #6ee7a8;
  box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.52);
  animation: discord-status-pulse 1.3s ease-in-out infinite;
}

@keyframes discord-status-pulse {
  0% {
    transform: scale(0.82);
    opacity: 0.62;
  }
  55% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(0.82);
    opacity: 0.62;
  }
}

.discord-status-card strong,
.discord-bot-status-panel strong {
  color: #fff0c2;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.discord-status-card span,
.discord-bot-status-panel span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.discord-status-card[data-state="ok"],
.discord-bot-status-panel[data-state="ok"] {
  border-color: rgba(93, 182, 140, 0.38);
  box-shadow: 0 0 18px rgba(70, 168, 113, 0.1);
}

.discord-status-card[data-state="warn"],
.discord-bot-status-panel[data-state="warn"] {
  border-color: rgba(255, 187, 87, 0.34);
}

.discord-bot-status-panel[data-state="error"] {
  border-color: rgba(255, 132, 98, 0.36);
}

.discord-header-card h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  line-height: 1;
}

.discord-header-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.discord-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
}

.discord-activity-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  padding: 9px;
}

.discord-transcript-detail {
  grid-column: auto;
}

.discord-card-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.discord-transcript-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
}

.discord-export-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(5, 9, 9, 0.42);
  font-size: 0.72rem;
  white-space: nowrap;
}

.discord-export-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--ember);
}

.discord-transcript-delay {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 190, 86, 0.22);
  border-radius: 6px;
  background: rgba(255, 176, 70, 0.08);
  color: #ffd98f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.discord-transcript-delay[data-state="waiting"] {
  color: var(--muted);
}

.discord-transcript-delay[data-state="ended"],
.discord-transcript-delay[data-state="idle"] {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.discord-speaker-editor {
  display: grid;
  gap: 12px;
}

.discord-speaker-editor-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.discord-speaker-editor-list {
  display: grid;
  gap: 8px;
}

.discord-speaker-editor-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(232, 183, 91, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(8, 13, 13, 0.62);
}

.discord-speaker-editor-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.discord-speaker-editor-row strong {
  overflow: hidden;
  color: #fff0c2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-speaker-editor-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.discord-speaker-editor-row input {
  min-width: 0;
  border: 1px solid rgba(255, 190, 86, 0.24);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(1, 5, 5, 0.72);
}

.discord-speaker-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.discord-card-head h3 {
  margin: 0;
  overflow: hidden;
  color: #ffe7b4;
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-roll-list,
.discord-sidebar-roll-list,
.discord-transcript-list,
.discord-sidebar-transcript-list,
.discord-transcript-entry-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.discord-transcript-entry-list {
  gap: 4px;
  overflow-anchor: none;
  scroll-behavior: smooth;
}

.discord-sidebar-roll-list,
.discord-sidebar-transcript-list {
  gap: 5px;
}

.discord-transcript-entry-list[data-busy="true"] {
  border-color: rgba(255, 179, 64, 0.24);
  box-shadow: inset 0 -18px 28px rgba(255, 128, 32, 0.16);
}

.discord-transcript-entry-list[data-busy="true"]::after {
  content: "Preparing the voice transcription...";
  position: sticky;
  bottom: 0;
  display: block;
  margin-top: 2px;
  padding: 5px 8px;
  border-top: 1px solid rgba(255, 190, 86, 0.24);
  color: #ffd98f;
  background: rgba(21, 11, 4, 0.76);
  font-size: 0.72rem;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 165, 58, 0.55);
}

.discord-roll-item {
  --roll-accent: #f59e0b;
  --roll-accent-soft: rgba(245, 158, 11, 0.18);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
}

.discord-roll-item[data-degree="criticalSuccess"] {
  --roll-accent: #38bdf8;
  --roll-accent-soft: rgba(56, 189, 248, 0.22);
}

.discord-roll-item[data-degree="success"] {
  --roll-accent: #22c55e;
  --roll-accent-soft: rgba(34, 197, 94, 0.18);
}

.discord-roll-item[data-degree="failure"] {
  --roll-accent: #c2410c;
  --roll-accent-soft: rgba(194, 65, 12, 0.2);
}

.discord-roll-item[data-degree="criticalFailure"] {
  --roll-accent: #7f1d1d;
  --roll-accent-soft: rgba(127, 29, 29, 0.24);
}

.discord-roll-item {
  align-items: center;
  padding: 6px;
  border: 1px solid var(--roll-accent-soft);
  border-radius: 8px;
  background: rgba(8, 13, 13, 0.58);
  cursor: pointer;
}

.discord-roll-item:hover,
.discord-roll-item:focus-visible {
  border-color: var(--roll-accent);
  outline: none;
  box-shadow: 0 0 14px var(--roll-accent-soft);
}

.discord-roll-total {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid var(--roll-accent);
  border-radius: 8px;
  color: var(--roll-accent);
  background: var(--roll-accent-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: inset 0 0 14px var(--roll-accent-soft), 0 0 14px var(--roll-accent-soft);
}

.discord-roll-item .discord-roll-total {
  min-height: 34px;
  font-size: 1rem;
}

.discord-roll-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.discord-roll-title {
  margin: 0;
  overflow: hidden;
  color: var(--roll-accent);
  text-shadow: 0 0 10px var(--roll-accent-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-roll-title {
  font-size: 1rem;
}

.discord-roll-item .discord-roll-title {
  font-size: 0.78rem;
  font-weight: 700;
}

.discord-roll-chip {
  color: var(--roll-accent);
  font-weight: 800;
  text-shadow: 0 0 10px var(--roll-accent-soft);
}

.discord-roll-chip.dc {
  color: var(--roll-accent);
}

.discord-roll-chip.result {
  text-transform: uppercase;
  letter-spacing: 0;
}

.discord-roll-body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-roll-body p {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

.discord-transcript-item {
  min-width: 0;
}

.discord-transcript-open {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(232, 183, 91, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(8, 13, 13, 0.58);
  cursor: pointer;
  text-align: left;
}

.discord-transcript-item.compact .discord-transcript-open {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px;
  padding: 6px;
}

.discord-transcript-open:hover,
.discord-transcript-open[data-active="true"] {
  border-color: rgba(255, 187, 87, 0.44);
  box-shadow: 0 0 18px rgba(243, 155, 49, 0.12);
}

.discord-transcript-open[data-status="recording"] {
  border-color: rgba(255, 195, 74, 0.32);
  box-shadow: 0 0 16px rgba(255, 178, 52, 0.13);
}

.discord-transcript-status {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid rgba(93, 182, 140, 0.34);
  border-radius: 8px;
  color: #cff7d6;
  background: rgba(22, 68, 42, 0.42);
  font-size: 0.78rem;
  line-height: 1;
}

.discord-transcript-item.compact .discord-transcript-status {
  min-height: 32px;
  font-size: 0.7rem;
}

.discord-transcript-status[data-state="recording"] {
  border-color: rgba(255, 207, 82, 0.78);
  background: linear-gradient(180deg, rgba(255, 205, 79, 0.32), rgba(163, 97, 17, 0.42));
  color: #fff1b8;
  box-shadow:
    0 0 10px rgba(255, 195, 64, 0.52),
    inset 0 0 8px rgba(255, 221, 124, 0.18);
  text-shadow: 0 0 8px rgba(255, 230, 145, 0.72);
  animation: discord-live-pulse 1.7s ease-in-out infinite;
}

@keyframes discord-live-pulse {
  0%,
  100% {
    box-shadow:
      0 0 8px rgba(255, 195, 64, 0.38),
      inset 0 0 8px rgba(255, 221, 124, 0.15);
  }
  50% {
    box-shadow:
      0 0 18px rgba(255, 195, 64, 0.78),
      inset 0 0 10px rgba(255, 238, 153, 0.28);
  }
}

.discord-transcript-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.discord-transcript-name {
  overflow: hidden;
  color: #fff1c8;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-transcript-body small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-transcript-item.compact .discord-transcript-body small {
  font-size: 0.68rem;
}

.discord-roll-detail {
  --roll-accent: #f59e0b;
  --roll-accent-soft: rgba(245, 158, 11, 0.18);
  display: grid;
  gap: 12px;
}

.discord-roll-detail[data-degree="criticalSuccess"] {
  --roll-accent: #38bdf8;
  --roll-accent-soft: rgba(56, 189, 248, 0.22);
}

.discord-roll-detail[data-degree="success"] {
  --roll-accent: #22c55e;
  --roll-accent-soft: rgba(34, 197, 94, 0.18);
}

.discord-roll-detail[data-degree="failure"] {
  --roll-accent: #c2410c;
  --roll-accent-soft: rgba(194, 65, 12, 0.2);
}

.discord-roll-detail[data-degree="criticalFailure"] {
  --roll-accent: #7f1d1d;
  --roll-accent-soft: rgba(127, 29, 29, 0.24);
}

.discord-roll-detail-header {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.discord-roll-detail-header h3,
.discord-roll-detail-header p {
  margin: 0;
}

.discord-roll-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.discord-roll-detail-row {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(232, 183, 91, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 13, 13, 0.58);
}

.discord-roll-detail-row span {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.discord-roll-detail-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-roll-detail-note {
  margin: 0;
  color: var(--roll-accent);
  font-weight: 800;
}

.discord-roll-detail-output {
  margin: 0;
  overflow: auto;
  border: 1px solid var(--roll-accent-soft);
  border-radius: 8px;
  padding: 10px;
  color: #ffe7b4;
  background: rgba(2, 6, 6, 0.72);
  white-space: pre-wrap;
}

.discord-roll-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.discord-transcript-entry {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 6px;
  padding: 7px 9px;
  background: rgba(4, 8, 9, 0.54);
  animation: discord-transcript-rise 520ms ease-out both;
}

@keyframes discord-transcript-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
    box-shadow: 0 10px 22px rgba(255, 141, 45, 0.14);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    box-shadow: none;
  }
}

.discord-transcript-entry.error {
  border-color: rgba(255, 132, 98, 0.32);
  background: rgba(72, 20, 14, 0.28);
}

.discord-transcript-entry[data-kind="roll"] {
  border-color: rgba(56, 189, 248, 0.52);
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.18), rgba(255, 179, 64, 0.1)),
    rgba(7, 12, 14, 0.72);
  box-shadow:
    inset 0 0 18px rgba(56, 189, 248, 0.08),
    0 0 16px rgba(56, 189, 248, 0.12);
}

.discord-transcript-entry[data-kind="roll"] .discord-transcript-entry-head strong {
  color: #9ee7ff;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.42);
}

.discord-transcript-entry[data-kind="roll"] .discord-transcript-entry-head strong::after {
  content: " roll";
  margin-left: 7px;
  color: #ffd98f;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.discord-transcript-entry-head {
  display: flex;
  gap: 7px;
  align-items: baseline;
  justify-content: flex-start;
  min-width: 0;
}

.discord-transcript-entry-head strong {
  min-width: 0;
  overflow: hidden;
  color: #ffe7b4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-transcript-entry p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.32;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.discord-transcript-lines {
  display: grid;
  gap: 2px;
}

.discord-transcript-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  will-change: opacity, transform;
}

.discord-transcript-line-new {
  animation: discord-transcript-line-rise 720ms cubic-bezier(0.18, 0.8, 0.22, 1) both;
}

@keyframes discord-transcript-line-rise {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: drop-shadow(0 14px 18px rgba(255, 150, 46, 0.34));
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: none;
  }
}

.discord-transcript-line small {
  color: var(--muted);
  font-size: 0.69rem;
}

.discord-transcript-line[data-kind="roll"] small {
  color: #93e6ff;
}

.discord-transcript-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.discord-transcript-line[data-kind="roll"] span {
  color: #ffe8ad;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 196, 92, 0.26);
}

.alchemy-panel {
  grid-row: 4;
  min-height: 0;
  overflow: auto;
}

.alchemy-panel[hidden] {
  display: none;
}

.alchemy-workspace {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 10px;
  min-height: 100%;
  padding: 16px;
}

.alchemy-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.alchemy-controls label {
  color: var(--muted);
  font-size: 0.84rem;
}

.alchemy-controls select,
.alchemy-style-field select,
.alchemy-pf2e-field input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
  outline: none;
}

.alchemy-style-field,
.alchemy-pf2e-field {
  position: relative;
  width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
}

.alchemy-formula-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  width: min(720px, 100%);
  align-items: start;
}

.alchemy-reagent-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 72px;
}

.alchemy-reagent-summary[hidden] {
  display: none;
}

.alchemy-reagent-image {
  width: 72px;
  height: 100%;
  min-height: 72px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  object-fit: cover;
  background: rgba(2, 5, 6, 0.58);
  box-shadow: 0 0 18px rgba(243, 155, 49, 0.1);
}

.alchemy-reagent-image[hidden] {
  display: none;
}

.alchemy-category-effect {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-items: stretch;
  margin: 0;
  min-height: 72px;
  overflow: visible;
  color: #e7d8b3;
  font-size: 0.84rem;
  line-height: 1.32;
}

.alchemy-category-effect span {
  display: flex;
  align-items: center;
  min-width: 0;
}

.alchemy-add-button,
.alchemy-brew-button,
.alchemy-poultice-brew-button {
  border-color: rgba(125, 219, 124, 0.5);
  color: #dfffd7;
  background: linear-gradient(180deg, rgba(57, 112, 57, 0.92), rgba(24, 72, 38, 0.92));
}

.alchemy-poultice-brew-button {
  border-color: rgba(167, 221, 126, 0.58);
  background: linear-gradient(180deg, rgba(73, 126, 52, 0.92), rgba(33, 82, 33, 0.92));
  box-shadow: 0 0 18px rgba(132, 215, 92, 0.13);
}

.alchemy-poultice-brew-button[hidden] {
  display: none;
}

.alchemy-cauldron-stage {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 0;
  border: 1px solid rgba(232, 183, 91, 0.22);
  border-radius: 8px;
  padding: 12px 18px 14px;
  background: rgba(7, 12, 12, 0.62);
}

.alchemy-slots {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(220px, 280px) minmax(110px, 1fr);
  grid-template-rows: repeat(2, minmax(118px, auto));
  grid-template-areas:
    "slot0 cauldron slot1"
    "slot2 cauldron slot3";
  gap: 10px;
  align-items: center;
  width: min(720px, 100%);
}

.alchemy-slot {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-height: 104px;
  border: 1px dashed rgba(232, 183, 91, 0.34);
  border-radius: 8px;
  padding: 12px 30px 12px 12px;
  color: var(--muted);
  background: rgba(3, 7, 8, 0.58);
  overflow: hidden;
  overflow-wrap: anywhere;
  cursor: default;
}

.alchemy-slot.filled {
  --alchemy-slot-rgb: 232, 183, 91;
  --alchemy-slot-glow: rgba(232, 183, 91, 0.18);
  --alchemy-slot-image: none;
  border-style: solid;
  color: #f8e7bf;
}

.alchemy-slot.filled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-repeat: no-repeat;
  background-size: 100% 100%, 118px 118px;
  opacity: 0.74;
  pointer-events: none;
  filter: saturate(0.9) contrast(1.05);
}

.alchemy-slot.alchemy-slot-art-left::before {
  background-image:
    linear-gradient(90deg, rgba(3, 7, 8, 0) 0%, rgba(3, 7, 8, 0.18) 38%, rgba(3, 7, 8, 0.76) 64%, rgba(3, 7, 8, 0.94) 100%),
    var(--alchemy-slot-image);
  background-position: center, left center;
}

.alchemy-slot.alchemy-slot-art-right::before {
  background-image:
    linear-gradient(270deg, rgba(3, 7, 8, 0) 0%, rgba(3, 7, 8, 0.18) 38%, rgba(3, 7, 8, 0.76) 64%, rgba(3, 7, 8, 0.94) 100%),
    var(--alchemy-slot-image);
  background-position: center, right center;
}

.alchemy-slot.rarity-common {
  --alchemy-slot-rgb: 116, 120, 124;
  --alchemy-slot-glow: rgba(158, 163, 168, 0.3);
  border-color: rgba(116, 120, 124, 0.72);
  background: linear-gradient(180deg, rgba(42, 45, 46, 0.78), rgba(18, 21, 22, 0.72));
  box-shadow: inset 0 0 0 1px rgba(164, 169, 174, 0.08), 0 0 10px rgba(116, 120, 124, 0.08);
}

.alchemy-slot.rarity-uncommon {
  --alchemy-slot-rgb: 64, 127, 77;
  --alchemy-slot-glow: rgba(80, 177, 95, 0.34);
  border-color: rgba(55, 101, 66, 0.72);
  background: linear-gradient(180deg, rgba(42, 66, 41, 0.78), rgba(18, 42, 28, 0.72));
  box-shadow: inset 0 0 0 1px rgba(80, 177, 95, 0.08), 0 0 10px rgba(45, 91, 56, 0.09);
}

.alchemy-slot.rarity-rare {
  --alchemy-slot-rgb: 65, 107, 170;
  --alchemy-slot-glow: rgba(76, 135, 221, 0.36);
  border-color: rgba(55, 86, 142, 0.78);
  background: linear-gradient(180deg, rgba(31, 50, 78, 0.82), rgba(14, 29, 51, 0.74));
  box-shadow: inset 0 0 0 1px rgba(91, 146, 229, 0.09), 0 0 10px rgba(54, 98, 168, 0.1);
}

.alchemy-slot.rarity-epic {
  --alchemy-slot-rgb: 216, 169, 68;
  --alchemy-slot-glow: rgba(255, 196, 70, 0.42);
  border-color: rgba(218, 168, 61, 0.86);
  background: linear-gradient(180deg, rgba(86, 62, 19, 0.86), rgba(48, 33, 11, 0.78));
  box-shadow: inset 0 0 0 1px rgba(255, 211, 98, 0.1), 0 0 12px rgba(218, 168, 61, 0.12);
}

.alchemy-slot.known {
  border-color: rgba(var(--alchemy-slot-rgb), 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(var(--alchemy-slot-rgb), 0.18),
    0 0 18px var(--alchemy-slot-glow),
    0 0 34px rgba(var(--alchemy-slot-rgb), 0.12);
  animation: knownIngredientGlow 2.8s ease-in-out infinite;
}

@keyframes knownIngredientGlow {
  0%,
  100% {
    filter: brightness(0.96);
  }

  50% {
    filter: brightness(1.18);
  }
}

.alchemy-slot-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
}

.alchemy-slot-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.62);
}

.alchemy-slot-name {
  display: block;
  min-width: 0;
  text-align: center;
}

.alchemy-slot-effect {
  display: block;
  max-width: 100%;
  overflow: visible;
  color: #cfe1c5;
  font-size: 0.72rem;
  line-height: 1.22;
  text-align: center;
}

.alchemy-slot.rarity-common .alchemy-slot-effect {
  color: #d8dcdf;
}

.alchemy-slot.rarity-uncommon .alchemy-slot-effect {
  color: #cfe1c5;
}

.alchemy-slot.rarity-rare .alchemy-slot-effect {
  color: #c9dcff;
}

.alchemy-slot.rarity-epic .alchemy-slot-effect {
  color: #ffe3a1;
}

.alchemy-slot-clear {
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  aspect-ratio: 1;
  border: 0;
  color: #ff8d7e;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  background: transparent;
  text-shadow: 0 0 8px rgba(84, 9, 11, 0.7);
  cursor: pointer;
}

.alchemy-slot-clear:hover {
  color: #ffb3a8;
  transform: scale(1.08);
}

.alchemy-ingredient-throw {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 56px;
  aspect-ratio: 1;
  border: 1px solid rgba(211, 255, 190, 0.34);
  border-radius: 10px;
  object-fit: cover;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(125, 219, 124, 0.42));
  will-change: transform, opacity;
}

.alchemy-slot[data-slot-index="0"] {
  grid-area: slot0;
}

.alchemy-slot[data-slot-index="1"] {
  grid-area: slot1;
}

.alchemy-slot[data-slot-index="2"] {
  grid-area: slot2;
}

.alchemy-slot[data-slot-index="3"] {
  grid-area: slot3;
}

.alchemy-cauldron {
  grid-area: cauldron;
  position: relative;
  display: grid;
  place-items: center;
  width: min(300px, 72vw);
  aspect-ratio: 0.88;
  margin-top: 12px;
}

.cauldron-bowl {
  position: relative;
  z-index: 2;
  width: 82%;
  height: 52%;
  border: 4px solid rgba(30, 42, 38, 0.95);
  border-top-width: 8px;
  border-radius: 46% 46% 40% 40% / 22% 22% 64% 64%;
  background:
    linear-gradient(180deg, #283833, #111a18);
  box-shadow: inset 0 -18px 22px rgba(0, 0, 0, 0.34), 0 18px 34px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.cauldron-liquid {
  position: absolute;
  top: 12%;
  left: 8%;
  width: 84%;
  height: 13%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(177, 255, 145, 0.92), rgba(77, 179, 75, 0.62) 55%, rgba(24, 95, 45, 0.4) 72%);
  box-shadow: 0 0 18px rgba(125, 219, 124, 0.22), inset 0 -4px 8px rgba(17, 61, 31, 0.4);
}

.cauldron-bowl::before,
.cauldron-bowl::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 24px;
  height: 18px;
  border: 3px solid rgba(30, 42, 38, 0.95);
  border-radius: 999px;
}

.cauldron-bowl::before {
  left: -18px;
}

.cauldron-bowl::after {
  right: -18px;
}

.cauldron-flames {
  position: absolute;
  bottom: 13%;
  left: 50%;
  z-index: 3;
  width: 60%;
  height: 28%;
  transform: translateX(-50%);
  pointer-events: none;
}

.cauldron-flames span {
  position: absolute;
  bottom: 0;
  width: 16px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, #ffe58a 0 24%, #f39b31 58%, rgba(173, 54, 18, 0.16) 78%, transparent 80%);
  box-shadow: 0 0 16px rgba(243, 155, 49, 0.5);
  opacity: 0.72;
}

.cauldron-flames span:nth-child(1) { left: 4%; transform: translateY(0) scale(0.8); }
.cauldron-flames span:nth-child(2) { left: 14%; transform: translateY(-8px) scale(1); }
.cauldron-flames span:nth-child(3) { left: 24%; transform: translateY(-2px) scale(0.75); }
.cauldron-flames span:nth-child(4) { left: 34%; transform: translateY(-12px) scale(1.1); }
.cauldron-flames span:nth-child(5) { left: 45%; transform: translateY(-4px) scale(0.9); }
.cauldron-flames span:nth-child(6) { left: 55%; transform: translateY(-13px) scale(1.12); }
.cauldron-flames span:nth-child(7) { left: 65%; transform: translateY(-3px) scale(0.82); }
.cauldron-flames span:nth-child(8) { left: 75%; transform: translateY(-10px) scale(1); }
.cauldron-flames span:nth-child(9) { left: 84%; transform: translateY(-1px) scale(0.72); }
.cauldron-flames span:nth-child(10) { left: 92%; transform: translateY(-7px) scale(0.86); }

.alchemy-cauldron.brewing .cauldron-flames span {
  animation: cauldronFlame 0.72s ease-in-out infinite;
}

.alchemy-cauldron.brewing .cauldron-flames span:nth-child(2n) {
  animation-delay: 0.12s;
}

.alchemy-cauldron.brewing .cauldron-flames span:nth-child(3n) {
  animation-delay: 0.24s;
}

.cauldron-bubbles {
  position: absolute;
  top: 20%;
  left: 50%;
  z-index: 4;
  width: 62%;
  height: 14%;
  transform: translateX(-50%);
  pointer-events: none;
}

.cauldron-bubbles span {
  position: absolute;
  bottom: 0;
  width: 12px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(158, 255, 145, 0.75);
  box-shadow: 0 0 14px rgba(125, 219, 124, 0.45);
  opacity: 0.2;
}

.cauldron-bubbles span:nth-child(1) { left: 5%; }
.cauldron-bubbles span:nth-child(2) { left: 16%; width: 9px; }
.cauldron-bubbles span:nth-child(3) { left: 27%; width: 13px; }
.cauldron-bubbles span:nth-child(4) { left: 38%; width: 8px; }
.cauldron-bubbles span:nth-child(5) { left: 48%; width: 11px; }
.cauldron-bubbles span:nth-child(6) { left: 58%; width: 14px; }
.cauldron-bubbles span:nth-child(7) { left: 68%; width: 8px; }
.cauldron-bubbles span:nth-child(8) { left: 78%; width: 12px; }
.cauldron-bubbles span:nth-child(9) { left: 88%; width: 9px; }
.cauldron-bubbles span:nth-child(10) { left: 12%; width: 7px; }
.cauldron-bubbles span:nth-child(11) { left: 22%; width: 10px; }
.cauldron-bubbles span:nth-child(12) { left: 33%; width: 6px; }
.cauldron-bubbles span:nth-child(13) { left: 53%; width: 9px; }
.cauldron-bubbles span:nth-child(14) { left: 73%; width: 7px; }
.cauldron-bubbles span:nth-child(15) { left: 93%; width: 11px; }

.alchemy-cauldron.brewing .cauldron-bubbles span {
  animation: cauldronBubble 1.1s ease-in-out infinite;
}

.cauldron-splash {
  position: absolute;
  top: 20%;
  left: 50%;
  z-index: 6;
  width: 46%;
  height: 18%;
  transform: translateX(-50%);
  pointer-events: none;
}

.cauldron-splash span {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 8px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(211, 255, 177, 0.95), rgba(85, 218, 77, 0.7) 62%, transparent 72%);
  box-shadow: 0 0 14px rgba(125, 219, 124, 0.72);
  opacity: 0;
  animation: cauldronSplash 0.72s ease-out forwards;
}

.cauldron-splash span:nth-child(1) { --splash-x: -42px; --splash-y: -20px; animation-delay: 0s; }
.cauldron-splash span:nth-child(2) { --splash-x: -30px; --splash-y: -36px; animation-delay: 0.03s; }
.cauldron-splash span:nth-child(3) { --splash-x: -15px; --splash-y: -28px; animation-delay: 0.05s; }
.cauldron-splash span:nth-child(4) { --splash-x: 0px; --splash-y: -42px; animation-delay: 0.01s; }
.cauldron-splash span:nth-child(5) { --splash-x: 16px; --splash-y: -30px; animation-delay: 0.04s; }
.cauldron-splash span:nth-child(6) { --splash-x: 31px; --splash-y: -38px; animation-delay: 0.02s; }
.cauldron-splash span:nth-child(7) { --splash-x: 43px; --splash-y: -22px; animation-delay: 0.06s; }
.cauldron-splash span:nth-child(8) { --splash-x: -8px; --splash-y: -18px; width: 11px; animation-delay: 0.08s; }
.cauldron-splash span:nth-child(9) { --splash-x: 9px; --splash-y: -17px; width: 10px; animation-delay: 0.08s; }

.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(2) {
  animation-delay: 0.18s;
}

.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(3) {
  animation-delay: 0.34s;
}

.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(4) { animation-delay: 0.1s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(5) { animation-delay: 0.42s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(6) { animation-delay: 0.22s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(7) { animation-delay: 0.56s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(8) { animation-delay: 0.3s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(9) { animation-delay: 0.68s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(10) { animation-delay: 0.74s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(11) { animation-delay: 0.46s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(12) { animation-delay: 0.58s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(13) { animation-delay: 0.16s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(14) { animation-delay: 0.64s; }
.alchemy-cauldron.brewing .cauldron-bubbles span:nth-child(15) { animation-delay: 0.38s; }

.cauldron-steam {
  position: absolute;
  top: -34%;
  left: 50%;
  z-index: 5;
  width: 78%;
  height: 62%;
  transform: translateX(-50%);
  pointer-events: none;
}

.cauldron-steam span {
  position: absolute;
  bottom: 0;
  width: 8px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(186, 192, 185, 0.42);
  box-shadow: 0 0 12px rgba(214, 220, 210, 0.2);
  filter: blur(0.4px);
  opacity: 0;
}

.cauldron-steam span:nth-child(1) { left: 2%; width: 6px; animation-delay: 0.04s; animation-duration: 2.2s; }
.cauldron-steam span:nth-child(2) { left: 7%; width: 9px; animation-delay: 0.4s; animation-duration: 2.7s; }
.cauldron-steam span:nth-child(3) { left: 12%; width: 5px; animation-delay: 0.82s; animation-duration: 2.35s; }
.cauldron-steam span:nth-child(4) { left: 17%; width: 10px; animation-delay: 1.15s; animation-duration: 2.85s; }
.cauldron-steam span:nth-child(5) { left: 22%; width: 7px; animation-delay: 0.22s; animation-duration: 2.45s; }
.cauldron-steam span:nth-child(6) { left: 27%; width: 11px; animation-delay: 0.7s; animation-duration: 2.95s; }
.cauldron-steam span:nth-child(7) { left: 32%; width: 6px; animation-delay: 1.42s; animation-duration: 2.5s; }
.cauldron-steam span:nth-child(8) { left: 37%; width: 9px; animation-delay: 0.54s; animation-duration: 2.75s; }
.cauldron-steam span:nth-child(9) { left: 42%; width: 5px; animation-delay: 1.04s; animation-duration: 2.32s; }
.cauldron-steam span:nth-child(10) { left: 47%; width: 12px; animation-delay: 0.18s; animation-duration: 3s; }
.cauldron-steam span:nth-child(11) { left: 52%; width: 7px; animation-delay: 0.92s; animation-duration: 2.55s; }
.cauldron-steam span:nth-child(12) { left: 57%; width: 10px; animation-delay: 1.3s; animation-duration: 2.88s; }
.cauldron-steam span:nth-child(13) { left: 62%; width: 6px; animation-delay: 0.34s; animation-duration: 2.4s; }
.cauldron-steam span:nth-child(14) { left: 67%; width: 11px; animation-delay: 0.78s; animation-duration: 3.05s; }
.cauldron-steam span:nth-child(15) { left: 72%; width: 5px; animation-delay: 1.5s; animation-duration: 2.3s; }
.cauldron-steam span:nth-child(16) { left: 77%; width: 9px; animation-delay: 0.62s; animation-duration: 2.7s; }
.cauldron-steam span:nth-child(17) { left: 82%; width: 7px; animation-delay: 1.08s; animation-duration: 2.58s; }
.cauldron-steam span:nth-child(18) { left: 87%; width: 10px; animation-delay: 0.12s; animation-duration: 2.9s; }
.cauldron-steam span:nth-child(19) { left: 92%; width: 6px; animation-delay: 0.96s; animation-duration: 2.38s; }
.cauldron-steam span:nth-child(20) { left: 96%; width: 8px; animation-delay: 1.36s; animation-duration: 2.8s; }
.cauldron-steam span:nth-child(21) { left: 14%; width: 12px; animation-delay: 1.8s; animation-duration: 3.15s; }
.cauldron-steam span:nth-child(22) { left: 35%; width: 8px; animation-delay: 1.72s; animation-duration: 2.65s; }
.cauldron-steam span:nth-child(23) { left: 59%; width: 13px; animation-delay: 1.94s; animation-duration: 3.25s; }
.cauldron-steam span:nth-child(24) { left: 80%; width: 8px; animation-delay: 1.64s; animation-duration: 2.62s; }

.alchemy-cauldron.brewing .cauldron-steam span {
  animation-name: cauldronSteam;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes cauldronBubble {
  0%,
  100% {
    opacity: 0.18;
    transform: translateY(10px) scale(0.7);
  }
  50% {
    opacity: 1;
    transform: translateY(-18px) scale(1.1);
  }
}

@keyframes cauldronSplash {
  0% {
    opacity: 0;
    transform: translate(-50%, 4px) scale(0.45);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--splash-x, 0px)), var(--splash-y, -28px)) scale(1.2);
  }
}

@keyframes cauldronSteam {
  0% {
    opacity: 0;
    transform: translateY(10px) translateX(0) scale(0.45);
  }
  20% {
    opacity: 0.55;
  }
  70% {
    opacity: 0.22;
  }
  100% {
    opacity: 0;
    transform: translateY(-92px) translateX(var(--steam-drift, 10px)) scale(1.45);
  }
}

@keyframes cauldronFlame {
  0%,
  100% {
    opacity: 0.5;
    filter: saturate(1);
  }
  50% {
    opacity: 1;
    filter: saturate(1.35);
  }
}

.alchemy-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.alchemy-stage-status {
  min-height: 1.25em;
  margin: -3px 0 0;
  color: #ffd27b;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-shadow:
    0 0 6px rgba(255, 229, 138, 0.72),
    0 0 16px rgba(243, 155, 49, 0.54),
    0 0 28px rgba(173, 54, 18, 0.42);
}

.alchemy-stage-status[data-state="busy"] {
  color: #ffe58a;
  animation: emberTextGlow 1.35s ease-in-out infinite;
}

.alchemy-stage-status[data-state="good"] {
  color: #fff1b8;
}

.alchemy-stage-status[data-state="bad"],
.alchemy-stage-status[data-state="warn"] {
  color: #ffb18d;
}

@keyframes emberTextGlow {
  0%,
  100% {
    filter: brightness(0.92);
  }
  50% {
    filter: brightness(1.22);
  }
}

.alchemy-pf2e-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: end;
  margin-top: 6px;
}

.alchemy-pf2e-input-row input {
  margin-top: 0;
}

.alchemy-pf2e-info-button {
  width: 38px;
  height: 38px;
  border-color: rgba(232, 183, 91, 0.34);
  color: #ffe1a0;
  background: rgba(4, 8, 10, 0.72);
}

.alchemy-pf2e-info-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.alchemy-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: flex-end;
  width: min(860px, 100%);
}

.alchemy-export-control {
  position: relative;
  display: grid;
  gap: 5px;
  width: min(360px, 100%);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
}

.alchemy-export-control input {
  width: 100%;
  border: 1px solid rgba(245, 180, 72, 0.32);
  border-radius: 8px;
  background: rgba(3, 8, 8, 0.78);
  color: var(--text);
  padding: 10px 12px;
}

.alchemy-export-control input:disabled {
  opacity: 0.55;
}

.alchemy-export-selection {
  min-height: 16px;
  color: #ffe1a0;
  font-size: 0.78rem;
}

.alchemy-export-results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(245, 180, 72, 0.32);
  border-radius: 8px;
  background: rgba(2, 8, 8, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
}

.alchemy-export-results[hidden] {
  display: none;
}

.alchemy-export-result {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(245, 236, 215, 0.08);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.alchemy-export-result:hover,
.alchemy-export-result:focus-visible {
  background: rgba(245, 180, 72, 0.14);
}

.alchemy-export-result small,
.alchemy-export-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.alchemy-export-empty {
  padding: 10px 12px;
}

.alchemy-result {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
}

.alchemy-result[hidden] {
  display: none;
}

.alchemy-result h2 {
  font-size: 1.52rem;
  text-align: center;
}

.alchemy-result-body {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: min(860px, 100%);
}

.alchemy-image-card {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0;
}

.alchemy-result img {
  width: 100%;
  height: 300px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  object-fit: cover;
  background: rgba(2, 4, 5, 0.62);
}

.alchemy-potion-base {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.alchemy-effects {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  height: 300px;
  min-height: 0;
}

.alchemy-effects article {
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 10, 0.58);
  overflow: visible;
}

.alchemy-effects h3 {
  margin: 0;
  color: #ffe1a0;
}

.alchemy-effects p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.alchemy-import-guide {
  display: grid;
  gap: 12px;
  color: var(--text);
  line-height: 1.45;
}

.alchemy-pf2e-detail {
  display: grid;
  gap: 14px;
  color: var(--text);
  line-height: 1.45;
}

.alchemy-pf2e-detail h3 {
  margin: 0;
  color: var(--parchment);
}

.alchemy-pf2e-detail-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.alchemy-pf2e-detail-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
}

.alchemy-pf2e-detail-list dt {
  color: #ffe1a0;
}

.alchemy-pf2e-detail-list dd {
  margin: 0;
  color: var(--text);
}

.alchemy-pf2e-description {
  margin: 0;
  white-space: pre-line;
}

.alchemy-import-guide ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.alchemy-discovery-list {
  display: grid;
  gap: 14px;
  max-height: 520px;
  overflow: auto;
}

.alchemy-discovery-group {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 10, 0.42);
}

.alchemy-discovery-group h3 {
  font-size: 1rem;
}

.alchemy-discovery-check {
  justify-content: flex-start;
}

.alchemy-potion-admin-list {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}

.alchemy-potion-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: rgba(7, 11, 12, 0.54);
}

.alchemy-potion-admin-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.alchemy-potion-admin-summary strong,
.alchemy-potion-admin-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alchemy-potion-admin-summary span {
  color: var(--muted);
  font-size: 0.82rem;
}

.topic-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(245, 236, 215, 0.12);
  color: #f9e8bd;
  background: rgba(5, 10, 10, 0.74);
  overflow: hidden;
}

.topic-strip[hidden] {
  display: none;
}

.mobile-quick-actions {
  display: none;
  gap: 8px;
  padding: 10px 12px 0;
}

.topic-label {
  flex: 0 0 auto;
  color: var(--parchment);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

#topicText {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scroll-jumps {
  position: sticky;
  top: 8px;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  height: 0;
  pointer-events: none;
}

.scroll-jumps[hidden] {
  display: none;
}

.scroll-jumps .icon-button {
  width: 34px;
  border: 0;
  border-radius: 0;
  color: rgba(245, 236, 215, 0.88);
  background: transparent;
  pointer-events: auto;
  opacity: 0.72;
}

.scroll-jumps .icon-button:hover {
  color: var(--text);
  border-color: transparent;
}

.scroll-jumps .icon-button svg {
  width: 28px;
  height: 28px;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100%;
  text-align: center;
  color: var(--muted);
}

.empty-state[hidden] {
  display: none;
}

.empty-state h2 {
  color: var(--text);
  font-size: 4rem;
  line-height: 1;
  text-shadow: 0 0 28px rgba(243, 155, 49, 0.24);
}

.empty-state p {
  max-width: 36rem;
  margin: 0;
  font-size: 1.02rem;
}

.campfire-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 152px;
  height: 132px;
  filter: drop-shadow(0 0 28px rgba(243, 155, 49, 0.42));
}

.campfire-mark::before {
  position: absolute;
  content: "";
  inset: auto 8px 0;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 196, 92, 0.32), transparent 72%);
}

.campfire-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.message {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
  min-width: 0;
  margin-block: 0 18px;
}

.message > * {
  min-width: 0;
}

.message.user {
  margin-left: auto;
  justify-items: end;
}

.message.assistant,
.message.error {
  margin-right: auto;
}

.message-label {
  color: var(--parchment);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ember-title {
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  color: #ffe4a9;
  background: rgba(66, 38, 17, 0.28);
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.message-body {
  max-width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.message.stoking .message-body {
  position: relative;
  border-color: rgba(255, 204, 112, 0.54);
  background:
    linear-gradient(180deg, rgba(66, 38, 17, 0.4), rgba(9, 13, 14, 0.72));
  animation: stokePulse 1.8s ease-in-out infinite;
}

.message.stoking .message-body.markdown-body {
  overflow-x: visible;
}

.message.stoking .message-body::after {
  position: absolute;
  inset: auto 18px -1px 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 216, 138, 0.78), transparent);
  content: "";
}

.message.thinking .message-body {
  position: relative;
  border-color: rgba(255, 204, 112, 0.44);
  background:
    linear-gradient(180deg, rgba(66, 38, 17, 0.34), rgba(8, 12, 11, 0.82));
  animation: stokePulse 2.2s ease-in-out infinite;
}

.message.thinking .message-body::after {
  position: absolute;
  inset: auto 18px -1px 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 216, 138, 0.68), transparent);
  content: "";
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.message-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.stoke-status {
  color: #ffe1a0;
  font-size: 0.78rem;
  line-height: 1.25;
}

.stoke-status::after {
  display: inline-block;
  width: 1.4em;
  content: "";
  animation: statusDots 1.4s steps(1, end) infinite;
}

.user .message-body {
  color: #fff9ea;
  background:
    linear-gradient(180deg, rgba(53, 127, 115, 0.72), rgba(25, 59, 47, 0.78));
  border-color: rgba(154, 222, 213, 0.28);
  white-space: pre-wrap;
}

.assistant .message-body {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(19, 25, 19, 0.82), rgba(8, 12, 11, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, 0.05);
}

.error .message-body {
  color: #ffe5df;
  background: rgba(94, 35, 34, 0.78);
  border-color: rgba(224, 109, 94, 0.54);
  white-space: pre-wrap;
}

.markdown-body {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.markdown-body > * + * {
  margin-top: 0.82em;
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #ffe4a9;
  line-height: 1.15;
}

.markdown-body h2 {
  font-size: 1.32rem;
}

.markdown-body h3 {
  font-size: 1.18rem;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: 1.02rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
  margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.35rem;
}

.markdown-body li + li {
  margin-top: 0.34em;
}

.markdown-body strong {
  color: #fff2cb;
}

.markdown-body em {
  color: #f6d99f;
}

.markdown-body code {
  padding: 0.08rem 0.28rem;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 6px;
  color: #ffe5b0;
  background: rgba(3, 7, 8, 0.62);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  padding: 12px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  background: rgba(3, 7, 8, 0.72);
  overflow-x: auto;
  white-space: pre;
}

.markdown-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.markdown-body blockquote {
  padding: 10px 12px;
  border-left: 3px solid var(--ember);
  color: #f5dec0;
  background: rgba(240, 161, 58, 0.08);
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid rgba(245, 236, 215, 0.16);
}

.markdown-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(245, 236, 215, 0.14);
  border-radius: 8px;
}

.markdown-body table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.markdown-body th,
.markdown-body td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(245, 236, 215, 0.12);
  border-right: 1px solid rgba(245, 236, 215, 0.1);
  text-align: left;
  vertical-align: top;
}

.markdown-body th:last-child,
.markdown-body td:last-child {
  border-right: 0;
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.markdown-body th {
  color: #ffe4a9;
  background: rgba(53, 127, 115, 0.28);
}

.typing {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  align-items: center;
}

.typing-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.typing span {
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ember);
  animation: pulse 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing span:nth-child(3) {
  animation-delay: 0.32s;
}

.typing-phrase {
  min-width: 0;
  min-height: 1.35em;
  color: #ffe1a0;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.typing-phrase-enter {
  animation: phraseFloat 10s ease-in-out both;
}

.ai-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: rgba(255, 229, 172, 0.78);
  font-size: 0.78rem;
  line-height: 1.3;
}

.ai-elapsed {
  min-width: 3.5em;
  color: #ffd982;
  font-variant-numeric: tabular-nums;
}

.ai-slow-notice {
  color: #ffdda1;
  text-shadow: 0 0 12px rgba(255, 176, 64, 0.32);
}

.ai-slow-notice[hidden] {
  display: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: max-content max-content;
  gap: 12px;
  align-content: end;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 115%, rgba(243, 155, 49, 0.24), transparent 58%),
    var(--panel-strong);
}

.composer[hidden] {
  display: none;
}

.mode-toggle {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(245, 236, 215, 0.14);
  border-radius: 8px;
  background: rgba(3, 8, 8, 0.58);
}

.mode-toggle label {
  min-width: 0;
}

.mode-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle label > input + span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.15;
  text-align: center;
}

.mode-toggle label > input:checked + span {
  color: #2a170b;
  border-color: rgba(255, 210, 126, 0.52);
  background: linear-gradient(180deg, #ffdc88, var(--ember));
  box-shadow: 0 0 22px rgba(243, 155, 49, 0.16);
}

.mode-toggle label > input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(240, 161, 58, 0.22);
}

.image-vision-toggle {
  display: none;
}

.composer.image-mode .knowledge-mode-toggle {
  display: none;
}

.composer.image-mode .image-vision-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(150px, 190px);
  align-items: stretch;
}

.image-size-inline {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(232, 183, 91, 0.16);
  border-radius: 8px;
  padding: 5px 7px;
  color: var(--muted);
  background: rgba(4, 8, 10, 0.5);
  font-size: 0.78rem;
}

.image-size-inline span {
  white-space: nowrap;
}

.image-size-inline select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
  outline: none;
}

textarea {
  width: 100%;
  min-width: 0;
  height: 48px;
  max-height: 180px;
  min-height: 48px;
  overflow-y: auto;
  resize: none;
  border: 1px solid rgba(245, 236, 215, 0.18);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(4, 7, 9, 0.58);
  outline: none;
  line-height: 1.4;
}

textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(240, 161, 58, 0.12);
}

textarea::placeholder {
  color: rgba(245, 236, 215, 0.48);
}

.burnout-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(232, 183, 91, 0.26);
  border-radius: 8px;
  background: rgba(64, 35, 17, 0.32);
}

.burnout-panel[hidden] {
  display: none;
}

.burnout-panel p {
  flex: 1 1 260px;
  margin: 0;
  color: #ffe4a9;
}

.composer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(12, 16, 20, 0.78);
  cursor: pointer;
}

.icon-button.compact {
  width: 40px;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover {
  border-color: var(--line-strong);
}

.icon-button.send {
  color: #2a170b;
  background: linear-gradient(180deg, #ffdc88, var(--ember));
  border-color: rgba(255, 210, 126, 0.58);
  box-shadow: 0 0 24px rgba(243, 155, 49, 0.2);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 5, 6, 0.72);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.modal-backdrop[hidden] {
  display: none;
}

.pin-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(880px, 100%);
  max-height: min(860px, 92dvh);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(13, 18, 22, 0.97);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pin-modal-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.pin-modal-head h2 {
  font-size: 1.55rem;
  line-height: 1;
}

.pin-modal-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.discord-setup-modal {
  width: min(760px, 100%);
}

.discord-setup-guide {
  gap: 12px;
}

.discord-setup-guide article {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(232, 183, 91, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 9, 0.42);
}

.discord-setup-guide h3 {
  margin: 0;
  color: #ffe7b4;
  font-size: 1rem;
}

.discord-setup-guide p,
.discord-setup-guide ol {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.discord-setup-guide ol {
  padding-left: 22px;
}

.discord-setup-guide a {
  color: #ffcf7c;
}

.all-pin-list {
  display: grid;
  gap: 14px;
}

.pin-detail {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(245, 236, 215, 0.14);
  border-radius: 8px;
  background: rgba(8, 12, 14, 0.42);
}

.pin-title-large {
  color: #ffe4a9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.2;
}

.pin-text {
  padding: 12px;
  border: 1px solid rgba(245, 236, 215, 0.1);
  border-radius: 8px;
  color: var(--text);
  background: rgba(4, 7, 9, 0.48);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pin-text.question {
  color: #fff9ea;
  background: rgba(45, 128, 121, 0.38);
  white-space: pre-wrap;
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-item {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 9px 10px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  color: #f6deb0;
  background: rgba(8, 12, 14, 0.46);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.source-item strong {
  color: #ffe4a9;
  font-weight: 800;
  white-space: nowrap;
}

.source-item span {
  min-width: 0;
}

.pin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-actions {
  padding-bottom: 4px;
}

.status-action-note {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.status-action-note.good {
  color: #d8f3cb;
}

.status-action-note.bad {
  color: #ffd2c7;
}

.status-detail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(245, 236, 215, 0.08);
  overflow-wrap: anywhere;
}

.status-detail-row:last-child {
  border-bottom: 0;
}

.dm-portal-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px;
}

.dm-portal-header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(243, 155, 49, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(17, 28, 23, 0.9), rgba(7, 12, 12, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.dm-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.dm-brand img {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(232, 183, 91, 0.38);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(243, 155, 49, 0.18);
}

.dm-brand h1 {
  margin: 0;
  color: #fff4d8;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  letter-spacing: 0;
}

.dm-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(232, 183, 91, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.72);
}

.dm-tab {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.dm-tab:hover,
.dm-tab.active {
  color: var(--text);
  border-color: rgba(232, 183, 91, 0.34);
  background: rgba(75, 47, 23, 0.44);
}

.text-button.subtle {
  color: var(--muted);
  background: rgba(8, 12, 14, 0.42);
}

.text-button.disabled {
  pointer-events: none;
  opacity: 0.56;
}

.dm-portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.dm-section:not(.active) {
  display: none;
}

.dm-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 25, 22, 0.9), rgba(7, 12, 12, 0.92)),
    var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.dm-card.span-2 {
  grid-column: 1 / -1;
}

.dm-card h2 {
  margin: 0;
  color: var(--parchment);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.dm-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.dm-inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.dm-record-actions {
  display: inline-flex !important;
  flex-wrap: wrap;
  gap: 0.4rem !important;
  justify-content: flex-end;
  min-width: fit-content !important;
}

.dm-compact-select {
  display: grid;
  gap: 4px;
  min-width: min(220px, 100%);
  color: var(--muted);
  font-size: 0.78rem;
}

.dm-compact-select select {
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
}

.dm-lore-modal textarea {
  min-height: 18rem;
}

.dm-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(232, 183, 91, 0.28);
  border-radius: 999px;
  padding: 4px 9px;
  color: #ffe8b9;
  background: rgba(75, 47, 23, 0.34);
  font-size: 0.78rem;
  font-weight: 700;
}

.dm-context-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.dm-context-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.dm-management-form {
  display: grid;
  gap: 9px;
}

.dm-management-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.dm-context-form select,
.dm-management-form input,
.dm-management-form select,
.dm-management-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
  outline: none;
}

.dm-management-form textarea {
  resize: vertical;
  line-height: 1.45;
}

.dm-discord-connect {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(232, 183, 91, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(2, 5, 5, 0.36);
}

.dm-discord-connect .text-button {
  width: max-content;
}

.dm-field-help {
  margin: -4px 0 2px;
  color: rgba(214, 202, 173, 0.72);
  font-size: 0.76rem;
  line-height: 1.35;
}

.dm-context-form select:focus,
.dm-management-form input:focus,
.dm-management-form select:focus,
.dm-management-form textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(243, 155, 49, 0.12);
}

.dm-check {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  gap: 8px !important;
  align-items: center;
  color: var(--text) !important;
}

.dm-check input {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.dm-facts {
  display: grid;
  gap: 7px;
  margin: 0;
}

.dm-facts div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(245, 236, 215, 0.08);
}

.dm-facts div:last-child {
  border-bottom: 0;
}

.dm-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.dm-facts dd {
  min-width: 0;
  margin: 0;
  color: #fff0c2;
  overflow-wrap: anywhere;
}

.dm-app-list,
.dm-game-list,
.dm-record-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dm-app,
.dm-game,
.dm-record,
.dm-empty-row {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 9px;
  background: rgba(8, 12, 14, 0.52);
}

.dm-app,
.dm-game,
.dm-record {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dm-app.enabled {
  border-color: rgba(139, 196, 124, 0.28);
}

.dm-app.disabled {
  opacity: 0.7;
}

.dm-game.selected {
  border-color: rgba(243, 155, 49, 0.46);
  box-shadow: 0 0 18px rgba(243, 155, 49, 0.12);
}

.dm-app span,
.dm-game span,
.dm-record span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dm-app strong,
.dm-app small,
.dm-game strong,
.dm-game small,
.dm-record strong,
.dm-record small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-app strong,
.dm-game strong,
.dm-record strong {
  color: #fff3d2;
}

.dm-app small,
.dm-game small,
.dm-record small,
.dm-empty-row {
  color: var(--muted);
  font-size: 0.82rem;
}

.dm-record p {
  max-width: 100%;
  margin: 4px 0 0;
  color: #dfd4bd;
  font-size: 0.84rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dm-record code {
  max-width: 100%;
  color: #f7c979;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dm-record-list.compact {
  gap: 0.35rem;
}

.dm-record-list.compact .dm-record,
.dm-record-list.compact .dm-empty-row {
  padding: 0.55rem 0.65rem;
}

.dm-app em {
  color: #d8f3cb;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.dm-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.dm-dry-run-output {
  min-height: 7rem;
  margin: 0.8rem 0 0;
  padding: 0.8rem;
  border: 1px solid rgba(246, 179, 74, 0.22);
  background: rgba(1, 8, 7, 0.48);
  color: rgba(255, 244, 214, 0.78);
  overflow: auto;
  white-space: pre-wrap;
}

.config-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(1280px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px;
}

.config-embedded body {
  background: transparent;
}

.config-embedded .config-shell {
  width: 100%;
  min-height: auto;
  padding: 0;
}

.config-embedded .config-header,
.config-embedded #configNotice,
.config-embedded [data-config-tab="portal"],
.config-embedded [data-config-panel="portal"],
.config-embedded [data-config-tab="errors"],
.config-embedded [data-config-panel="errors"],
.config-embedded .config-legacy-access-card,
.config-embedded .config-server-controls-card,
.config-embedded .config-alchemy-discoveries-card,
.config-embedded .config-alchemy-potions-card {
  display: none !important;
}

.config-embedded .config-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
}

.config-embedded .config-card {
  box-shadow: none;
}

.config-header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 28, 23, 0.9), rgba(7, 12, 12, 0.92)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.config-brand h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  letter-spacing: 0;
}

.config-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(232, 183, 91, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 12, 0.72);
}

.config-tab {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.config-tab:hover,
.config-tab.active {
  color: var(--text);
  border-color: rgba(232, 183, 91, 0.34);
  background: rgba(75, 47, 23, 0.44);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.config-card,
.provider-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 25, 22, 0.9), rgba(7, 12, 12, 0.92)),
    var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.config-card {
  padding: 12px;
}

.config-card.span-2 {
  grid-column: 1 / -1;
}

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

.config-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.config-card h2,
.provider-card h3 {
  margin: 0;
  color: var(--parchment);
  font-size: 1rem;
  letter-spacing: 0;
}

.config-card label,
.provider-card label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.config-card input,
.config-card select,
.config-card textarea,
.provider-card input,
.provider-card textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(232, 183, 91, 0.24);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: rgba(4, 8, 10, 0.72);
  outline: none;
}

.config-card textarea,
.provider-card textarea {
  resize: vertical;
  line-height: 1.45;
}

.config-card input:focus,
.config-card select:focus,
.config-card textarea:focus,
.provider-card input:focus,
.provider-card textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(243, 155, 49, 0.12);
}

.config-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.config-check {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  gap: 9px !important;
  align-items: center;
  color: var(--text) !important;
}

.config-check input {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 9px;
}

.route-key-field {
  max-width: 620px;
}

.route-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 9px;
}

.route-shortcut {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 9px;
  background: rgba(3, 8, 8, 0.42);
}

.route-shortcut h3 {
  margin: 0;
  color: var(--parchment);
  font-size: 0.96rem;
}

.route-shortcut-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-test-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.route-test-status[data-state="ok"] {
  color: #d8f3cb;
}

.route-test-status[data-state="error"] {
  color: #ffd2c7;
}

.route-test-status[data-state="warn"] {
  color: #ffe0a3;
}

.ai-test-details {
  margin-top: 5px;
  color: var(--muted);
}

.ai-test-details summary {
  width: fit-content;
  color: #ffd982;
  cursor: pointer;
}

.ai-test-details pre {
  max-height: 260px;
  margin: 6px 0 0;
  border: 1px solid rgba(232, 183, 91, 0.18);
  border-radius: 8px;
  padding: 8px;
  color: #f7ead0;
  background: rgba(2, 6, 7, 0.74);
  overflow: auto;
  white-space: pre-wrap;
}

.image-generation-test-preview {
  width: min(220px, 100%);
  margin: 8px 0 12px;
  border: 1px solid rgba(232, 183, 91, 0.26);
  border-radius: 8px;
  padding: 6px;
  background: rgba(2, 6, 7, 0.62);
  box-shadow: 0 0 22px rgba(255, 177, 69, 0.12);
}

.image-generation-test-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.route-note {
  margin: 0;
  font-size: 0.72rem;
}

.route-shortcut-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.provider-card {
  padding: 10px;
}

.provider-card-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.provider-card-head h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.provider-card-head span {
  flex: 0 0 auto;
  max-width: 48%;
  overflow: hidden;
  color: var(--moon);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-json {
  min-height: 420px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
}

.config-json.compact {
  min-height: 0;
}

#configNotice {
  min-height: 1.4em;
  margin: 0 4px;
}

#configNotice[data-state="ok"] {
  color: #d6ffc8;
}

#configNotice[data-state="error"] {
  color: #ffd2c7;
}

#ragStatusText[data-state="ok"] {
  color: #d6ffc8;
}

#ragStatusText[data-state="error"] {
  color: #ffd2c7;
}

.error-log-list {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
}

.error-log-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(245, 236, 215, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(3, 8, 8, 0.46);
}

.error-log-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.error-log-head strong {
  color: #ffe1a0;
}

.error-log-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.error-log-item p {
  margin: 0;
}

.error-log-item pre {
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(232, 183, 91, 0.16);
  border-radius: 8px;
  padding: 10px;
  color: #d8cbb0;
  background: rgba(0, 0, 0, 0.28);
  white-space: pre-wrap;
}

.rag-admin-card {
  border-color: rgba(255, 190, 92, 0.38);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(243, 155, 49, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(20, 28, 23, 0.94), rgba(7, 12, 12, 0.94));
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  }

  .provider-grid,
  .route-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pin-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    height: auto;
    min-height: 100dvh;
    padding: 10px;
  }

  .archive-panel {
    grid-column: auto;
    grid-row: 2;
    gap: 14px;
  }

  .chat-panel {
    grid-column: auto;
    grid-row: 1;
    min-height: 68dvh;
  }

  .mobile-quick-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .pin-list {
    max-height: 260px;
  }

  .chat-scroll {
    padding: 18px;
  }

  .image-panel,
  .scry-panel,
  .audio-panel,
  .discord-panel,
  .account-panel {
    padding: 14px;
  }

  .alchemy-panel {
    overflow-x: hidden;
  }

  .image-settings {
    align-items: start;
  }

  .image-settings {
    grid-template-columns: 1fr;
  }

  .image-stage {
    min-height: 360px;
  }

  .scry-upload-card,
  .scry-result,
  .audio-upload-card,
  .audio-result,
  .discord-header-card,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .discord-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .discord-transcript-detail {
    grid-column: auto;
  }

  .discord-roll-detail-grid {
    grid-template-columns: 1fr;
  }

  .scry-result img {
    max-height: 420px;
  }

  .empty-state h2 {
    font-size: 3.35rem;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .mode-toggle {
    grid-template-columns: 1fr;
  }

  .composer.image-mode .image-vision-toggle {
    grid-template-columns: 1fr;
  }

  .composer-actions {
    justify-content: flex-end;
  }

  .alchemy-controls,
  .alchemy-effects {
    grid-template-columns: 1fr;
  }

  .alchemy-formula-row {
    grid-template-columns: 1fr;
  }

  .alchemy-result-body {
    grid-template-columns: 1fr;
  }

  .alchemy-result img,
  .alchemy-effects {
    height: auto;
  }

  .alchemy-result img {
    aspect-ratio: 1;
  }

  .alchemy-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "slot0 slot1"
      "cauldron cauldron"
      "slot2 slot3";
    width: 100%;
  }

  .login-form {
    grid-template-columns: 1fr;
  }

  .ember-list-controls {
    grid-template-columns: 1fr;
  }

  .ember-list-count {
    white-space: normal;
  }

  .config-shell {
    padding: 10px;
  }

  .operator-shell {
    padding: 10px;
  }

  .operator-header {
    align-items: flex-start;
  }

  .operator-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .operator-account-picker,
  .operator-support-grid,
  .operator-form,
  .operator-form.operator-support-card,
  .operator-form-stacked,
  .operator-app-toggle-set,
  .operator-form.wide {
    grid-template-columns: 1fr;
  }

  .operator-account-picker small {
    white-space: normal;
    padding-bottom: 0;
  }

  .dm-portal-shell {
    padding: 10px;
  }

  .dm-portal-grid,
  .dm-context-form {
    grid-template-columns: 1fr;
  }

  .dm-card.span-2 {
    grid-column: auto;
  }

  .dm-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .config-grid,
  .config-two,
  .provider-grid,
  .route-shortcut-grid,
  .route-shortcut-numbers {
    grid-template-columns: 1fr;
  }

  .config-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 10px;
    overflow-x: hidden;
  }

  .archive-view-tabs,
  .mobile-quick-actions {
    width: 100%;
    max-width: 100%;
  }

  .archive-view-tab {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    padding-inline: 9px;
  }

  .brand-lockup {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .brand-actions {
    flex-direction: column;
    gap: 6px;
  }

  .sigil {
    width: 48px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .empty-state h2 {
    font-size: 3rem;
  }

  .archive-panel,
  .chat-panel {
    border-radius: 8px;
  }

  .chat-scroll,
  .image-panel,
  .scry-panel,
  .discord-panel,
  .account-panel {
    padding: 12px;
  }

  .scry-upload-card,
  .discord-header-card,
  .account-layout,
  .account-meta,
  .account-inline-row,
  .alchemy-controls,
  .alchemy-formula-row,
  .alchemy-result-actions {
    grid-template-columns: 1fr;
  }

  .discord-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .discord-transcript-actions {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }

  .discord-transcript-actions .text-button,
  .discord-export-toggle {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .alchemy-workspace {
    padding: 12px;
  }

  .alchemy-cauldron-stage {
    padding: 10px;
    overflow: hidden;
  }

  .alchemy-slots {
    gap: 8px;
  }

  .alchemy-slot {
    min-height: 96px;
    padding: 10px 26px 10px 10px;
  }

  .alchemy-result-actions {
    justify-content: stretch;
  }

  .alchemy-result-actions .text-button {
    flex: 1 1 100%;
  }

  .alchemy-cauldron {
    width: min(260px, 100%);
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
