/* Market page (/app/market) and the Parcels | Market switch in the top bar.
   Neutral dark surfaces; data in blue (sales), gold (prices) and violet (permits); green only for actions.
   Type scale: page 28, section 20, card 15, body 14, labels 12, figures 36 (tabular). */
.market-app{--mk-page:#0b0f14;--mk-card:#121821;--mk-raised:#1b2430;--mk-line:rgba(148,163,184,.14);--mk-line-strong:rgba(148,163,184,.24);
  --mk-text:#e6edf3;--mk-soft:#c4ced8;--mk-muted:#93a1b1;--mk-action:#5fe0a0;--mk-sales:#4a8bd0;--mk-sales-old:#2a4a70;--mk-sales-best:#7fb3f0;
  --mk-prices:#e3b341;--mk-permits:#b9a3ff;--mk-up:#5fe0a0;--mk-down:#f0a07a}
.section-tabs{display:flex;gap:4px;padding:4px;margin-left:8px;border:1px solid rgba(148,163,184,.2);border-radius:10px;background:rgba(0,0,0,.25)}
.section-tabs a{padding:8px 18px;border-radius:7px;color:#93a1b1;font-size:14px;font-weight:500;text-decoration:none}
.section-tabs .tab-soon{margin-left:6px;padding:1px 6px;border-radius:9px;background:rgba(214,176,92,.16);color:#d6b05c;font-size:10px;font-weight:600;letter-spacing:.3px;vertical-align:1px}
.section-tabs a:hover{color:#e6edf3;background:rgba(148,163,184,.08)}
.section-tabs a.active{background:#1b2430;color:#e6edf3;font-weight:600;box-shadow:inset 0 -2px #5fe0a0}
.market-app{height:auto!important;min-height:100vh;overflow:visible!important;background:var(--mk-page);font-variant-numeric:tabular-nums}
/* the map workspace locks page scrolling (body overflow hidden); the Market page scrolls */
body:has(.market-app){overflow:auto;background:#0b0f14}
.terrax-app.market-app .app-topbar{position:sticky;top:0;z-index:20;background:#0e131a;border-bottom:1px solid var(--mk-line)}
.market-page{max-width:1440px;margin:0 auto;padding:28px 28px 40px;color:var(--mk-text);font-size:14px}
.market-empty{padding:60px 0;color:var(--mk-muted);text-align:center}
.market-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;flex-wrap:wrap}
.market-head h1{margin:0;font-size:28px;font-weight:700;letter-spacing:-.015em;color:var(--mk-text)}
.market-head p{margin:6px 0 0;color:var(--mk-muted);font-size:14px}
.market-choices{display:flex;flex-wrap:wrap;gap:6px}
.market-choices button{padding:7px 14px;border:1px solid var(--mk-line-strong);border-radius:16px;background:transparent;color:var(--mk-soft);font:500 13px var(--tx-font,Inter,sans-serif);cursor:pointer}
.market-choices button:hover{border-color:rgba(148,163,184,.45);color:var(--mk-text)}
.market-choices button[aria-pressed="true"]{border-color:var(--mk-text);background:var(--mk-text);color:var(--mk-page);font-weight:600}
.market-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:22px}
.market-kpis article{padding:18px 20px;border:1px solid var(--mk-line);border-radius:12px;background:var(--mk-card)}
.market-kpis small{color:var(--mk-muted);font-size:12px}
.market-kpis div{display:flex;align-items:baseline;gap:12px;margin-top:8px}
.market-kpis strong{font-size:36px;font-weight:600;letter-spacing:-.02em;color:var(--mk-text)}
.market-kpis strong.prices{color:var(--mk-prices)}
.market-kpis strong.permits{color:var(--mk-permits)}
.market-kpis div span{font-size:14px;font-weight:600;color:var(--mk-up)}
.market-kpis div span.down{color:var(--mk-down)}
.market-kpis p{margin:4px 0 0;color:var(--mk-muted);font-size:12px}
.market-grid{display:grid;grid-template-columns:minmax(0,46%) minmax(0,1fr);gap:16px;margin-top:16px}
.market-column{display:flex;flex-direction:column;gap:16px;min-width:0}
.market-card{padding:20px;border:1px solid var(--mk-line);border-radius:12px;background:var(--mk-card)}
.market-card>header{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.market-card h2{margin:0;font-size:15px;font-weight:600;color:var(--mk-text)}
.market-card>header span,.market-card>header div>span{color:var(--mk-muted);font-size:12px}
.market-note{margin:10px 0 0;color:var(--mk-muted);font-size:12px;line-height:1.5}
.market-map,.market-hexes{display:block;width:100%;height:auto}
.market-map path{cursor:pointer;transition:filter .15s}
.market-map path.market-island{fill:#1f2833;stroke:none;cursor:default;filter:none}
.market-hexes path.market-island{fill:#16202b;stroke:none}
.market-map path:hover{filter:brightness(1.15)}
.market-map-label{font:12px var(--tx-font,Inter,sans-serif);text-anchor:middle;cursor:pointer}.market-map-label text{paint-order:stroke;stroke:#0b0f14;stroke-width:3.2px;stroke-linejoin:round}.market-map-label .market-map-count{font-size:10.5px}.market-trend{margin-top:6px}
.market-legend{display:flex;align-items:center;gap:10px;margin-top:8px;color:var(--mk-muted);font-size:12px}
.market-legend i{flex:0 0 200px;height:6px;border-radius:3px;background:linear-gradient(90deg,#1e3a5f,#2f6aa3,#4a8bd0,#7fb3f0)}
.market-legend em{margin-left:auto;font-style:normal}
.market-ranking{display:flex;flex-direction:column;gap:2px}
.market-ranking button{display:grid;grid-template-columns:120px minmax(0,1fr) 64px 60px;align-items:center;gap:12px;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--mk-text);font:13px var(--tx-font,Inter,sans-serif);text-align:left;cursor:pointer}
.market-ranking button:hover,.market-ranking button.active{background:rgba(148,163,184,.08)}
.market-ranking button.active span,.market-ranking button.active b{font-weight:600}
.market-ranking i{display:block;height:8px;border-radius:4px;background:var(--mk-sales)}
.market-ranking button.reference span,.market-ranking button.reference b{color:var(--mk-muted)}
.market-ranking button.reference i{height:1px;background:var(--mk-muted)}
.market-ranking b{text-align:right;font-weight:500}
.market-ranking small{text-align:right;color:var(--mk-muted);font-size:12px}
.market-keys{display:flex;gap:16px;color:var(--mk-muted);font-size:12px}
.market-keys span{display:flex;align-items:center;gap:6px}
.market-keys i.bar{width:10px;height:10px;border-radius:2px;background:var(--mk-sales)}
.market-keys i.dash{width:16px;border-top:2px dashed var(--mk-muted)}
.market-bars{display:block;width:100%;height:auto;font:10px var(--tx-font,Inter,sans-serif)}
.market-bars line,.market-line-chart line{stroke:rgba(148,163,184,.12)}
.market-bars text,.market-line-chart text{fill:var(--mk-muted)}
.market-bars rect{fill:var(--mk-sales-old)}
.market-bars rect.recent{fill:var(--mk-sales)}
.market-bars path.previous{fill:none;stroke:var(--mk-muted);stroke-width:1.5;stroke-dasharray:4 4}
.market-cta{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-radius:12px;background:var(--mk-action);color:#0b0f14;text-decoration:none}
.market-cta:hover{background:#7ae8b2}
.market-cta span{display:flex;flex-direction:column;gap:2px}
.market-cta strong{font-size:15px;font-weight:600}
.market-cta small{color:#1f4a37;font-size:13px}
.market-cta b{font-size:20px;font-weight:600}
.market-cta.small{margin-top:12px;padding:13px 18px;border-radius:10px}
.market-cta.small strong{font-size:14px}
.market-section-title{margin:36px 0 14px;font-size:20px;font-weight:600;color:var(--mk-text)}
.market-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
.market-section-title+.market-pair{margin-top:0}
.market-latest{text-align:right}
.market-latest strong{display:block;font-size:28px;font-weight:600;color:var(--mk-text)}
.market-latest span{color:var(--mk-up);font-size:13px;font-weight:600}
.market-line-chart{display:block;width:100%;height:auto;font:7px var(--tx-font,Inter,sans-serif)}
.market-line-chart path{fill:none;stroke-width:2}
.market-modes{display:flex;gap:4px;padding:3px;border:1px solid var(--mk-line-strong);border-radius:9px}
.market-modes button{padding:6px 12px;border:0;border-radius:6px;background:transparent;color:var(--mk-muted);font:500 12px var(--tx-font,Inter,sans-serif);cursor:pointer}
.market-modes button[aria-pressed="true"]{background:var(--mk-raised);color:var(--mk-text);font-weight:600}
.market-badge{padding:3px 9px;border-radius:10px;background:rgba(185,163,255,.14);color:var(--mk-permits)!important;font-size:11px!important;font-weight:600}
.market-hexes path.outline{fill:#16202b;stroke:#26323f;stroke-width:1}
.market-card-foot{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.market-3d-open{flex:none;margin-top:8px;padding:7px 13px;border:1px solid var(--mk-line-strong);border-radius:8px;background:transparent;color:var(--mk-text);font:600 12px var(--tx-font,Inter,sans-serif);cursor:pointer}
.market-3d-open:hover{border-color:rgba(148,163,184,.45)}
.market-sources{margin:28px 0 0;color:var(--mk-muted);font-size:12px;line-height:1.6}.market-sources a{margin-left:8px;color:#5fd49a;font-weight:600;text-decoration:none}.market-sources a:hover{text-decoration:underline}
/* one market line in the analysis overview */
.market-line{display:flex;align-items:center;gap:16px;margin:0 0 14px;padding:12px 16px;border:1px solid rgba(148,163,184,.18);border-radius:12px;background:#121821;color:#e6edf3;text-decoration:none;font-size:13.5px;line-height:1.5}
.market-line:hover{border-color:rgba(148,163,184,.4)}
.market-line svg{flex:0 0 96px;height:30px}
.market-line path{fill:none;stroke:#4a8bd0;stroke-width:2}
.market-line span{flex:1}
.market-line b{color:#5fe0a0;font-weight:600}
.market-line em{font-style:normal;font-weight:600;color:#5fe0a0;white-space:nowrap}
@media(max-width:1100px){.market-grid,.market-pair{grid-template-columns:minmax(0,1fr)}}
@media(max-width:760px){
  /* the Parcels | Market tabs take the place of the product switch on a phone */
  .app-topbar{gap:8px}.app-topbar .platform-product small{display:none}
  /* "My analyses" as an account icon; the text stays as its accessible name */
  .app-topbar .platform-my-analyses{flex:none;width:34px;height:34px;margin-right:0;padding:0;font-size:0;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eaf2ee' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E") center/18px no-repeat}
  .section-tabs{margin-left:0;padding:3px}.section-tabs a{padding:6px 10px;font-size:13px}
  .market-page{padding:18px 16px 32px}.market-head h1{font-size:24px}
  .market-kpis{grid-template-columns:minmax(0,1fr)}
  .market-legend{flex-wrap:wrap}.market-legend i{flex-basis:140px}.market-legend em{flex-basis:100%;margin-left:0}
  .market-ranking button{grid-template-columns:96px minmax(0,1fr) 56px;gap:8px}.market-ranking small{display:none}
  .market-line{flex-wrap:wrap}.market-line svg{display:none}
}
/* Statistics tabs (12/11/2026): one district choice for every tab; each card has its own period or type switch */
.market-tabs{display:flex;gap:2px;margin:22px 0 0;border-bottom:1px solid var(--mk-line);overflow-x:auto}
.market-tabs button{flex:none;padding:10px 18px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--mk-muted);font:500 14px var(--tx-font,Inter,sans-serif);cursor:pointer}
.market-tabs button:hover,.market-tabs button:hover:not(:disabled){background:transparent;color:var(--mk-text)}
.market-tabs button.active{border-bottom-color:var(--mk-action);color:var(--mk-text);font-weight:600}
.kpi-more{margin-top:10px;padding:0;border:0;background:transparent;color:var(--mk-action);font:600 12px var(--tx-font,Inter,sans-serif);cursor:pointer}
.kpi-more:hover{text-decoration:underline}
.stat-stack{display:flex;flex-direction:column;gap:16px;margin-top:16px}
.stat-stack .market-pair{margin-top:0}
.stat-controls{display:flex;flex-wrap:wrap;gap:8px}
.stat-figure{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px;margin:0 0 12px}
.stat-figure strong{font-size:30px;font-weight:600;letter-spacing:-.02em;color:var(--mk-text)}
.stat-figure strong.prices{color:var(--mk-prices)}.stat-figure strong.permits{color:var(--mk-permits)}.stat-figure strong.real{color:var(--mk-up)}
.stat-figure span{font-size:14px;font-weight:600;color:var(--mk-up)}.stat-figure .stat-figure-extra{flex-basis:100%;margin:0;color:var(--mk-text);font-size:13.5px}.stat-figure span.down{color:var(--mk-down)}
.stat-figure small{flex-basis:100%;color:var(--mk-muted);font-size:12px}
.stat-chart{display:block;width:100%;height:auto;font:11px var(--tx-font,Inter,sans-serif)}
.stat-chart line{stroke:rgba(148,163,184,.12)}
.stat-chart text{fill:var(--mk-muted)}
.stat-chart text.end{font-weight:600}
.stat-chart path{fill:none;stroke-linejoin:round;stroke-linecap:round}
.stat-chart rect.hover{fill:transparent}
.stat-chart rect.hover:hover{fill:rgba(148,163,184,.06)}
.stat-subtitle{margin:18px 0 6px;font-size:13px;font-weight:600;color:var(--mk-soft)}
.stat-compare button{grid-template-columns:120px minmax(0,1fr) 72px 72px}
.stat-keys{flex-wrap:wrap;margin-top:6px}
.stat-keys i{display:inline-block;width:14px;height:10px;border-radius:2px}
.stat-source{margin:6px 0 0;color:#7f8d9c;font-size:11.5px;line-height:1.5}
.stat-select{display:flex;align-items:center;gap:8px;color:var(--mk-muted);font-size:12px}
.stat-select select{max-width:240px;padding:6px 10px;border:1px solid var(--mk-line-strong);border-radius:8px;background:var(--mk-raised);color:var(--mk-text);font:13px var(--tx-font,Inter,sans-serif)}
.stat-hint{color:var(--mk-muted);font-size:12px}
.land-bar{display:flex;height:14px;margin:4px 0 14px;border-radius:7px;overflow:hidden;background:var(--mk-raised)}
.land-bar i{display:block;height:100%}
.land-table{width:100%;border-collapse:collapse;font-size:13px}
.land-table th{padding:6px 8px;border-bottom:1px solid var(--mk-line-strong);color:var(--mk-muted);font-size:12px;font-weight:500;text-align:right}
.land-table th:first-child,.land-table td:first-child{text-align:left}
.land-table td{padding:7px 8px;border-bottom:1px solid var(--mk-line);color:var(--mk-text);text-align:right}
.land-table td i{display:inline-block;width:10px;height:10px;margin-right:8px;border-radius:2px;vertical-align:-1px}
@media(max-width:760px){
  .market-tabs button{padding:9px 12px;font-size:13px}
  .stat-figure strong{font-size:26px}
  .stat-compare button{grid-template-columns:96px minmax(0,1fr) 60px}
  .stat-select select{max-width:180px}
}
.stat-split{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(280px,1fr);gap:28px;align-items:start}
.stat-side .stat-subtitle{margin-top:4px}
.stat-side .stat-compare button{grid-template-columns:96px minmax(0,1fr) 64px 52px;gap:8px;padding:6px 6px}
@media(max-width:1100px){.stat-split{grid-template-columns:minmax(0,1fr);gap:8px}}
.stat-legend{margin:0;padding:0;list-style:none}
.stat-legend li{display:grid;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 6px;border-bottom:1px solid var(--mk-line);font-size:13px}
.stat-legend i{display:block;width:14px;height:10px;border-radius:2px}
.stat-legend b{font-size:15px;font-weight:600}
@media(max-width:760px){.stat-chart{font-size:22px}.stat-chart path{stroke-width:4}}
.land-table td{white-space:nowrap}.land-table td:first-child{white-space:normal}
@media(max-width:760px){.stat-chart text.x-alt{display:none}.land-table{font-size:12px}.land-table th,.land-table td{padding:6px 4px}}
/* the (i) stays red inside card headers (the header span rule above would grey it) */
.market-card>header .info-tip{color:#ff6b5e;font-size:inherit}.market-card>header .info-tip.source-tip{color:#70dda5;margin-left:4px}.market-card>header .info-tip.source-tip:hover,.market-card>header .info-tip.source-tip.open{color:#c5f5d8}.market-card>header .info-tip:hover,.market-card>header .info-tip.open{color:#ff8f84}
/* market value: totals and per-transfer amounts stay on one line */
.stat-compare.value-compare button{grid-template-columns:110px minmax(0,1fr) 84px 72px}.stat-compare.value-compare b,.stat-compare.value-compare small{white-space:nowrap}
.stat-explain{margin-top:14px;padding:12px 14px;border:1px solid rgba(161,173,187,.2);border-radius:9px;background:#0d1218;color:#c3cbd4;font-size:12.5px;line-height:1.55}.stat-explain h4{margin:0 0 6px;font-size:13px;color:#e6edf3}.stat-explain ul{margin:0;padding-left:17px}.stat-explain li{margin:3px 0}
.market-source-list{margin:6px 0 0;color:#93a1b1;font-size:12px;line-height:1.6}.market-source-list summary{cursor:pointer;color:#5fd49a;font-weight:600;width:max-content}.market-source-list summary:hover{text-decoration:underline}
.market-source-list ul{margin:8px 0 6px;padding-left:18px}.market-source-list strong{color:#c9d2dc;font-weight:600}.market-source-list p{margin:0}
