/* Dream inherits the report card language from bodygraph-v2. */
.uk-dream-svg.is-fhd-dream-v2 {
    width: 100% !important;
    flex-basis: 100% !important;
    max-width: none !important;
}

.hgsvg_dream.is-fhd-dream-v2 {
    width: 100%;
    min-width: 0;
    container-type: inline-size;
}

.hgsvg_dream.is-fhd-dream-v2 > .svg_dream,
.hgsvg_dream.is-fhd-dream-v2 > .fhd-dream-data {
    display: none !important;
}

.fhd-dream-viewer {
    margin: 0 0 30px;
    font-family: "Source Sans 3", system-ui, sans-serif;
}

.fhd-dream-viewer *,
.fhd-dream-viewer *::before,
.fhd-dream-viewer *::after {
    box-sizing: border-box;
}

.fhd-dream-viewer .fhd-bodygraph-legend .is-landmark {
    background: #a58db8;
    box-shadow: 0 0 0 3px rgba(165, 141, 184, 0.14);
}

.fhd-dream-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--fhd-border);
}

.fhd-dream-toolbar h2 {
    margin: 0;
    color: var(--fhd-ink);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.fhd-dream-toolbar p {
    margin: 5px 0 0;
    color: var(--fhd-muted);
    font-size: 14px;
    line-height: 1.45;
}

.fhd-dream-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 28px;
    background: #fbf9fc;
    border-bottom: 1px solid var(--fhd-border);
}

.fhd-dream-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fhd-dream-tabs button,
.fhd-dream-save,
.fhd-dream-export-menu button {
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.fhd-dream-tabs button {
    padding: 9px 15px;
    color: var(--fhd-muted);
    background: transparent;
}

.fhd-dream-tabs button:hover {
    color: var(--fhd-brand);
    background: #f0ebf4;
}

.fhd-dream-tabs button[aria-selected="true"] {
    color: #ffffff;
    background: var(--fhd-brand);
    box-shadow: 0 4px 12px rgba(97, 56, 138, 0.2);
}

.fhd-dream-export {
    position: relative;
}

.fhd-dream-save {
    padding: 9px 16px;
    color: var(--fhd-brand);
    background: #ffffff;
    border-color: #cbbbd9;
}

.fhd-dream-save:hover {
    color: #ffffff;
    background: var(--fhd-brand);
    border-color: var(--fhd-brand);
}

.fhd-dream-export-menu {
    position: absolute;
    z-index: 5;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 3px;
    min-width: 170px;
    padding: 6px;
    background: #ffffff;
    border: 1px solid var(--fhd-border);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(32, 25, 35, 0.16);
}

.fhd-dream-export-menu[hidden] {
    display: none;
}

.fhd-dream-export-menu button {
    padding: 9px 10px;
    color: var(--fhd-ink);
    text-align: left;
    background: #ffffff;
}

.fhd-dream-export-menu button:hover {
    background: #f5f0f8;
}

.fhd-dream-layout {
    display: grid;
    grid-template-columns: minmax(160px, 200px) minmax(0, 1fr) minmax(160px, 200px);
    align-items: center;
    gap: clamp(8px, 2vw, 24px);
    padding: 28px 22px 12px;
}

.fhd-dream-viewer[data-mode="personality"] .fhd-dream-layout {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 200px);
}

.fhd-dream-viewer[data-mode="design"] .fhd-dream-layout {
    grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
}

.fhd-dream-rail[hidden] {
    display: none;
}

.fhd-dream-chart {
    min-width: 0;
    text-align: center;
}

.fhd-dream-canvas {
    width: 100%;
    background: #ffffff;
}

.fhd-dream-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
}

.fhd-dream-gate {
    cursor: pointer;
    outline: none;
}

.fhd-dream-gate:hover > path,
.fhd-dream-gate.is-selected > path,
.fhd-dream-gate:focus-visible > path {
    stroke: #61388a;
    stroke-width: 13;
}

.fhd-dream-gate:focus-visible {
    filter: drop-shadow(0 0 8px rgba(97, 56, 138, 0.35));
}

.fhd-dream-stat {
    margin: 0;
    color: var(--fhd-muted);
    font-size: 13px;
    font-weight: 650;
}

.fhd-dream-pan-hint {
    display: none;
    margin: 2px 0 8px;
    color: var(--fhd-muted);
    font-size: 12px;
}

.fhd-dream-zoom {
    display: none;
    margin: 0 auto 8px;
    padding: 7px 12px;
    color: var(--fhd-brand);
    background: #ffffff;
    border: 1px solid #cbbbd9;
    border-radius: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.fhd-dream-rail {
    align-self: stretch;
    min-width: 0;
    padding-top: 14px;
}

.fhd-dream-rail h3 {
    margin: 0 0 10px;
    color: var(--fhd-ink);
    font-size: 16px;
    font-weight: 750;
}

.fhd-dream-rail.is-design h3 {
    color: #c43128;
    text-align: right;
}

.fhd-dream-rail ol {
    display: grid;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fhd-dream-rail li {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 31px;
    padding: 5px 6px;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.2;
}

.fhd-dream-rail li:nth-child(odd) {
    background: #faf8fb;
}

.fhd-dream-rail.is-design li {
    justify-content: flex-end;
    color: #bf342c;
}

.fhd-dream-rail.is-personality li {
    color: #201923;
}

.fhd-dream-planet-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fhd-dream-planet-glyph {
    flex: 0 0 19px;
    font-family: "Segoe UI Symbol", sans-serif;
    font-size: 17px;
    line-height: 1;
}

.fhd-dream-rail strong {
    flex: 0 0 auto;
    min-width: 30px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.fhd-dream-rail .is-empty {
    color: var(--fhd-muted);
    font-style: italic;
    text-align: left;
}

.fhd-dream-inspector {
    min-height: 92px;
    margin: 10px 28px 26px;
    padding: 16px 20px;
    color: var(--fhd-ink);
    background: #f8f6fa;
    border-radius: 14px;
}

.fhd-dream-inspector h3 {
    margin: 0 0 3px;
    font-size: 17px;
    font-weight: 750;
}

.fhd-dream-inspector p,
.fhd-dream-inspector small {
    display: block;
    margin: 0;
    color: var(--fhd-muted);
    font-size: 14px;
    line-height: 1.45;
}

.fhd-dream-inspector small {
    margin-top: 5px;
}

.fhd-dream-viewer button:focus-visible {
    outline: 3px solid #b896d4;
    outline-offset: 2px;
}

@media (max-width: 880px) {
    .fhd-dream-layout,
    .fhd-dream-viewer[data-mode="personality"] .fhd-dream-layout,
    .fhd-dream-viewer[data-mode="design"] .fhd-dream-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 20px;
    }

    .fhd-dream-chart {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .fhd-dream-canvas {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        touch-action: pan-x pan-y;
    }

    .fhd-dream-viewer.is-zoomed .fhd-dream-svg {
        min-width: 800px;
        max-height: none;
    }

    .fhd-dream-zoom,
    .fhd-dream-viewer.is-zoomed .fhd-dream-pan-hint {
        display: block;
    }

    .fhd-dream-rail {
        grid-row: 2;
    }

    .fhd-dream-rail.is-design {
        grid-column: 1;
    }

    .fhd-dream-rail.is-personality {
        grid-column: 2;
    }

    .fhd-dream-viewer[data-mode="personality"] .fhd-dream-rail.is-personality,
    .fhd-dream-viewer[data-mode="design"] .fhd-dream-rail.is-design {
        grid-column: 1 / -1;
    }
}

@container (max-width: 840px) {
    .fhd-dream-layout,
    .fhd-dream-viewer[data-mode="personality"] .fhd-dream-layout,
    .fhd-dream-viewer[data-mode="design"] .fhd-dream-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 20px;
    }

    .fhd-dream-chart {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .fhd-dream-canvas {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        touch-action: pan-x pan-y;
    }

    .fhd-dream-viewer.is-zoomed .fhd-dream-svg {
        min-width: 800px;
        max-height: none;
    }

    .fhd-dream-zoom,
    .fhd-dream-viewer.is-zoomed .fhd-dream-pan-hint {
        display: block;
    }

    .fhd-dream-rail {
        grid-row: 2;
    }

    .fhd-dream-rail.is-design {
        grid-column: 1;
    }

    .fhd-dream-rail.is-personality {
        grid-column: 2;
    }

    .fhd-dream-viewer[data-mode="personality"] .fhd-dream-rail.is-personality,
    .fhd-dream-viewer[data-mode="design"] .fhd-dream-rail.is-design {
        grid-column: 1 / -1;
    }
}

@media (max-width: 540px) {
    .fhd-dream-toolbar,
    .fhd-dream-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    .fhd-dream-toolbar .fhd-bodygraph-legend {
        justify-content: flex-start;
    }

    .fhd-dream-layout {
        gap: 6px 10px;
        padding: 12px 10px;
    }

    .fhd-dream-viewer.is-zoomed .fhd-dream-svg {
        min-width: 1000px;
    }

    .fhd-dream-tabs {
        width: 100%;
    }

    .fhd-dream-tabs button {
        flex: 1 1 auto;
        padding: 9px 7px;
    }

    .fhd-dream-export,
    .fhd-dream-save {
        width: 100%;
    }

    .fhd-dream-rail li {
        gap: 3px;
        padding: 5px 3px;
        font-size: 11px;
    }

    .fhd-dream-planet-glyph {
        flex-basis: 14px;
        font-size: 14px;
    }

    .fhd-dream-rail strong {
        min-width: 26px;
        font-size: 12px;
    }

    .fhd-dream-inspector {
        margin: 8px 12px 18px;
    }
}
