/* Keizaal Atlas — tool dock (tools.js). One docked panel on the left for every focused tool. */

.kz-dock {
  position: fixed;
  z-index: 60;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: 360px;
  display: flex;
  flex-direction: column;
  background: var(--glass-2);
  border: 1px solid var(--gold-line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  overflow: hidden;
  animation: kzd-in var(--t-slow) var(--ease);
}
.kz-dock[hidden] { display: none; }
@keyframes kzd-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

.kzd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.kzd-title-wrap { min-width: 0; }
.kzd-kicker {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.kzd-title {
  margin: 2px 0 0;
  font-family: "Cinzel", "Palatino Linotype", Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.kzd-done {
  flex: none;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--primary-line);
  background: var(--primary-dim);
  color: var(--primary-strong);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.kzd-done:hover { background: var(--primary); color: var(--primary-ink); }

.kzd-tabs {
  display: flex;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}
.kzd-tabs[hidden] { display: none; }
.kzd-tab {
  position: relative;
  flex: 1;
  padding: 9px 4px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.kzd-tab:hover:not(:disabled) { color: var(--text); }
.kzd-tab.is-active { color: var(--accent); }
.kzd-tab.is-active::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.kzd-tab:disabled { opacity: 0.4; cursor: default; }
.kzd-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: #ff9d4d;
  color: #1a0f05;
  font-size: 10.5px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
}

.kzd-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kzd-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.kzd-selected { border-color: var(--gold-line); background: var(--gold-glow); }
.kzd-h {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.kzd-lead { margin: 0; color: var(--text); line-height: 1.45; }
.kzd-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.kzd-pad { padding: 2px 2px 0; }
.kzd-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }

.kzd-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kzd-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
}
.kzd-step.is-current { border-color: var(--primary-line); background: var(--primary-dim); }
.kzd-num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid currentColor;
}
.kzd-num-start { color: #5aeaff; }
.kzd-num-dest { color: #ff9a4d; }
.kzd-step.is-done .kzd-num { background: currentColor; }
.kzd-step.is-done .kzd-num-start { color: #5aeaff; }
.kzd-step.is-done .kzd-num::before { content: ''; }
.kzd-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kzd-step-text b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kzd-step-text span { color: var(--muted); font-size: 12px; }
.kzd-step-act { display: flex; gap: 4px; flex: none; }
.kzd-step.is-done .kzd-num { color: #0b0d10; }
.kzd-step.is-done .kzd-num-start { background: #5aeaff; border-color: #5aeaff; }
.kzd-step.is-done .kzd-num-dest { background: #ff9a4d; border-color: #ff9a4d; }

.kzd-pill {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 650;
  border: 1px solid var(--line);
  color: var(--muted);
}
.kzd-pill.is-ok { color: var(--ready); border-color: rgba(131, 191, 122, 0.5); background: rgba(131, 191, 122, 0.1); }
.kzd-pill.is-busy { color: var(--primary-strong); border-color: var(--primary-line); background: var(--primary-dim); }
.kzd-pill.is-warn { color: #e8c879; border-color: var(--gold-line); background: var(--gold-glow); }
.kzd-pill.is-bad { color: var(--danger-strong); border-color: rgba(198, 107, 89, 0.5); background: rgba(198, 107, 89, 0.1); }

.kzd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kzd-stats-2 { grid-template-columns: repeat(2, 1fr); }
.kzd-stat {
  padding: 7px 8px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.kzd-stat span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kzd-stat b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }

.kzd-row { display: flex; flex-wrap: wrap; }
.kzd-gap { gap: 6px; }
.kzd-row > .kzd-btn { flex: 1 1 auto; }

.kzd-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.kzd-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.22); }
.kzd-btn:disabled { opacity: 0.4; cursor: default; }
.kzd-btn.is-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.kzd-btn.is-primary:hover:not(:disabled) { background: var(--primary-strong); border-color: var(--primary-strong); }
.kzd-btn.is-primary:disabled { background: rgba(95, 198, 221, 0.18); border-color: transparent; color: var(--primary-strong); opacity: 0.6; }
.kzd-btn.is-wide, .kzd-btn.is-primary.wide { width: 100%; }
.kzd-btn.is-danger { color: var(--danger-strong); border-color: rgba(198, 107, 89, 0.45); }
.kzd-btn.is-danger:hover:not(:disabled) { background: rgba(198, 107, 89, 0.16); }
.kzd-btn.is-ghost { background: none; border-color: transparent; color: var(--muted); }
.kzd-btn.is-icon { min-width: 30px; min-height: 30px; padding: 0; color: var(--muted); }
.kzd-btn.is-icon:hover:not(:disabled) { color: var(--danger-strong); }
.kzd-body > .kzd-btn { width: 100%; min-height: 40px; }

.kzd-seg {
  display: flex;
  padding: 3px;
  gap: 3px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}
.kzd-seg button {
  flex: 1;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.kzd-seg button:hover { color: var(--text); }
.kzd-seg button.is-on { background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 0 0 1px var(--gold-line); }

.kzd-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kzd-label span { font-weight: 400; opacity: 0.8; }
.kzd-input {
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
}
.kzd-input:focus { outline: none; border-color: var(--primary-line); box-shadow: 0 0 0 3px var(--primary-dim); }

.kzd-switch { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.kzd-switch input { width: 16px; height: 16px; accent-color: var(--primary); }
.kzd-range { display: flex; align-items: center; gap: 10px; }
.kzd-range input { flex: 1; accent-color: var(--accent); }
.kzd-range b { width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.kzd-range.is-off { opacity: 0.45; }

.kzd-search { display: flex; flex-direction: column; gap: 6px; }
.kzd-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.kzd-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.kzd-item:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.05); }
.kzd-item.is-selected { border-color: var(--gold-line); background: var(--gold-glow); }
.kzd-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kzd-item-meta { font-size: 11.5px; color: var(--muted); }

.kzd-empty { padding: 28px 12px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.kzd-empty b { font-size: 14px; }
.kzd-empty p { margin: 0; color: var(--muted); line-height: 1.5; }
.kzd-empty-sm { padding: 18px 8px; text-align: center; color: var(--muted); }

.kzd-foot {
  border-top: 1px solid var(--line);
  padding: 10px 16px 12px;
  background: rgba(0, 0, 0, 0.2);
}
.kzd-foot[hidden] { display: none; }
.kzd-keys {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  font-size: 11.5px;
}
.kzd-keys dt { color: var(--text); font-weight: 600; white-space: nowrap; }
.kzd-keys dd { margin: 0; color: var(--muted); }

.kzd-toast {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: #1b2228;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
}
.kzd-toast.is-on { opacity: 1; transform: none; }
.kzd-toast.is-ok { border-color: rgba(131, 191, 122, 0.5); }
.kzd-toast.is-warn { border-color: rgba(232, 200, 121, 0.5); }

/* While a tool is open, it is the only thing on screen besides the map + top bar. */
body.kz-tool-open .right-panel,
body.kz-tool-open .fab-cluster,
body.kz-tool-open .layers-pane,
body.kz-tool-open #route-primary-action,
body.kz-tool-open #kz-loc-banner,
body.kz-tool-open #app-notices,
body.kz-tool-open #kz-feedback-btn,
body.kz-tool-open #debug-route-overlay,
body.kz-tool-open #map-attribution { display: none !important; }

/* Phones: the dock becomes a bottom sheet so the map stays usable above it. */
@media (max-width: 720px) {
  .kz-dock {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 58vh;
  }
  .kzd-tab { font-size: 12px; }
}

/* evidence rows: the app-wide button min-height squeezed the two lines */
.kzd-item { min-height: 0; height: auto; flex: none; }
.kzd-item > span { flex: none; line-height: 1.35; }

/* Route Lab: legs of a saved route */
select.kzd-input { cursor: pointer; }
.kzd-legs { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
.kzd-leg {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 0;
  padding: 7px 9px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  flex: none;
}
.kzd-leg:hover:not(:disabled) { border-color: var(--line); background: rgba(255, 255, 255, 0.06); }
.kzd-leg.is-active { border-color: var(--primary-line); background: var(--primary-dim); }
.kzd-leg:disabled { opacity: 0.4; cursor: default; }
.kzd-leg-n {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 221, 122, 0.16);
  color: #ffdd7a;
  font-size: 11px;
  font-weight: 700;
}
.kzd-leg-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kzd-leg-text i { font-style: normal; color: var(--muted); padding: 0 3px; }

/* ── Build route ─────────────────────────────────────────────────────────── */
.kzd-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kzd-stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px 7px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  cursor: grab;
}
.kzd-stop:active { cursor: grabbing; }
.kzd-stop.is-dragging { opacity: 0.45; }
.kzd-stop.drop-before::before, .kzd-stop.drop-after::after {
  content: ''; position: absolute; left: 2px; right: 2px; height: 3px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 6px rgba(197, 170, 104, 0.55); pointer-events: none;
}
.kzd-stop.drop-before::before { top: -5px; }
.kzd-stop.drop-after::after { bottom: -5px; }
.kzd-grip { color: var(--muted); font-size: 11px; letter-spacing: -2px; padding: 0 2px; opacity: 0.7; }
.kzd-stop-n {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #ffdd7a; color: #1c1405; font-size: 11.5px; font-weight: 800;
}
.kzd-stop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kzd-stop-text b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kzd-stop-text span { font-size: 11.5px; color: var(--muted); }
.kzd-stop-act { display: flex; gap: 2px; flex: none; }
.kzd-legrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 3px 4px 3px 18px;
  min-height: 26px;
  font-size: 12px;
  color: var(--muted);
}
.kzd-legline { width: 2px; align-self: stretch; min-height: 20px; margin-right: 6px; border-radius: 2px; background: rgba(255, 221, 122, 0.55); }
.kzd-legrow.is-own .kzd-legline { background: #ffc45c; }
.kzd-legrow.is-own .kzd-legrow-text { color: #ffc45c; font-weight: 600; }
.kzd-legrow.is-straight .kzd-legline { background: repeating-linear-gradient(to bottom, rgba(255,221,122,0.6) 0 4px, transparent 4px 7px); }
.kzd-legrow-text { flex: 1 1 auto; }
.kzd-btn.is-link {
  min-height: 0; height: auto; padding: 2px 4px; border: 0; background: none;
  color: var(--primary-strong); font-size: 12px; font-weight: 600;
}
.kzd-btn.is-link:hover:not(:disabled) { background: none; text-decoration: underline; }
.kzd-btn.is-ghost.wide, .kzd-btn.is-primary.wide { width: 100%; }
.kzd-foot-actions { display: flex; gap: 8px; }
.kzd-foot-actions .kzd-btn { flex: 1; min-height: 38px; }
.kzd-empty-tight { padding: 18px 10px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.kzd-nowrap { flex-wrap: nowrap; }
.kzd-nowrap .kzd-input { flex: 1; }
.kzd-warn { color: #e8b27a; }
.kzd-range-wide { width: auto !important; min-width: 64px; }

/* ── Waypoints ───────────────────────────────────────────────────────────── */
.kzd-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--line);
  color: var(--muted);
}
.kzd-callout.is-on { border: 1px solid var(--primary-line); background: var(--primary-dim); color: var(--text); }
.kzd-callout b { grid-column: 1; }
.kzd-callout span { grid-column: 1; font-size: 12px; color: var(--muted); }
.kzd-callout .kzd-btn { grid-column: 2; grid-row: 1 / span 2; }
.kzd-wp { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border-radius: var(--r-xs); background: rgba(255, 255, 255, 0.025); flex: none; }
.kzd-wp:hover { background: rgba(255, 255, 255, 0.05); }
.kzd-wp-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #c5aa68); box-shadow: 0 0 0 2px rgba(0,0,0,0.5); }
.kzd-wp-name {
  flex: 1; min-width: 0; min-height: 28px; padding: 0 4px; text-align: left; border: 0; background: none;
  color: var(--text); font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.kzd-wp-name:hover { color: var(--accent); background: none; }

/* ── Map QC hosted in the dock ───────────────────────────────────────────── */
.kz-dock .mapqc-overlay {
  position: static;
  transform: none;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kz-dock .mapqc-overlay .path-hint-overlay-copy strong { display: none; }
.kz-dock .mapqc-overlay .path-hint-overlay-copy span {
  display: block; padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-dim);
  border: 1px solid var(--primary-line); color: var(--text); font-size: 12.5px;
}
.kz-dock .mapqc-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.kz-dock .mapqc-tool { height: 36px; }
.kz-dock .mapqc-end { display: none; }
.kz-dock .mapqc-panel { max-height: none; border-top: 1px solid var(--line); }

/* the old floating bars for these tools are replaced by the dock */
body.kz-tool-open #route-builder-overlay,
body.kz-tool-open #waypoint-edit-overlay { display: none !important; }

/* ── Atlas menu → Staff: tool launcher ───────────────────────────────────── */
.staff-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.staff-tool {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 0;
  height: auto;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--gold-line);
  border-radius: var(--r-sm);
  background: var(--gold-glow);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.staff-tool:hover { border-color: var(--accent); background: var(--accent-dim); }
.staff-tool b { color: var(--accent); font-size: 14px; }
.staff-tool span { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ── Map tools button: a labeled toolbox, not an icon that reads as "settings" ── */
.fab-cluster { width: auto; }
.fab.tools-toggle-btn {
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px 0 12px;
  border-radius: 21px;
}
.tools-toggle-btn svg { width: 19px; height: 19px; }
.tools-toggle-label { font-size: 13px; font-weight: 650; letter-spacing: 0.02em; }
body #kz-feedback-btn { right: 118px; }
/* dropping waypoints lives in the Waypoints tool now */
.tools-actions .waypoint-sub-fab { display: none !important; }
.right-panel .panel-card.is-empty { display: none; }

/* ── Live chat with the team (app/chat.js) ───────────────────────────────── */
#kz-chat { position: fixed; left: 14px; bottom: 18px; z-index: 4200; font-family: "Segoe UI", system-ui, sans-serif; }
#kz-chat[hidden] { display: none; }
body.kz-tool-open #kz-chat { left: auto; right: 14px; bottom: 74px; }
.kzc-launch {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--primary-line); background: rgba(10, 22, 26, 0.95); color: var(--primary-strong);
  font: 650 13px "Segoe UI", sans-serif; cursor: pointer; box-shadow: var(--shadow);
}
.kzc-launch[hidden] { display: none; }
.kzc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ready); box-shadow: 0 0 0 3px rgba(131,191,122,.2); }
.kzc-badge { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #ff9d4d; color: #1a0f05; font-size: 11px; line-height: 18px; text-align: center; font-weight: 800; }
.kzc-panel {
  width: min(360px, calc(100vw - 28px)); height: min(460px, calc(100vh - 140px)); display: flex; flex-direction: column;
  background: #0d1418; border: 1px solid var(--primary-line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;   /* solid: the map must not show through the words */
}
.kzc-panel[hidden] { display: none; }
.kzc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.kzc-head b { display: block; color: var(--accent); font: 700 15px "Cinzel", Georgia, serif; }
.kzc-head span { font-size: 11px; color: var(--muted); }
.kzc-btns { display: flex; gap: 6px; flex: none; }
.kzc-min, .kzc-x { min-height: 0; width: 32px; height: 32px; padding: 0; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.05); color: var(--text); }
.kzc-min:hover, .kzc-x:hover { background: rgba(255, 255, 255, 0.14); }
@media (max-width: 720px) {   /* phones: leave the map and the bottom buttons usable */
  #kz-chat { left: 8px; right: 8px; bottom: 70px; }
  .kzc-panel { width: auto; height: min(420px, 56vh); }
  .kzc-min, .kzc-x { width: 38px; height: 38px; }
}
.kzc-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.kzc-bub { max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.kzc-bub.me { align-self: flex-end; align-items: flex-end; }
.kzc-t { padding: 8px 11px; border-radius: 13px; font-size: 13.5px; line-height: 1.45; word-wrap: break-word; color: var(--text); }
.kzc-bub.them .kzc-t { background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.kzc-bub.me .kzc-t { background: #2b4a53; border-bottom-right-radius: 4px; }
.kzc-t a { color: var(--primary-strong); }
.kzc-m { font-size: 10.5px; color: var(--muted); }
.kzc-send { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.kzc-send[hidden] { display: none; }
.kzc-send textarea { flex: 1; resize: none; min-height: 38px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.35); color: var(--text); font: inherit; font-size: 13.5px; }
.kzc-send button { min-height: 38px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--primary); color: var(--primary-ink); font-weight: 700; cursor: pointer; }
.kzc-foot { display: flex; justify-content: center; padding: 0 10px 8px; }
.kzc-foot[hidden] { display: none; }
.kzc-end { border: 0; background: none; color: var(--muted); font: 600 12px "Segoe UI", sans-serif; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.kzc-end:hover { color: #f0a78f; background: rgba(255, 255, 255, 0.06); }
.kzc-note { align-self: center; font-size: 11.5px; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); }
.kzc-ended { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-align: center; }
.kzc-ended[hidden] { display: none; }

/* staff player panel: chat inside the dock */
.kzd-chatcard { gap: 8px; }
.kzd-chatlog { display: flex; flex-direction: column; gap: 8px; max-height: 300px; min-height: 120px; overflow-y: auto; padding: 4px 2px; }
.kzd-chat-input { height: auto; min-height: 56px; padding: 8px 10px; resize: none; }

/* staff "Online now": top-bar button + a list that stays open beside the map */
#kz-online-btn { display: none; position: relative; }
body.is-staff #kz-online-btn { display: grid; }
#kz-online-btn.is-on { color: var(--accent); border-color: var(--gold-line); }
.kz-online-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #3f9d5a; color: #fff; font: 700 10px "Segoe UI", sans-serif; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(14, 17, 18, 0.9); }
.kz-online-badge[hidden] { display: none; }
#kz-online-pane { position: fixed; z-index: 215; top: 64px; left: 12px; width: 320px; max-height: min(70vh, 620px); display: flex; flex-direction: column;
  background: var(--glass-2); border: 1px solid var(--gold-line); border-radius: var(--r); box-shadow: var(--shadow-lg); color: var(--text);
  font: 13px "Segoe UI", system-ui, -apple-system, sans-serif; overflow: hidden; }
#kz-online-pane[hidden], body:not(.is-staff) #kz-online-pane { display: none; }
.kzo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.kzo-head b { display: block; font: 700 15px "Cinzel", "Palatino Linotype", Georgia, serif; color: var(--accent); letter-spacing: 0.02em; }
.kzo-count { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.kzo-x { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: var(--text);
  font-size: 18px; line-height: 1; cursor: pointer; }
.kzo-x:hover { background: rgba(255, 255, 255, 0.1); }
.kzo-q { margin: 8px 10px 0; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.3);
  color: var(--text); font: inherit; }
.kzo-q[hidden] { display: none; }
.kzo-list { overflow-y: auto; padding: 4px 6px 6px; min-height: 40px; }
.kzo-sec { margin: 9px 8px 4px; font: 600 10.5px "Segoe UI", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kzo-row { display: flex; align-items: stretch; gap: 4px; border-radius: 9px; }
.kzo-row.is-on { background: rgba(232, 200, 121, 0.12); }
.kzo-go { flex: 1; min-width: 0; display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: center; text-align: left; padding: 6px 8px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.kzo-go:hover, .kzo-open:hover { background: rgba(255, 255, 255, 0.08); }
.kzo-dot { width: 9px; height: 9px; border-radius: 50%; grid-row: span 2; }
.kzo-dot.is-game { background: #5ad17a; box-shadow: 0 0 0 3px rgba(90, 209, 122, 0.18); }
.kzo-dot.is-app { background: #8b949c; }
.kzo-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kzo-name em { font-style: normal; font-weight: 400; color: var(--muted); }
.kzo-where { grid-column: 2; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kzo-open { flex: none; width: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.kzo-empty { margin: 14px 10px; color: var(--muted); }
.kzo-foot { padding: 8px 14px 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 11.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 720px) { #kz-online-pane { left: 8px !important; right: 8px; width: auto !important; max-height: 55vh; } }

/* staff: a player's full account, sliding out over the map */
#kz-account-drawer { position: fixed; z-index: 5200; top: 0; right: 0; bottom: 0; width: min(780px, 100vw); display: flex; flex-direction: column;
  background: #0e1112; border-left: 1px solid var(--gold-line); box-shadow: -18px 0 60px rgba(0, 0, 0, 0.6); animation: kza-in 0.18s ease-out; }
@keyframes kza-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.kza-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: var(--text); }
.kza-head b { flex: 1; min-width: 0; font: 700 16px "Cinzel", "Palatino Linotype", Georgia, serif; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kza-link { color: var(--muted); font: 12px "Segoe UI", sans-serif; text-decoration: none; white-space: nowrap; }
.kza-link:hover { color: var(--text); text-decoration: underline; }
.kza-frame { flex: 1; width: 100%; border: 0; background: #0e1112; }
