
#domain-tiles {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  padding:2px 8px 4px;
}
.domain-tile {
  width:18px;
  height:18px;
  border:1px solid rgba(0,0,0,0.35);
  border-radius:3px;
  cursor:pointer;
  display:inline-block;
  box-sizing:border-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.domain-tile:hover {
  transform: translateY(-1px);
}
.domain-tile.active {
  outline:2px solid #111827;
  outline-offset:2px;
}

#marker-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 420px;
  z-index: 2000;
  transform: translateX(-420px);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  pointer-events: none;
}
#marker-panel.open {
  transform: translateX(0);
}
#marker-panel-inner {
  width: 420px;
  height: 100%;
  background: #f5f3ef;
  border-right: 1px solid #ccc8bf;
  box-shadow: 3px 0 18px rgba(0,0,0,0.13);
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: all;
  font-family: Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 13px;
  color: #1a1814;
  padding: 16px 16px 40px;
  box-sizing: border-box;
}
#marker-panel-tab {
  position: absolute;
  left: 420px;
  top: 20%;
  transform: translateY(-50%);
  width: 22px;
  height: 140px;
  background: #1a1814;
  border-radius: 0 4px 4px 0;
  border: #64EB52 solid 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: background 0.15s;
  flex-shrink: 0;
}
#marker-panel-tab:hover { background: #374151; }
#marker-panel-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #f5f3ef;
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  user-select: none;
  white-space: nowrap;
}
/* Panel header */
#marker-panel-inner .mp-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ccc8bf;
}
#marker-panel-inner .mp-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1814;
  letter-spacing: -0.2px;
  margin-bottom: 3px;
}
#marker-panel-inner .mp-sub {
  font-size: 11px;
  color: #7a746a;
  font-weight: 300;
}
/* Filter bar inside panel */
#marker-panel-inner .mp-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
#marker-panel-inner .mp-filter-btn {
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid #ccc8bf;
  background: #fff;
  color: #7a746a;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: 0.2px;
}
#marker-panel-inner .mp-filter-btn:hover { border-color: #1a1814; color: #1a1814; }
#marker-panel-inner .mp-filter-btn.active { background: #1a1814; color: #f5f3ef; border-color: #1a1814; }
/* Cat label */
#marker-panel-inner .mp-cat-label {
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #a8a29a;
  margin-bottom: 8px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#marker-panel-inner .mp-cat-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0dcd4;
}
/* Marker cards */
#marker-panel-inner .mp-card {
  background: #fff;
  border: 1px solid #e0dcd4;
  border-radius: 6px;
  padding: 11px 13px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
#marker-panel-inner .mp-card:hover {
  border-color: #ccc8bf;
  box-shadow: 0 1px 5px rgba(0,0,0,0.06);
}
#marker-panel-inner .mp-card.open {
  border-color: #ccc8bf;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
#marker-panel-inner .mp-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 5px;
}
#marker-panel-inner .mp-sym {
  font-size: 18px;
  line-height: 1;
  min-width: 24px;
  text-align: center;
}
#marker-panel-inner .mp-code {
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  font-size: 10px;
  color: #a8a29a;
  min-width: 28px;
  letter-spacing: 0.3px;
}
#marker-panel-inner .mp-name {
  font-size: 12px;
  font-weight: 500;
  color: #1a1814;
  flex: 1;
  letter-spacing: -0.1px;
}
#marker-panel-inner .mp-tag {
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 500;
}
/* tag colours — mirror taxonomy vars */
.mp-tag-origin   { background:#edf7f1; border:1px solid #a8dfc0; color:#1a5c38; }
.mp-tag-distort  { background:#fdf0ee; border:1px solid #f5b8b0; color:#8c2a1e; }
.mp-tag-link     { background:#eaf1fc; border:1px solid #aac6f0; color:#1a4080; }
.mp-tag-struct   { background:#f0eefe; border:1px solid #c4baf5; color:#3c2e8a; }
.mp-tag-suppress { background:#fef5e7; border:1px solid #f0cc85; color:#7a4a08; }
.mp-tag-outcome  { background:#f2f2f2; border:1px solid #c8c4bc; color:#3a3830; }
#marker-panel-inner .mp-def {
  font-size: 11px;
  color: #7a746a;
  line-height: 1.6;
  padding-left: 33px;
}
#marker-panel-inner .mp-example {
  display: none;
  font-size: 10.5px;
  color: #a8a29a;
  line-height: 1.65;
  margin-top: 9px;
  padding: 9px 11px;
  background: #f9f8f5;
  border-left: 2px solid #ccc8bf;
  border-radius: 0 4px 4px 0;
  margin-left: 33px;
}
#marker-panel-inner .mp-card.open .mp-example { display: block; }
#marker-panel-inner .mp-ex-label {
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a8a29a;
  margin-bottom: 4px;
  font-weight: 500;
}
#marker-panel-inner .mp-hint {
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  font-size: 9px;
  color: #a8a29a;
  margin-top: 4px;
  padding-left: 33px;
  letter-spacing: 0.3px;
}
#marker-panel-inner .mp-card.open .mp-hint { display: none; }

#guide-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 420px;
  z-index: 2100;
  transform: translateX(-420px);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  pointer-events: none;
}
#guide-panel.open { transform: translateX(0); }
#guide-panel-inner {
  width: 420px;
  min-height: 0;
  background: #f5f3ef;
  border-right: 1px solid #ccc8bf;
  box-shadow: 3px 0 18px rgba(0,0,0,0.13);
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: all;
  font-family: Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 13px;
  color: #1a1814;
  padding: 16px 10px 40px 28px;
  box-sizing: border-box;
}
#guide-panel-tab {
  position: absolute;
  left: 416px;
  top: 40%;
  transform: translateY(-50%);
  width: 22px;
  height: 140px;
  background: #1a1814;
  border: #574DE8 solid 1px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  transition: background 0.15s;
  flex-shrink: 0;
}
#guide-panel-tab:hover { background: #374151; }
#guide-panel-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #f5f3ef;
  font-family: ui-monospace, 'Courier New', Courier, monospace;
  user-select: none;
  white-space: nowrap;
}
#guide-panel-inner .mp-header { position: sticky; top: 0; z-index: 30; background: #f5f3ef; padding-top: 16px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #ccc8bf; }
#guide-panel-inner .mp-title { font-size: 14px; font-weight: 500; color: #1a1814; letter-spacing: -0.2px; margin-bottom: 3px; }
#guide-panel-inner .mp-sub { font-size: 11px; color: #7a746a; font-weight: 300; }
#guide-panel-inner .mp-filters { position: sticky; top: 56px; z-index: 29; background: #f5f3ef; display: flex; gap: 5px; flex-wrap: wrap; padding: 8px 0 10px 0; border-bottom: 1px solid #e0dcd4; }
#guide-panel-inner .mp-filter-btn { font-family: ui-monospace, 'Courier New', Courier, monospace; font-size: 10px; padding: 4px 10px; border-radius: 3px; border: 1px solid #ccc8bf; background: #fff; color: #7a746a; cursor: pointer; transition: all 0.12s; letter-spacing: 0.2px; }
#guide-panel-inner .mp-filter-btn:hover { border-color: #1a1814; color: #1a1814; }
#guide-panel-inner .mp-filter-btn.active { background: #1a1814; color: #f5f3ef; border-color: #1a1814; }
.guide-view { display: none; }
.guide-view.active { display: block; }
#guide-panel-inner .guide-domain-list { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
#guide-panel-inner .guide-domain-row { display:grid; grid-template-columns: 18px 88px 1fr; align-items:start; column-gap:10px; row-gap:2px; padding:8px 10px; background:#fff; border:1px solid #d8d3ca; border-radius:6px; }
#guide-panel-inner .guide-domain-chip { display:inline-block; width:14px; height:14px; min-width:14px; min-height:14px; margin-top:2px; border:1px solid rgba(0,0,0,0.35); border-radius:3px; box-sizing:border-box; }
#guide-panel-inner .guide-domain-name { display:block; font-size:12px; font-weight:600; color:#1a1814; line-height:1.35; }
#guide-panel-inner .guide-domain-text { display:block; font-size:11px; color:#6f685d; line-height:1.45; }

@media print {
  #marker-panel, #guide-panel { display: none !important; }
}