:root {
  --bg-app: #0d1015;
  --bg-panel: #151a21;
  --bg-panel-elevated: #1b222c;
  --bg-card: #202733;
  --bg-card-hover: #283140;
  --border-subtle: #2b3545;
  --border-focus: #e09f3e;
  --text-primary: #f0f4f8;
  --text-secondary: #9fb0c2;
  --text-muted: #687787;
  --accent-gold: #e09f3e;
  --accent-gold-dim: rgba(224, 159, 62, 0.16);
  --accent-green: #2ea043;
  --accent-green-bright: #3fb950;
  --accent-red: #f85149;
  --accent-blue: #58a6ff;
  --cat-trench: #c98a4b;
  --cat-bunker: #7994b0;
  --cat-ground: #6e8559;
  --cat-hulldown: #b86f52;
  --cat-extra: #9b7ede;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
}

/* TOP HEADER */
.app-header {
  min-height: 50px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 5px 12px;
  gap: 8px;
  z-index: 20;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3a2d1d, #1f2630);
  border: 1px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 12px;
}

.brand-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.segmented-group {
  display: flex;
  background: var(--bg-app);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.seg-btn.active {
  background: var(--accent-gold);
  color: #0f1216;
}

.seg-badge {
  font-size: 10px;
  padding: 0px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-mono);
}

.grid-size-box {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-app);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.grid-size-box label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.dim-input {
  width: 42px;
  background: var(--bg-panel-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 2px 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.dim-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: #46556b;
}

.btn-primary {
  background: var(--accent-gold);
  color: #101318;
  border-color: var(--accent-gold);
}

.btn-primary:hover {
  background: #ebb052;
  border-color: #ebb052;
}

.btn-accent-outline {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border-color: rgba(224, 159, 62, 0.45);
}

.btn-accent-outline:hover {
  background: rgba(224, 159, 62, 0.26);
}

.btn-danger-outline {
  color: #ff7b72;
  border-color: rgba(248, 81, 73, 0.35);
}

.btn-danger-outline:hover {
  background: rgba(248, 81, 73, 0.15);
}

.btn-sm {
  padding: 3px 7px;
  font-size: 11px;
}

.create-board-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.create-board-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-app);
  padding: 3px 9px 3px 4px;
  border-radius: 6px;
  border: 1px solid rgba(224, 159, 62, 0.35);
}

.create-subsets-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.create-opt-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.create-opt-label:hover {
  color: var(--text-primary);
}

.create-opt-label input {
  accent-color: var(--accent-gold);
  cursor: pointer;
}

/* 2-COLUMN MAIN LAYOUT: LEFT TABBED DOCK + EXPANSIVE BOARD AREA */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100vw;
  overflow: hidden;
}

.sidebar-dock {
  width: 350px;
  min-width: 350px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: margin-left 0.2s ease;
  z-index: 15;
}

.sidebar-dock.collapsed {
  margin-left: -350px;
}

/* PRIMARY SIDEBAR TABS */
.dock-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-app);
  padding: 4px;
  gap: 3px;
  border-bottom: 1px solid var(--border-subtle);
}

.dock-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 7px 4px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.dock-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.dock-tab.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  box-shadow: inset 0 -2px 0 var(--accent-gold);
}

.dock-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.dock-pane.active {
  display: flex;
}

/* TAB 3: KICKSTARTER PANE & TOOLTIP */
.ks-pane-header {
  padding: 12px 14px;
  background: rgba(224, 159, 62, 0.08);
  border-bottom: 1px solid rgba(224, 159, 62, 0.22);
}

.ks-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.ks-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--accent-gold);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ks-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 4px;
}

/* Tooltip on Information Icon */
.info-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
}

.info-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 700;
  font-family: serif;
  font-style: italic;
  background: rgba(224, 159, 62, 0.15);
  transition: all 0.15s ease;
  user-select: none;
}

.info-tooltip-wrap:hover .info-circle,
.info-tooltip-wrap:focus-within .info-circle {
  background: var(--accent-gold);
  color: #121418;
  box-shadow: 0 0 10px rgba(224, 159, 62, 0.55);
}

.info-tooltip-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: -90px;
  width: 280px;
  background: #14181f;
  border: 1px solid rgba(224, 159, 62, 0.45);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 1000;
  pointer-events: none;
}

.info-tooltip-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 94px;
  width: 10px;
  height: 10px;
  background: #14181f;
  border-left: 1px solid rgba(224, 159, 62, 0.45);
  border-top: 1px solid rgba(224, 159, 62, 0.45);
  transform: rotate(45deg);
}

.info-tooltip-wrap:hover .info-tooltip-popover,
.info-tooltip-wrap:focus-within .info-tooltip-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* KS Pane Body & Cards */
.ks-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ks-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ks-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ks-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.ks-section-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.badge-gold {
  background: rgba(224, 159, 62, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(224, 159, 62, 0.35);
}

.badge-teal {
  background: rgba(112, 193, 179, 0.18);
  color: #70c1b3;
  border: 1px solid rgba(112, 193, 179, 0.35);
}

.ks-section-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

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

.ks-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ks-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.ks-card.comp:hover {
  border-color: #70c1b3;
}

.ks-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ks-card-name {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-primary);
}

.ks-card-badge {
  font-size: 10px;
  color: var(--accent-gold);
  font-weight: 600;
}

.ks-card-badge.comp {
  color: #70c1b3;
}

.ks-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
}

.ks-card-perms {
  color: var(--accent-gold);
  font-weight: 600;
}

.ks-card-perms.comp {
  color: #70c1b3;
}

.ks-card-btn {
  width: 100%;
  justify-content: center;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.ks-card-btn.comp {
  border-color: rgba(112, 193, 179, 0.4);
  color: #70c1b3;
}

.ks-card-btn.comp:hover {
  background: rgba(112, 193, 179, 0.15);
  border-color: #70c1b3;
}

/* TAB 1: TILE LIBRARY */
.palette-controls {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cat-tab {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cat-tab.active {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.subtype-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.subtype-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  cursor: pointer;
}

.subtype-pill.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.brush-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-app);
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.brush-bar span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.rot-pills {
  display: flex;
  gap: 3px;
}

.rot-pill {
  background: var(--bg-panel-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.rot-pill.active {
  background: var(--accent-gold);
  color: #101318;
  border-color: var(--accent-gold);
  font-weight: 700;
}

.palette-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  align-content: start;
}

.tile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 7px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.tile-card:hover {
  background: var(--bg-card-hover);
  border-color: #4f5f78;
}

.tile-card.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 1px var(--accent-gold);
  background: #262e3a;
}

.tile-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #12161c;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
}

.tile-card-used-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent-gold);
  color: #0f1216;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  z-index: 4;
}

.tile-card-flip-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(13, 16, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 5;
}

.tile-card-flip-btn:hover {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.tile-card-cat-dot {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 4;
}

.tile-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-card-ports {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.port-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

/* MINI SIDE-BY-SIDE DRAWER AT BOTTOM OF PALETTE */
.mini-compare-drawer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-panel-elevated);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

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

.mini-compare-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.mini-compare-thumb {
  width: 100%;
  max-width: 115px;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.mini-compare-lbl {
  font-size: 9.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* TAB 2: KIT LIST / MANIFEST */
.manifest-summary {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.summary-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 7px;
  text-align: center;
}

.summary-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.summary-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.manifest-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manifest-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.manifest-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.manifest-item:hover {
  border-color: var(--accent-blue);
}

.manifest-item-info {
  min-width: 0;
  flex: 1;
}

.manifest-item-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manifest-item-file {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qty-badge {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border: 1px solid rgba(224, 159, 62, 0.4);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.manifest-footer {
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-panel-elevated);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* DEDICATED TILE PREVIEW & SIDE-BY-SIDE COMPARE COLUMN */
.tile-preview-pane {
  width: 245px;
  min-width: 245px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: margin-left 0.2s ease, opacity 0.15s ease;
  z-index: 14;
}

.tile-preview-pane.collapsed {
  display: none;
}

.preview-pane-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-pane-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  min-width: 0;
  flex: 1;
}

.compare-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
}

.compare-card-viewport {
  width: 100%;
  max-width: 185px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  background: #10141a;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

/* EXPANSIVE BOARD WORKSPACE */
.workspace-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: radial-gradient(circle at center, #181f29 0%, #0b0e13 100%);
  overflow: hidden;
  position: relative;
}

.board-toolbar {
  height: 40px;
  background: rgba(21, 26, 33, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-pill strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.conn-status {
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.conn-status.ok {
  background: rgba(46, 160, 67, 0.16);
  color: #56d364;
  border: 1px solid rgba(46, 160, 67, 0.4);
}

.conn-status.warn {
  background: rgba(248, 81, 73, 0.16);
  color: #ff7b72;
  border: 1px solid rgba(248, 81, 73, 0.4);
}

.view-toggles {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-label input {
  accent-color: var(--accent-gold);
}

.board-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
}

.board-frame {
  margin: auto;
  flex-shrink: 0;
  background: #141920;
  border: 2px solid #354052;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.7);
  position: relative;
}

.board-compass {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.6px;
}

.board-grid {
  display: grid;
  gap: 4px;
  background: #0b0e12;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #262f3d;
}

.grid-cell {
  background: #171e28;
  border: 1px dashed #2e394a;
  border-radius: 4px;
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.1s ease, background 0.1s ease;
  overflow: hidden;
}

.grid-cell:hover {
  border-color: var(--accent-gold);
  background: #1d2633;
}

.grid-cell.drag-over {
  border: 2px solid var(--accent-gold);
  background: rgba(224, 159, 62, 0.18);
  z-index: 5;
}

.grid-cell.occupied {
  border-style: solid;
  border-color: #323e4f;
  cursor: pointer;
}

.grid-cell.selected-cell {
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(224, 159, 62, 0.35);
  z-index: 4;
}

.grid-cell.highlighted-tile {
  border: 2px solid var(--accent-blue);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.55);
  z-index: 4;
}

.cell-coord {
  position: absolute;
  top: 4px;
  left: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(159, 176, 194, 0.42);
  pointer-events: none;
  z-index: 3;
  text-shadow: 0 1px 2px #000;
}

.cell-pin-badge {
  position: absolute;
  top: 3px;
  left: 34px;
  font-size: 10px;
  line-height: 1;
  background: rgba(224, 159, 62, 0.22);
  border: 1px solid rgba(224, 159, 62, 0.55);
  color: var(--accent-gold);
  border-radius: 3px;
  padding: 1px 3px;
  pointer-events: none;
  z-index: 4;
}

.cell-empty-hint {
  font-size: 10.5px;
  color: rgba(104, 119, 135, 0.38);
  pointer-events: none;
}

.cell-svg-wrap {
  width: 100%;
  height: 100%;
  display: block;
}

.cell-label-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(10, 13, 18, 0.92), rgba(10, 13, 18, 0));
  padding: 10px 5px 3px 5px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}

.cell-tile-name {
  font-size: 10px;
  font-weight: 700;
  color: #e6edf3;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-rot-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--accent-gold);
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid rgba(224, 159, 62, 0.35);
}

.cell-actions {
  position: absolute;
  top: 3px;
  right: 3px;
  display: none;
  gap: 2px;
  z-index: 6;
}

.grid-cell.occupied:hover .cell-actions {
  display: flex;
}

.cell-act-btn {
  height: 21px;
  min-width: 21px;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(13, 16, 21, 0.88);
  color: var(--text-primary);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell-act-btn:hover {
  background: var(--accent-gold);
  color: #000;
}

.cell-act-btn.active-mode {
  background: var(--accent-blue);
  color: #000;
  border-color: var(--accent-blue);
}

.cell-act-btn.del:hover {
  background: var(--accent-red);
  color: #fff;
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #1f2937;
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 9px 15px;
  border-radius: 7px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65);
  font-size: 12px;
  font-weight: 600;
  z-index: 100;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* EDITION BADGES & MOBILE BANNER */
.edition-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* UNIFIED EDITION TOGGLE */
.edition-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #303c4f;
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}

.edition-toggle-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.edition-toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.edition-toggle-btn.active {
  background: #253347;
  color: #79c0ff;
  border: 1px solid #3d587c;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mobile-notice-banner {
  background: #151d2a;
  border-bottom: 1px solid #2f4569;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #d1dded;
  z-index: 100;
}

.notice-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: #fff;
}
