/*
  Map mobile boundary.
  This file is the only mobile-specific Map layout layer. It is loaded after
  shared CSS and applies only when graph.html sets html.map-layout-mobile.
  Do not place desktop or tablet fixes here.
*/

html.map-layout-mobile,
html.map-layout-mobile body {
  overflow-x: hidden !important;
}

html.map-layout-mobile .graph-shell {
  box-sizing: border-box !important;
  width: calc(100vw - 20px) !important;
  max-width: calc(100vw - 20px) !important;
  margin-inline: 10px !important;
  gap: 8px !important;
  padding: 10px 0 18px !important;
  overflow-x: hidden !important;
}

html.map-layout-mobile .graph-shell > *,
html.map-layout-mobile .graph-shell .mobile-map-panel,
html.map-layout-mobile .graph-shell .graph-workbench,
html.map-layout-mobile .graph-shell .map-panel,
html.map-layout-mobile .graph-shell .right-panel,
html.map-layout-mobile .graph-shell .selected-card {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

html.map-layout-mobile .graph-shell .site-nav,
html.map-layout-mobile .graph-shell > .topbar .eyebrow,
html.map-layout-mobile .graph-shell .graph-intro,
html.map-layout-mobile .graph-shell .graph-command-bar,
html.map-layout-mobile .graph-shell .map-insight-deck,
html.map-layout-mobile .graph-shell .graph-controls,
html.map-layout-mobile .graph-shell .graph-next-panel,
html.map-layout-mobile .graph-shell .graph-data-footer,
html.map-layout-mobile .graph-shell .mobile-map-distance,
html.map-layout-mobile .graph-shell .mobile-map-tabs {
  display: none !important;
}

html.map-layout-mobile .graph-shell > .topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  padding-block: 8px 4px !important;
  padding-right: 56px !important;
}

html.map-layout-mobile .graph-shell > .topbar h1 {
  font-size: 1.38rem !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

html.map-layout-mobile .graph-shell .topbar-tools {
  display: none !important;
}

html.map-layout-mobile .graph-shell .mobile-map-panel {
  display: grid !important;
  gap: 6px !important;
  padding: 7px !important;
  border: 1px solid var(--color-border-strong) !important;
  border-radius: 12px !important;
  background: var(--color-surface) !important;
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.08) !important;
}

html.map-layout-mobile .graph-shell .mobile-map-controls {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 6px !important;
}

html.map-layout-mobile .graph-shell .mobile-map-search {
  grid-column: 1 / -1 !important;
}

html.map-layout-mobile .graph-shell .mobile-map-search span,
html.map-layout-mobile .graph-shell .mobile-map-axis span {
  display: none !important;
}

html.map-layout-mobile .graph-shell .mobile-map-panel input,
html.map-layout-mobile .graph-shell .mobile-map-panel select {
  width: 100% !important;
  min-height: 36px !important;
  border-radius: 10px !important;
  font-size: 0.76rem !important;
}

html.map-layout-mobile .graph-shell .mobile-filter-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 86px !important;
  min-height: 36px !important;
  padding-inline: 10px !important;
  border-radius: 10px !important;
  font-size: 0.72rem !important;
  white-space: nowrap !important;
}

html.map-layout-mobile .graph-shell .mobile-map-ruler {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

html.map-layout-mobile .graph-shell .mobile-map-ruler .ruler-button {
  min-height: 32px !important;
}

html.map-layout-mobile .graph-shell .graph-workbench {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.map-layout-mobile .graph-shell .map-panel {
  height: clamp(340px, 46dvh, 430px) !important;
  min-height: 340px !important;
  border: 0 !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #071216 !important;
}

html.map-layout-mobile .graph-shell .canvas-stage {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
}

html.map-layout-mobile .graph-shell #graphCanvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  cursor: grab !important;
  touch-action: none !important;
}

html.map-layout-mobile .graph-shell #graphCanvas:active {
  cursor: grabbing !important;
}

html.map-layout-mobile .graph-shell .map-head,
html.map-layout-mobile .graph-shell .map-guide,
html.map-layout-mobile .graph-shell .map-legend,
html.map-layout-mobile .graph-shell .nav-pad,
html.map-layout-mobile .graph-shell .graph-tooltip {
  display: none !important;
}

html.map-layout-mobile .graph-shell .left-panel.filter-drawer:not([open]) {
  display: none !important;
}

html.map-layout-mobile .graph-shell .left-panel.filter-drawer[open] {
  position: fixed !important;
  z-index: 80 !important;
  inset: auto 10px 10px !important;
  width: auto !important;
  max-width: none !important;
  max-height: min(78dvh, 620px) !important;
  overflow: auto !important;
  border: 1px solid var(--color-border-strong) !important;
  border-radius: 18px !important;
  padding: 12px !important;
  background: var(--color-surface) !important;
  box-shadow: 0 26px 80px rgb(15 23 42 / 0.24) !important;
}

html.map-layout-mobile .graph-shell .right-panel {
  display: block !important;
  position: static !important;
  z-index: auto !important;
  margin: 8px 0 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.map-layout-mobile .graph-shell .right-panel .preset-section {
  display: none !important;
}

html.map-layout-mobile .graph-shell .selected-card {
  display: grid !important;
  align-content: start !important;
  position: relative !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  border: 1px solid var(--color-border-strong) !important;
  border-radius: 15px !important;
  padding: 10px 12px 11px !important;
  background: var(--color-surface) !important;
  box-shadow: 0 14px 34px rgb(15 23 42 / 0.08) !important;
}

html.map-layout-mobile .graph-shell .selected-card::before,
html.map-layout-mobile .graph-shell .selected-stage-ranks {
  display: none !important;
}

html.map-layout-mobile .graph-shell .selected-card-kicker {
  display: block !important;
  margin-bottom: 8px !important;
  color: #4f46e5 !important;
  font-size: 0.68rem !important;
  font-weight: 950 !important;
  letter-spacing: 0.04em !important;
}

html.map-layout-mobile .graph-shell .selected-head {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 9px !important;
  margin: 0 !important;
  padding-right: 0 !important;
}

html.map-layout-mobile .graph-shell .selected-head .cover-wrap {
  width: 58px !important;
  height: 58px !important;
  border-radius: 10px !important;
}

html.map-layout-mobile .graph-shell .selected-head .eyebrow {
  margin: 0 0 3px !important;
  color: #4f46e5 !important;
  font-size: 0.68rem !important;
  font-weight: 950 !important;
  letter-spacing: 0.08em !important;
}

html.map-layout-mobile .graph-shell .selected-title,
html.map-layout-mobile .graph-shell .selected-artist {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html.map-layout-mobile .graph-shell .selected-title {
  margin: 0 !important;
  color: var(--color-text) !important;
  font-size: 0.96rem !important;
  font-weight: 950 !important;
  line-height: 1.18 !important;
}

html.map-layout-mobile .graph-shell .selected-meta-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  margin-top: 3px !important;
}

html.map-layout-mobile .graph-shell .selected-artist {
  flex: 0 1 auto !important;
  max-width: 100% !important;
  color: var(--color-text-muted) !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
}

html.map-layout-mobile .graph-shell .tag-line {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-top: 10px !important;
}

html.map-layout-mobile .graph-shell .tag {
  border: 1px solid #d5e0ec !important;
  color: #334155 !important;
  background: #f8fafc !important;
}

html.map-layout-mobile .graph-shell a.tag {
  color: #3730a3 !important;
}

html.map-layout-mobile .graph-shell .selected-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

html.map-layout-mobile .graph-shell .selected-actions .detail-link {
  width: 100% !important;
  min-height: 40px !important;
  border-color: #cbd5e1 !important;
  border-radius: 10px !important;
  padding-inline: 13px !important;
  color: #334155 !important;
  background: #ffffff !important;
  font-size: 0.82rem !important;
  box-shadow: none !important;
}

html.map-layout-mobile .graph-shell .selected-ruler,
html.map-layout-mobile .graph-shell .selected-detail-drawer,
html.map-layout-mobile .graph-shell .inspector-block,
html.map-layout-mobile .graph-shell .shape-bars,
html.map-layout-mobile .graph-shell .journey-block,
html.map-layout-mobile .graph-shell .metric-card,
html.map-layout-mobile .graph-shell .relative-metric,
html.map-layout-mobile .graph-shell .shape-reading {
  border-color: #d5e0ec !important;
  color: #111827 !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.06) !important;
}

html.map-layout-mobile .graph-shell .selected-ruler {
  display: grid !important;
  gap: 8px !important;
  margin-top: 14px !important;
}

html.map-layout-mobile .graph-shell .selected-relative-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
}

html.map-layout-mobile .graph-shell .selected-detail-drawer {
  margin-top: 10px !important;
  padding: 10px !important;
}

html.map-layout-mobile .graph-shell .selected-detail-drawer > summary {
  display: block !important;
  color: #111827 !important;
}

html.map-layout-mobile .graph-shell .selected-detail-drawer > summary::after {
  display: inline !important;
  color: #0891b2 !important;
}

html.map-layout-mobile .graph-shell .selected-observed-head {
  margin-top: 12px !important;
}

html.map-layout-mobile .graph-shell .selected-metrics {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
}

html.map-layout-mobile .graph-shell .relative-metric span,
html.map-layout-mobile .graph-shell .metric-label,
html.map-layout-mobile .graph-shell .section-note,
html.map-layout-mobile .graph-shell .inspector-section-head small,
html.map-layout-mobile .graph-shell .vote-rank-row,
html.map-layout-mobile .graph-shell .shape-row {
  color: #475569 !important;
}

html.map-layout-mobile .graph-shell .relative-metric strong,
html.map-layout-mobile .graph-shell .metric-value,
html.map-layout-mobile .graph-shell .inspector-section-head span,
html.map-layout-mobile .graph-shell .vote-count-label,
html.map-layout-mobile .graph-shell .shape-row > span:last-child,
html.map-layout-mobile .graph-shell .shape-reading-head strong {
  color: #111827 !important;
}

html.map-layout-mobile .graph-shell .vote-rank-track,
html.map-layout-mobile .graph-shell .shape-track {
  background: #e8eef5 !important;
}

html.map-layout-mobile .graph-shell .vote-rank-fill,
html.map-layout-mobile .graph-shell .shape-fill {
  background: #14b8a6 !important;
}

html.map-layout-mobile .graph-shell .selected-type-bars span {
  background: var(--type-color, #14b8a6) !important;
}

html.map-layout-mobile .graph-shell .journey-chip {
  border-color: #d5e0ec !important;
  color: #334155 !important;
  background: #f8fafc !important;
}

html.map-layout-mobile .graph-shell .journey-chip.active {
  border-color: #a5b4fc !important;
  color: #3730a3 !important;
  background: #eef2ff !important;
}

html.map-layout-mobile .graph-shell .mobile-map-tools {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  margin-top: 8px !important;
}

html.map-layout-mobile .graph-shell .mobile-map-tool-button,
html.map-layout-mobile .graph-shell .mobile-map-tool-link,
html.map-layout-mobile .graph-shell .mobile-map-tool-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  border: 1px solid var(--color-border-strong) !important;
  border-radius: 999px !important;
  padding: 0 12px !important;
  color: var(--color-text) !important;
  background: var(--color-surface) !important;
  font: inherit !important;
  font-size: 0.74rem !important;
  font-weight: 850 !important;
  text-decoration: none !important;
}

html.map-layout-mobile .graph-shell .mobile-map-tool-button {
  color: var(--readable-brand) !important;
  background: var(--color-brand-soft) !important;
  border-color: var(--color-brand-border) !important;
  cursor: pointer !important;
}

html.map-layout-mobile .graph-shell .map-reading-callout {
  margin: 2px 2px 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--color-text-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 0.76rem !important;
  line-height: 1.6 !important;
}

html.map-layout-mobile .graph-shell .map-reading-callout strong {
  display: inline !important;
  margin-right: 6px !important;
  color: var(--color-text) !important;
}
