/* Extension docks and top-bar buttons, the map tooltip and the city / province panel. */
/* Extension hosts (app/api.js: app.ui.dock, app.ui.addTopButton). */
/* Docks sit flush under the top bar at the screen edge; the map stays full-size underneath and
   app.visibleArea() shrinks instead. --dock-left / --dock-right on <body> hold the visible docks'
   widths (0px when closed). */
.app-dock {
  position: fixed; top: var(--topbar-h); bottom: 0; width: var(--dock-w, 380px);
  max-width: calc(100vw - 120px); z-index: 12;
  overflow-y: auto; overscroll-behavior: contain; border-radius: 0; border-top: none;
}
.app-dock-left { left: 0; border-left: none; }
.app-dock-right { right: 0; border-right: none; }
.btn-ext.active, .btn-ext[aria-pressed="true"] {
  background: linear-gradient(180deg, #5a4a24, #3a2f15); border-color: var(--gold-bright);
}
/* Extension buttons cost top-bar room: their labels go first, then (body.tb-ext) the brand text
   gives way. */
@media (max-width: 1720px) {
  .btn-ext .lbl { display: none; }
  .btn-ext { padding: 4px 7px; }
  body.tb-ext .turn { display: none; }
}
@media (max-width: 1320px) and (min-width: 701px) { body.tb-ext .brand-text { display: none; } }
/* A docked dashboard plus the minimap leave the lens dock no room on smaller desktops: drop the
   minimap. */
@media (max-width: 1360px) and (min-width: 701px) {
  body.dock-open #minimap-wrap { display: none; }
  body.dock-open #lens-area { left: calc(12px + var(--dock-left, 0px)); }
}

/* Tooltip. */
.tooltip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 280px;
  background: rgba(12, 18, 26, .96); border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 9px; font-size: 12px; line-height: 1.45; color: var(--ink);
}
.tooltip b { color: var(--gold-bright); font-family: var(--serif); }
.tooltip .muted { color: var(--ink-dim); }
.tooltip svg.icon { vertical-align: -2px !important; }

/* City / province panel. */
#city-panel {
  position: fixed; top: 52px; right: calc(12px + var(--dock-right, 0px)); bottom: 12px;
  width: 370px; z-index: 12;
  overflow-y: auto; padding: 0 0 12px; overscroll-behavior: contain;
}
.sheet-grip { display: none; }
.cp-head {
  padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); position: relative;
  background: linear-gradient(180deg, rgba(255,235,190,.05), transparent);
}
.cp-head .stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 6px 0 0 0;
  box-shadow: inset -1px 0 0 rgba(0,0,0,.4);
}
.cp-kind { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.cp-name {
  margin: 0; font-weight: normal; font-family: var(--serif); font-size: 24px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gold-bright); padding-right: 34px; line-height: 1.15;
}
.cp-name .cap { color: #ffe9a8; }
.cp-full { color: var(--ink-dim); font-size: 12px; margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip {
  font: 11px var(--sans); letter-spacing: .06em; padding: 1px 7px; border-radius: 9px;
  border: 1px solid rgba(201,164,92,.5); background: rgba(0,0,0,.25); color: var(--gold-bright);
}
button.chip { cursor: pointer; }
button.chip:hover { background: rgba(201,164,92,.2); }
.cp-pop {
  margin-top: 8px; font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.cp-pop svg { color: var(--ink-dim); }
.cp-pop b { font-size: 16px; }
.cp-pop .growth { white-space: nowrap; }
.cp-pop .growth .since { color: var(--ink-dim); font-size: 12px; }
.cp-close { position: absolute; top: 10px; right: 10px; }
.cp-section { padding: 10px 16px 4px; }
.cp-section h3 {
  margin: 4px 0 8px; font-family: var(--serif); font-weight: normal; font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 8px;
}
.cp-section h3::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent);
}
.yield-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.yield-tile {
  background: rgba(0,0,0,.25); border: 1px solid rgba(201,164,92,.25); border-radius: 5px;
  padding: 6px 2px; text-align: center; cursor: help;
}
.yield-tile .ico {
  display: flex; justify-content: center; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
}
.yield-tile .val {
  font-weight: 700; font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums;
}
.yield-tile .lbl {
  font-size: 10px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em;
}
.yield-tile .rank {
  font-size: 10px; color: var(--gold-bright); margin-top: 2px; font-variant-numeric: tabular-nums;
}
.ind {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 6px; align-items: center;
  margin-bottom: 5px; font-size: 12px;
}
.ind .bar {
  grid-column: 2 / 4; height: 5px; background: rgba(255,255,255,.07); border-radius: 3px;
  overflow: hidden;
}
.ind .bar i { display: block; height: 100%; border-radius: 3px; }
.ind .n { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.lq { font-size: 10px; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
.lq.hi { background: rgba(127,191,63,.25); color: #b9e486; }
.lq.lo { background: rgba(255,255,255,.06); color: var(--ink-dim); }
.stat-row {
  display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0;
  border-bottom: 1px dashed rgba(201,164,92,.15);
}
.stat-row .sl { display: inline-flex; align-items: center; gap: 6px; }
.stat-row .sl svg, .stat-row .sl .emoji { color: var(--ink-dim); width: 14px; }
.stat-row > span:last-child { text-align: right; }
.stat-row .cmp { font-size: 11px; color: var(--ink-dim); margin-left: 6px; white-space: nowrap; }
.good { color: #9fd76a !important; } .bad { color: #f08a6a !important; }
.city-list { display: flex; flex-direction: column; gap: 3px; }
.city-row {
  display: grid; grid-template-columns: 1fr auto 12px; gap: 8px; align-items: center; width: 100%;
  text-align: left; cursor: pointer;
  padding: 6px 8px; border-radius: 4px; background: rgba(0,0,0,.22);
  border: 1px solid rgba(201,164,92,.2); font-size: 13px;
}
.city-row:hover, .city-row:focus-visible {
  border-color: var(--gold); background: rgba(201,164,92,.12);
}
.cr-name {
  font-family: var(--serif); color: var(--gold-bright); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-name .muted { font-family: var(--sans); font-size: 11px; }
.cr-pop { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.cr-go { color: var(--gold); }
.cp-section p.muted { font-size: 12px; margin: 4px 0; }
.cp-foot { padding: 10px 16px 0; font-size: 11px; color: var(--ink-dim); }
.cp-foot a { color: var(--gold); cursor: pointer; }

/* The estimate mark (ui/estimate.js): a small icon after an estimated value. */
.est {
  display: inline-flex; align-items: center; color: #b9a6e8; cursor: help;
  margin-left: 3px; padding: 1px; border-radius: 50%; vertical-align: -2px;
}
.est:hover, .est:focus-visible { color: #e2d6ff; outline: 1px solid rgba(185, 166, 232, .6); }
/* The "why" mark (ui/whyMark.js): a small ⓘ after a value whose reason sits only in a title. */
.why {
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-dim);
  cursor: help; margin-left: 3px; padding: 0 2px; border-radius: 50%; vertical-align: -2px;
  font-size: 11px; line-height: 1.2;
}
.why:hover, .why:focus-visible { color: var(--ink); outline: 1px solid var(--ink-dim); }
.tooltip { z-index: 60; }
.tooltip .nowrap { white-space: nowrap; }
.cp-head .seat { margin-top: 4px; font-size: 12px; color: var(--gold-bright); }
