:root {
    --cor-principal: #11387f;
    --cor-secundaria: #007fc8;
    --branco: #fff;
    --cinza1: #847770;
    --cinza2: #e7e7e7;
    --cinza3: #f3f1f1;
    --texto-suave: #55627a;
    --linha: #c5c9d0;
    --linha-suave: #dde0e5;
    --gutter: 32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
    background:
        radial-gradient(ellipse 40% 34% at 50% 40%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, #e1e1e1 0%, var(--cinza2) 22%, #ededed 55%, var(--cinza3) 100%);
    font-family: 'Alfa Laval', 'Helvetica Neue', Arial, sans-serif;
    color: var(--cor-principal);
    -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
i, em { font-style: normal; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cor-secundaria); outline-offset: 4px; }
::selection { color: var(--branco); background: var(--cor-secundaria); }

svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- palco ---------- */
#app {
    position: relative;
    height: 100dvh;
    display: grid;
    grid-template-columns: minmax(320px, 400px) 1fr 300px;
    grid-template-rows: 84px 1fr auto;
    grid-template-areas:
        "top  top    top"
        "hero center boilers"
        "hint center boilers";
    column-gap: 28px;
    padding: 0 var(--gutter) 28px;
}

#app > :not(#viewer) { z-index: 1; }

#viewer { position: absolute; inset: 0; z-index: 0; }
#viewer canvas { display: block; cursor: grab; touch-action: none; outline: none; opacity: 0; transition: opacity .5s ease; }
#viewer canvas:active { cursor: grabbing; }
#app[data-state="ready"] #viewer canvas { opacity: 1; }

/* ---------- pontos de informação no modelo ---------- */
#hotspots { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
#app:not([data-state="ready"]) #hotspots { visibility: hidden; }

.hotspot {
    position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px;
    display: grid; place-items: center; border-radius: 50%; pointer-events: auto;
    color: var(--branco); background: var(--cor-secundaria); border: 2px solid var(--branco);
    box-shadow: 0 4px 14px rgba(17, 56, 127, .3);
    transition: opacity .15s linear, background-color .2s ease;
}
.hotspot::before {
    content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid var(--cor-secundaria);
    animation: hotspot-pulse 2.4s ease-out infinite;
}
.hotspot svg { width: 14px; height: 14px; stroke-width: 2; transition: transform .2s ease; }
.hotspot:hover, .hotspot[aria-expanded="true"] { background: var(--cor-principal); }
.hotspot[aria-expanded="true"]::before { animation: none; border-color: var(--cor-principal); }
.hotspot[aria-expanded="true"] svg { transform: rotate(45deg); }
.hotspot[data-hidden] { pointer-events: none; }

@keyframes hotspot-pulse {
    0% { transform: scale(.75); opacity: 1; }
    100% { transform: scale(1.45); opacity: 0; }
}

.hotspot-card {
    position: absolute; left: 0; top: 0; width: min(270px, calc(100% - 16px)); padding: 18px 20px 20px;
    pointer-events: auto; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
    border: 1px solid var(--linha-suave); border-left: 3px solid var(--cor-secundaria);
    box-shadow: 0 14px 36px rgba(17, 56, 127, .14);
}
.hotspot-card h3 { padding-right: 24px; font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.hotspot-card p { margin-top: 8px; font-size: 13.5px; line-height: 1.5; color: var(--texto-suave); }
.hotspot-card__close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; }
.hotspot-card__close:hover { color: var(--cor-secundaria); }
.hotspot-card__close svg { width: 18px; height: 18px; }

/* ---------- cabeçalho ---------- */
.topbar { grid-area: top; display: flex; align-items: center; gap: 48px; }

.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; color: inherit; }
.brand img { height: 32px; display: block; }
.brand__text { display: flex; flex-direction: column; gap: 5px; padding-left: 18px; border-left: 1px solid var(--linha); line-height: 1; }
.brand__text b { font-weight: 700; font-size: 14px; letter-spacing: .38em; }
.brand__text span { font-weight: 400; font-size: 9.5px; letter-spacing: .42em; color: var(--texto-suave); }

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 24px; }

/* Seletor de idioma: mostra o código (EN, PT, ES) e abre a lista nativa do <select>, invisível por cima. */
.language {
    position: relative; display: flex; align-items: center; gap: 7px; height: 44px; cursor: pointer;
    font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--cor-principal);
    transition: color .2s ease;
}
.language:hover { color: var(--cor-secundaria); }
.language:has(select:focus-visible) { outline: 2px solid var(--cor-secundaria); outline-offset: 4px; }
.language svg { width: 18px; height: 18px; }
.language .language__chevron { width: 9px; height: 6px; stroke-width: 1.8; }
.language select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font: inherit; }

.cta {
    height: 44px; padding: 0 22px 0 24px; display: flex; align-items: center; gap: 10px;
    background: var(--cor-principal); color: var(--branco);
    font-size: 11px; font-weight: 700; letter-spacing: .14em;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    transition: background-color .2s ease;
}
.cta:hover { background: var(--cor-secundaria); }
.cta svg { width: 16px; height: 16px; stroke-width: 1.8; }

/* ---------- painel do modelo ---------- */
#hero { grid-area: hero; align-self: start; padding-top: 28px; pointer-events: none; }
#hero :is(a, button) { pointer-events: auto; }

.crumb { font-size: 11px; font-weight: 400; letter-spacing: .2em; color: var(--texto-suave); }
.crumb i { color: var(--cor-secundaria); margin: 0 4px; }
.crumb b { font-weight: 700; color: var(--cor-principal); }

.kicker { margin-top: 34px; font-size: 12px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--cor-secundaria); }

#name {
    display: flex; align-items: flex-end; gap: 16px; margin-top: 10px;
    font-weight: 700; font-size: clamp(56px, 5.4vw, 92px); line-height: .88; letter-spacing: .01em;
    text-transform: uppercase;
}
#name .slash { flex: none; width: 14px; height: .62em; margin-bottom: .1em; background: var(--cor-secundaria); transform: skewX(-22deg); }

.subtitle { min-height: 22px; margin-top: 12px; font-weight: 700; font-size: 18px; letter-spacing: .06em; color: var(--texto-suave); }

.rule { display: block; height: 1px; margin: 26px 0 22px; background: linear-gradient(90deg, var(--linha), rgba(197, 201, 208, 0)); }

.stats { display: flex; gap: 40px; }
.stats dt { font-size: 10.5px; font-weight: 400; letter-spacing: .2em; color: var(--texto-suave); }
.stats dd { margin-top: 4px; font-weight: 700; font-size: 34px; line-height: 1; }
.stats small { margin-left: 5px; font-size: 13px; letter-spacing: .06em; color: var(--texto-suave); }

.description { margin-top: 22px; max-width: 34ch; font-size: 14px; line-height: 1.55; color: var(--texto-suave); }

.actions { display: inline-grid; gap: 10px; margin-top: 28px; }

.link {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 13px 18px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .16em; color: var(--cor-principal); text-decoration: none;
    border: 1px solid var(--linha); background: rgba(255, 255, 255, .45); backdrop-filter: blur(6px);
    transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.link:hover { color: var(--cor-secundaria); border-color: var(--cor-secundaria); background: rgba(255, 255, 255, .8); }
.link svg { width: 14px; height: 10px; }
.link--primary { color: var(--branco); background: var(--cor-principal); border-color: var(--cor-principal); }
.link--primary:hover { color: var(--branco); background: var(--cor-secundaria); border-color: var(--cor-secundaria); }
.link--primary svg { width: 16px; height: 16px; }

.hint {
    grid-area: hint; align-self: end; display: flex; align-items: center; gap: 14px; pointer-events: none;
    font-size: 10.5px; font-weight: 400; letter-spacing: .18em; line-height: 1.75; color: var(--texto-suave);
}
.hint span { white-space: pre-line; }
.hint svg { flex: none; width: 24px; height: 24px; color: var(--cor-principal); }

/* ---------- área central (sobre o 3D) ---------- */
#center { grid-area: center; position: relative; display: grid; grid-template-rows: auto 1fr auto; pointer-events: none; }
#center::before {
    content: ''; position: absolute; inset: 8px 0 0; pointer-events: none;
    --c: linear-gradient(var(--linha), var(--linha));
    background:
        var(--c) top left / 18px 1px, var(--c) top left / 1px 18px,
        var(--c) top right / 18px 1px, var(--c) top right / 1px 18px,
        var(--c) bottom left / 18px 1px, var(--c) bottom left / 1px 18px,
        var(--c) bottom right / 18px 1px, var(--c) bottom right / 1px 18px;
    background-repeat: no-repeat;
}

#tools { justify-self: end; display: flex; gap: 6px; margin: 22px 14px 0 0; pointer-events: auto; }
#tools button {
    width: 42px; height: 42px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .55); border: 1px solid var(--linha); backdrop-filter: blur(6px);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
#tools button:hover { color: var(--cor-secundaria); background: var(--branco); }
#tools button[aria-pressed="true"] { color: var(--cor-secundaria); border-color: var(--cor-secundaria); background: var(--branco); }
#tools svg { width: 20px; height: 20px; }

#loading {
    grid-row: 2; align-self: center; justify-self: center; display: grid; justify-items: center; gap: 14px;
    font-size: 11.5px; font-weight: 400; letter-spacing: .24em; text-align: center;
}
#app:not([data-state="loading"], [data-state="failed"]) #loading { display: none; }
.loading__mark { width: 22px; height: 22px; border: 2px solid var(--cor-secundaria); animation: spin 1.6s cubic-bezier(.6, 0, .4, 1) infinite; }
.loading__bar { width: 240px; height: 2px; background: var(--linha); overflow: hidden; }
.loading__bar i { display: block; height: 100%; background: var(--cor-secundaria); transform: scaleX(0); transform-origin: left; transition: transform .15s linear; }
#loading-percent { font-weight: 700; font-size: 24px; letter-spacing: .04em; }
#retry {
    display: none; pointer-events: auto; padding: 12px 18px; border: 1px solid var(--cor-principal);
    font-size: 11px; font-weight: 700; letter-spacing: .16em;
}
#retry:hover { color: var(--branco); background: var(--cor-principal); }
#app[data-state="failed"] #retry { display: block; }
#app[data-state="failed"] :is(.loading__bar, #loading-percent) { display: none; }
#app[data-state="failed"] .loading__mark { animation: none; border-color: var(--cinza1); transform: rotate(45deg); }

@keyframes spin { to { transform: rotate(360deg); } }

.bottom { grid-row: 3; justify-self: center; display: grid; justify-items: center; gap: 16px; padding: 0 24px 6px; }

#model-title { display: flex; align-items: center; gap: 20px; font-size: 13px; font-weight: 700; letter-spacing: .45em; white-space: nowrap; }
#model-title i { width: 52px; height: 1px; background: var(--linha); }
#model-title em { font-weight: 400; letter-spacing: 2px; color: var(--cinza1); margin: 0 12px 0 0; }
#model-title em:last-child { margin: 0 0 0 12px; }
#model-title b { font-weight: 700; }

#variants { list-style: none; display: flex; align-items: center; pointer-events: auto; }
#variants li { display: flex; align-items: center; }
#variants li + li::before { content: ''; width: 28px; height: 1px; background: var(--linha); }
#variants button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; white-space: nowrap; }
#variants b { font-weight: 700; font-size: 13px; }
#variants span { font-size: 11px; font-weight: 400; letter-spacing: .19em; color: var(--texto-suave); transition: color .2s ease; }
#variants button:hover span { color: var(--cor-secundaria); }
#variants [aria-current="true"] b { font-weight: 400; font-size: 30px; color: var(--cor-secundaria); }
#variants [aria-current="true"] span { font-weight: 700; color: var(--cor-principal); }

/* ---------- seletor de caldeiras ---------- */
#boilers {
    grid-area: boilers; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto;
    padding: 24px 2px 2px; scrollbar-width: thin; scrollbar-color: var(--linha) transparent;
}
#boilers::before { content: attr(data-heading); margin-bottom: 8px; font-size: 10.5px; font-weight: 400; letter-spacing: .22em; color: var(--texto-suave); }

.card {
    flex: none; display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 14px;
    min-height: 84px; padding: 8px 14px 8px 8px; text-align: left;
    background: rgba(255, 255, 255, .42); border: 1px solid transparent; border-left: 3px solid transparent;
    backdrop-filter: blur(6px);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { background: rgba(255, 255, 255, .8); border-color: var(--linha-suave); }
.card[aria-current="true"] {
    background: var(--branco); border-color: var(--linha-suave); border-left-color: var(--cor-secundaria);
    box-shadow: 0 10px 28px rgba(17, 56, 127, .08);
}

.card__thumb {
    position: relative; width: 104px; height: 66px; display: grid; place-items: center; overflow: hidden;
    background-image:
        linear-gradient(var(--linha-suave) 1px, transparent 1px),
        linear-gradient(90deg, var(--linha-suave) 1px, transparent 1px);
    background-size: 13px 13px;
}
/* A imagem ocupa a caixa toda e a caldeira é encaixada inteira no centro, com uma folga: vale para a caixa fixa do
   desktop e para a proporcional do celular. As miniaturas têm fundo transparente (tools/thumbnails.mjs). */
.card__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 4%; object-fit: contain; }
.card__mono {
    font-weight: 700; font-size: 28px; letter-spacing: .04em;
    color: transparent; -webkit-text-stroke: 1px var(--cor-principal); opacity: .6;
}

.card__text { display: grid; gap: 3px; }
.card__text b { font-weight: 700; font-size: 19px; letter-spacing: .06em; line-height: 1.1; }
.card__text small { font-size: 12px; color: var(--texto-suave); }
.card__text em { margin-top: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .2em; color: var(--cor-secundaria); }

/* ---------- popovers e aviso ---------- */
.popover {
    margin: auto; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 34px 30px 30px;
    color: var(--cor-principal); background: rgba(250, 250, 250, .97);
    border: 1px solid var(--linha); box-shadow: 0 24px 60px rgba(17, 56, 127, .16);
}
.popover::backdrop { background: rgba(17, 56, 127, .14); backdrop-filter: blur(2px); }
.popover h2 { font-size: 14px; font-weight: 700; letter-spacing: .3em; }
.popover .popover__kicker { margin: 0 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--cor-secundaria); }
.popover p { margin-top: 16px; font-size: 14px; line-height: 1.55; color: var(--texto-suave); }
/* Números da caldeira (capacidade, pressão, tensão), marcados com **...** no catálogo. */
.popover p b { font-weight: 700; color: var(--cor-principal); white-space: nowrap; }
.popover__close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; }
.popover__close:hover { color: var(--cor-secundaria); }
.popover__close svg { width: 20px; height: 20px; }

#notice {
    position: fixed; left: 50%; bottom: 32px; z-index: 10; padding: 12px 20px; max-width: calc(100vw - 32px);
    font-size: 11px; font-weight: 700; letter-spacing: .2em; color: var(--branco); background: var(--cor-principal);
    overflow-wrap: anywhere; opacity: 0; pointer-events: none; transform: translate(-50%, 16px);
    transition: opacity .25s ease, transform .25s ease;
}
#notice[data-show] { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tela limpa ---------- */
/* Como na vitrine (showcase.html): só a marca, a caldeira no meio da tela e a legenda embaixo à esquerda. Das
   ferramentas ficam os pontos de informação, a tela cheia e o botão que volta, mais apagados até o mouse passar. */
.caption { display: none; grid-row: 3; justify-self: start; flex-direction: column; gap: 8px; padding-bottom: 6px; pointer-events: none; }
.caption span { font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--cor-secundaria); }
.caption b { font-weight: 700; font-size: clamp(30px, 2.6vw, 46px); line-height: .9; letter-spacing: .02em; text-transform: uppercase; }

#app[data-clean] :is(.topbar__actions, #hero, .hint, #boilers, #bottom) { display: none; }
#app[data-clean] #center { grid-column: 1 / -1; grid-row: 2 / -1; }
#app[data-clean] #center::before { display: none; }
#app[data-clean] .caption { display: flex; animation: caption-in .6s ease .15s both; }
#app[data-clean] #tools > :not(#hotspots-toggle, #fullscreen, #clean) { display: none; }
#app[data-clean] #tools { opacity: .5; transition: opacity .3s ease; }
#app[data-clean] #tools:is(:hover, :focus-within) { opacity: 1; }

@keyframes caption-in {
    from { opacity: 0; transform: translateY(8px); }
}

/* ---------- telas médias ---------- */
@media (max-width: 1280px) {
    #app { grid-template-columns: minmax(280px, 330px) 1fr 260px; column-gap: 20px; }
    .card { grid-template-columns: 84px 1fr; gap: 12px; }
    .card__thumb { width: 84px; height: 56px; }
}

@media (min-width: 900px) and (max-height: 820px) {
    #app { grid-template-rows: 76px 1fr auto; }
    .card { min-height: 70px; padding-block: 6px; }
    .card__thumb { height: 54px; }
    .card__text em { margin-top: 2px; }
    .kicker { margin-top: 24px; }
}

/* ---------- celular / tablet retrato ---------- */
/* Tudo cabe em uma tela: o 3D ocupa a altura que sobra e os seletores ficam numa grade compacta, sem rolagem lateral.
   Em telas muito baixas o 3D para em 300px e a página passa a rolar. */
@media (max-width: 899px) {
    :root { --gutter: 16px; }
    html, body { height: auto; overflow: auto; }

    #app {
        height: auto; min-height: 100vh; min-height: 100svh;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 60px auto minmax(300px, 1fr) auto;
        grid-template-areas: "top" "hero" "viewer" "boilers";
        padding-top: env(safe-area-inset-top);
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .topbar { gap: 16px; }
    .brand img { height: 26px; }
    .brand__text { padding-left: 14px; }
    .cta { height: 40px; padding: 0 16px 0 18px; }

    #hero { padding-top: 6px; }
    .kicker { margin-top: 12px; }
    #name { margin-top: 6px; font-size: clamp(40px, 12vw, 60px); }
    .subtitle { min-height: 0; margin-top: 6px; font-size: 15px; }
    .rule, .stats, .description { display: none; }
    .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
    .actions .link { gap: 10px; padding: 11px 14px; font-size: 10.5px; letter-spacing: .12em; }
    .hint { display: none; }

    #viewer, #center, #app[data-clean] #center { grid-area: viewer; }
    /* `contain: size` impede que o canvas (com altura fixa em px) empurre a linha da grade ao girar o aparelho. */
    #viewer { position: relative; height: auto; margin: 8px calc(var(--gutter) * -1) 0; contain: size; }
    #center { margin-top: 8px; }
    #center::before { inset: 0; }

    #tools { gap: 4px; margin: 10px 0 0; }
    #tools button { width: 38px; height: 38px; }
    #fullscreen { display: none !important; }

    .bottom { padding: 0 0 8px; gap: 4px; max-width: 100%; }
    #model-title { font-size: 11px; letter-spacing: .26em; gap: 0; }
    #model-title i { display: none; }
    #variants button { min-height: 40px; padding: 0 10px; }
    #variants li + li::before { width: 12px; }
    #variants [aria-current="true"] b { font-size: 24px; }

    #boilers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; padding: 0; overflow: visible; }
    #boilers::before { display: none; }

    .card {
        grid-template-columns: minmax(0, 1fr); gap: 4px; min-height: 0; padding: 4px 4px 6px; text-align: center;
        border: 1px solid transparent; border-bottom: 2px solid transparent;
    }
    .card[aria-current="true"] { border-color: var(--linha-suave); border-bottom-color: var(--cor-secundaria); }
    .card__thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; background-size: 9px 9px; }
    .card__mono { font-size: 21px; }
    .card__text b { font-size: 13px; letter-spacing: .04em; }
    .card__text :is(small, em) { display: none; }
}

/* Celulares: o seletor de idioma fica só com o código e o compartilhar, só com o ícone (o texto continua para leitores
   de tela), para a marca caber na mesma linha. */
@media (max-width: 559px) {
    .topbar__actions { gap: 14px; }
    .language > svg:first-child { display: none; }
    .cta { width: 40px; padding: 0; justify-content: center; }
    .cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Celulares estreitos: cabeçalho mais justo para a marca não quebrar linha. */
@media (max-width: 380px) {
    .topbar { gap: 10px; }
    .brand { gap: 10px; }
    .brand__text { padding-left: 10px; }
    .brand__text b { letter-spacing: .3em; }
    .brand__text span { letter-spacing: .3em; white-space: nowrap; }
    .topbar__actions { gap: 10px; }
}

/* Celulares baixos (ex.: iPhone SE): topo mais enxuto para o 3D e os seletores caberem sem rolar. */
@media (max-width: 899px) and (max-height: 760px) {
    #app { grid-template-rows: 56px auto minmax(280px, 1fr) auto; }
    .crumb, .subtitle { display: none; }
    .kicker { margin-top: 8px; }
    #name { font-size: clamp(36px, 11vw, 48px); }
    .actions { margin-top: 12px; }
}

/* Tablet retrato: uma linha só com todas as caldeiras. */
@media (min-width: 560px) and (max-width: 899px) {
    #boilers { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}

/* ---------- celular deitado ---------- */
/* Vem depois dos blocos acima e vale tanto abaixo quanto acima de 900px de largura: textos e seletores à esquerda,
   o 3D ocupa a tela toda por trás (como no desktop) e a caldeira fica centralizada na coluna da direita. */
@media (orientation: landscape) and (max-height: 520px) {
    :root { --gutter: 16px; }
    html, body { height: 100%; overflow: hidden; }

    #app {
        height: 100dvh; min-height: 0;
        grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
        grid-template-rows: 48px auto minmax(0, 1fr);
        grid-template-areas: "top top" "hero center" "boilers center";
        column-gap: 16px;
        padding: 0 max(var(--gutter), env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
    }

    .topbar { gap: 16px; }
    .brand img { height: 24px; }
    .brand__text { padding-left: 14px; }
    .cta { height: 36px; padding: 0 14px 0 16px; }

    #hero { padding-top: 0; }
    .crumb, .subtitle, .rule, .stats, .description, .hint { display: none; }
    .kicker { margin-top: 2px; font-size: 11px; }
    #name { margin-top: 4px; font-size: clamp(32px, 9vh, 44px); }
    .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
    .actions .link { gap: 8px; padding: 10px 12px; font-size: 10px; letter-spacing: .1em; }

    #viewer { grid-area: auto; position: absolute; inset: 0; height: auto; margin: 0; contain: none; }
    #center { grid-area: center; margin: 0; }
    #app[data-clean] #center { grid-area: 2 / 1 / -1 / -1; }
    #center::before { inset: 0; }

    #tools { gap: 4px; margin: 8px 8px 0 0; }
    #tools button { width: 36px; height: 36px; }
    #fullscreen { display: none !important; }

    .bottom { padding: 0 0 6px; gap: 2px; max-width: 100%; }
    #model-title { font-size: 11px; letter-spacing: .26em; gap: 0; }
    #model-title i { display: none; }
    #variants button { min-height: 36px; padding: 0 10px; }
    #variants li + li::before { width: 12px; }
    #variants [aria-current="true"] b { font-size: 22px; }

    #boilers {
        display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto;
        align-content: end; gap: 6px; min-height: 0; margin: 10px 0 0; padding: 0; overflow: hidden auto; scrollbar-width: none;
    }
    #boilers::before { display: none; }

    .card {
        width: auto; grid-template-columns: minmax(0, 1fr); gap: 3px; min-height: 0; padding: 3px 3px 5px; text-align: center;
        border: 1px solid transparent; border-bottom: 2px solid transparent;
    }
    .card[aria-current="true"] { border-color: var(--linha-suave); border-bottom-color: var(--cor-secundaria); }
    .card__thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; background-size: 9px 9px; }
    .card__mono { font-size: 18px; }
    .card__text b { font-size: 12px; letter-spacing: .04em; }
    .card__text :is(small, em) { display: none; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 760px) {
    .actions .link { justify-content: center; padding: 10px 8px; }
    .actions .link svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
