:root {
    --wherehdb-bg: #f8f2eb;
    --wherehdb-bg-soft: #fffaf5;
    --wherehdb-text: #1a1612;
    --wherehdb-soft: #5c504a;
    --wherehdb-muted: #8b7b72;
    --wherehdb-line: rgb(26 22 18 / 0.12);
    --wherehdb-accent: #f0722a;
    --wherehdb-accent-soft: rgb(240 114 42 / 0.12);
    --wherehdb-accent-line: rgb(240 114 42 / 0.28);
    --wherehdb-surface: rgb(255 255 255 / 0.7);
    --wherehdb-surface-strong: rgb(255 255 255 / 0.94);
    --wherehdb-field: rgb(255 255 255 / 0.74);
    --wherehdb-track: rgb(26 22 18 / 0.08);
    --wherehdb-shadow: 0 18px 46px rgb(90 64 42 / 0.1);
    --wherehdb-page-bg:
        radial-gradient(circle at 12% 10%, rgb(232 244 253 / 0.92), transparent 28rem),
        linear-gradient(145deg, #e8f4fd 0%, var(--wherehdb-bg) 46%, #fce9d4 100%);
    --background-color: var(--wherehdb-bg);
    --color-primary-text: var(--wherehdb-text);
    --color-secondary-text: var(--wherehdb-soft);
    --color-border: var(--wherehdb-line);
    --ghost-accent-color: var(--wherehdb-accent);
}

html[data-wherehdb-resolved-theme="dark"] {
    --wherehdb-bg: #17110e;
    --wherehdb-bg-soft: #261d17;
    --wherehdb-text: #f3ece5;
    --wherehdb-soft: #cdbdb1;
    --wherehdb-muted: #9f9086;
    --wherehdb-line: rgb(255 236 218 / 0.16);
    --wherehdb-accent: #ff8845;
    --wherehdb-accent-soft: rgb(255 136 69 / 0.14);
    --wherehdb-accent-line: rgb(255 136 69 / 0.32);
    --wherehdb-surface: rgb(38 29 23 / 0.78);
    --wherehdb-surface-strong: rgb(28 22 18 / 0.96);
    --wherehdb-field: rgb(28 22 18 / 0.88);
    --wherehdb-track: rgb(255 236 218 / 0.1);
    --wherehdb-shadow: 0 18px 46px rgb(0 0 0 / 0.28);
    --wherehdb-page-bg:
        radial-gradient(circle at 12% 10%, rgb(16 35 42 / 0.9), transparent 28rem),
        linear-gradient(145deg, #130f0c 0%, #211710 48%, #10232a 100%);
    --background-color: var(--wherehdb-bg);
    --color-primary-text: var(--wherehdb-text);
    --color-secondary-text: var(--wherehdb-soft);
    --color-border: var(--wherehdb-line);
    --ghost-accent-color: var(--wherehdb-accent);
}

html,
body,
.gh-viewport {
    background: var(--wherehdb-page-bg);
    color: var(--wherehdb-text);
}

:is(.gh-navigation, .gh-footer).has-accent-color,
.gh-navigation,
.gh-footer {
    background: transparent;
    color: var(--wherehdb-text);
}

.gh-navigation-inner,
.gh-footer-inner {
    border-color: var(--wherehdb-line);
}

.gh-navigation-logo,
.gh-footer-logo,
.gh-header-title,
.gh-card-title,
.gh-article-title,
.gh-container-title,
.gh-content,
.gh-content :is(h1, h2, h3, h4, h5, h6, p, li, blockquote),
.gh-comments {
    color: var(--wherehdb-text);
}

.gh-navigation-menu a,
.gh-card-excerpt,
.gh-card-meta,
.gh-article-meta,
.gh-article-meta a,
.gh-article-meta-content,
.gh-article-author-name a,
.gh-footer,
.gh-footer a,
.gh-footer-signup-subhead {
    color: var(--wherehdb-soft);
}

.gh-navigation-menu a:hover,
.gh-article-author-name a:hover,
.gh-card-link:hover .gh-card-title,
.gh-footer a:hover {
    color: var(--wherehdb-accent);
    opacity: 1;
}

.gh-navigation-actions {
    background: transparent;
}

.gh-navigation-menu li:has(> a[href="https://wherehdb.com/map"]),
.gh-navigation-menu .nav-map,
.gh-navigation-menu a[href="https://wherehdb.com/map"] {
    display: none;
}

.gh-button,
.gh-content .kg-button-card a.kg-btn,
.wherehdb-map-cta {
    border: 1px solid var(--wherehdb-accent);
    border-radius: 12px;
    background: var(--wherehdb-accent);
    color: #fff7ef;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--wherehdb-accent) 18%, transparent);
}

.gh-button:hover,
.gh-content .kg-button-card a.kg-btn:hover,
.wherehdb-map-cta:hover {
    border-color: var(--wherehdb-accent);
    background: var(--wherehdb-accent);
    color: #fff7ef;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--wherehdb-accent) 26%, transparent);
    opacity: 1;
}

.gh-button-share {
    border-color: var(--wherehdb-line);
    background: var(--wherehdb-surface);
    color: var(--wherehdb-soft);
    box-shadow: none;
}

.gh-button-share:hover {
    border-color: var(--wherehdb-accent-line);
    background: var(--wherehdb-accent-soft);
    color: var(--wherehdb-accent);
}

.gh-navigation-members a[href="#/portal/signin"]:not(.gh-button) {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--wherehdb-soft);
    box-shadow: none;
    padding: 0;
}

.gh-navigation-members a[href="#/portal/signin"]:not(.gh-button):hover {
    background: transparent;
    color: var(--wherehdb-accent);
    opacity: 1;
}

.gh-icon-button,
.wherehdb-theme-toggle {
    border: 1px solid var(--wherehdb-line);
    border-radius: 12px;
    background: var(--wherehdb-surface);
    color: var(--wherehdb-soft);
}

.gh-icon-button:hover,
.wherehdb-theme-toggle:hover {
    border-color: var(--wherehdb-accent-line);
    color: var(--wherehdb-accent);
    opacity: 1;
}

.wherehdb-theme-toggle {
    appearance: none;
    display: inline-grid;
    place-items: center;
    inline-size: 36px;
    block-size: 36px;
    cursor: pointer;
    padding: 0;
}

.gh-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    height: auto;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.gh-form:hover {
    background: transparent;
}

.gh-form-input,
.gh-form-input:focus {
    position: static;
    inset: auto;
    width: 100%;
    height: 48px;
    border: 1px solid var(--wherehdb-accent-line);
    border-radius: 12px;
    background: var(--wherehdb-field);
    color: var(--wherehdb-text);
    padding: 0 16px;
    box-shadow: none;
}

.gh-form-input:focus {
    border-color: var(--wherehdb-accent);
    box-shadow: 0 0 0 3px var(--wherehdb-accent-soft);
}

.gh-form .gh-button {
    position: static;
    right: auto;
    height: 48px;
    min-width: 132px;
    border-radius: 12px;
    padding: 0 18px;
}

.gh-form > svg {
    display: none;
}

.gh-form [data-members-error] {
    top: calc(100% + 6px);
}

.gh-form-input::placeholder {
    color: var(--wherehdb-muted);
}

.kg-bookmark-container,
.kg-toggle-card {
    border-color: var(--wherehdb-line);
    background: var(--wherehdb-surface);
    color: var(--wherehdb-text);
}

.gh-card {
    border-color: transparent;
    border-radius: 12px;
    background: transparent;
}

.gh-card-image,
.gh-card-image img {
    overflow: hidden;
    border-radius: 12px;
}

.gh-article-tag,
.gh-card-tag,
a.gh-card-tag,
.gh-content a {
    color: var(--wherehdb-accent);
}

.gh-comments {
    border: 1px solid var(--wherehdb-line);
    border-radius: 18px;
    background: var(--wherehdb-surface-strong);
    box-shadow: var(--wherehdb-shadow);
    padding: 24px;
}

.gh-comments,
.gh-comments * {
    border-color: var(--wherehdb-line);
}

html[data-wherehdb-resolved-theme="light"] .gh-comments {
    color-scheme: light;
}

html[data-wherehdb-resolved-theme="dark"] .gh-comments {
    color-scheme: dark;
}

.gh-comments iframe {
    background: transparent;
    color-scheme: inherit;
}

.kg-toggle-card {
    box-shadow: var(--wherehdb-shadow);
}

.kg-toggle-heading,
.kg-toggle-heading-text,
.kg-toggle-content,
.kg-toggle-content p {
    color: var(--wherehdb-text);
}

.kg-toggle-card-icon,
.kg-toggle-heading path {
    color: var(--wherehdb-accent);
    stroke: var(--wherehdb-accent);
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kg-gallery-row {
    display: flex;
    gap: 0.75rem;
}

.kg-gallery-image {
    flex: 1 1 0;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-bookmark-card {
    width: 100%;
}

.kg-bookmark-container {
    overflow: hidden;
    border-color: var(--wherehdb-line);
    background: var(--wherehdb-surface);
    color: var(--wherehdb-text);
}

.kg-bookmark-icon {
    border-radius: 3px;
}

.kg-bookmark-author,
.kg-bookmark-publisher {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footnotes,
.footnotes li,
.footnotes p {
    color: var(--wherehdb-soft);
}

.footnotes {
    border-color: var(--wherehdb-line);
}

.footnote-ref a,
.footnote-backref,
.wherehdb-ref a,
.wherehdb-ref-back {
    color: var(--wherehdb-accent);
    text-decoration: none;
}

.wherehdb-ref a:hover,
.wherehdb-ref-back:hover,
.wherehdb-generated-references a:hover {
    text-decoration: underline;
}

.wherehdb-generated-references {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--wherehdb-line);
    color: var(--wherehdb-soft);
}

.wherehdb-generated-references h2 {
    color: var(--wherehdb-text);
}

.wherehdb-generated-references ol {
    padding-left: 1.4rem;
}

.wherehdb-generated-references li {
    margin: 0.75rem 0;
    padding: 0.35rem 0.45rem;
    scroll-margin-top: 24px;
    border-radius: 10px;
    color: var(--wherehdb-soft);
    transition: background-color 180ms ease-out, box-shadow 180ms ease-out;
}

.wherehdb-generated-references a {
    color: var(--wherehdb-accent);
    overflow-wrap: anywhere;
}

.wherehdb-reference-target {
    animation: wherehdbRefPulse 1.4s ease-out 1;
}

@keyframes wherehdbRefPulse {
    0% {
        background: var(--wherehdb-accent-soft);
        box-shadow:
            0 0 0 1px var(--wherehdb-accent-line),
            0 0 0 8px color-mix(in srgb, var(--wherehdb-accent) 10%, transparent);
    }

    100% {
        background: transparent;
        box-shadow:
            0 0 0 1px transparent,
            0 0 0 0 transparent;
    }
}

.wherehdb-viz {
    margin-block: 2rem;
    border: 1px solid var(--wherehdb-line);
    border-radius: 18px;
    background: var(--wherehdb-surface);
    box-shadow: var(--wherehdb-shadow);
    color: var(--wherehdb-text);
    padding: clamp(20px, 4vw, 34px);
}

.wherehdb-viz__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--wherehdb-line);
    padding-bottom: 18px;
}

.wherehdb-viz__eyebrow {
    margin: 0 0 6px;
    color: var(--wherehdb-accent);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wherehdb-viz h3 {
    margin: 0;
}

.wherehdb-viz__value {
    display: grid;
    min-width: 92px;
    place-items: center;
    border-radius: 16px;
    background: var(--wherehdb-accent-soft);
    color: var(--wherehdb-accent);
    font-weight: 800;
    line-height: 1;
    padding: 12px;
}

.wherehdb-viz__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.wherehdb-viz__controls button {
    appearance: none;
    border: 1px solid var(--wherehdb-line);
    border-radius: 999px;
    background: transparent;
    color: var(--wherehdb-soft);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    padding: 9px 13px;
}

.wherehdb-viz__controls button[aria-pressed="true"] {
    border-color: var(--wherehdb-accent-line);
    background: var(--wherehdb-accent-soft);
    color: var(--wherehdb-accent);
}

.wherehdb-viz__list {
    display: grid;
    gap: 14px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.wherehdb-viz__row {
    display: grid;
    grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.wherehdb-viz__label {
    color: var(--wherehdb-soft);
    font-weight: 700;
}

.wherehdb-viz__track {
    overflow: hidden;
    height: 14px;
    border-radius: 999px;
    background: var(--wherehdb-track);
}

.wherehdb-viz__bar {
    display: block;
    width: var(--score, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--wherehdb-accent);
    transition: width 220ms ease;
}

.wherehdb-viz__note {
    margin: 20px 0 0;
    color: var(--wherehdb-soft);
}

.wherehdb-visual-note {
    margin: 2rem 0;
    padding: 18px 20px;
    border: 1px solid var(--wherehdb-line);
    border-radius: 16px;
    background: var(--wherehdb-surface);
    color: var(--wherehdb-soft);
}

.wherehdb-visual-note strong {
    display: block;
    margin-bottom: 8px;
    color: var(--wherehdb-accent);
}

#ghost-portal-root {
    color-scheme: inherit;
}

#wherehdb-portal-mask {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

html[data-wherehdb-resolved-theme="dark"] #wherehdb-portal-mask[data-active="true"] {
    opacity: 0;
    visibility: hidden;
}

#ghost-portal-root {
    z-index: 2147483646;
}

#ghost-portal-root iframe,
#ghost-portal-root iframe[title="portal-popup"],
iframe[title="portal-popup"] {
    background: transparent;
    color-scheme: inherit;
    display: none;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

#ghost-portal-root iframe[data-wherehdb-portal-styled="true"],
#ghost-portal-root iframe[title="portal-popup"][data-wherehdb-portal-styled="true"],
iframe[title="portal-popup"][data-wherehdb-portal-styled="true"] {
    display: block;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

@media (max-width: 720px) {
    .gh-form {
        grid-template-columns: 1fr;
    }

    .gh-form .gh-button {
        width: 100%;
    }

    .gh-navigation-actions {
        gap: 8px;
    }

    .wherehdb-map-cta {
        margin-left: auto;
    }

    .wherehdb-viz__header,
    .wherehdb-viz__row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .wherehdb-viz__value {
        width: 92px;
    }
}
