/* Gig app earnings map (/earnings-map.html). Uses tokens from /site.css. */
.emap-section { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(24px, 4vw, 48px); }
.emap { overflow-anchor: none; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(14px, 2.4vw, 28px); }

.emap-bar-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; color: var(--ink-2); }
.emap-bar-top select { font: inherit; font-weight: 600; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 32px 8px 12px; min-height: 40px; }

.emap-canvas { position: relative; }
.emap-svg { display: block; width: 100%; height: auto; overflow: visible; }
.emap-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-3); }
.emap.is-ready .emap-loading { display: none; }

.emap-state { fill: #e2e5e1; stroke: none; cursor: pointer; transition: fill .35s ease, opacity .35s ease; outline: none; }
.emap-state:hover, .emap-state:focus-visible { filter: brightness(1.04); }
.emap-state:focus-visible { stroke: var(--ink); stroke-width: 2.5; }
.emap-state.is-dim { opacity: .18; }
.emap-hatch { pointer-events: none; }
.emap-borders { fill: none; stroke: #fff; stroke-width: 1.1; stroke-linejoin: round; pointer-events: none; }
.emap-outline { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.emap-bands rect { animation: emap-band .28s ease-out both; transform-box: fill-box; transform-origin: left; }
@keyframes emap-band { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.emap-lab { font: 600 10.5px var(--font-body); text-anchor: middle; letter-spacing: .02em; transition: opacity .3s; }
.emap.is-zooming .emap-lab, .emap.is-zooming .emap-hatch { opacity: 0; }

.emap-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.emap-key { display: inline-flex; align-items: center; gap: 6px; }
.emap-key > i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.emap-key b { color: var(--ink); font-weight: 600; }
.emap-key-est > i { background: repeating-linear-gradient(45deg, #9aa29c 0 2px, transparent 2px 5px); border: 1px solid #c3c8c4; }
.emap-scale { gap: 8px; }
.emap-ramp { display: inline-flex; }
.emap-ramp i { width: 22px; height: 12px; display: inline-block; }
.emap-ramp i:first-child { border-radius: 3px 0 0 3px; }
.emap-ramp i:last-child { border-radius: 0 3px 3px 0; }

.emap-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(21, 32, 26, .12); }

/* tooltip */
.emap-tip { position: absolute; left: 0; top: 0; z-index: 5; width: 290px; max-width: calc(100% - 16px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px -16px rgba(21, 32, 26, .35); padding: 12px 14px; pointer-events: none; font-size: 13px; }
.emap-th { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.emap-th strong { font: 600 17px var(--font-display); }
.emap-th span { color: var(--ink-3); font-size: 12px; }
.emap-tip ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.emap-tip li { display: grid; grid-template-columns: auto 92px 1fr auto; align-items: center; gap: 6px; }
.emap-tip li .emap-dot { margin: 0; }
.emap-tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emap-tn em, .emap-table em { font-style: normal; color: var(--ink-3); font-size: 11px; }
.emap-bar { height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.emap-bar i { display: block; height: 100%; border-radius: 3px; }
.emap-tip b { font-variant-numeric: tabular-nums; font-weight: 600; }
.emap-tf { margin-top: 8px; color: var(--green); font-weight: 600; font-size: 12px; }

/* detail view */
.emap-detail { display: none; }
.emap.is-detail .emap-mapview { display: none; }
.emap.is-detail .emap-detail { display: block; animation: emap-in .35s ease-out both; }
@keyframes emap-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.emap-dhead { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.emap-back { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; min-height: 40px; cursor: pointer; }
.emap-back:hover { background: var(--green-soft); }
.emap-dtitle { font: 600 clamp(26px, 3.4vw, 38px)/1.1 var(--font-display); margin: 0; }
.emap-dsub { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.emap-dbody { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: clamp(18px, 3vw, 40px); align-items: start; }
.emap-pie { width: 100%; height: auto; display: block; overflow: visible; }
.emap-slice { stroke: #fff; stroke-width: 1.5; cursor: pointer; transform-origin: 160px 160px; animation: emap-slice .45s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .2s, transform .2s; outline: none; }
@keyframes emap-slice { from { opacity: 0; transform: scale(.6) rotate(-20deg); } to { opacity: 1; transform: none; } }
.emap-slice.is-off { opacity: .3; }
.emap-slice.is-on { transform: scale(1.04); }
.emap-slab { font: 700 13px var(--font-body); text-anchor: middle; pointer-events: none; }
.emap-c1 { font: 500 12px var(--font-body); fill: var(--ink-3); text-anchor: middle; text-transform: uppercase; letter-spacing: .08em; }
.emap-c2 { font: 600 21px var(--font-display); fill: var(--ink); text-anchor: middle; }
.emap-c3 { font: 600 16px var(--font-body); fill: var(--green); text-anchor: middle; }
.emap-pienote { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }

.emap-dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.emap-dstats div { background: var(--paper-2); border-radius: 12px; padding: 10px 12px; }
.emap-dstats span { display: block; font-size: 12px; color: var(--ink-3); }
.emap-dstats b { font-size: 19px; font-variant-numeric: tabular-nums; }
.emap-dstats .up { color: var(--green); }
.emap-dstats .down { color: var(--tomato); }

.emap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.emap-list li { display: grid; grid-template-columns: 22px auto 1fr auto; gap: 8px; align-items: start; padding: 9px 10px; border-radius: 10px; transition: background .15s; }
.emap-list li.is-on { background: var(--paper-2); }
.emap-list .emap-dot { margin: 5px 0 0; width: 12px; height: 12px; }
.emap-rank { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.emap-ln b { font-weight: 600; }
.emap-ln small { color: var(--ink-3); font-size: 12px; }
.emap-split, .emap-cities { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.emap-lv { text-align: right; }
.emap-lv b { display: block; font-variant-numeric: tabular-nums; font-size: 16px; }
.emap-lv small { font-size: 11px; color: var(--ink-3); }

/* static content */
.emap-h2 { font: 600 clamp(22px, 2.6vw, 30px)/1.2 var(--font-display); margin: clamp(32px, 5vw, 56px) 0 16px; }
.emap-h2:first-child { margin-top: 0; }
.emap-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.emap-answers div { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.emap-answers span { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.emap-answers b { font-size: 17px; }
.emap-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.emap-app-card { border: 1px solid var(--line); border-top: 4px solid var(--app); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.emap-app-card h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; }
.emap-app-meta, .emap-app-low { font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px; }
.emap-app-low { margin: 8px 0 0; }
.emap-app-card ol { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 3px; }
.emap-app-card li b { float: right; font-variant-numeric: tabular-nums; }
.emap-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.emap-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.emap-table th, .emap-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.emap-table thead th { background: var(--paper-2); font-size: 12.5px; color: var(--ink-2); position: sticky; top: 0; }
.emap-table td b { font-variant-numeric: tabular-nums; }
.emap-table tbody tr:hover { background: var(--paper-2); }
.emap-table tr.is-est { color: var(--ink-3); }
.emap-table a { color: inherit; font-weight: 600; }
.emap-small { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.emap-method { max-width: 780px; }
.emap-method p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.6; }
.emap-faq { border-bottom: 1px solid var(--line); padding: 12px 0; max-width: 780px; }
.emap-faq summary { font-weight: 600; cursor: pointer; }
.emap-faq p { color: var(--ink-2); line-height: 1.6; margin: 8px 0 0; }

@media (max-width: 760px) {
    .emap-dbody { grid-template-columns: 1fr; }
    .emap-piewrap { max-width: 340px; margin: 0 auto; width: 100%; }
    .emap-lab { font-size: 13px; }
}
@media (max-width: 480px) {
    .emap-dstats b { font-size: 16px; }
    .emap-list li { grid-template-columns: 18px auto 1fr auto; gap: 6px; padding: 8px 4px; }
}
@media (prefers-reduced-motion: reduce) {
    .emap-bands rect, .emap-slice, .emap.is-detail .emap-detail { animation: none; }
}
.emap-dhead > div { flex: 1; min-width: 200px; }
.emap-esttoggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 40px; }
.emap-esttoggle input { width: 18px; height: 18px; accent-color: var(--green); }
.emap-slab.is-est { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }

/* Reserve the legend's height (filled by earnings-map.js) so the content below does not shift (CLS). */
.emap-legend { min-height: 50px; }
@media (max-width: 600px) { .emap-legend { min-height: 79px; } }
