:root {
  color-scheme: dark;
  --bg: #11130f;
  --surface: #171b17;
  --panel: #1d231e;
  --panel-2: #242c26;
  --panel-3: #111711;
  --line: #3b463e;
  --line-soft: #2a332c;
  --text: #f1f4ee;
  --muted: #a9b4a9;
  --accent: #62bf7d;
  --accent-strong: #8ee39e;
  --gold: #e7c15b;
  --danger: #e15f4f;
  --blue: #6aa8e8;
  --input: #0d130f;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(180deg, rgba(98, 191, 125, 0.08), transparent 280px),
    linear-gradient(90deg, rgba(231, 193, 91, 0.05), transparent 45%),
    var(--bg);
}

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

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: #62705f;
  background: #2c352e;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="color"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--input);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
input[type="color"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 191, 125, 0.14);
}

a {
  color: inherit;
}

.wide-btn {
  width: 100%;
}

.primary-btn {
  border-color: rgba(98, 191, 125, 0.72);
  background: var(--accent);
  color: #08120b;
  font-weight: 800;
}

.primary-btn:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.danger-btn {
  border-color: rgba(225, 95, 79, 0.58);
  background: rgba(225, 95, 79, 0.1);
  color: #ffc2b9;
}

.panel-title {
  display: block;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
  line-height: 1.42;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark.full {
  gap: 14px;
}

.brand-logo-frame {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 193, 91, 0.55);
  border-radius: 8px;
  background: #0c100c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.brand-mark.full .brand-logo-frame {
  width: 58px;
  height: 58px;
}

.brand-logo-frame img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.brand-text strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.brand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.brand-links a,
.admin-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.brand-links a:hover,
.admin-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.home-shell,
.join-dialog,
.admin-shell {
  min-height: 100dvh;
  padding: 22px;
}

.home-shell {
  display: grid;
  place-items: center;
}

.home-layout {
  width: min(1160px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.96fr);
  gap: 16px;
  align-items: stretch;
}

.home-panel,
.promo-card,
.join-card,
.admin-hero,
.admin-login,
.admin-panel,
.admin-room-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 35, 30, 0.94);
  box-shadow: var(--shadow);
}

.home-panel {
  min-height: 430px;
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 24px;
}

.home-copy h1,
.admin-heading h1,
.join-card h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: 0;
}

.home-copy p,
.admin-heading p,
.join-card p,
.promo-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.home-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.home-info {
  display: grid;
  gap: 12px;
}

.promo-card {
  padding: 18px;
}

.promo-card h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

.promo-links,
.admin-links,
.compact-links,
.side-links,
.mini-links {
  margin-top: 12px;
}

.tool-notes {
  display: grid;
  gap: 9px;
}

.tool-notes div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 13px;
  background: rgba(17, 23, 17, 0.72);
}

.tool-notes strong {
  font-size: 14px;
}

.tool-notes span {
  color: var(--muted);
  font-size: 13px;
}

.join-dialog {
  display: grid;
  place-items: center;
}

.join-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
}

.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 304px;
  align-items: stretch;
  overflow: hidden;
  background: #11140f;
}

.side-panel,
.tools-panel {
  height: 100dvh;
  min-height: 0;
  padding: 14px;
  background: rgba(29, 35, 30, 0.96);
  overflow: auto;
  overscroll-behavior: contain;
}

.side-panel {
  border-right: 1px solid var(--line);
}

.tools-panel {
  border-left: 1px solid var(--line);
}

.panel-section {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.panel-section:first-child {
  padding-top: 0;
}

.panel-section:last-child {
  border-bottom: 0;
}

.brand-section p {
  margin: 10px 0 0;
}

.room-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.connection-line {
  margin-top: 8px;
}

.status,
.topbar-meta,
.board-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
}

.status-dot.online {
  background: var(--accent);
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.copy-row input {
  font-size: 13px;
}

.participants {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.participant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 8px 9px;
  background: var(--panel-3);
}

.participant span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge,
.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #2d352f;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-badge.commander {
  background: rgba(231, 193, 91, 0.16);
  color: var(--gold);
}

.participant-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.participant-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-ping-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ping-color, var(--gold));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ping-color, var(--gold)) 18%, transparent);
}

.participant-role-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.participant-role-select {
  width: 100%;
  min-width: 112px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.participant-ping-permission {
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.participant-ping-permission.active {
  border-color: color-mix(in srgb, var(--ping-color, var(--gold)) 64%, var(--line-soft));
  background: color-mix(in srgb, var(--ping-color, var(--gold)) 18%, transparent);
  color: var(--text);
}

.participant-ping-permission.global {
  opacity: 0.72;
}

.role-badge span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
}

.role-badge.participant {
  background: rgba(77, 163, 255, 0.13);
  color: #9dceff;
}

.role-badge.observer {
  background: rgba(169, 180, 169, 0.12);
  color: #d7ddd5;
}

.participant.role-observer {
  border-color: rgba(169, 180, 169, 0.2);
  background: rgba(24, 28, 25, 0.68);
}
.status-badge.online {
  background: rgba(98, 191, 125, 0.15);
  color: var(--accent-strong);
}

.status-badge.idle {
  background: rgba(169, 180, 169, 0.12);
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  color: var(--text);
  line-height: 1.35;
}

.toggle-row input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 0;
  accent-color: var(--accent);
}

.room-settings-panel {
  padding: 10px 0;
}

.settings-drawer {
  display: grid;
}

.settings-drawer > summary {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  user-select: none;
}

.settings-drawer > summary::-webkit-details-marker {
  display: none;
}

.settings-summary-main {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
}

.settings-summary-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--gold);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.settings-drawer[open] .settings-chevron {
  transform: rotate(180deg);
  border-color: rgba(231, 193, 91, 0.52);
  background: rgba(231, 193, 91, 0.08);
}

.settings-drawer-body {
  display: grid;
  gap: 0;
  padding-top: 10px;
}

.settings-group {
  padding: 12px 2px 10px;
  border-top: 1px solid var(--line-soft);
}

.settings-group:first-child {
  border-top: 0;
  padding-top: 4px;
}

.settings-group .panel-title {
  margin-bottom: 8px;
}

.settings-group .toggle-row {
  margin: 8px 0;
}

.mini-promo {
  display: grid;
  gap: 5px;
}

.mini-promo strong {
  color: var(--gold);
  font-size: 14px;
}

.mini-promo span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.board-area {
  min-width: 0;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: start;
  overflow: hidden;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 22, 18, 0.98);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  position: relative;
  z-index: 2;
}

.topbar-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.topbar-title strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title span {
  color: var(--muted);
  font-size: 13px;
}

.topbar-meta {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.topbar-links {
  justify-content: flex-end;
}

.board-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: start center;
  align-content: start;
  padding: 10px 12px 12px;
  overflow: auto;
  overscroll-behavior: contain;
}

.canvas-frame {
  position: relative;
  width: min(100%, calc(100dvh - 82px), 900px);
  aspect-ratio: 1 / 1;
  border: 1px solid #69786c;
  border-radius: 8px;
  background: #22291f;
  box-shadow: var(--shadow);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

canvas.pan-mode {
  cursor: grab;
}

canvas.is-panning {
  cursor: grabbing;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-btn.active,
.segmented-control button.active {
  border-color: var(--accent);
  background: rgba(98, 191, 125, 0.16);
  color: var(--accent-strong);
}

.ping-log-panel {
  display: grid;
  gap: 9px;
}

.ping-log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ping-log-head .panel-title {
  margin-bottom: 2px;
}

.ping-log-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ping-clear-btn {
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ping-clear-btn:not(:disabled):hover {
  color: var(--text);
}

.ping-log-count {
  min-width: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.ping-log-list {
  display: grid;
  gap: 7px;
  max-height: 188px;
  overflow: auto;
  padding-right: 2px;
}

.ping-log-item {
  --ping-color: var(--gold);
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ping-color);
  border-radius: 8px;
  padding: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ping-color) 10%, transparent), rgba(17, 23, 17, 0.72));
}

.ping-log-item.own {
  border-color: color-mix(in srgb, var(--ping-color) 48%, var(--line-soft));
}

.ping-log-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--ping-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ping-color) 17%, transparent);
}

.ping-log-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ping-log-main strong,
.ping-log-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ping-log-main strong {
  color: var(--text);
  font-size: 12px;
}

.ping-log-main span {
  color: var(--muted);
  font-size: 11px;
}

.ping-log-square {
  border-radius: 6px;
  padding: 4px 7px;
  background: rgba(7, 12, 10, 0.52);
  color: var(--ping-color);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.ping-log-empty {
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.history-tools {
  display: grid;
  gap: 9px;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.history-grid button {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 48px;
  padding: 8px 9px;
}

.history-grid small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.history-grid button:not(:disabled):hover small {
  color: var(--text);
}

#history-note {
  margin: 0;
}

.color-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.color-btn {
  position: relative;
  min-height: 42px;
  padding: 0;
}

.color-btn::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 5px;
  background: var(--swatch);
}

.color-btn.active {
  border-color: #f1f4ee;
}

.selected-box {
  display: grid;
  gap: 8px;
}

.rotation-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
}

.rotation-value {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input);
  color: var(--muted);
}

.map-library {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.map-select {
  height: 178px;
  overflow: auto;
}

.map-select option {
  padding: 7px 8px;
}

.map-preview-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0d130f;
  overflow: hidden;
}

.map-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-preview-box img:not([src]) {
  display: none;
}

.map-upload-grid {
  grid-template-columns: 1fr;
}

.map-upload-grid button {
  white-space: normal;
}

.map-view-controls {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  margin-top: 8px;
}

#map-upload-note {
  margin: 0;
}

#map-upload-note.error {
  color: #ffb2a8;
}

.snapshots-panel {
  display: grid;
  gap: 10px;
}

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

.snapshot-count {
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.snapshot-create {
  display: grid;
  gap: 8px;
}

.snapshots-list {
  display: grid;
  gap: 8px;
  max-height: 270px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.snapshot-card,
.snapshot-empty {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 9px;
  background: var(--panel-3);
}

.snapshot-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.snapshot-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.snapshot-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-main span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.snapshot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.snapshot-meta span {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(169, 180, 169, 0.16);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.snapshot-actions button {
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  font-size: 12px;
}

#snapshots-note {
  margin: 0;
}

#snapshots-note.error {
  color: #ffb2a8;
}

.file-input {
  display: none;
}


.offline-banner {
  position: fixed;
  left: 50%;
  top: max(10px, env(safe-area-inset-top));
  z-index: 30;
  width: min(560px, calc(100vw - 24px));
  transform: translateX(-50%);
  border: 1px solid rgba(231, 193, 91, 0.58);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(27, 24, 15, 0.96);
  color: #ffe6a1;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

html.is-offline .topbar {
  border-bottom-color: rgba(231, 193, 91, 0.42);
}

html.is-offline canvas {
  cursor: grab;
}

.toast-layer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(18, 22, 18, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.admin-shell {
  display: grid;
  align-content: start;
  gap: 16px;
}

.admin-hero {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0 auto;
  padding: 18px;
}

.admin-heading h1 {
  font-size: 30px;
}

.admin-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  margin: 0 auto;
}

.admin-login,
.admin-panel {
  padding: 16px;
}

.admin-login {
  align-self: start;
  display: grid;
  gap: 12px;
}

.admin-toolbar,
.cleanup-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.admin-toolbar > div {
  display: grid;
  gap: 4px;
}

.admin-toolbar strong {
  font-size: 18px;
}

.cleanup-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.cleanup-row label {
  width: min(220px, 100%);
}

.admin-room-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-room-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.admin-room-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-room-card header div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-room-card header strong,
.admin-room-card header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-room-card header span {
  color: var(--muted);
  font-size: 13px;
}

.admin-room-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.admin-room-card dl div {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 8px;
  background: var(--panel-3);
}

.admin-room-card dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-room-card dd {
  margin: 0;
  font-size: 13px;
}

.admin-room-card p {
  margin: 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 278px minmax(0, 1fr);
    align-items: start;
    overflow: visible;
  }

  .side-panel,
  .tools-panel,
  .board-area {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .tools-panel {
    min-height: auto;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .tools-panel .panel-section {
    padding: 0;
    border-bottom: 0;
  }

  .map-tools,
  .tools-ad {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .home-shell,
  .join-dialog,
  .admin-shell {
    padding: 12px;
  }

  .home-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .board-area {
    order: 1;
    min-height: auto;
  }

  .tools-panel {
    order: 2;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .side-panel {
    order: 3;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .side-panel .panel-section,
  .tools-panel .panel-section {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 12px;
    background: rgba(17, 23, 17, 0.72);
  }

  .brand-section,
  #permissions-section,
  .panel-ad,
  .map-tools,
  .tools-ad {
    grid-column: 1 / -1;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    align-items: flex-start;
    flex-direction: column;
    padding: 10px;
  }

  .topbar-meta {
    width: 100%;
    justify-content: space-between;
  }

  .board-wrap {
    place-items: start center;
    padding: 8px;
    overflow: visible;
  }

  .canvas-frame {
    width: min(100%, calc(100dvh - 155px), 820px);
  }

  .map-library {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .map-library .segmented-control,
  .map-library #map-search,
  .map-library #map-filter,
  .map-library #map-select,
  .map-library #select-library-map,
  .map-library #map-meta {
    grid-column: 1 / -1;
  }

  .map-preview-box {
    grid-column: 1 / -1;
    max-height: 220px;
  }

  .admin-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  button,
  input[type="text"],
  input[type="password"],
  input[type="number"],
  select {
    min-height: 46px;
  }

  .home-panel,
  .promo-card,
  .join-card,
  .admin-login,
  .admin-panel {
    padding: 16px;
  }

  .home-copy h1,
  .join-card h1 {
    font-size: 29px;
  }

  .admin-heading h1 {
    font-size: 26px;
  }

  .side-panel,
  .tools-panel,
  .tool-grid,
  .copy-row,
  .cleanup-row,
  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .side-panel,
  .tools-panel {
    display: grid;
  }

  .cleanup-row,
  .admin-toolbar,
  .topbar-meta,
  .board-status {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-links a {
    flex: 1 1 calc(50% - 7px);
  }

  .canvas-frame {
    width: calc(100vw - 20px);
  }

  .map-select {
    height: 150px;
  }

  .admin-room-list,
  .admin-room-card dl {
    grid-template-columns: 1fr;
  }

  .offline-banner {
    top: max(8px, env(safe-area-inset-top));
    width: calc(100vw - 20px);
    padding: 8px 10px;
    font-size: 12px;
  }

  .toast-layer {
    right: 10px;
    bottom: 10px;
  }
}
.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.form-error {
  margin: 0;
  border: 1px solid rgba(225, 95, 79, 0.48);
  border-radius: 7px;
  padding: 10px 12px;
  background: rgba(225, 95, 79, 0.12);
  color: #ffd1ca;
  font-size: 13px;
}

.room-security-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--panel-3);
}

.room-security-status span,
.room-security-status strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-security-status strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.room-password-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.password-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.password-actions button {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

.admin-login-view {
  min-height: calc(100dvh - 44px);
  display: grid;
  place-items: center;
}

.admin-login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(29, 35, 30, 0.96);
  box-shadow: var(--shadow);
}

.admin-login-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: 0;
}

.admin-login-card p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.48;
}

.admin-dashboard {
  width: min(1240px, 100%);
  display: grid;
  gap: 14px;
  margin: 0 auto;
}

.admin-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(29, 35, 30, 0.94);
  box-shadow: var(--shadow);
}

.admin-dashboard-head > div:first-child {
  display: grid;
  gap: 10px;
}

.admin-dashboard-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.admin-actions,
.admin-room-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-captcha {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

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

.captcha-box {
  min-height: 96px;
  overflow: hidden;
}

.admin-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 116px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.65);
  font-size: 0.88rem;
  text-decoration: none;
}

.admin-action-link:hover {
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
}

.admin-actions button {
  min-width: 116px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat-grid div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  background: rgba(17, 23, 17, 0.82);
}

.admin-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-stat-grid strong {
  font-size: 28px;
  line-height: 1;
}

.admin-control-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(160px, 0.8fr) minmax(150px, 0.7fr) minmax(160px, auto);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(29, 35, 30, 0.9);
}

.admin-room-card.active-room {
  border-color: rgba(98, 191, 125, 0.5);
}

.admin-room-card.empty-room {
  opacity: 0.82;
}

.admin-room-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.admin-room-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-room-actions a:hover {
  border-color: var(--accent);
}

.room-panel .brand-section {
  padding-bottom: 10px;
}

.topbar-meta {
  max-width: 100%;
}

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

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

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-control-bar {
    grid-template-columns: 1fr;
  }

  .room-panel .brand-section p {
    margin-bottom: 0;
  }
}

@media (max-width: 560px) {
  .admin-login-card {
    padding: 16px;
  }

  .admin-login-card h1,
  .admin-dashboard-head h1 {
    font-size: 27px;
  }

  .admin-stat-grid,
  .admin-room-actions {
    grid-template-columns: 1fr;
  }

  .topbar-title strong {
    white-space: normal;
  }
}
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.craft-signature {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(169, 183, 195, 0.84);
}

.craft-signature a {
  color: rgba(237, 244, 247, 0.82);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 191, 90, 0.34);
}

.craft-signature a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.craft-signature code {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(232, 191, 90, 0.92);
  font: 700 11px/1.2 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: nowrap;
}

.home-footer,
.join-footer,
.admin-dashboard-footer {
  width: min(1160px, 100%);
  margin: 14px auto 0;
}

.admin-login-footer,
.side-version-footer {
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.admin-dashboard-footer {
  justify-content: flex-end;
}

.side-version-footer {
  display: grid;
  justify-content: stretch;
  gap: 8px;
  margin-top: 10px;
}

.side-footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.side-footer-product {
  min-width: 0;
  color: rgba(222, 232, 225, 0.78);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-footer-credit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: rgba(169, 183, 195, 0.8);
  font-size: 11px;
  line-height: 1.35;
}

.side-footer-credit a {
  color: rgba(237, 244, 247, 0.82);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 191, 90, 0.28);
}

.side-footer-credit a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.side-footer-line {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(232, 191, 90, 0.18);
  border-radius: 999px;
  background: rgba(232, 191, 90, 0.075);
  color: rgba(232, 191, 90, 0.9);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-version-badge {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.version-badge {
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 10px;
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.version-badge:hover {
  border-color: var(--accent);
  color: var(--text);
}

.admin-version-badge {
  min-width: auto;
  min-height: 36px;
}

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

.version-modal-dialog {
  width: min(640px, 100%);
  max-height: min(82dvh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(29, 35, 30, 0.98);
  box-shadow: var(--shadow);
  outline: none;
}

.version-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 16px;
  background: rgba(29, 35, 30, 0.98);
}

.version-modal-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.icon-close {
  flex: 0 0 auto;
  width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

.version-entry-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.version-entry {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 13px;
  background: rgba(17, 23, 17, 0.72);
}

.version-entry header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.version-entry strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.version-entry header span {
  color: var(--muted);
  font-size: 12px;
}

.version-entry ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.45;
}

.version-entry li::marker {
  color: var(--gold);
}

@media (max-width: 860px) {
  .home-footer,
  .join-footer,
  .admin-dashboard-footer {
    width: 100%;
  }

  .admin-dashboard-footer {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .app-footer {
    flex-wrap: wrap;
  }

  .craft-signature {
    width: 100%;
    font-size: 11px;
  }

  .craft-signature code {
    white-space: normal;
    text-align: center;
  }

  .version-modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .version-modal-dialog {
    max-height: 86dvh;
  }

  .version-modal-head h2 {
    font-size: 21px;
  }
}
textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.42;
}

.chat-panel {
  display: grid;
  gap: 10px;
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chat-head .panel-title {
  margin-bottom: 3px;
}

.chat-head button {
  position: relative;
  min-height: 38px;
  padding: 7px 10px;
  white-space: nowrap;
}

.chat-unread {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff4f2;
  font-size: 11px;
  font-weight: 900;
}

.chat-body {
  display: grid;
  gap: 9px;
}

.chat-panel.collapsed .chat-body {
  display: none;
}

.chat-messages {
  height: min(30dvh, 260px);
  min-height: 156px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: var(--input);
}

.chat-empty {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.chat-message {
  position: relative;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 9px 34px 9px 9px;
  background: rgba(255, 255, 255, 0.035);
}

.chat-message.own {
  border-color: rgba(98, 191, 125, 0.38);
  background: rgba(98, 191, 125, 0.08);
}

.chat-message header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.chat-message strong {
  min-width: 0;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.chat-message p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  min-height: 24px;
  border-radius: 6px;
  padding: 0;
  color: #ffc2b9;
  font-size: 18px;
  line-height: 1;
}

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

.chat-form-row {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(110px, 1fr);
  gap: 8px;
  align-items: center;
}

.chat-form-row .primary-btn {
  width: 100%;
}

#chat-note {
  margin: 0;
}

@media (max-width: 1180px) {
  .chat-panel {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .chat-panel {
    grid-column: 1 / -1;
  }

  .chat-messages {
    height: min(34dvh, 280px);
  }
}

@media (max-width: 560px) {
  textarea {
    min-height: 88px;
  }

  .chat-messages {
    min-height: 190px;
  }

  .chat-form-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
.drawing-tools {
  display: grid;
  gap: 10px;
}

.drawing-tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawing-tool-grid button:nth-child(5),
.drawing-tool-grid button:nth-child(6) {
  grid-column: span 1;
}

.draw-settings {
  display: grid;
  gap: 10px;
}

.draw-settings label {
  min-width: 0;
}

.draw-settings input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.draw-color-field {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 8px;
  align-items: end;
}

.draw-color-field .panel-title {
  margin-bottom: 0;
}

input[type="color"] {
  min-height: 44px;
  padding: 4px;
  cursor: pointer;
}

.draw-text-field input {
  font-size: 13px;
}

#drawing-note {
  margin: 0;
}

@media (max-width: 1180px) {
  .ping-log-panel,
  .history-tools,
  .drawing-tools {
    grid-column: span 2;
  }

  .draw-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draw-text-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .ping-log-panel,
  .history-tools,
  .drawing-tools {
    grid-column: 1 / -1;
  }

  .drawing-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .draw-settings,
  .drawing-tool-grid,
  .history-grid,
  .draw-color-field {
    grid-template-columns: 1fr;
  }

  .ping-log-list {
    max-height: 220px;
  }
}

@media (max-width: 560px) {
  .participant {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .participant-role-control {
    justify-content: flex-start;
  }

  .participant-role-select {
    min-width: 0;
    flex: 1 1 150px;
  }

  .participant-ping-permission {
    flex: 0 0 auto;
  }
}

.compact-map-toggle,
.offline-queue-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.compact-map-toggle.active,
.offline-queue-pill:not([hidden]) {
  border-color: rgba(231, 193, 91, 0.62);
  background: rgba(231, 193, 91, 0.1);
  color: var(--gold);
}

.offline-queue-pill.has-conflicts {
  border-color: rgba(225, 95, 79, 0.72);
  color: #ffc2b9;
}

@media (max-width: 860px) {
  html.compact-map-mode .app-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
  }

  html.compact-map-mode .side-panel,
  html.compact-map-mode .tools-panel {
    display: none;
  }

  html.compact-map-mode .board-area {
    min-height: 100dvh;
  }

  html.compact-map-mode .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  html.compact-map-mode .board-wrap {
    min-height: calc(100dvh - 88px);
    padding: 6px;
    place-items: center;
  }

  html.compact-map-mode .canvas-frame {
    width: min(calc(100vw - 12px), calc(100dvh - 100px));
  }
}


.admin-ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-ops-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 29, 0.68);
}

.admin-ops-card strong {
  font-size: 18px;
}

.admin-ops-card p {
  margin: 0;
}

.admin-ops-card button {
  width: 100%;
}

.admin-ops-card.danger-zone {
  border-color: rgba(225, 95, 79, 0.36);
}

.admin-audit-panel {
  gap: 14px;
}

.admin-ops-columns {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr);
  gap: 14px;
}

.admin-ops-columns h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.admin-log-row {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

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

.admin-log-row span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 860px) {
  .admin-ops-grid,
  .admin-ops-columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
  }

  .topbar-title {
    gap: 2px;
  }

  .topbar-title strong {
    font-size: 15px;
  }

  .topbar-title span {
    font-size: 12px;
  }

  .topbar-meta {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .board-status {
    display: none;
  }

  .compact-map-toggle,
  .offline-queue-pill {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .board-wrap {
    padding-top: 6px;
  }
}
