/* Compact layout when new-*-map pages are embedded on /election-map/fillable-maps/ (?embed=1). */
html.fillable-map-embed-root {
    color-scheme: dark;
    background: transparent;
}

body.fillable-map-embed {
    background: transparent;
    overflow: hidden;
    height: 100vh;
    max-height: 100vh;
}

body.fillable-map-embed .senate-map-shell,
body.fillable-map-embed .gov-map-shell,
body.fillable-map-embed .house-map-shell {
    min-height: 0;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    transform: none;
    background: transparent;
    container-type: inline-size;
    box-sizing: border-box;
    padding-top: 6px;
    /* Bar = full width − 40px; map renders 30px narrower than full width (10px wider than bar). */
    --embed-map-scale: calc((100cqi - 30px) / 100cqi);
}

body.fillable-map-embed #standaloneMapExportRoot {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
}

body.fillable-map-embed .scoreboard-wrap {
    flex: 0 0 auto;
    width: calc(100% - 40px);
    max-width: none;
    margin: 0.1rem auto 0;
    padding: 0;
    box-sizing: border-box;
    transform: none;
    pointer-events: auto;
    overflow: visible;
}

body.fillable-map-embed .scoreboard-wrap > div {
    padding-top: 1.65rem;
}

body.fillable-map-embed .scoreboard-wrap > div > div:first-child {
    top: 6px !important;
}

body.fillable-map-embed .scoreboard-wrap .flex.justify-between {
    top: 0 !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
}

body.fillable-map-embed .seats-text,
body.fillable-map-embed #seatsText {
    font-size: 9px !important;
    line-height: 1.1 !important;
}

body.fillable-map-embed #repLabel,
body.fillable-map-embed #demLabel {
    font-size: 0.82rem !important;
    gap: 0.3rem !important;
    align-items: center !important;
    line-height: 1 !important;
    margin-top: 0 !important;
}

body.fillable-map-embed #repLabel > span:not([id]),
body.fillable-map-embed #demLabel > span:not([id]) {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1 !important;
}

body.fillable-map-embed #repCount,
body.fillable-map-embed #demCount,
body.fillable-map-embed #repEvCount,
body.fillable-map-embed #demEvCount {
    font-size: 1.14rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    transform: translateY(0);
}

body.fillable-map-embed .map-score-logo {
    height: 20px !important;
}

body.fillable-map-embed #barContainer {
    margin-top: 0 !important;
    min-height: 0 !important;
    height: 49px !important;
    max-height: 49px !important;
    border-radius: 4px;
}

body.fillable-map-embed #neutralBar {
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
}

body.fillable-map-embed #neutralBar .ml-3 {
    margin-left: 0.25rem !important;
}

body.fillable-map-embed #repSegments,
body.fillable-map-embed #demSegments {
    height: 100% !important;
}

body.fillable-map-embed #repSegments > div span,
body.fillable-map-embed #demSegments > div span {
    font-size: inherit !important;
}

body.fillable-map-embed #repSegments > div span span:only-child,
body.fillable-map-embed #demSegments > div span span:only-child {
    font-size: 0.6rem !important;
}

body.fillable-map-embed #repSegments > div span span:first-child:not(:only-child),
body.fillable-map-embed #demSegments > div span span:first-child:not(:only-child) {
    font-size: 0.48rem !important;
    line-height: 1.05 !important;
}

body.fillable-map-embed #repSegments > div span span:last-child:not(:only-child),
body.fillable-map-embed #demSegments > div span span:last-child:not(:only-child) {
    font-size: 0.6rem !important;
    line-height: 1.1 !important;
}

body.fillable-map-embed .triangle-top {
    border-left-width: 4px;
    border-right-width: 4px;
    border-top-width: 5px;
}

body.fillable-map-embed .map-wrap,
body.fillable-map-embed #houseMapZoomBlock {
    flex: 1 1 auto;
    border-radius: 0 0 6px 6px;
    min-height: 0;
    height: auto !important;
    margin: calc(-0.35rem + 5px) auto 0;
    left: auto;
    width: 100%;
    max-width: none;
    overflow: hidden;
    pointer-events: auto !important;
    position: relative !important;
    transform: scale(var(--embed-map-scale));
    transform-origin: center 42%;
    background: transparent !important;
}

body.fillable-map-embed .house-map-shell .map-wrap,
body.fillable-map-embed .house-map-shell #houseMapZoomBlock {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body.fillable-map-embed .house-map-shell #houseMapZoomViewport {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    cursor: default !important;
    touch-action: auto !important;
    z-index: 1 !important;
    background: transparent !important;
}

body.fillable-map-embed .house-map-shell #houseMapStage {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    transform: none !important;
    pointer-events: auto !important;
    background: transparent !important;
}

body.fillable-map-embed .house-map-shell #houseCdMap {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: block;
    transform: scale(1.155) !important;
    transform-origin: center 42% !important;
}

body.fillable-map-embed #map,
body.fillable-map-embed #houseCdMap {
    height: 100% !important;
    width: 100%;
    display: block;
}

body.fillable-map-embed #map {
    transform: scale(1.155);
    transform-origin: center 42%;
}

body.fillable-map-embed #houseMapTopMask {
    display: none !important;
}

body.fillable-map-embed #map image,
body.fillable-map-embed #houseCdMap image {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.fillable-map-embed .house-map-shell #barContainer {
    margin-top: 0 !important;
}

body.fillable-map-embed footer {
    display: none !important;
}
