:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2b303b;
  --text: #e6e8ec;
  --muted: #8a92a3;
  --accent: #4f8cff;
  --ok: #3fb97c;
  --warn: #d9a53a;
  --bad: #e5594f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px / 1.45 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}
h3 {
  font-size: 0.9rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mono,
pre,
textarea.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0.25rem 0 0.75rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.25rem;
  height: 48px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
nav .brand {
  margin-right: 0.5rem;
}
nav a {
  color: var(--muted);
  padding: 14px 0;
  border-bottom: 2px solid transparent;
}
nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
nav a:hover {
  text-decoration: none;
  color: var(--text);
}
nav .push {
  margin-left: auto;
}
.content {
  padding: 1.25rem;
  max-width: 1500px;
  margin: 0 auto;
}

button,
select,
input,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}
button {
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.small {
  padding: 3px 9px;
  font-size: 12px;
}
textarea {
  width: 100%;
  resize: vertical;
}
select {
  max-width: 100%;
}
input[type="text"],
input[type="password"] {
  width: 100%;
}

.login {
  max-width: 340px;
  margin: 18vh auto 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(340px, 5fr) 7fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .console-grid {
    grid-template-columns: 1fr;
  }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-label {
  color: var(--muted);
  font-size: 12px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.url-line {
  display: flex;
  align-items: center;
  gap: 4px;
  word-break: break-all;
}
.url-line input {
  flex: 1;
}

.resp-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.resp-head h2 {
  margin: 0;
  margin-right: auto;
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid;
}
.badge-ok {
  color: var(--ok);
  border-color: var(--ok);
}
.badge-warn {
  color: var(--warn);
  border-color: var(--warn);
}
.badge-bad {
  color: var(--bad);
  border-color: var(--bad);
}
.tag {
  background: var(--panel-2);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 0.75rem 0 0.5rem;
}
.body-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  max-height: 62vh;
  overflow: auto;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.raw {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  max-height: 62vh;
  overflow: auto;
}
.error-box {
  border: 1px solid var(--bad);
  background: rgba(229, 89, 79, 0.1);
  color: #ffb4ae;
  border-radius: 6px;
  padding: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.error-text {
  color: var(--bad);
}

table {
  border-collapse: collapse;
}
table.kv {
  margin: 0.5rem 0;
}
table.kv td {
  padding: 1px 12px 1px 0;
}
table.grid {
  width: 100%;
}
table.grid th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
}
table.grid td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
label.inline {
  display: flex;
  align-items: center;
  gap: 4px;
}
.thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.log-content {
  max-width: 640px;
}

.j-node,
.j-row {
  font-family: var(--mono);
  font-size: 12.5px;
}
.j-children {
  margin-left: 1.1rem;
  border-left: 1px solid var(--border);
  padding-left: 0.6rem;
}
.j-key {
  color: #9cb3ff;
}
.j-meta {
  color: var(--muted);
}
.j-string {
  color: #9ad6a6;
}
.j-number {
  color: #e0b074;
}
.j-boolean,
.j-null {
  color: #d492e6;
}
summary {
  cursor: pointer;
}

.log {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 62vh;
  overflow: auto;
  padding: 0.5rem;
}
.log-entry {
  padding: 4px 6px;
  border-left: 3px solid var(--border);
  margin-bottom: 6px;
}
.log-entry pre {
  font-family: var(--mono);
  font-size: 12px;
  max-height: 260px;
  overflow: auto;
}
.log-meta {
  color: var(--muted);
  font-size: 11px;
}
.log-out {
  border-left-color: var(--accent);
}
.log-in {
  border-left-color: var(--ok);
}
.log-sys {
  border-left-color: var(--warn);
  color: var(--muted);
}

.refs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ref {
  position: relative;
}
.ref img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}
.ref button {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 6px;
}
.result-image img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 6px;
}

.history {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
}
.history-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 6px 4px;
}
.history-item:hover {
  background: var(--panel-2);
}

.branding {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 1.5rem;
  align-items: start;
}
.branding > span {
  grid-column: 1 / -1;
}

.logo-preview-holder {
  max-width: 250px;
  background: conic-gradient(
    #8f8f8f80 25%,
    #ffffff80 0 50%,
    #8f8f8f80 0 75%,
    #ffffff80 0
  );
  background-size: 20px 20px; /* Controls the size of the overall pattern loop */
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
}

.logo-preview {
  max-width: 220px;
  max-height: 140px;
  /* background: #fff; */
  border-radius: 6px;
  padding: 8px;
  display: block;
}

table.colors td {
  padding: 3px 12px 3px 0;
}
table.colors input[type="color"] {
  width: 42px;
  height: 30px;
  padding: 2px;
  cursor: pointer;
}
table.colors input[type="color"].unset {
  opacity: 0.35;
}
table.colors input[type="text"] {
  width: 110px;
}
@media (max-width: 800px) {
  .branding {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}
button.danger:hover:not(:disabled) {
  border-color: var(--bad);
  color: var(--bad);
}

/* ---- layout editor */
.stage-wrap {
  display: flex;
  overflow: auto;
  background: repeating-conic-gradient(#14171d 0% 25%, #11141a 0% 50%) 0 0 / 20px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.stage {
  position: relative;
  user-select: none;
  touch-action: none;
  margin: auto; /* centers it, and unlike justify-content stays scrollable when zoomed in */
  flex: none;
}
.stage-img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.overlay {
  position: absolute;
  inset: 0;
}
.box {
  position: absolute;
  border: 1px dashed rgba(79, 140, 255, 0.55);
  pointer-events: none;
  box-sizing: border-box;
}
.box.skipped {
  border-color: rgba(217, 165, 58, 0.8);
}
.box.selected {
  border: 2px solid var(--accent);
  background: rgba(79, 140, 255, 0.08);
}
.box-label {
  position: absolute;
  left: -2px;
  bottom: 100%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 2px;
  pointer-events: auto;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}
.h-nw {
  left: 0;
  top: 0;
}
.h-n {
  left: 50%;
  top: 0;
}
.h-ne {
  left: 100%;
  top: 0;
}
.h-e {
  left: 100%;
  top: 50%;
}
.h-se {
  left: 100%;
  top: 100%;
}
.h-s {
  left: 50%;
  top: 100%;
}
.h-sw {
  left: 0;
  top: 100%;
}
.h-w {
  left: 0;
  top: 50%;
}
.guide {
  position: absolute;
  background: #ff4fa3;
  pointer-events: none;
}
.guide-v {
  top: 0;
  bottom: 0;
  width: 1px;
}
.guide-h {
  left: 0;
  right: 0;
  height: 1px;
}

.layers h2,
.inspector h2 {
  margin-top: 0;
}
.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0.6rem;
}
.layer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.layer:hover {
  background: var(--panel-2);
}
.layer.selected {
  background: rgba(79, 140, 255, 0.15);
  border-color: var(--accent);
}
.layer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.layer-warn {
  color: var(--warn);
}
.layer-actions {
  display: none;
  gap: 2px;
}
.layer:hover .layer-actions,
.layer.selected .layer-actions {
  display: flex;
}
.layer-actions button {
  padding: 0 6px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.inspector input[type="text"],
.inspector input[type="number"],
.inspector select {
  width: 100%;
}
.color-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.color-row select {
  flex: 1;
}
.swatch {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  flex: none;
}
.inspector-actions {
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.j-thumb {
  height: 40px;
  width: 40px;
  object-fit: contain;
  vertical-align: middle;
  margin-left: 8px;
  border-radius: 4px;
  background: repeating-conic-gradient(#2a2f3a 0% 25%, #20242d 0% 50%) 0 0 / 10px 10px;
}

.url-line {
  flex-wrap: wrap;
}
.url-line input {
  flex: 1 1 140px;
  min-width: 140px;
}

/* ---- player photo review */
.photo-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 800px) {
  .photo-layout {
    grid-template-columns: 1fr;
  }
}
.photo-search {
  display: flex;
  gap: 6px;
  margin-bottom: 0.6rem;
}
.photo-search input {
  flex: 1;
  min-width: 0;
}
.photo-teams {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}
.photo-team {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
  border: 1px solid transparent;
}
.photo-team:hover {
  background: var(--panel-2);
  text-decoration: none;
}
.photo-team.selected {
  background: rgba(79, 140, 255, 0.15);
  border-color: var(--accent);
}
.photo-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-team-counts {
  display: flex;
  gap: 6px;
  font-size: 12px;
  flex: none;
}
.ok-text {
  color: var(--ok);
}
.bad-text {
  color: var(--bad);
}
.photo-main {
  min-width: 0;
}
.photo-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.8rem;
}
.photo-card {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.photo-card.is-approved {
  border-color: var(--ok);
}
.photo-card.is-excluded {
  border-color: var(--bad);
  opacity: 0.55;
}
.photo-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: repeating-conic-gradient(#2a2f3a 0% 25%, #20242d 0% 50%) 0 0 / 14px 14px;
}
.photo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.photo-render-tag {
  position: absolute;
  top: 4px;
  left: 4px;
}
.photo-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
button.active {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.2);
}
button.approve.active {
  border-color: var(--ok);
  background: rgba(63, 185, 124, 0.2);
}
button.exclude.active {
  border-color: var(--bad);
  background: rgba(229, 89, 79, 0.2);
}

.content-bar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.content-bar > .muted {
  line-height: 32px;
}
.live-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.live-match {
  max-width: 380px;
}
.live-status {
  flex: 1 1 280px;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.4;
  padding-top: 6px;
  color: var(--text);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.prompt-text {
  width: 100%;
  line-height: 1.45;
}
.upload-row {
  display: grid;
  grid-template-columns: 2rem minmax(160px, 1fr) auto minmax(220px, 2fr) auto auto auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.upload-row.over-limit {
  opacity: 0.5;
}
.game-search {
  min-width: 260px;
}
.ref-list {
  margin: 0.4rem 0;
  padding-left: 1.2rem;
  font-size: 13px;
}
.prompt-resolved {
  white-space: pre-wrap;
  max-height: 420px;
  overflow: auto;
}

.scope-actions {
  display: inline-flex;
  gap: 0.4rem;
}

.new-client input {
  flex: 1 1 220px;
  max-width: 320px;
}

.box.locked {
  border-color: rgba(150, 150, 160, 0.35);
}
.box.locked.selected {
  border: 2px dashed rgba(150, 150, 160, 0.9);
  background: rgba(150, 150, 160, 0.08);
}
.box.locked .box-label {
  background: #6b6f7a;
}
button.lock.on {
  background: rgba(79, 140, 255, 0.25);
}

.panel.notice {
  border-color: var(--warn, #d9a53a);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.asset-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.asset-thumb {
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  background: repeating-conic-gradient(#cfcfd6 0% 25%, #f4f4f6 0% 50%) 0 0 / 16px 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-card {
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.stat-label {
  color: var(--muted, #8b8fa0);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 30px;
  font-weight: 600;
  margin: 0.25rem 0;
}
.stat-value.low {
  color: var(--bad);
}
.stat-detail {
  font-size: 12.5px;
  color: var(--muted, #8b8fa0);
}

.small-text {
  font-size: 12px;
}
.ok-text {
  color: var(--ok, #4cc38a);
}
.key-test-result {
  margin: 0.25rem 0 1rem;
  min-height: 1.2em;
}

.photo-source {
  display: flex;
  gap: 0.25rem;
  margin: 0.3rem 0;
}

.bundle-row {
  display: grid;
  grid-template-columns:
    auto minmax(120px, 1fr) minmax(110px, 0.7fr) minmax(170px, 1.2fr)
    7rem minmax(150px, 1fr) auto auto auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.bundle-row.off {
  opacity: 0.5;
}

.layer-grip {
  color: var(--muted);
  cursor: grab;
  letter-spacing: -2px;
  user-select: none;
}
.layer.dragging {
  opacity: 0.4;
}
.layer.drop-above {
  box-shadow: 0 -2px 0 0 var(--accent);
}
.layer.drop-below {
  box-shadow: 0 2px 0 0 var(--accent);
}

.box.selection-bounds {
  border: 1px dashed var(--accent);
  background: transparent;
  pointer-events: none;
}
.box.selection-bounds .box-label {
  background: var(--accent);
}
.marquee {
  position: absolute;
  border: 1px solid var(--accent);
  background: rgba(79, 140, 255, 0.12);
  pointer-events: none;
}
.align-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.zoom-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 12px;
}
.zoom-label {
  min-width: 3.2rem;
  text-align: center;
}
.stage-wrap.pan-ready,
.stage-wrap.pan-ready .overlay {
  cursor: grab;
}
.stage-wrap.panning,
.stage-wrap.panning .overlay {
  cursor: grabbing;
}
.box.hover {
  border: 2px solid #ffb020;
  background: rgba(255, 176, 32, 0.18);
  z-index: 5;
}
.stage.hover-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #ffb020;
  background: rgba(255, 176, 32, 0.1);
  pointer-events: none;
}
.layer.hover {
  background: rgba(255, 176, 32, 0.16);
  border-color: #ffb020;
}

/* ---- prompt configuration dock (layout editor) */
.prompt-dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.18);
}
.dock-grip {
  display: none;
  height: 8px;
  cursor: ns-resize;
  border-radius: 10px 10px 0 0;
}
.prompt-dock.open .dock-grip {
  display: block;
}
.dock-grip:hover {
  background: var(--border);
}
.dock-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.8rem;
}
.dock-toggle {
  border: none;
  background: none;
  font-weight: 600;
  padding: 0.2rem 0.3rem;
}
.dock-spacer {
  flex: 1;
}
.dock-body {
  display: none;
  overflow: auto;
  padding: 0 0.8rem 0.8rem;
  height: 46vh;
  border-top: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.prompt-dock.open .dock-body {
  display: block;
}
.dock-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}
.dock-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.6rem;
}
.dock-tab {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 0.4rem 0.9rem;
}
.dock-tab.current {
  border-bottom-color: var(--accent, #4f8cff);
  font-weight: 600;
}
.dock-tab .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--ok, #3fb950);
}
.engine-note {
  margin: 0 0 0.6rem;
}
.engine-note.active {
  color: var(--ok, #3fb950);
  font-size: 13px;
}
.dock-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1100px) {
  .dock-columns {
    grid-template-columns: 1fr;
  }
}
.dock-preview {
  position: sticky;
  top: 0;
}
.preview-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.preview-head h4 {
  margin: 0.4rem 0;
}
.dock-edit h4 {
  margin: 0.8rem 0 0.3rem;
}
.dock-settings {
  margin-top: 0.8rem;
}
.dock-settings summary {
  cursor: pointer;
  color: var(--muted);
}
.zoom-bar .mode-select {
  margin-left: auto;
  width: auto;
}

/* ---- element groups (layout editor) */
.layer.layer-group {
  font-weight: 600;
}
.layer.layer-group .caret {
  padding: 0 0.3rem;
  border: none;
  background: none;
}
.layer.layer-group .group-name {
  font-family: inherit;
}
.layer.in-group {
  margin-left: 1rem;
  border-left: 2px solid var(--border);
}
.group-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* ---- layout editor workspace: fills the window below the nav, panels scroll on their own */
body.editor-mode {
  overflow: hidden;
}
body.editor-mode #app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
body.editor-mode .content {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.ed {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ed-top,
.ed-context {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 6px 12px;
  min-width: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.ed-context {
  background: var(--bg);
  font-size: 12.5px;
}
.ed-top .label-input {
  width: 240px;
  flex: 0 1 240px;
  min-width: 100px;
}
.ed-top .type-input {
  width: 150px;
}
.ed-top input[type="number"] {
  width: 78px;
}
.ed-top .crumb {
  white-space: nowrap;
}
.ed-spacer {
  flex: 1;
  min-width: 0;
}
.ed-top .hint,
.ed-context .hint {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ed-context .hint {
  flex: 0 1 auto;
}
.ed-context select {
  padding: 4px 8px;
}
.ed > .notice {
  flex: none;
  margin: 0;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.ed > .notice p {
  margin: 0;
}
.ed > .notice .actions {
  margin: 0;
}
.ed-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 290px;
}
.ed-left,
.ed-right {
  min-height: 0;
  min-width: 0;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}
.ed-left {
  border-right: 1px solid var(--border);
}
.ed-right {
  border-left: 1px solid var(--border);
}
.ed-left .layers {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.7rem;
}
.ed-left .layer-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.ed-right .inspector {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.inspector .inspector-actions {
  position: sticky;
  bottom: -0.7rem;
  margin: 1rem -0.7rem -0.7rem;
  padding: 0.6rem 0.7rem;
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.inspector-section {
  border-top: 1px solid var(--border);
}
.inspector-section > summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.inspector-section > .form {
  padding-bottom: 0.6rem;
}
.ed-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.ed-center > .zoom-bar,
.ed-center > .content-bar {
  flex: none;
  margin: 0;
  padding: 5px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--panel);
}
.ed-center > .content-bar {
  align-items: center;
  gap: 0.5rem;
}
.ed-center > .content-bar > .muted {
  line-height: 1.4;
}
.ed-center .live-status {
  padding-top: 0;
  max-height: 3.4em;
  overflow: auto;
}
.ed-center > .error-box {
  flex: none;
  margin: 0;
  border-radius: 0;
}
.ed-center > .stage-wrap {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
.ed-center > .prompt-dock {
  flex: none;
  position: static;
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
}
.ed-center .dock-body {
  height: var(--dock-height, 340px);
  max-height: calc(100vh - 460px);
  min-height: 140px;
}
.zoom-bar .mode-select {
  margin-left: 0;
}

/* dialogs over the editor */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal {
  width: min(780px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-body,
.modal > table {
  padding: 1rem;
  overflow: auto;
}
.shortcuts {
  border-collapse: collapse;
  margin: 0.5rem 1rem 1rem;
}
.shortcuts td {
  padding: 4px 14px 4px 0;
  vertical-align: top;
}
.ed-top .layout-id {
  color: var(--muted);
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ed-top .layout-id {
  color: var(--muted);
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* side panel used by the Player photos and Teams pages */
.editor-side {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  max-height: calc(100vh - 200px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.team-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}
.swatches {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border);
  display: inline-block;
}
.color-input {
  width: 44px;
  height: 28px;
  padding: 0;
}
.team-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}
.color-edit {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.color-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.hex-text {
  width: 6.2rem;
}
.hex-text.invalid {
  border-color: var(--bad);
}

/* layouts page: groups of thumbnail cards */
.layout-group h3 {
  margin: 1.4rem 0 0.6rem;
}
.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.layout-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.layout-card:hover {
  border-color: var(--accent);
}
.thumb-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 210px;
  padding: 8px;
  background: repeating-conic-gradient(#14171d 0% 25%, #11141a 0% 50%) 0 0 / 16px 16px;
}
.thumb-box:hover {
  text-decoration: none;
}
.thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.15s;
}
.thumb.ready {
  opacity: 1;
}

.grid .thumb {
  max-width: 200px;
}

.card-body {
  padding: 0.6rem 0.75rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 12px;
}
.card-clients {
  margin: 0.2rem 0 0;
}

/* content generation matrix (client page) */
.content-modes td,
.content-modes th {
  text-align: left;
}
.content-modes .group-row td {
  padding-top: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.content-modes tr.planned {
  opacity: 0.55;
}
.radio-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.content-modes input[type="radio"] {
  width: auto;
}
