.app-shell {
    --menu-w: 14.375rem;
    --app-content-max: 80rem;
    --app-content-gutter: clamp(.75rem, 2.4vw, 2rem);
    --app-content-top: clamp(1.25rem, 3vw, 2.75rem);
    --app-green: #245b43;
    --app-dark: #17382f;
    --app-light: #f4f6f3;
    background: var(--app-light);
    font-family: system-ui, sans-serif;
    padding-inline-start: var(--menu-w);
}
.app-shell.app-acesso {
    padding: clamp(1rem, 5vw, 3rem);
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: #182821;
}
.app-acesso-cartao { width: 100%; max-width: 32rem; }
.app-acesso-marca { color: var(--app-dark); }
.app-shell.app-acesso input:focus {
    border-color: var(--app-green);
    box-shadow: 0 0 0 .2rem #245b4333;
}
.app-menu {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--menu-w);
    z-index: 1020;
    background: var(--app-dark);
    color: #edf6f1;
    display: flex;
    flex-direction: column;
}
.app-brand { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 10px; }
.app-brand a { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 700; }
.app-menu > nav { display: flex; flex-direction: column; flex: 1; overflow: auto; padding: 6px 10px 12px; }
a.app-nav-link { display: flex; align-items: center; gap: .6rem; }
.app-nav-link .bi { flex: none; inline-size: 1.15rem; text-align: center; }
.app-menu > nav > a, .app-conta a { color: #e4eee9; padding: 10px 12px; text-decoration: none; border-radius: 7px; }
.app-menu > nav > a:hover, .app-menu > nav > a:focus-visible, .app-conta a:hover, .app-conta a:focus-visible { background: #285346; color: white; }
.app-menu a[aria-current="page"], .app-menu a[aria-current="location"] { background: #325e50; color: white; font-weight: 700; }
.app-conta { display: grid; margin-top: auto; }
.app-conta span { padding: 14px 12px 3px; font-size: .85rem; }
.app-conta small { display: block; color: #cadbd2; }
.app-menu-toggle { display: none; padding: 7px 12px; border: 1px solid #8bafa0; border-radius: 7px; background: transparent; color: white; }
.app-shell > .app-main {
    width: 100%;
    max-width: var(--app-content-max);
    min-width: 0;
    margin-inline: auto;
    padding: var(--app-content-top) var(--app-content-gutter) 2rem;
    container: app-main / inline-size;
}
.app-main .app-header {
    padding: 0 0 1rem;
    background: transparent;
    border-bottom: 1px solid #d1ded5;
    box-shadow: none;
}
.app-main .toolbar { padding: 1rem 0; }
.app-main .filters-panel { margin-inline: 0; }
.app-main .content { padding: 0; }
.app-shell .btn-primary, .app-shell .btn-accent {
    --bs-btn-color: white;
    --bs-btn-bg: var(--app-green);
    --bs-btn-border-color: var(--app-green);
    --bs-btn-hover-color: white;
    --bs-btn-hover-bg: #19452f;
    --bs-btn-hover-border-color: #19452f;
    background-color: var(--app-green);
    border-color: var(--app-green);
    color: white;
}
.app-shell .btn-primary:hover, .app-shell .btn-accent:hover { background-color: #19452f; }
.app-shell {
    --primary: var(--app-green);
    --primary-light: #387c57;
    --accent: #b88937;
}
.app-shell [hidden] { display: none !important; }
.app-shell .item-card .card-body,
.app-shell .item-card .card-img-wrap,
.app-shell .inv-table tbody tr { cursor: auto; }
.app-shell .btn-outline-primary {
    --bs-btn-color: var(--app-green);
    --bs-btn-border-color: var(--app-green);
    --bs-btn-hover-color: white;
    --bs-btn-hover-bg: var(--app-green);
    --bs-btn-hover-border-color: var(--app-green);
}
.app-shell .ordenar-coluna {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
}
.app-shell h1 { color: var(--app-dark); }
.app-main h1, .app-main .app-header h1 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    line-height: 1.2;
}
.app-shell a:focus-visible, .app-shell button:focus-visible { outline: 2px solid #479373; outline-offset: 3px; }
.app-skip { position: absolute; z-index: 1100; background: white; padding: .75rem; }
.ficha-topo { margin-bottom: 22px; }
.ficha .btn-primary { color: white; }
.ficha-topo h1 { font-size: clamp(1.45rem, 3.2vw, 2rem); margin: .55rem 0 .25rem; }
.ficha-topo .ficha-numero { color: #536860; font-weight: 600; white-space: nowrap; }
.app-separadores {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid #d1ded5;
}
.app-separadores > :is(a, button) {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2rem;
    padding: .2rem .55rem;
    border: 1px solid transparent;
    border-radius: .35rem;
    background: transparent;
    color: #245b43;
    font-size: .875rem;
    line-height: 1.3;
    text-decoration: none;
    text-align: start;
}
.app-separadores > :is(a, button):hover { background: #eaf1ed; }
.app-separadores > :is([aria-current="page"], [aria-selected="true"], [aria-pressed="true"]) {
    background: #dceae1;
    border-color: #91b4a1;
    color: #1a4533;
    font-weight: 650;
}
.app-separadores > :is(a, button):focus-visible { outline-offset: 1px; }
.ficha-vistas { padding: 0; border: 0; }
.ficha-vistas button { border-color: #d1ded5; }
.ficha-layout #fichaForm { overflow: visible; }
.ficha-layout #progressoFicha { border-radius: 12px 12px 0 0; overflow: hidden; }
.ficha-acoes { position: sticky; bottom: 0; z-index: 3; background: white; border-radius: 0 0 12px 12px; }

@media (max-width: 768px) {
    .app-shell { padding-inline-start: 0; }
    .app-menu { width: auto; position: sticky; top: 0; inset-inline: auto; }
    .app-brand { padding: 9px 14px; }
    .app-menu-toggle { display: inline-block; }
    .app-menu > nav { display: none; position: absolute; background: var(--app-dark); inset-inline: 0; top: 100%; max-height: 70vh; }
    .app-menu.aberto > nav { display: flex; }
    .app-shell .search-box { min-width: min(100%, 250px); }
}

.ajuda-contextual {
    margin-block: .5rem 1rem;
    max-width: 76ch;
    color: #36564a;
    line-height: 1.5;
}
.ajuda-contextual a { margin-inline-start: .25rem; }
.ajuda-topico, #tarefas, #importar, #copia { scroll-margin-top: 5rem; }
.ajuda-topico summary { cursor: pointer; }
.ajuda-topico:target { border-color: #579178 !important; }
.ajuda-manual { overflow-wrap: anywhere; }
#pesquisaAjuda, .ajuda-resultado-atual { scroll-margin-top: 5rem; }
.ajuda-resultado-atual { outline: 2px solid var(--app-green); outline-offset: .25rem; }
.vocabulario-linha { scroll-margin-top: 5rem; }
#contaNova { scroll-margin-top: 5rem; }
.vocabulario-linha:target > td { --bs-table-bg: #e1efe3; }
.revisao-comparacao {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: .5rem;
}
.revisao-comparacao dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.revisao-anterior { background: #f2f5f3; }
.revisao-atual, .revisao-marca, .revisao-valor { background: #e1efe3; color: #17382f; }
.revisao-valor { border-inline-start: .2rem solid #347455; padding-inline: .4rem; }
.ajuda-manual h1 { font-size: 1.35rem; }
.ajuda-manual h2 { font-size: 1.15rem; }
.ajuda-manual img { max-width: 100%; height: auto; }
.app-area-atual { display: none; }

@media (max-width: 768px) {
    .app-area-atual { display: block; color: #d2e6dc; font-weight: 400; font-size: .75rem; }
}

.app-ficha-submenu {
    margin: .4rem 0 .65rem 1.2rem;
    border-inline-start: 1px solid #648679;
    padding-inline: .55rem .2rem;
}
.app-ficha-submenu p { color: #c5dccf; font-size: .78rem; padding-inline: .4rem; }
.app-ficha-submenu button, .app-ficha-submenu a {
    display: block;
    width: 100%;
    text-decoration: none;
    border: 0;
    border-radius: 6px;
    padding: .4rem;
    text-align: start;
    background: transparent;
    color: #e4eee9;
    font-size: .875rem;
}
.app-ficha-submenu :is(a, button):hover, .app-ficha-submenu :is(a, button):focus-visible { background: #285346; }
.app-menu .app-ficha-submenu [aria-current] { background: #dceae1; color: #17382f; font-weight: 700; }
.app-admin-submenu a.app-nav-link { display: flex; }
.app-area-submenu a.app-nav-link { display: flex; }
[id$="Titulo"], #searchInput, #modoEtiquetas, #tituloManual { scroll-margin-top: 5rem; }
.admin-grupo { padding-inline: .4rem; font-weight: 600; }
.admin-seccoes-movel .admin-grupo { font-size: .85rem; padding-inline: 1rem; color: var(--app-dark); }
.admin-card-link { display: flex; align-items: center; gap: .7rem; }
.admin-card-link .bi {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 2rem;
    block-size: 2rem;
    border-radius: 6px;
    background: #e6f0e8;
    color: var(--app-green);
}
#novoMuseu, #importar, #copia { scroll-margin-top: 5rem; }

#nota-revisao, .ficha-passo h2 { scroll-margin-top: 5rem; }
.ficha-navegacao-movel { display: none; }
@media (max-width: 768px) {
    .app-ficha-submenu { display: none; }
    .app-menu.aberto .app-area-submenu { display: block; }
    .app-menu-toggle { flex-shrink: 0; }
    .ficha-navegacao-movel {
        display: block;
        color: var(--app-dark);
        background: white;
        border: 1px solid #d1ded5;
        border-radius: 8px;
    }
    .ficha-navegacao-movel summary { padding: .7rem .85rem; cursor: pointer; font-weight: 600; }
    .ficha-navegacao-movel summary span {
        display: block;
        margin-inline-start: 1rem;
        font-size: .875rem;
        font-weight: 400;
    }
    .ficha-navegacao-movel ul, .ficha-navegacao-movel ol { padding: .25rem .5rem .5rem; }
    .ficha-navegacao-movel :is(a, button) {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 44px;
        padding: .45rem .55rem;
        text-decoration: none;
        text-align: start;
        color: var(--app-green);
        background: transparent;
        border: 0;
        border-radius: 6px;
    }
    .ficha-navegacao-movel :is([aria-current], a:hover, button:hover) { background: #dceae1; }
    .ficha-navegacao-movel [aria-current] { font-weight: 700; }
    .ficha-navegacao-movel summary:focus-visible { outline: 2px solid var(--app-green); outline-offset: 2px; }
}

.inventario-filtro-ativo {
    border-radius: .35rem;
    padding: .25rem .55rem;
    background: #dceae1;
    color: #17382f;
    font-size: .85rem;
}
.app-shell .resumo-cartao { display: block; color: inherit; text-decoration: none; min-width: 0; }
.app-shell .resumo-cartao :is(.card-body, .card-img-wrap) { cursor: pointer; }
.resumo-cartao-acao { display: inline-block; margin-top: .65rem; color: #245b43; text-decoration: underline; }
.app-shell .modal {
    --bs-modal-margin: clamp(.5rem, 2vmin, 1.25rem);
    --bs-modal-padding: clamp(.75rem, 2.2vmin, 1.25rem);
    --bs-modal-header-padding: var(--bs-modal-padding);
}
.app-shell .modal-content { overflow-wrap: anywhere; }
.app-shell .modal-body { min-width: 0; }
.app-shell #resumoFicha .modal-dialog { --bs-modal-width: 55rem; }
#resumoFicha .modal-content {
    height: min(40rem, calc(100vh - 2 * var(--bs-modal-margin)));
    height: min(40rem, calc(100dvh - 2 * var(--bs-modal-margin)));
    overflow-y: auto;
}
.resumo-corpo {
    display: grid;
    align-items: start;
    align-content: start;
    flex: 1 0 auto;
    gap: var(--bs-modal-padding);
}
.resumo-imagem { margin: 0; min-width: 0; }
.resumo-imagem img {
    display: block;
    margin-inline: auto;
    max-height: min(27vh, 16rem);
    max-height: min(27dvh, 16rem);
    object-fit: contain;
}
.resumo-texto { min-width: 0; }
.resumo-dados { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr); gap: .25rem .75rem; }
.resumo-dados dd { margin: 0; overflow-wrap: anywhere; }
.museu-mapa {
    height: clamp(17rem, 50dvh, 34rem);
    background: #edf3ed;
    z-index: 0;
    scroll-margin-top: 5rem;
}
.museu-mapa.a-marcar { cursor: crosshair; }
.museu-mapa .museu-pin {
    border: 2px solid #fff;
    border-radius: 50%;
    background: #245b43;
    box-shadow: 0 1px 5px #17382f;
}
.museu-mapa .museu-pin-edicao { background: #214f8f; cursor: grab; }
.museu-mapa .museu-toponimo {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    border: 0;
    background: none;
    box-shadow: none;
    text-shadow: 0 0 3px #182821, 1px 1px 2px #182821, -1px -1px 2px #182821;
}
#painelMapa { container-type: inline-size; }
.mapa-disposicao, .mapa-filtros { display: grid; gap: .85rem; min-width: 0; }
.mapa-resultados {
    max-height: 22rem;
    overflow-y: auto;
    min-width: 0;
    overflow-wrap: anywhere;
    background: #f8faf8;
}
.mapa-resultados li { padding: .55rem .2rem; border-bottom: 1px solid #dfe7e0; }
.mapa-resultados li:last-child { border-bottom: 0; }
.mapa-resultados li button { margin-top: .25rem; text-align: start; }
.mapa-legenda { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.mapa-cor {
    display: inline-block;
    margin-inline-end: .38rem;
    inline-size: .75rem;
    block-size: .75rem;
    border-radius: 50%;
    background: #176b4c;
}
.mapa-cor-rever { background: #a85905; }
.mapa-cor-pesquisa { background: #205b82; }
@container (min-width: 35rem) {
    .mapa-filtros { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}
@container (min-width: 49rem) {
    .mapa-disposicao { grid-template-columns: minmax(0, 2.35fr) minmax(15rem, 1fr); }
    .mapa-resultados { max-height: min(57dvh, 38rem); }
}
#editarCoordenadas, #editarEstrutura, #novoLocal { scroll-margin-top: 5rem; }
#resumoDescricao { white-space: pre-line; }
@media (min-width: 40rem) {
    .resumo-corpo:has(.resumo-imagem:not([hidden])) {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    }
    .resumo-imagem img {
        max-height: min(48vh, 24rem);
        max-height: min(48dvh, 24rem);
    }
}
#decisaoTitulo, #notaRevisao { scroll-margin-top: 5rem; }

.ajuda-painel {
    min-width: 0;
    margin-block-end: 1rem;
    color: #182821;
}
.ajuda-painel h2 { color: var(--app-dark); }
.ajuda-painel a { color: var(--app-green); }
.ajuda-painel-tamanho { display: none; }
.ficha .ajuda-conteudo { container-type: inline-size; }

@container (max-width: 34rem) {
    .ajuda-conteudo .ficha-campos,
    .ajuda-conteudo .ficha-identificacao-rapida {
        grid-template-columns: minmax(0, 1fr);
    }
}

@container app-main (min-width: 50rem) {
    .ajuda-disposicao {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }
    .ajuda-conteudo { grid-area: 1 / 1; }
    .ajuda-painel {
        grid-area: 1 / 2;
        position: sticky;
        top: 1rem;
        width: var(--largura-painel-ajuda, 320px);
        max-height: calc(100vh - 2rem);
        overflow: auto;
        margin-inline-start: 1rem;
    }
    .ajuda-painel-tamanho { display: block; }
    .ajuda-painel-tamanho input { accent-color: var(--app-green); }
    .ajuda-painel-tamanho input:focus-visible {
        outline: 2px solid var(--app-green);
        outline-offset: 3px;
    }
}
