/* The side tabs 区域 and 商路 (界面 三; src/UI/scope-tabs.js): the scope chooser and 规则 | 详情 at the top, the hint while
   nothing is chosen, then the rules or the details; and 选择区域 (src/UI/region-select.js): its button on the control line
   (bordered as 编辑地图) and the outline drawn on the map. */

.scope-tab-head { gap: 10px; padding-bottom: 4px; }
.scope-tab-head + .scope-tab-hint { margin: 6px 18px 14px; }
.scope-tab #region-rules > .display-rules:first-child,
.scope-tab #route-rules > .display-rules:first-child { padding-top: 6px; }

/* 规则 | 详情: two toggles, half the line each (the pressed one shows its content; pressing it again hides both) */
.scope-tab-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.scope-tab-switch[hidden] { display: none; }
.game-shell .inspector .scope-tab-switch > button {
  min-width: 0;
  height: 32px;
  border: 1px solid #c8d0c9;
  border-radius: 3px;
  background: var(--paper-strong);
  color: var(--ink);
  font: inherit;
  font-size: var(--font-medium);
  cursor: pointer;
}
/* the pressed one by border, background and colour, not weight (human 2026-11-03: "why bold title? … the rule didn't told you
   how to do?") */
.game-shell .inspector .scope-tab-switch > button[aria-pressed="true"] {
  border-color: #244943;
  background: #eef1eb;
  color: #244943;
}

/* 商路 详情 for a set of routes: two a line, each with its two cities' colours left and right */
.scope-route-list { padding: 14px 18px; }
.scope-route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
/* the 选区's two groups, 区内商路 and 跨界商路, under small headings */
.scope-route-group { margin: 10px 0 6px; color: var(--muted); font-size: var(--font-small); font-weight: 400; }
.scope-route-list .section-title + .scope-route-group { margin-top: 0; }
.scope-route-link {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #c8d0c9;
  border-left: 5px solid var(--route-a, #c8d0c9);
  border-right: 5px solid var(--route-b, #c8d0c9);
  border-radius: 3px;
  background: #fffdf6;
  color: var(--ink);
  font-size: var(--font-medium);
  line-height: 30px;
  cursor: pointer;
}
.scope-route-link:hover { background: #eef1eb; }
.scope-route-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.scope-route-days { flex: none; color: var(--muted); white-space: nowrap; }
.scope-route-days::before { content: "· "; }

/* 选择区域 on the control line, next to 编辑地图 and as it */
.controlbar #region-select-toggle {
  border-color: #b9c4bd;
  background: #fffdf6;
  color: var(--ink);
}
.controlbar #region-select-toggle:hover { border-color: var(--teal); }
.controlbar #region-select-toggle.active {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
}
.controlbar #region-select-toggle:disabled { cursor: not-allowed; opacity: 0.5; }

/* the map in 选择区域: a crosshair, the captions take no pointer (a press on a caption draws or picks what is under it) */
.map-stage.region-selecting:not(.pan-mode) #map-world,
.map-stage.region-selecting:not(.pan-mode) .periodic-map-projection,
.map-stage.region-selecting:not(.pan-mode) .large-terrain-vector { cursor: crosshair; }
.map-stage.region-selecting .city-caption-layer { pointer-events: none; }
/* the lasso (src/UI/region-select.js, as GoodNotes'): while drawing a thin dashed line over a faint fill, the dashed straight
   line back to its start; after the lasso its closed outline as marching ants. Strokes keep their screen width at any zoom. */
.region-lasso-fill { fill: rgba(242, 193, 78, 0.12); stroke: none; }
.region-lasso-line,
.region-lasso-close,
.region-lasso-outline {
  fill: none;
  stroke: #8a6a2a;
  stroke-width: 1.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.region-lasso-close { opacity: 0.6; }
.region-lasso-outline { fill: rgba(242, 193, 78, 0.06); animation: region-lasso-ants 0.8s linear infinite; }
@keyframes region-lasso-ants { to { stroke-dashoffset: -9; } }
@media (prefers-reduced-motion: reduce) { .region-lasso-outline { animation: none; } }

/* 跳转 fixed the map (map-view.js setViewLocked): no drag or zoom; the 拖动 −/＋/复位 buttons disabled */
.map-viewport-controls button:disabled { cursor: not-allowed; opacity: 0.45; }
.map-stage.view-locked #map-world { cursor: default; }

/* a road shared by several routes (map-view.js openRouteChooser): a small card at the click, a button per route in its two
   cities' colours; Esc or a press outside closes it */
.route-chooser {
  position: absolute;
  z-index: 12;
  display: grid;
  gap: 4px;
  width: max-content;
  min-width: 180px;
  max-width: 280px;
  padding: 8px;
  border: 1px solid #b9c4bd;
  border-radius: 4px;
  background: var(--paper-strong, #fffdf6);
  box-shadow: 0 4px 14px rgba(40, 44, 38, 0.22);
}
.route-chooser-title { margin: 0 0 2px; color: var(--muted); font-size: var(--font-small); }
.route-chooser .scope-route-link { width: 100%; text-align: left; font: inherit; font-size: var(--font-medium); }
.route-chooser .scope-route-link:focus-visible { outline: 2px solid var(--teal, #244943); outline-offset: 1px; }
