:root {
  --void: #0a0908;
  --panel: #151119;
  --panel-2: #1c1620;
  --bone: #e7dfce;
  --bone-dim: #8e8778;
  --ash: #413a31;
  --ash-line: #2a2620;
  --c-draft: #ff5a1f;
  --c-edit: #9bb0c4;
  --c-judge: #e31c2e;
  --accent: #ff5a1f;
  --accent-dim: #b33e14;
  --accent-glow: rgba(255, 90, 31, 0.4);
  --good: #7fa86b;
  --warn: #c9a227;
  --fail: #e85a3a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --mono: "JetBrains Mono", "Consolas", monospace;
  --display: "Oswald", sans-serif;
}

body[data-mode="edit"] {
  --accent: #9bb0c4;
  --accent-dim: #4e6273;
  --accent-glow: rgba(155, 176, 196, 0.35);
}

body[data-mode="judge"] {
  --accent: #e31c2e;
  --accent-dim: #7a0e17;
  --accent-glow: rgba(227, 28, 46, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--bone);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  background: var(--void);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-left: var(--safe-left);
}

/* Desktop: phone-column shell instead of ultrawide stretch */
@media (min-width: 768px) {
  html {
    background: #050403;
  }

  body {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    border-left: 1px solid var(--ash-line);
    border-right: 1px solid var(--ash-line);
    box-shadow: 0 0 80px -20px var(--accent-glow);
  }
}

@media (min-width: 1100px) {
  body {
    max-width: 520px;
  }
}

::selection {
  background: var(--accent);
  color: #0a0705;
}

/* header */
header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6px 52px 10px;
  background: radial-gradient(
    ellipse 700px 160px at 50% -40%,
    var(--accent-glow),
    transparent 65%
  );
  transition: background 0.6s ease;
}

.hero {
  text-align: center;
  position: relative;
}

.brand-logo-wrap {
  width: min(200px, 52vw);
  aspect-ratio: 440 / 293;
  margin: 0 auto;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  /* Draft default so something shows before/without JS */
  background-image: url("/brand/logo-draft.png");
  /* Drop baked black plate against the void / header glow */
  mix-blend-mode: screen;
}

body[data-mode="draft"] .brand-logo-wrap {
  background-image: url("/brand/logo-draft.png");
}

body[data-mode="edit"] .brand-logo-wrap {
  background-image: url("/brand/logo-edit.png");
}

body[data-mode="judge"] .brand-logo-wrap {
  background-image: url("/brand/logo-judge.png");
}

.tagline {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: -14px;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 8px rgba(10, 9, 8, 0.9);
  transition: color 0.5s ease;
}

.status {
  margin: 6px 0 0;
  min-height: 1.1em;
  font-size: 10px;
  color: var(--bone-dim);
  letter-spacing: 0.4px;
}

.status.ok {
  color: var(--good);
}

.status.err {
  color: var(--fail);
}

.status.busy {
  color: var(--warn);
}

.icon-row {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--ash-line);
  color: var(--ash);
  cursor: pointer;
  font-size: 15px;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.icon-btn:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* route */
.route {
  position: relative;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  align-items: center;
}

.route .base {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  background: var(--ash-line);
}

.route .anim {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  background-repeat: repeat-x;
  background-size: 36px 2px;
}

/* Draft: Hellcycle fire streak — full-width trail, traveling hot core */
body[data-mode="draft"] .route {
  height: 20px;
}

body[data-mode="draft"] .route .base {
  /* Continuous road of fire under the moving core */
  display: block;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(179, 62, 20, 0.35),
    rgba(255, 90, 31, 0.75),
    rgba(255, 180, 80, 0.55),
    rgba(255, 90, 31, 0.75),
    rgba(179, 62, 20, 0.35)
  );
  box-shadow:
    0 0 4px 1px rgba(255, 90, 31, 0.4),
    0 -1px 6px 1px rgba(255, 90, 31, 0.15);
}

body[data-mode="draft"] .route .anim {
  top: 50%;
  bottom: auto;
  left: 0;
  right: 0;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 0;
  background-color: transparent;
  /* Leading left tip bulges; trail tapers right */
  background-image:
    radial-gradient(
      ellipse 11px 7px at 7% 50%,
      #fff2c4 0%,
      #ffe0a0 28%,
      #ff5a1f 55%,
      transparent 72%
    ),
    linear-gradient(
      90deg,
      transparent 0%,
      #ff5a1f 5%,
      #ff8a2a 12%,
      rgba(255, 90, 31, 0.75) 28%,
      rgba(255, 90, 31, 0.35) 55%,
      rgba(255, 90, 31, 0.12) 78%,
      transparent 100%
    );
  background-size: 55% 100%, 55% 100%;
  background-repeat: no-repeat;
  -webkit-mask-image: none;
  mask-image: none;
  filter: none;
  box-shadow:
    0 0 7px 1px rgba(255, 90, 31, 0.85),
    0 -2px 9px 2px rgba(255, 140, 50, 0.35),
    0 -4px 12px 1px rgba(255, 90, 31, 0.18);
  animation: flame-streak 1.4s linear infinite;
}

body[data-mode="draft"] .route .anim::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  background-image:
    radial-gradient(
      ellipse 16px 11px at 7% 50%,
      rgba(255, 180, 80, 0.4) 0%,
      rgba(255, 90, 31, 0.18) 45%,
      transparent 70%
    ),
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 90, 31, 0.12) 8%,
      rgba(255, 140, 50, 0.18) 30%,
      rgba(255, 90, 31, 0.08) 65%,
      transparent 100%
    );
  background-size: 55% 100%, 55% 100%;
  background-repeat: no-repeat;
  filter: blur(3px);
  animation: flame-streak 1.4s linear infinite;
  pointer-events: none;
  -webkit-mask-image: none;
  mask-image: none;
  box-shadow: none;
}

/* bg-size 55%: % position = (container - tile) * p/100.
   Fully off-right → fully off-left so the loop doesn't jump mid-path. */
@keyframes flame-streak {
  from {
    background-position: 222.22% 0;
  }
  to {
    background-position: -122.22% 0;
  }
}

@keyframes flow-reverse {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 18px 0;
  }
}

body[data-mode="edit"] .route {
  height: 22px;
}

body[data-mode="edit"] .route .base {
  display: none;
}

body[data-mode="edit"] .route .anim {
  /* Mystical Chains — classic angled interlocking rings */
  top: 50%;
  height: 16px;
  transform: translateY(-50%);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='16' viewBox='0 0 18 16' fill='none'%3E%3Cellipse cx='4.5' cy='8' rx='6.2' ry='3.15' transform='rotate(-40 4.5 8)' stroke='%23a8b9ca' stroke-width='1.85'/%3E%3Cellipse cx='13.5' cy='8' rx='6.2' ry='3.15' transform='rotate(40 13.5 8)' stroke='%23c5d2de' stroke-width='1.85'/%3E%3C/svg%3E");
  background-size: 18px 16px;
  background-repeat: repeat-x;
  background-position: 0 0;
  -webkit-mask-image: none;
  mask-image: none;
  animation: flow-reverse 1.2s linear infinite;
  box-shadow: none;
  filter: drop-shadow(0 0 1.5px rgba(155, 176, 196, 0.35));
  opacity: 1;
}

body[data-mode="edit"] .route .anim::before {
  content: none;
}

body[data-mode="judge"] .route .anim {
  height: 2px;
  background: var(--accent);
  background-image: none;
  -webkit-mask-image: none;
  mask-image: none;
  filter: none;
  animation: none;
  opacity: 0.95;
  box-shadow: 0 0 14px 1px var(--accent-glow);
}

.eyes {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 18px;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 2;
  pointer-events: none;
}

body[data-mode="judge"] .eyes {
  opacity: 1;
}

/* Penance Stare — empty sockets burning from within */
.eyes .eye {
  position: relative;
  width: 18px;
  height: 12px;
  border-radius: 50% 50% 42% 42%;
  background: radial-gradient(
    ellipse 70% 65% at 50% 48%,
    #5c160c 0%,
    #1a0506 55%,
    #050202 100%
  );
  box-shadow:
    0 0 8px 1px rgba(227, 28, 46, 0.55),
    0 0 18px 3px rgba(227, 28, 46, 0.35),
    inset 0 0 0 1.5px rgba(227, 28, 46, 0.85),
    inset 0 0 6px 1px rgba(255, 59, 30, 0.35);
  transform: scale(1);
  transform-origin: center center;
  animation: penance-stare 4.2s linear infinite;
  will-change: transform, box-shadow, filter;
}

.eyes .eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%) scale(1);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e85a3a 0%, #e31c2e 45%, #5c160c 100%);
  box-shadow:
    0 0 6px 2px rgba(227, 28, 46, 0.9),
    0 0 12px 3px rgba(255, 90, 31, 0.35);
  animation: penance-pupil 4.2s linear infinite;
}

@keyframes penance-stare {
  0%,
  70% {
    transform: scale(1);
    filter: saturate(1) brightness(1);
    box-shadow:
      0 0 8px 1px rgba(227, 28, 46, 0.55),
      0 0 18px 3px rgba(227, 28, 46, 0.35),
      inset 0 0 0 1.5px rgba(227, 28, 46, 0.85),
      inset 0 0 6px 1px rgba(255, 59, 30, 0.35);
  }
  82% {
    transform: scale(1.45);
    filter: saturate(1.35) brightness(1.08);
    box-shadow:
      0 0 16px 4px rgba(227, 28, 46, 0.85),
      0 0 34px 10px rgba(160, 15, 25, 0.5),
      inset 0 0 0 1.75px rgba(227, 28, 46, 0.95),
      inset 0 0 10px 2px rgba(200, 30, 40, 0.55);
  }
  88% {
    transform: scale(1.7);
    filter: saturate(1.55) brightness(1.12);
    box-shadow:
      0 0 24px 7px rgba(227, 28, 46, 1),
      0 0 48px 14px rgba(140, 8, 18, 0.65),
      inset 0 0 0 2px #e31c2e,
      inset 0 0 12px 3px rgba(227, 28, 46, 0.8);
  }
  100% {
    transform: scale(1);
    filter: saturate(1) brightness(1);
    box-shadow:
      0 0 8px 1px rgba(227, 28, 46, 0.55),
      0 0 18px 3px rgba(227, 28, 46, 0.35),
      inset 0 0 0 1.5px rgba(227, 28, 46, 0.85),
      inset 0 0 6px 1px rgba(255, 59, 30, 0.35);
  }
}

@keyframes penance-pupil {
  0%,
  70% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 6px 2px rgba(227, 28, 46, 0.9),
      0 0 12px 3px rgba(200, 40, 40, 0.4);
  }
  82% {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow:
      0 0 8px 2px rgba(227, 28, 46, 0.95),
      0 0 15px 4px rgba(160, 15, 25, 0.65);
  }
  88% {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow:
      0 0 10px 3px rgba(227, 28, 46, 1),
      0 0 18px 5px rgba(160, 15, 25, 0.8);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      0 0 6px 2px rgba(227, 28, 46, 0.9),
      0 0 12px 3px rgba(200, 40, 40, 0.4);
  }
}

/* modes */
.control-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--ash-line);
}

.modes-compact {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ash-line);
  border-radius: 4px;
  overflow: hidden;
  width: min(360px, 100%);
}

.modes-compact button {
  flex: 1;
  min-height: 40px;
  background: none;
  border: none;
  border-right: 1px solid var(--ash-line);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ash);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
  transition:
    color 0.25s,
    background 0.25s;
}

.modes-compact button:last-child {
  border-right: none;
}

.modes-compact button:hover {
  color: var(--bone-dim);
}

.modes-compact button.active {
  color: var(--accent);
  background: linear-gradient(180deg, var(--accent-glow), transparent 75%);
}

/* chat */
.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.danny {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--ash-line);
  border-bottom-left-radius: 3px;
  color: var(--bone);
}

.bubble.you {
  align-self: flex-end;
  background: var(--accent-dim);
  color: #fbeee6;
  border-bottom-right-radius: 3px;
  opacity: 0.92;
  transition: background 0.5s ease;
}

.bubble.summary {
  align-self: stretch;
  max-width: none;
  background: rgba(74, 67, 58, 0.25);
  border: 1px dashed var(--ash);
  font-size: 12px;
  color: var(--bone-dim);
}

.bubble .who {
  display: block;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 4px;
}

.bubble.you .who {
  color: rgba(251, 238, 230, 0.65);
  text-align: right;
}

.note-card {
  align-self: flex-start;
  max-width: 82%;
  border: 1px dashed var(--accent-dim);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 11.5px;
  color: var(--bone-dim);
  display: flex;
  gap: 7px;
  align-items: flex-start;
  transition: border-color 0.5s ease;
}

.note-card svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.note-card b {
  color: var(--accent-dim);
  font-weight: 600;
}

/* power strip */
.power-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  background: var(--panel);
  border: none;
  border-top: 1px solid var(--ash-line);
  border-bottom: 1px solid transparent;
  color: var(--bone);
  font-family: var(--mono);
  padding: 8px 14px;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    background 0.3s;
}

.power-strip:hover {
  background: var(--panel-2);
}

.power-strip.open {
  border-bottom-color: var(--ash-line);
}

.power-strip.pulse {
  animation: strip-pulse 0.55s ease;
}

@keyframes strip-pulse {
  0% {
    box-shadow: inset 0 0 0 0 transparent;
  }
  35% {
    box-shadow:
      inset 0 0 0 1px var(--accent-dim),
      0 0 18px -4px var(--accent-glow);
  }
  100% {
    box-shadow: inset 0 0 0 0 transparent;
  }
}

.power-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.power-name {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  transition: color 0.4s ease;
}

.power-verb {
  font-size: 11px;
  color: var(--bone-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.power-chevron {
  color: var(--ash);
  font-size: 11px;
  flex-shrink: 0;
}

.drawer {
  flex: 0 0 auto;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.drawer.open {
  max-height: min(42dvh, 380px);
  overflow-y: auto;
}

.windshield {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-top: 1px solid var(--ash-line);
  padding: 10px 14px 12px;
}

.ws-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.5s ease;
}

.ws-label .small {
  color: var(--ash);
  letter-spacing: 1px;
  font-weight: 400;
  text-transform: none;
  font-family: var(--mono);
  font-size: 10px;
}

textarea.manuscript,
.brief,
.search-mini,
.note-editor input,
.note-editor textarea,
.modal input,
#chatInput {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--ash-line);
  border-radius: 3px;
  color: var(--bone);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
}

textarea.manuscript {
  min-height: 90px;
  line-height: 1.55;
}

.brief,
.search-mini,
.note-editor input,
.modal input {
  resize: none;
  min-height: 0;
  font-size: 12px;
  padding: 8px 10px;
}

textarea.manuscript:focus,
.brief:focus,
.search-mini:focus,
.note-editor input:focus,
.note-editor textarea:focus,
.modal input:focus,
#chatInput:focus {
  border-color: var(--accent-dim);
  box-shadow:
    0 0 0 1px var(--accent-dim),
    0 0 18px -8px var(--accent-glow);
}

.ws-foot {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.brief {
  flex: 1;
  min-width: 120px;
  margin: 0;
}

button.cta {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 11px;
  min-height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: #0a0705;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 70%, white),
    var(--accent) 55%,
    var(--accent-dim)
  );
  box-shadow: 0 2px 0 var(--accent-dim);
  transition:
    transform 0.12s ease,
    background 0.3s ease;
  white-space: nowrap;
}

button.cta:hover:not(:disabled) {
  transform: translateY(-1px);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--bone-dim);
  margin-top: 8px;
  cursor: pointer;
}

.toggle-row input {
  accent-color: var(--accent);
}

.ability-result {
  margin-top: 10px;
  padding: 10px;
  background: var(--void);
  border: 1px solid var(--ash-line);
  border-radius: 3px;
}

.ability-result.hidden,
.note-editor.hidden,
.hidden {
  display: none !important;
}

.meta {
  font-size: 11px;
  color: var(--bone-dim);
  margin-bottom: 6px;
}

.content {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bone);
}

.judge {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ash-line);
  border-left: 3px solid var(--c-judge);
  font-size: 12px;
  background: var(--panel-2);
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 10px;
  border-radius: 2px;
  font-family: var(--display);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge.pass {
  background: rgba(127, 168, 107, 0.2);
  color: var(--good);
}

.badge.fail {
  background: rgba(232, 90, 58, 0.2);
  color: var(--fail);
}

.badge.warn {
  background: rgba(201, 162, 39, 0.2);
  color: var(--warn);
}

/* composer */
.composer-wrap {
  flex: 0 0 auto;
  border-top: 1px solid var(--ash-line);
  background: var(--void);
  padding: 8px 12px calc(10px + var(--safe-bottom));
  width: 100%;
}

.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#chatInput {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border-radius: 18px;
  background: var(--panel);
  padding: 10px 14px;
  line-height: 1.4;
}

.composer button.send {
  background: var(--accent);
  color: #0a0705;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 14px;
  transition:
    background 0.5s ease,
    transform 0.12s ease;
}

.composer button.send:hover:not(:disabled) {
  transform: translateY(-1px);
}

.composer-extra {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
}

.composer-extra button {
  background: none;
  border: none;
  color: var(--ash);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  min-height: 32px;
  padding: 4px 6px;
}

.composer-extra button:hover {
  color: var(--bone-dim);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* markers panel */
.side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(5, 4, 4, 0.6);
}

.side-backdrop[hidden] {
  display: none !important;
}

.markers-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 100vw);
  z-index: 30;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-left: 1px solid var(--ash-line);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  padding: calc(14px + var(--safe-top)) 14px calc(14px + var(--safe-bottom));
  overflow-y: auto;
  padding-right: calc(14px + var(--safe-right));
}

.markers-panel.open {
  transform: translateX(0);
}

.markers-panel h3 {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.markers-panel h3 button {
  background: none;
  border: none;
  color: var(--ash);
  font-size: 16px;
  cursor: pointer;
  width: 44px;
  height: 44px;
}

.search-mini {
  margin-bottom: 8px;
}

.mini-actions,
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.btn-ghost,
.btn-flame {
  font-family: var(--display);
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 10px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 3px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--ash-line);
  color: var(--bone-dim);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--ash);
  color: var(--bone);
}

.btn-flame {
  background: var(--accent);
  border: none;
  color: #0a0705;
  font-weight: 700;
}

.note-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  max-height: 40vh;
  overflow-y: auto;
}

.note-list li {
  font-size: 12px;
  color: var(--bone-dim);
  padding: 10px 8px;
  border-top: 1px solid var(--ash-line);
  cursor: pointer;
  min-height: 40px;
}

.note-list li:first-child {
  border-top: none;
}

.note-list li:hover,
.note-list li.active {
  color: var(--bone);
}

.note-list li.active {
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

.note-editor input,
.note-editor textarea {
  margin-bottom: 8px;
}

.note-editor textarea {
  min-height: 80px;
}

/* settings modal */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 4, 4, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay[hidden] {
  display: none !important;
}

.modal {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--ash-line);
  border-radius: 8px;
  padding: 18px 18px 16px;
  position: relative;
}

.modal h2 {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--bone);
}

.modal-sub {
  font-size: 11px;
  color: var(--ash);
  margin-bottom: 14px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--ash);
  font-size: 16px;
  cursor: pointer;
  width: 44px;
  height: 44px;
}

.modal label {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 6px;
}

.modal input {
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-actions button {
  flex: 1;
  font-family: var(--display);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 10.5px;
  min-height: 40px;
  padding: 8px;
  border-radius: 3px;
  cursor: pointer;
}

.modal-actions .save {
  background: var(--accent);
  color: #0a0705;
  border: none;
}

.modal-actions .check {
  background: none;
  border: 1px solid var(--ash-line);
  color: var(--bone-dim);
}

.persona-btn {
  width: 100%;
  margin-bottom: 8px;
}

.persona-preview {
  white-space: pre-wrap;
  font-size: 11px;
  max-height: 8rem;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--void);
  border: 1px solid var(--ash-line);
  border-radius: 2px;
  color: var(--bone-dim);
}

@media (min-width: 480px) {
  .brand-logo-wrap {
    width: 220px;
  }

  .tagline {
    font-size: 14px;
    margin-top: -16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  header,
  .route .anim,
  .eyes span,
  .power-strip.pulse,
  .drawer {
    animation: none !important;
    transition: none !important;
  }

  body[data-mode="draft"] .route .anim,
  body[data-mode="draft"] .route .anim::before,
  body[data-mode="edit"] .route .anim {
    animation: none;
  }
}
