/* GM3 additions on top of the house shell: Evolve branding, the location and radius switchers,
   the catchment map, the location page panels and small print helpers. */

/* ---- Branding: Evolve only. The PNG is 532x160 (3.325:1). ---- */
.evolve-mark { display: block; height: auto; }
.evolve-mark--sidebar { width: 118px; }     /* -> 35px tall */
.evolve-mark--login   { width: 176px; align-self: center; }  /* -> 53px tall */
.evolve-mark--doc     { width: 128px; }
.sidebar__brand .brand__stack { gap: 8px; }
.brand__label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-tertiary); }

.cobrand { padding: 12px 0 10px; border-top: 1px solid var(--border); margin-bottom: 8px; }
.cobrand__label { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.cobrand__client { display: block; font-family: var(--font-display); font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 3px; line-height: 1.3; }
.cobrand__by { display: block; font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

.login-partners { display: flex; flex-direction: column; gap: 6px; }
.login-cobrand__prep { font-size: 12px; color: var(--text-secondary); }
.login-cobrand__prep strong { color: var(--text); font-weight: 600; }

/* ---- Radius toggle (1 / 3 / 5 km) in the topbar ---- */
.radius-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; margin-left: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elevated); }
.radius-seg .seg { padding: 4px 10px; border-radius: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-secondary); text-decoration: none; transition: background var(--transition), color var(--transition); }
.radius-seg .seg:hover { color: var(--text); background: var(--bg-hover); }
.radius-seg .seg.active { color: #fff; background: var(--accent); }

/* ---- Location page ---- */
.loc-hero { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.loc-hero__side h1 { font-size: 24px; margin: 0 0 4px; line-height: 1.15; }
.loc-hero__side .loc-hero__addr { color: var(--text-secondary); font-size: 12.5px; }
.loc-hero__facts { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.loc-hero__map { min-width: 0; display: flex; flex-direction: column; }
/* The map grows to the height of the facts card beside it, so both columns end on the same line */
.loc-hero__map .map-wrap--hero { flex: 1 0 auto; display: flex; flex-direction: column; }
.loc-hero__map .map-wrap--hero #catchmentMap, .loc-hero__map .map-wrap--hero #heroMap3d { height: 640px; flex: 1 0 auto; }
/* Full screen: the Fullscreen API where available, a fixed overlay otherwise */
.map-fs-btn { position: absolute; left: 12px; top: 84px; z-index: 600; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-light); border-radius: 6px; background: rgba(19,19,20,0.92); color: var(--text); cursor: pointer; }
.map-fs-btn:hover { background: var(--bg-hover); }
.map-fs-btn svg { width: 15px; height: 15px; }
.map-wrap.is-fs { position: fixed; inset: 0; z-index: 2000; border-radius: 0; border: 0; }
.map-wrap.is-fs #catchmentMap, .map-wrap.is-fs #heroMap3d, .map-wrap:fullscreen #catchmentMap, .map-wrap:fullscreen #heroMap3d { height: 100vh !important; }
.map-wrap:fullscreen { border-radius: 0; border: 0; background: #0d0f12; }
.fact { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.fact__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.fact__value { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.fact__sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.map-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #0d0f12; }
#catchmentMap { width: 100%; height: 560px; }
.map-wrap--hero #catchmentMap { height: 460px; }
.map-legend--gm { position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: var(--radius); background: rgba(19,19,20,0.92); font-size: 11px; color: var(--text-secondary); }
.map-legend--gm .legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.map-inspector--gm { position: absolute; right: 12px; top: 12px; z-index: 500; width: 260px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: var(--radius); background: rgba(19,19,20,0.94); font-size: 12px; }
.map-inspector--gm .kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.map-inspector--gm .kv-row:last-child { border-bottom: 0; }
.map-toolbar--gm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--bg-card); }
.map-toolbar--gm + .map-wrap { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.chip--gm { cursor: pointer; user-select: none; }
.chip--3d { border-color: var(--accent-line); color: var(--accent); gap: 6px; }
.chip--3d svg { width: 13px; height: 13px; }
.chip--3d.chip--on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip--3d.chip--busy { opacity: 0.6; pointer-events: none; }
.chip--3d.chip--off { opacity: 0.5; }
#heroMap3d { width: 100%; height: 460px; }
.map-wrap--hero #heroMap3d[hidden], .map-wrap--hero #catchmentMap[hidden] { display: none; }

/* ---- Rent distribution and ring tables ---- */
.ring-table td.ring-cur, .ring-table th.ring-cur { background: var(--accent-dim); }
.pill-n { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-tertiary); }
.kpi-note { font-size: 11px; color: var(--text-tertiary); margin-top: 6px; }

/* ---- Official context notes: the values are full sentences, so each note stacks instead of using kv-row ---- */
.ctx-note { padding: 10px 0; border-bottom: 1px solid var(--border); }
.card__head + .ctx-note { padding-top: 0; }
.ctx-note:last-child { border-bottom: 0; padding-bottom: 0; }
.ctx-note__metric { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.ctx-note__value { font-size: 14px; font-weight: 600; line-height: 1.45; margin-top: 2px; }
.ctx-note .src-note { margin-top: 4px; }

/* ---- AI narrative ---- */
.ai-text { font-size: 14px; line-height: 1.65; color: var(--text); }
.ai-text p { margin: 0 0 10px; }
.ai-text ul { margin: 0 0 10px 18px; }
.ai-text h4 { font-family: var(--font-display); font-size: 13px; margin: 12px 0 4px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.ai-meta { display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-tertiary); margin-top: 8px; }

/* ---- Overview location cards ---- */
.overview-hero { margin-bottom: 16px; }
.loc-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); text-decoration: none; color: inherit; transition: border-color var(--transition), transform var(--transition); }
.loc-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.loc-card__name { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.loc-card__addr { font-size: 12px; color: var(--text-secondary); }
.loc-card__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---- User administration ---- */
.mb-lg { margin-bottom: 16px; }
.invite-grid { grid-template-columns: 1.2fr 1.4fr 1.4fr 0.8fr 0.8fr auto; align-items: end; gap: 12px; }
.invite-grid .form-group { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); height: 40px; }
.filter-input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-elevated); color: var(--text); font-size: 12.5px; min-width: 240px; }
.handlink { border-color: var(--accent-line); }
.handlink__row { display: flex; gap: 8px; align-items: center; }
.handlink__row input { flex: 1; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-elevated); color: var(--text); font-size: 12px; }
.edit-form { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.edit-form input { padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-elevated); color: var(--text); font-size: 12px; width: 150px; }
.actions form, .actions details { display: inline-block; vertical-align: middle; margin-left: 4px; }
.actions details summary::-webkit-details-marker { display: none; }
.actions details summary { list-style: none; }
@media (max-width: 1100px) { .invite-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Release notes (admin) ---- */
.release + .release { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.release__head { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.release__date { color: var(--text-tertiary); font-weight: 500; }
.release__kind { margin: 16px 0 2px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.release__kind--added { color: var(--success); }
.release__kind--changed { color: var(--accent); }
.release__kind--fixed { color: var(--warning); }
.release__kind--removed, .release__kind--security { color: var(--danger); }
.release__item { margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--border); max-width: 880px; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.release__item strong { color: var(--text); font-weight: 600; }
.release__item p + p { margin-top: 6px; }
.release__item code { font-family: var(--font-mono); font-size: 12px; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .loc-hero { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .loc-hero__facts { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 860px) {
  .loc-hero__facts, .loc-card__kpis { grid-template-columns: 1fr 1fr; }
  #catchmentMap, .loc-hero__map .map-wrap--hero #catchmentMap, .loc-hero__map .map-wrap--hero #heroMap3d { height: 420px; }
  .radius-seg { margin-left: 4px; }
}
/* Phones: the top bar becomes two rows (title, then location and radius) instead of a hidden horizontal scroll */
@media (max-width: 640px) {
  .topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; height: auto; min-height: var(--topbar-h); padding: 8px 14px; row-gap: 8px; column-gap: 10px; overflow: visible; }
  .topbar .nav-toggle { grid-column: 1; grid-row: 1; }
  .topbar__title { grid-column: 2 / 4; grid-row: 1; overflow: hidden; text-overflow: ellipsis; }
  .topbar .cat-switch { grid-column: 1 / 3; grid-row: 2; min-width: 0; margin-left: 0; padding-left: 0; border-left: 0; }
  .topbar .cat-select { max-width: 100%; }
  .topbar .radius-seg { grid-column: 3; grid-row: 2; justify-self: end; margin-left: 0; }
  .topbar__spacer, .topbar__kicker { display: none; }
}
