.admin-body { min-height: 100vh; min-height: 100dvh; }

.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--sp-5);
}

.gate__panel {
  width: min(360px, 100%);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  animation: loader-in var(--t-slow) var(--ease-spring) both;
}

.gate__logo { margin: 0 auto var(--sp-4); animation: breathe 3s var(--ease-in-out) infinite; }

.gate__title {
  margin-bottom: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

.gate__copy { margin-bottom: var(--sp-5); font-size: var(--fs-xs); color: var(--text-2); }

.gate__note {
  min-height: 16px;
  margin-top: var(--sp-3);
  font-size: var(--fs-micro);
  color: var(--danger);
}

.gate__back {
  display: inline-block;
  margin-top: var(--sp-4);
  font-size: var(--fs-micro);
  color: var(--text-3);
  transition: color var(--t-base);
}

.gate__back:hover { color: var(--brand); }

/* Temporary username/password sign-in */
.gate__divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-3);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}

.gate__divider::before,
.gate__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.gate__form { text-align: left; }

.temp-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: 10px var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  border-radius: var(--r-md);
  animation: row-in var(--t-slow) var(--ease-out) both;
}

.temp-banner svg { width: 15px; height: 15px; flex-shrink: 0; }

.admin {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.side__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

.side__brand em { font-style: normal; color: var(--brand); }

:root[data-theme='dark'] .side__brand img { filter: brightness(1.15); }

.side__nav { display: flex; flex-direction: column; gap: 2px; }

.side__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-align: left;
  color: var(--text-2);
  border-radius: var(--r-sm);
  transition: color var(--t-base) var(--ease-out), background var(--t-base);
}

.side__link:hover { color: var(--text); background: var(--surface-2); }

.side__link.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

.side__icon { display: grid; place-items: center; width: 15px; height: 15px; flex-shrink: 0; }
.side__icon svg { width: 100%; height: 100%; }

.side__badge {
  margin-left: auto;
  padding: 1px 6px;
  font-size: var(--fs-micro);
  color: var(--brand-ink);
  background: var(--brand);
  border-radius: var(--r-pill);
}

.side__badge:empty { display: none; }

.side__foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.side__me { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }

.side__me img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-inset);
}

.side__me-name {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side__actions { display: flex; gap: 4px; margin-left: auto; }
.side__actions .icon-btn { width: 28px; height: 28px; }

.panel { padding: var(--sp-5) var(--sp-6) var(--sp-8); min-width: 0; }

.panel__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.panel__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

.panel__top .btn { margin-left: auto; }
.panel__burger { display: none; }

.view { display: none; animation: reveal-up var(--t-slow) var(--ease-out) both; }
.view.is-active { display: block; }

.card {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card--flush { padding: 0; overflow: hidden; }

.card__title {
  margin-bottom: var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.split--promo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 0; }

.cards { display: flex; flex-direction: column; gap: var(--sp-2); }
.cards--tight { gap: 6px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-2);
}

.tile {
  position: relative;
  padding: var(--sp-4);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-spring), border-color var(--t-base);
}

.tile:hover { transform: translateY(-2px); border-color: var(--brand-ring); }

.tile__value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: 1.1;
}

.tile__label {
  margin-top: 2px;
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}

.tile__icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.tile__icon svg { width: 100%; height: 100%; }
.tile:hover .tile__icon { color: var(--brand); }

.feed { display: flex; flex-direction: column; }
.feed--audit { max-height: 70vh; overflow-y: auto; }

.feed__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-4);
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--border-soft);
  animation: row-in var(--t-slow) var(--ease-out) both;
}

.feed__row:last-child { border-bottom: none; }

.feed__action {
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.feed__target {
  color: var(--text);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed__meta { margin-left: auto; font-size: var(--fs-micro); color: var(--text-3); white-space: nowrap; }

.feed__empty { padding: var(--sp-6); text-align: center; font-size: var(--fs-xs); color: var(--text-3); }

.depth { display: flex; flex-direction: column; gap: 9px; }

.depth__row { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-xs); }
.depth__name { width: 96px; flex-shrink: 0; color: var(--text-2); }

.depth__track {
  flex: 1;
  height: 6px;
  background: var(--surface-inset);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.depth__fill {
  height: 100%;
  background: linear-gradient(90deg, #ffa04d, var(--brand));
  border-radius: var(--r-pill);
  transform-origin: left;
  animation: meter-grow var(--t-slower) var(--ease-out) both;
}

@keyframes meter-grow { from { transform: scaleX(0); } }

.depth__value { width: 32px; text-align: right; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.toolbar .tools__search { max-width: 280px; flex: 1 1 200px; }
.toolbar .btn { margin-left: auto; }

.admin-table { min-width: 640px; }

.admin-table .lb__row { cursor: pointer; }

.placement-chips { display: flex; flex-wrap: wrap; gap: 3px; }

.placement-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  border-radius: var(--r-xs);
}

.placement-chip__mode { opacity: 0.65; text-transform: uppercase; }

.entry {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  animation: row-in var(--t-slow) var(--ease-out) both;
  transition: border-color var(--t-base), transform var(--t-base) var(--ease-spring);
}

.entry:hover { border-color: var(--brand-ring); transform: translateY(-1px); }

.entry__avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: var(--r-sm);
}

.entry__avatar img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

.entry__main { min-width: 0; flex: 1; }

.entry__name {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.entry__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: var(--fs-micro);
  color: var(--text-3);
}

.entry__notes {
  margin-top: 5px;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.entry__actions { display: flex; gap: 5px; flex-shrink: 0; }

.status-pill {
  padding: 2px 8px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  border-radius: var(--r-pill);
}

.status-pill--queued { color: var(--warn); background: var(--warn-soft); }
.status-pill--claimed { color: var(--info); background: var(--info-soft); }
.status-pill--closed { color: var(--text-3); background: var(--surface-2); }
.status-pill--pending { color: var(--warn); background: var(--warn-soft); }
.status-pill--approved { color: var(--ok); background: var(--ok-soft); }
.status-pill--denied { color: var(--danger); background: var(--danger-soft); }

.form { display: flex; flex-direction: column; gap: var(--sp-3); }

.field { display: flex; flex-direction: column; gap: 5px; }

.field__label {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
  color: var(--text-3);
}

.field__hint { text-transform: none; letter-spacing: 0; opacity: 0.7; }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 9px var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.field textarea { resize: vertical; font-family: inherit; }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-focus);
}

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }

.select-shell--block { width: 100%; margin-left: 0; }
.select-shell--block select {
  width: 100%;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  box-shadow: none;
}

.form__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-1); }

.switches { display: flex; gap: var(--sp-4); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch__track {
  position: relative;
  width: 34px;
  height: 19px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base);
}

.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: var(--text-3);
  border-radius: 50%;
  transition: transform var(--t-base) var(--ease-spring), background var(--t-base);
}

.switch input:checked + .switch__track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(15px); background: #fff; }
.switch input:focus-visible + .switch__track { box-shadow: var(--shadow-focus); }

.promo-preview { min-height: 150px; }
.promo-preview .promo-card { min-height: 146px; }

.card--chat { display: flex; flex-direction: column; height: calc(100vh - 190px); padding: 0; }

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  overflow-y: auto;
}

.msg { display: flex; gap: var(--sp-3); animation: row-in var(--t-slow) var(--ease-out) both; }

.msg__avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-inset);
  object-fit: cover;
}

.msg__main { min-width: 0; flex: 1; }

.msg__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.msg__author {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text);
}

.msg__time { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-3); }

.msg__body {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.msg__delete {
  margin-left: auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  border-radius: var(--r-xs);
  opacity: 0;
  transition: opacity var(--t-base), color var(--t-base), background var(--t-base);
}

.msg:hover .msg__delete { opacity: 1; }
.msg__delete:hover { color: var(--danger); background: var(--danger-soft); }
.msg__delete svg { width: 11px; height: 11px; }

.chat__composer {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
}

.chat__composer input {
  flex: 1;
  padding: 10px var(--sp-4);
  font-size: var(--fs-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.chat__composer input:focus {
  outline: none;
  border-color: var(--brand-ring);
  box-shadow: var(--shadow-focus);
}

.icon-btn--send { width: 38px; height: 38px; color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
.icon-btn--send:hover { color: var(--brand-ink); background: var(--brand-hover); }

.modal[hidden] { display: none; }

.modal { position: fixed; inset: 0; z-index: var(--z-drawer); display: grid; place-items: center; padding: var(--sp-4); }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in var(--t-base) var(--ease-out) both;
}

.modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  animation: loader-in var(--t-slow) var(--ease-spring) both;
}

.modal__body { padding: var(--sp-5); }

.modal__title {
  margin-bottom: var(--sp-1);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

.modal__sub { margin-bottom: var(--sp-4); font-size: var(--fs-xs); color: var(--text-2); }

/* Tier grid used by the placement editor */
.tier-grid { display: flex; flex-direction: column; gap: var(--sp-2); }

.tier-row { display: flex; align-items: center; gap: var(--sp-2); }

.tier-row__mode {
  width: 104px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.tier-row__mode span:first-child { display: grid; place-items: center; width: 14px; height: 14px; color: var(--brand); }
.tier-row__mode svg { width: 100%; height: 100%; }

.tier-row__controls { display: flex; gap: 4px; flex: 1; }

.tier-select {
  flex: 1;
  padding: 6px var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  cursor: pointer;
}

.tier-select:focus { outline: none; border-color: var(--brand-ring); box-shadow: var(--shadow-focus); }

.tier-row__clear {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  transition: color var(--t-base), background var(--t-base);
}

.tier-row__clear:hover { color: var(--danger); background: var(--danger-soft); }
.tier-row__clear svg { width: 11px; height: 11px; }

@media (max-width: 1080px) {
  .split, .split--promo { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }

  .side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-header);
    width: 240px;
    transform: translateX(-100%);
    transition: transform var(--t-base) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }

  .side.is-open { transform: none; }
  .panel { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  .panel__burger { display: grid; }
  .card--chat { height: calc(100dvh - 170px); }
  .field-row { grid-template-columns: 1fr; }
  .entry { flex-wrap: wrap; }
  .entry__actions { width: 100%; }
  .entry__actions .btn { flex: 1; }
}

.botcard {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-3) var(--sp-3) 0;
  padding: var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.botcard:hover { border-color: var(--border-strong); }

.botcard__dot {
  position: relative;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-3);
}

/* The halo only animates while the bot is actually up, so a glance is enough. */
.botcard.is-online .botcard__dot { background: var(--ok); }
.botcard.is-online .botcard__dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: botPulse 2.4s var(--ease) infinite;
}
.botcard.is-offline .botcard__dot { background: var(--danger); }
.botcard.is-offline { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }

@keyframes botPulse {
  0%   { transform: scale(0.7); opacity: 0.9; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .botcard.is-online .botcard__dot::after { animation: none; }
}

.botcard__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.botcard__name {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.botcard__meta {
  font-size: var(--fs-micro);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__title--pad { padding: var(--sp-4) var(--sp-4) 0; }

.lb--admin .lb__td--pts {
  font-weight: var(--fw-bold);
  color: var(--brand);
}
.lb--admin tr.is-me { background: var(--brand-soft); }
.lb--admin tr.is-me td:first-child { box-shadow: inset 2px 0 0 var(--brand); }

.split--review { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }

.feed--tickets { max-height: 68vh; overflow-y: auto; padding: var(--sp-2); }

.ticket {
  display: block;
  width: 100%;
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.ticket:hover { border-color: var(--border-strong); }
.ticket.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.ticket__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.ticket__ign {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket__meta { margin-top: 2px; font-size: var(--fs-micro); color: var(--text-2); }
.ticket__meta--dim { color: var(--text-3); }

.transcript { max-height: 68vh; overflow-y: auto; padding: var(--sp-4); }
.transcript__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.transcript__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.tmeta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}
.tmeta__row dt { font-size: var(--fs-micro); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.tmeta__row dd { margin-top: 1px; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text); }

.transcript__notes {
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  background: var(--surface-inset);
  border-radius: var(--r-sm);
}

.transcript__log { display: flex; flex-direction: column; gap: var(--sp-3); }

.tmsg {
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  /* The bot's messages carry the questions and result card, so mark them. */
  border-left: 2px solid transparent;
}
.tmsg--bot { border-left-color: var(--brand); background: var(--surface-inset); }

.tmsg__head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-micro); }
.tmsg__head strong { color: var(--text); }
.tmsg__time { margin-left: auto; color: var(--text-3); }
.tmsg__body { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-2); white-space: pre-wrap; }

.tmsg__embed {
  padding: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-2);
  border-left: 2px solid var(--border-strong);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--surface);
}
.tmsg__embed-title { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text); }
.tmsg__embed-desc { margin-top: 2px; font-size: var(--fs-micro); color: var(--text-2); white-space: pre-wrap; }
.tmsg__field { margin-top: var(--sp-2); }
.tmsg__field span { font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--text-2); }
.tmsg__field p { font-size: var(--fs-micro); color: var(--text-2); white-space: pre-wrap; }

.tmsg__file {
  display: inline-block;
  margin-top: var(--sp-2);
  font-size: var(--fs-micro);
  color: var(--brand);
  text-decoration: underline;
}

.transcript__foot { padding-top: var(--sp-4); margin-top: var(--sp-4); border-top: 1px solid var(--border); }

@media (max-width: 900px) {
  .split--review { grid-template-columns: 1fr; }
  .feed--tickets, .transcript { max-height: none; }
}

@media (max-width: 620px) {
  .panel { padding: var(--sp-4) var(--sp-3) var(--sp-8); }
  .panel__title { font-size: var(--fs-xl); }

  .tiles { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .tile { padding: var(--sp-3); }

  .toolbar { flex-wrap: wrap; gap: var(--sp-2); }
  .toolbar__search { flex-basis: 100%; }

  .seg {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .seg::-webkit-scrollbar { display: none; }
  .seg__btn { flex: 0 0 auto; }

  /* Same card treatment as the public board — no sideways scrolling. */
  .lb--admin { min-width: 0; display: block; }
  .lb--admin thead { display: none; }
  .lb--admin tbody { display: block; }
  .lb--admin tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border);
  }
  .lb--admin td { display: inline-block; padding: 0; border: 0; }
  .lb--admin td:nth-child(2) { flex: 1 1 100%; }

  .entry { flex-wrap: wrap; }
  .entry__actions { width: 100%; }
  .entry__actions .btn { flex: 1; }

  .transcript, .feed--tickets { max-height: none; }
  .tmeta { grid-template-columns: repeat(2, 1fr); }

  .modal__panel { width: calc(100vw - var(--sp-4)); max-height: 88vh; }
}

@media (pointer: coarse) {
  .side__link { min-height: 48px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn { min-height: 44px; }
  .btn--sm { min-height: 40px; }
  .seg__btn { min-height: 40px; }
  .ticket { min-height: 56px; }
  input, select, textarea { font-size: 16px; }
}

@supports (padding: max(0px)) {
  .panel { padding-bottom: max(var(--sp-8), calc(env(safe-area-inset-bottom) + var(--sp-6))); }
  .side { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

.toolbar__search--wide {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1 1 420px;
  max-width: 560px;
  padding-left: var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.toolbar__search--wide:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.toolbar__search--wide .toolbar__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--brand);
}

.toolbar__search--wide .toolbar__icon svg {
  width: 16px;
  height: 16px;
}

.toolbar__search--wide input {
  width: 100%;
  padding: 10px var(--sp-3) 10px 0;
  font-size: var(--fs-sm);
  background: none;
  border: 0;
  color: var(--text);
}
.toolbar__search--wide input::placeholder { color: var(--text-3); }
.toolbar__search--wide input:focus { outline: none; }

/* Board depth: share of all placements. */
.depth__pct {
  display: block;
  font-style: normal;
  font-size: var(--fs-micro);
  color: var(--text-3);
}

.entry--featured {
  background: var(--brand-soft);
  box-shadow: inset 2px 0 0 var(--brand);
}

.clip-crown { color: var(--brand); vertical-align: -2px; }
.clip-crown svg { width: 14px; height: 14px; }

.seg--source { margin-bottom: var(--sp-4); }

.dropzone {
  display: grid;
  place-items: center;
  gap: var(--sp-1);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
}
.dropzone__icon svg { width: 16px; height: 16px; }

.dropzone__text {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Upload progress. A 100 MB clip on a home connection is not instant. */
.upbar {
  height: 6px;
  margin-top: var(--sp-3);
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: var(--r-pill);
}

.upbar__fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffa04d, var(--brand));
  border-radius: var(--r-pill);
  transition: width 120ms linear;
}

/* Account linking */

.linkbox {
  margin-top: 18px;
  padding: var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.linkbox__head { display: flex; align-items: center; gap: var(--sp-2); }
.linkbox__title { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text); }

.linkbox__badge {
  padding: 2px 8px;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tag);
  color: var(--text-3);
  background: var(--surface-inset);
  border-radius: var(--r-pill);
}
.linkbox__badge.is-verified { color: var(--ok); background: var(--ok-soft); }
.linkbox__badge.is-self { color: var(--brand); background: var(--brand-soft); }

.linkbox__meta { margin-top: 6px; font-size: var(--fs-micro); color: var(--text-3); overflow-wrap: anywhere; }
.linkbox__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }

.linkbox__input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 8px var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.linkbox__input:focus { outline: none; border-color: var(--brand); }

.linkbox__note { margin-top: var(--sp-2); font-size: var(--fs-micro); }

/* Injected icons must never size themselves off their container. */
.toolbar__icon svg,
.tools__search-icon svg,
.side__icon svg,
.tile__icon svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* ---- Activity panel ------------------------------------------------------ */

.act__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.act__sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.act__range {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.act__hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: 6px;
}

.act__trend {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 600;
}
.act__trend.is-up { color: #3fb950; }
.act__trend.is-down { color: #f85149; }
.act__trend.is-flat { color: var(--muted); font-weight: 500; }

.act__card { margin-bottom: var(--sp-4); }

.act__cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.act__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.act__key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.act__key--web { background: var(--brand); }
.act__key--bot { background: #6ea8fe; }

/* Fourteen-day stacked chart */
.act__chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  margin-top: var(--sp-3);
}

.act__col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.act__stack {
  width: 100%;
  max-width: 34px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 5px;
  overflow: hidden;
  background: var(--line);
}

.act__seg { display: block; width: 100%; }
.act__seg--web { background: var(--brand); }
.act__seg--bot { background: #6ea8fe; }

.act__day {
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Hour histogram */
.act__hours {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 96px;
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}

.act__hour {
  flex: 1 1 0;
  min-width: 6px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.act__hour span {
  width: 100%;
  background: var(--line);
  border-radius: 3px 3px 0 0;
  display: block;
}

.act__hour.is-peak span { background: var(--brand); }

.act__peak {
  flex: 1 0 100%;
  margin: var(--sp-3) 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Ranked bar lists */
.act__row { margin-bottom: var(--sp-3); }

.act__rowtop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 5px;
}

.act__name {
  font-size: 0.87rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.act__count {
  font-size: 0.87rem;
  font-weight: 600;
  white-space: nowrap;
}

.act__sub2 {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.74rem;
  margin-left: 6px;
}

.act__bar {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.act__bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

.act__stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.act__stat:last-child { border-bottom: 0; }
.act__stat span { color: var(--muted); }

.act__empty {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

@media (max-width: 640px) {
  .act__chart { height: 130px; gap: 3px; }
  .act__day { font-size: 0.6rem; }
}

/* Delete sits away from save and cancel so it is not clicked by reflex. */
.form__actions--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.form__actions-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.linkbox__badge.is-retired { color: var(--warn, #b26a00); background: rgba(210, 153, 34, 0.14); }

.field__hint {
  display: block;
  margin-top: 5px;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---- Backup -------------------------------------------------------------- */

.bk__list { display: flex; flex-direction: column; }

.bk__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.bk__row:last-child { border-bottom: 0; }

.bk__name { margin: 0 0 3px; font-size: 0.92rem; font-weight: 600; }

.bk__note {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.5;
}

.bk__care { margin-top: var(--sp-4); }

.bk__points {
  margin: var(--sp-2) 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}
.bk__points li { margin-bottom: 6px; }

/* ---- Site status --------------------------------------------------------- */

.lx__switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.lx__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 6px;
  vertical-align: middle;
}

.lx__dot.is-on {
  background: #d29922;
  box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.2);
}

textarea.input { resize: vertical; font-family: inherit; line-height: 1.5; }
