:root {
    color-scheme: light;
    --bg: #f3f6f5;
    --surface: rgba(255, 255, 255, .96);
    --surface-strong: #fff;
    --text: #18221f;
    --muted: #68756f;
    --line: #dce5e1;
    --primary: #176b4d;
    --primary-dark: #0d5038;
    --primary-soft: #e8f5ef;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --warning: #986500;
    --warning-soft: #fff7df;
    --info: #175cd3;
    --info-soft: #edf4ff;
    --shadow: 0 18px 45px rgba(22, 45, 35, .08);
    --radius: 22px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(23, 107, 77, .12), transparent 30rem),
        var(--bg);
    color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(220, 229, 225, .85);
    background: rgba(243, 246, 245, .82);
    backdrop-filter: blur(18px);
}
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-weight: 900;
    letter-spacing: -.05em;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(23, 107, 77, .22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.badge, .status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    background: #eef2f0;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}
.status-pill.loading { background: var(--info-soft); color: var(--info); }
.status-pill.success { background: var(--primary-soft); color: var(--primary-dark); }
.status-pill.danger { background: var(--danger-soft); color: var(--danger); }
.page-content { padding-block: 54px 76px; }
.hero { max-width: 820px; margin-bottom: 28px; }
.eyebrow { display: block; color: var(--primary); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 850; }
.hero h1 { margin: 8px 0 14px; font-size: clamp(2.35rem, 6vw, 4.7rem); line-height: .98; letter-spacing: -.065em; }
.hero p { margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.panel {
    padding: 26px;
    border: 1px solid rgba(220, 229, 225, .95);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading.compact { margin-bottom: 8px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 1.55rem; letter-spacing: -.04em; }
.import-panel { margin-bottom: 24px; border-color: #b8d8ca; }
#nfce-form { display: flex; align-items: end; gap: 12px; }
.field { display: block; }
.field.grow { flex: 1; }
.field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 750; }
input, textarea, select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-strong);
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23, 107, 77, .11); }
input[readonly], textarea[readonly] { background: #f8faf9; }
.field > small { display: block; margin-top: 7px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.button {
    appearance: none;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 800;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button.primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(23, 107, 77, .2); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #fff; border-color: var(--line); color: var(--text); }
.button.small { min-height: 38px; padding-inline: 14px; font-size: .82rem; }
.feedback { margin-top: 16px; padding: 13px 15px; border: 1px solid transparent; border-radius: 13px; line-height: 1.5; }
.feedback.info { background: var(--info-soft); color: var(--info); border-color: #bdd2fb; }
.feedback.success { background: var(--primary-soft); color: var(--primary-dark); border-color: #badfce; }
.feedback.danger { background: var(--danger-soft); color: var(--danger); border-color: #efc3be; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.result-main, .result-sidebar { display: grid; gap: 22px; }
.result-sidebar { position: sticky; top: 100px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .84rem; }
th { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .06em; }
th:nth-last-child(-n+2), td:nth-last-child(-n+2) { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
.totals-card > div, .validation-card > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.totals-card > div:last-child, .validation-card > div:last-child { border-bottom: 0; padding-bottom: 0; }
.totals-card span, .validation-card span { color: var(--muted); font-size: .82rem; }
.totals-card strong, .validation-card strong { text-align: right; }
.totals-card .eyebrow, .validation-card .eyebrow { margin-bottom: 10px; }
.grand-total { margin-top: 4px; padding-top: 17px !important; }
.grand-total strong { color: var(--primary); font-size: 1.45rem; }
.warning-text { color: var(--warning); }
.warning-list { margin: 0; padding-left: 20px; color: #7a5200; line-height: 1.6; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.footer-inner { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
    .result-layout { grid-template-columns: 1fr; }
    .result-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .shell { width: min(100% - 22px, 1180px); }
    .page-content { padding-block: 34px 56px; }
    .hero h1 { font-size: 2.65rem; }
    #nfce-form { flex-direction: column; align-items: stretch; }
    .button { width: 100%; }
    .form-grid.two, .result-sidebar { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .panel { padding: 19px; border-radius: 18px; }
    .panel-heading { flex-direction: column; align-items: stretch; }
    .panel-heading .button { width: auto; align-self: flex-start; }
    .brand small { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    td { border: 0; padding: 5px 0; text-align: left !important; }
    td::before { content: attr(data-label); display: inline-block; min-width: 105px; margin-right: 8px; color: var(--muted); font-size: .7rem; font-weight: 750; }
    .footer-inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #101513;
        --surface: rgba(24, 31, 28, .95);
        --surface-strong: #1b221f;
        --text: #edf3f0;
        --muted: #a6b0ab;
        --line: #34413b;
        --primary: #55c899;
        --primary-dark: #87dfba;
        --primary-soft: #173c2e;
        --danger: #ff8a80;
        --danger-soft: #451f1c;
        --warning: #f4c85b;
        --warning-soft: #3d3216;
        --info: #8ab4ff;
        --info-soft: #1e3152;
        --shadow: 0 18px 45px rgba(0, 0, 0, .25);
    }
    body { background: radial-gradient(circle at top left, rgba(85, 200, 153, .08), transparent 30rem), var(--bg); }
    .site-header { background: rgba(16, 21, 19, .84); }
    input[readonly], textarea[readonly] { background: #171d1a; }
    .button.secondary { background: var(--surface-strong); }
}

/* Leitura de QR Code */
.import-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.import-actions .button {
    white-space: nowrap;
}

.privacy-note {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.5;
}

.qr-dialog {
    width: min(620px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 0;
    border-radius: 23px;
    background: transparent;
    color: var(--text);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
}

.qr-dialog::backdrop {
    background: rgba(8, 14, 11, .68);
    backdrop-filter: blur(6px);
}

.qr-dialog-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 23px;
    background: var(--surface-strong);
}

.qr-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.qr-dialog-heading h2 {
    margin: 6px 0 0;
    font-size: 1.45rem;
    letter-spacing: -.04em;
}

.qr-close-button {
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--muted);
    cursor: pointer;
    font-size: 1.55rem;
    line-height: 1;
}

.qr-camera-frame {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    background: #09110d;
}

.qr-camera-frame video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.qr-scan-guide {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(62%, 270px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, .94);
    border-radius: 20px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .24);
    pointer-events: none;
}

.qr-scan-guide::before,
.qr-scan-guide::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    height: 2px;
    background: rgba(85, 200, 153, .95);
    box-shadow: 0 0 12px rgba(85, 200, 153, .9);
}

.qr-scan-guide::before { top: 34%; }
.qr-scan-guide::after { bottom: 34%; }

.qr-camera-status {
    min-height: 24px;
    margin: 14px 0 0;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.qr-dialog-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

@media (max-width: 920px) {
    #nfce-form {
        align-items: stretch;
        flex-direction: column;
    }

    .import-actions {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .import-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .import-actions .button {
        width: 100%;
    }

    .qr-dialog-card {
        padding: 18px;
    }

    .qr-camera-frame {
        min-height: 250px;
    }

    .qr-dialog-actions .button {
        width: 100%;
    }
}

@media (prefers-color-scheme: dark) {
    .qr-close-button {
        background: var(--surface-strong);
    }
}

/* ConectaNF: histórico e consultas armazenadas */
.header-actions,
.result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.button.full { width: 100%; }
.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--muted);
    font-weight: 750;
}
.back-link:hover { color: var(--text); }
.break-all { overflow-wrap: anywhere; word-break: break-word; }

.page-heading {
    margin-bottom: 28px;
}
.page-heading h1 {
    margin: 7px 0 10px;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1;
    letter-spacing: -.055em;
}
.page-heading p {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-card {
    padding: 0;
    overflow: hidden;
}

.history-card-main {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
}

.history-card-main:hover {
    background: rgba(23, 107, 77, .035);
}

.history-date {
    width: 62px;
    height: 62px;
    display: grid;
    place-content: center;
    text-align: center;
    border-radius: 17px;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.history-date strong {
    font-size: 1.35rem;
    line-height: 1;
}

.history-date span {
    margin-top: 4px;
    font-size: .65rem;
    font-weight: 800;
}

.history-copy { min-width: 0; }
.history-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.history-title-line h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
    letter-spacing: -.025em;
}
.history-copy p {
    margin: 6px 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: .86rem;
}
.history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.history-meta span,
.source-pill {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eff3f1;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
}
.source-pill {
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.history-total {
    min-width: 130px;
    text-align: right;
}
.history-total span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .72rem;
}
.history-total strong {
    font-size: 1.22rem;
    letter-spacing: -.03em;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 60px 24px;
    text-align: center;
}
.empty-state h1,
.empty-state h2 { margin: 0; }
.empty-state p {
    max-width: 600px;
    margin: 0 0 8px;
    color: var(--muted);
    line-height: 1.6;
}

.stored-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}
.stored-detail-main,
.stored-detail-sidebar {
    display: grid;
    gap: 18px;
}
.stored-detail-sidebar {
    position: sticky;
    top: 96px;
}
.detail-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}
.detail-data-grid > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(244, 246, 248, .48);
}
.detail-data-grid .wide { grid-column: 1 / -1; }
.detail-data-grid dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.detail-data-grid dd {
    margin: 0;
    line-height: 1.45;
    font-weight: 700;
}
.source-card {
    display: grid;
    gap: 14px;
}
.source-card > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.source-card > div span {
    color: var(--muted);
    font-size: .8rem;
}
.stored-image-link {
    display: grid;
    gap: 8px;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 800;
}
.stored-image-link img {
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

@media (max-width: 900px) {
    .stored-detail-layout { grid-template-columns: 1fr; }
    .stored-detail-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .source-card { grid-row: span 2; }
}

@media (max-width: 700px) {
    .header-actions .badge { display: none; }
    .history-card-main {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
    }
    .history-date {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
    .history-title-line { align-items: flex-start; }
    .history-title-line h2,
    .history-copy p { white-space: normal; }
    .history-total {
        grid-column: 2;
        text-align: left;
    }
    .history-total span { display: inline; margin-right: 5px; }
    .detail-data-grid,
    .stored-detail-sidebar { grid-template-columns: 1fr; }
    .detail-data-grid .wide { grid-column: auto; }
    .source-card { grid-row: auto; }
    .result-actions {
        width: 100%;
    }
    .result-actions .button { width: auto; }
}

@media (prefers-color-scheme: dark) {
    .history-meta span { background: #222c27; }
    .detail-data-grid > div { background: rgba(16, 21, 19, .46); }
    .stored-image-link img { background: #111; }
}

/* Acesso administrativo */
.inline-form {
    display: inline-flex;
    margin: 0;
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
}

.button.ghost:hover {
    color: var(--text);
    background: rgba(23, 107, 77, .05);
}

.auth-page {
    min-height: calc(100vh - 156px);
    display: grid;
    place-items: center;
}

.auth-panel {
    width: min(470px, 100%);
    padding: 34px;
}

.auth-panel h1 {
    margin: 7px 0 10px;
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1;
    letter-spacing: -.05em;
}

.auth-panel > p {
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form .feedback {
    margin-top: 0;
}

@media (max-width: 700px) {
    .header-inner {
        align-items: flex-start;
        padding-block: 12px;
    }

    .header-actions {
        justify-content: flex-end;
    }

    .header-actions .button,
    .header-actions .inline-form .button {
        width: auto;
        min-height: 38px;
        padding-inline: 12px;
    }

    .auth-panel {
        padding: 22px;
    }
}

@media (prefers-color-scheme: dark) {
    .button.ghost:hover {
        background: rgba(85, 200, 153, .08);
    }
}

/* ConectaNF v1.5.0: conferência por quantidade e pesquisa de produtos */
.item-calculation-warning {
    background: var(--warning-soft);
}

.item-calculation-warning td:first-child {
    box-shadow: inset 3px 0 0 var(--warning);
}

.product-search-heading {
    max-width: 860px;
}

.product-search-panel {
    margin-bottom: 30px;
    border-color: #b8d8ca;
}

.product-search-form {
    display: flex;
    align-items: end;
    gap: 12px;
}

.product-results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.product-results-heading h2 {
    margin: 6px 0 0;
    font-size: 1.65rem;
    letter-spacing: -.04em;
}

.product-results-grid {
    display: grid;
    gap: 16px;
}

.product-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.product-card-media {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f4f7f5;
}

.product-card-media img,
.product-photo-placeholder {
    width: 100%;
    height: 100%;
    min-height: 150px;
}

.product-card-media img {
    display: block;
    object-fit: contain;
    padding: 10px;
    background: #fff;
}

.product-photo-placeholder {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 7px;
    color: var(--muted);
    text-align: center;
}

.product-photo-placeholder span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.product-photo-placeholder small {
    font-size: .7rem;
}

.product-card-content {
    min-width: 0;
}

.product-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--line);
}

.product-card-top h3 {
    margin: 6px 0 0;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.product-price {
    flex: 0 0 auto;
    text-align: right;
}

.product-price strong,
.product-price span {
    display: block;
}

.product-price strong {
    color: var(--primary);
    font-size: 1.45rem;
}

.product-price span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.product-card-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 20px;
    padding-top: 17px;
}

.product-card-details div {
    min-width: 0;
}

.product-card-details span,
.product-card-details strong {
    display: block;
}

.product-card-details span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 750;
}

.product-card-details strong {
    overflow-wrap: anywhere;
    font-size: .86rem;
}

.product-empty-state {
    grid-column: 1 / -1;
}

@media (max-width: 800px) {
    .product-card-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .product-search-form,
    .product-results-heading,
    .product-card-top {
        align-items: stretch;
        flex-direction: column;
    }

    .product-card {
        grid-template-columns: 1fr;
    }

    .product-card-media {
        min-height: 220px;
    }

    .product-card-media img,
    .product-photo-placeholder {
        min-height: 220px;
    }

    .product-price {
        text-align: left;
    }

    .product-card-details {
        grid-template-columns: 1fr;
    }
}

@media (prefers-color-scheme: dark) {
    .product-card-media,
    .product-photo-placeholder {
        background: #171d1a;
    }

    .product-card-media img {
        background: #fff;
    }
}

/* ConectaNF v1.5.0: comparação de listas de compras */
.shopping-list-heading {
    max-width: 900px;
}

.shopping-list-panel {
    margin-bottom: 30px;
    border-color: #b8d8ca;
}

.shopping-list-form {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
    gap: 20px;
}

.shopping-list-text-field textarea {
    min-height: 250px;
    resize: vertical;
    line-height: 1.55;
}

.shopping-list-options {
    display: grid;
    align-content: start;
    gap: 16px;
}

.shopping-list-template {
    justify-self: start;
}

.shopping-list-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.shopping-list-summary {
    margin-bottom: 28px;
    border-color: #a9d2c1;
    background: linear-gradient(135deg, rgba(23, 107, 77, .08), rgba(255, 255, 255, .96));
}

.shopping-summary-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.shopping-summary-heading h2 {
    margin: 6px 0 8px;
    font-size: clamp(1.65rem, 3.3vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.shopping-summary-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.shopping-summary-total {
    flex: 0 0 auto;
    min-width: 180px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    text-align: right;
    box-shadow: 0 12px 28px rgba(23, 107, 77, .18);
}

.shopping-summary-total span,
.shopping-summary-total strong {
    display: block;
}

.shopping-summary-total span {
    margin-bottom: 4px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .8;
}

.shopping-summary-total strong {
    font-size: 1.65rem;
}

.shopping-summary-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.shopping-summary-metrics > div,
.shopping-date-strip > div {
    min-width: 0;
}

.shopping-summary-metrics span,
.shopping-summary-metrics strong,
.shopping-date-strip span,
.shopping-date-strip strong {
    display: block;
}

.shopping-summary-metrics span,
.shopping-date-strip span {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 760;
}

.shopping-summary-metrics strong,
.shopping-date-strip strong {
    overflow-wrap: anywhere;
    font-size: .88rem;
}

.shopping-results-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.shopping-results-heading h2 {
    margin: 6px 0 0;
    font-size: 1.65rem;
    letter-spacing: -.04em;
}

.shopping-store-list {
    display: grid;
    gap: 18px;
}

.shopping-store-card {
    overflow: hidden;
    padding: 0;
}

.shopping-store-card.winner {
    border: 2px solid var(--primary);
    box-shadow: 0 18px 44px rgba(23, 107, 77, .16);
}

.shopping-store-card.partial {
    border-style: dashed;
}

.shopping-store-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    padding: 22px 24px;
}

.shopping-store-header h3 {
    margin: 6px 0 5px;
    font-size: 1.35rem;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.shopping-store-header p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
}

.shopping-store-total {
    flex: 0 0 auto;
    text-align: right;
}

.shopping-store-total span,
.shopping-store-total strong,
.shopping-store-total small {
    display: block;
}

.shopping-store-total span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 760;
}

.shopping-store-total strong {
    margin: 3px 0;
    color: var(--primary);
    font-size: 1.65rem;
}

.shopping-store-total small {
    color: var(--muted);
    font-size: .72rem;
}

.shopping-date-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(23, 107, 77, .035);
}

.shopping-items-table {
    border: 0;
    border-radius: 0;
}

.shopping-items-table table {
    min-width: 960px;
}

.shopping-items-table td strong,
.shopping-items-table td small {
    display: block;
}

.shopping-items-table td small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .72rem;
}

.freshness-badge {
    display: inline-flex !important;
    width: fit-content;
    margin-top: 7px !important;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: .66rem !important;
    font-weight: 800 !important;
}

.freshness-badge.fresh {
    background: rgba(23, 107, 77, .11);
    color: var(--primary);
}

.freshness-badge.attention {
    background: var(--warning-soft);
    color: #8a5a00;
}

.freshness-badge.stale {
    background: rgba(181, 49, 49, .1);
    color: #a52d2d;
}

.freshness-badge.unknown {
    background: rgba(120, 130, 125, .12);
    color: var(--muted);
}

.shopping-missing-items {
    padding: 18px 24px 22px;
    border-top: 1px solid var(--line);
    background: var(--warning-soft);
}

.shopping-missing-items > strong {
    display: block;
    margin-bottom: 9px;
    color: #8a5a00;
}

.shopping-missing-items ul {
    margin: 0;
    padding-left: 20px;
    color: #76520b;
    line-height: 1.55;
}

@media (max-width: 980px) {
    .shopping-list-form {
        grid-template-columns: 1fr;
    }

    .shopping-list-actions {
        grid-column: auto;
    }

    .shopping-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shopping-date-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .shopping-list-actions,
    .shopping-summary-heading,
    .shopping-results-heading,
    .shopping-store-header {
        align-items: stretch;
        flex-direction: column;
    }

    .shopping-list-actions .button,
    .shopping-list-template {
        width: 100%;
        justify-content: center;
    }

    .shopping-summary-total,
    .shopping-store-total {
        width: 100%;
        text-align: left;
    }

    .shopping-summary-metrics {
        grid-template-columns: 1fr;
    }

    .shopping-items-table table {
        min-width: 0;
    }
}

@media (prefers-color-scheme: dark) {
    .shopping-list-summary {
        background: linear-gradient(135deg, rgba(85, 200, 153, .1), rgba(20, 26, 23, .96));
    }

    .shopping-date-strip {
        background: rgba(85, 200, 153, .04);
    }

    .freshness-badge.attention,
    .shopping-missing-items {
        color: #f0c36b;
    }

    .shopping-missing-items > strong,
    .shopping-missing-items ul {
        color: #f0c36b;
    }
}

.product-card-content > .freshness-badge { margin-top: 16px !important; }

/* Página inicial em formato de aplicativo — v1.6.0 */
.app-home-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(23, 107, 77, .12), transparent 25rem),
        radial-gradient(circle at 88% 24%, rgba(23, 92, 211, .07), transparent 22rem),
        var(--bg);
}

.app-home-header {
    border-bottom-color: rgba(220, 229, 225, .8);
}

.app-home-content {
    padding-block: 58px 78px;
}

.app-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 40px;
    align-items: end;
    margin-bottom: 52px;
}

.app-home-copy {
    max-width: 760px;
}

.app-home-copy h1 {
    max-width: 720px;
    margin: 10px 0 18px;
    font-size: clamp(2.55rem, 5vw, 5rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.app-home-copy p {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.7;
}

.app-home-highlight {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(23, 107, 77, .18);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-soft), var(--surface));
    box-shadow: var(--shadow);
}

.app-home-highlight-icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
}

.app-home-highlight-icon svg,
.app-card-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.app-home-highlight strong,
.app-home-highlight span {
    display: block;
}

.app-home-highlight strong {
    margin-bottom: 5px;
    font-size: .96rem;
}

.app-home-highlight span {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

.app-launcher {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, .7);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.app-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
}

.app-section-heading h2 {
    margin: 5px 0 0;
    font-size: clamp(1.45rem, 2.6vw, 2.15rem);
    letter-spacing: -.035em;
}

.app-section-note {
    color: var(--muted);
    font-size: .78rem;
}

.app-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.app-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 17px;
    align-items: center;
    min-height: 174px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-strong);
    color: var(--text);
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.app-card::after {
    content: '';
    position: absolute;
    right: -45px;
    bottom: -70px;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    background: var(--primary-soft);
    opacity: .55;
    transition: transform .25s ease;
}

.app-card:hover,
.app-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(23, 107, 77, .42);
    box-shadow: 0 20px 38px rgba(22, 45, 35, .12);
    outline: none;
}

.app-card:hover::after,
.app-card:focus-visible::after {
    transform: scale(1.14);
}

.app-card-featured {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.app-card-featured::after {
    background: rgba(255, 255, 255, .15);
}

.app-card-private {
    background: linear-gradient(145deg, var(--surface-strong), var(--primary-soft));
}

.app-card-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
}

.app-card-featured .app-card-icon {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.app-card-body {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.app-card-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.app-card-featured .app-card-kicker {
    color: rgba(255, 255, 255, .72);
}

.app-card-body strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.18rem;
    letter-spacing: -.02em;
}

.app-card-body > span:last-child {
    display: block;
    max-width: 470px;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.55;
}

.app-card-featured .app-card-body > span:last-child {
    color: rgba(255, 255, 255, .78);
}

.app-card-arrow {
    position: relative;
    z-index: 1;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 1.15rem;
    transition: transform .2s ease;
}

.app-card-featured .app-card-arrow {
    border-color: rgba(255, 255, 255, .28);
}

.app-card:hover .app-card-arrow,
.app-card:focus-visible .app-card-arrow {
    transform: translateX(4px);
}

.app-home-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.app-home-info article {
    display: flex;
    gap: 14px;
    padding: 20px 8px;
}

.app-info-number {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .08em;
}

.app-home-info strong {
    display: block;
    margin-bottom: 6px;
    font-size: .9rem;
}

.app-home-info p {
    margin: 0;
    color: var(--muted);
    font-size: .77rem;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .app-home-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .app-home-highlight {
        max-width: 620px;
    }
}

@media (max-width: 700px) {
    .app-home-content {
        padding-block: 38px 58px;
    }

    .app-home-hero {
        gap: 26px;
        margin-bottom: 34px;
    }

    .app-home-copy h1 {
        font-size: clamp(2.6rem, 13vw, 4rem);
    }

    .app-launcher {
        padding: 18px;
        border-radius: 22px;
    }

    .app-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .app-card-grid,
    .app-home-info {
        grid-template-columns: 1fr;
    }

    .app-card {
        min-height: 0;
        padding: 20px;
    }

    .app-card-icon {
        width: 50px;
        height: 50px;
        border-radius: 15px;
    }

    .app-card-arrow {
        width: 34px;
        height: 34px;
    }

    .app-home-info {
        gap: 0;
        margin-top: 16px;
    }

    .app-home-info article {
        padding: 17px 4px;
        border-bottom: 1px solid var(--line);
    }

    .app-home-info article:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 430px) {
    .app-home-header .header-actions .button {
        width: auto;
    }

    .app-home-highlight {
        align-items: flex-start;
    }

    .app-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .app-card-arrow {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    .app-launcher {
        background: rgba(24, 31, 28, .72);
    }

    .app-home-header {
        border-bottom-color: rgba(52, 65, 59, .8);
    }
}

/* ConectaNF v1.7.1: localização de estabelecimentos */
.location-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(23, 107, 77, .2);
    border-radius: 14px;
    background: rgba(23, 107, 77, .045);
}
.location-inline > div:first-child {
    min-width: 0;
}
.location-inline strong,
.location-inline small {
    display: block;
}
.location-inline small,
.location-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.45;
}
.location-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}
.location-card {
    display: grid;
    gap: 12px;
}
.location-card h3 {
    margin: 0;
    font-size: 1.05rem;
}
.location-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}
.product-location {
    margin-top: 16px;
}
.shopping-location {
    margin: 0;
    padding: 14px 24px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
}
.shopping-store-address {
    margin-top: 5px !important;
    max-width: 720px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .location-inline {
        align-items: stretch;
        flex-direction: column;
    }

    .location-actions,
    .location-actions .button {
        width: 100%;
    }

    .location-actions .button {
        justify-content: center;
    }
}

/* ConectaNF v1.7.1: localização segura por CNPJ de filial */
.location-correction-link {
    display: inline-flex;
    margin-top: 2px;
    font-size: .8rem;
}
.location-admin-layout {
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(0, 1.65fr);
    gap: 22px;
    align-items: start;
}
.location-supplier-list,
.location-edit-panel {
    padding: 22px;
}
.location-supplier-scroll {
    display: grid;
    gap: 8px;
    max-height: 680px;
    overflow: auto;
    padding-right: 4px;
}
.location-supplier-item {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    background: var(--surface);
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.location-supplier-item:hover,
.location-supplier-item.active {
    border-color: rgba(23, 107, 77, .45);
    background: rgba(23, 107, 77, .055);
    transform: translateY(-1px);
}
.location-supplier-item span {
    color: var(--muted);
    font-size: .79rem;
}
.location-status {
    width: fit-content;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.location-status.verified {
    color: #176b4d;
    background: rgba(23, 107, 77, .11);
}
.location-status.approximate {
    color: #8a5a00;
    background: rgba(211, 145, 0, .14);
}
.location-status.unavailable {
    color: #8b3341;
    background: rgba(166, 55, 73, .11);
}
.location-safety-note {
    margin: 2px 0 20px;
    padding: 14px 16px;
    border: 1px solid rgba(211, 145, 0, .24);
    border-radius: 12px;
    background: rgba(211, 145, 0, .065);
}
.location-safety-note p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.5;
}
.location-admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.location-admin-form .full {
    grid-column: 1 / -1;
}
.location-admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.location-delete-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .location-admin-layout {
        grid-template-columns: 1fr;
    }
    .location-supplier-scroll {
        max-height: 360px;
    }
}

@media (max-width: 650px) {
    .location-admin-form {
        grid-template-columns: 1fr;
    }
    .location-admin-form .full {
        grid-column: auto;
    }
    .location-admin-actions,
    .location-admin-actions .button {
        width: 100%;
    }
    .location-admin-actions .button {
        justify-content: center;
    }
}

/* ConectaNF v2.0.1: shell de aplicativo, navegação compacta e PWA */
:root {
    --app-header-height: 68px;
    --app-nav-height: 72px;
    --app-nav-bg: rgba(255, 255, 255, .94);
    --app-active: #176b4d;
}

.app-page {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-shell-header {
    min-height: var(--app-header-height);
}

.app-shell-header .header-inner {
    min-height: var(--app-header-height);
    gap: 20px;
}

.app-shell-header .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
}

.app-desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-inline: auto;
    padding: 5px;
    border: 1px solid rgba(220, 229, 225, .8);
    border-radius: 16px;
    background: rgba(255, 255, 255, .66);
}

.app-nav-link,
.app-bottom-link {
    color: var(--muted);
    text-decoration: none;
}

.app-nav-link {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .76rem;
    font-weight: 800;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.app-nav-link:hover {
    color: var(--text);
    background: rgba(23, 107, 77, .07);
    transform: translateY(-1px);
}

.app-nav-link.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.app-nav-link svg,
.app-bottom-link svg,
.app-icon-action svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.app-icon-action {
    appearance: none;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: .74rem;
    font-weight: 800;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.app-icon-action:hover {
    border-color: rgba(23, 107, 77, .3);
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.app-icon-action:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.app-bottom-nav {
    display: none;
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    max-width: min(420px, calc(100% - 32px));
    padding: 12px 16px;
    border: 1px solid rgba(220, 229, 225, .9);
    border-radius: 14px;
    background: rgba(24, 34, 31, .94);
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.4;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity .18s ease, transform .18s ease;
}

.app-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* A página inicial continua explicativa, mas os acessos ficam mais leves. */
.app-home-content {
    padding-block: 42px 72px;
}

.app-home-hero {
    gap: 28px;
    margin-bottom: 24px;
}

.app-home-copy h1 {
    max-width: 760px;
    font-size: clamp(2.4rem, 6vw, 4.4rem);
}

.app-launcher {
    padding: 22px;
    border-radius: 24px;
}

.app-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.app-card,
.app-card.app-card-featured {
    min-height: 188px;
    padding: 18px;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 13px;
    border-radius: 18px;
}

.app-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
}

.app-card-body strong {
    font-size: 1.04rem;
}

.app-card-body > span:last-child {
    font-size: .78rem;
    line-height: 1.5;
}

.app-card-arrow {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    font-size: .9rem;
}

.app-card {
    position: relative;
}

.app-home-info {
    margin-top: 20px;
}

/* Hierarquia visual mais próxima de um app: títulos menores e painéis mais claros. */
.app-page .page-content {
    padding-top: 38px;
}

.app-page .page-heading h1,
.app-page .hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.7rem);
}

.app-page .panel {
    box-shadow: 0 14px 36px rgba(22, 45, 35, .065);
}

html.is-offline .site-header::after {
    content: "Offline";
    position: absolute;
    right: 12px;
    bottom: -28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--warning-soft);
    color: var(--warning);
    font-size: .68rem;
    font-weight: 850;
}

@media (max-width: 1040px) {
    .app-nav-link {
        padding-inline: 9px;
    }

    .app-nav-link span {
        display: none;
    }

    .app-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    :root {
        --app-header-height: 60px;
        --app-nav-height: 68px;
    }

    body.app-page {
        padding-bottom: calc(var(--app-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .app-shell-header .header-inner {
        min-height: var(--app-header-height);
    }

    .app-shell-header .brand {
        gap: 9px;
    }

    .app-shell-header .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: .9rem;
    }

    .app-shell-header .brand strong {
        font-size: .92rem;
    }

    .app-desktop-nav {
        display: none;
    }

    .app-icon-action {
        width: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 50%;
    }

    .app-icon-action span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .app-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        display: block;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(220, 229, 225, .92);
        background: var(--app-nav-bg);
        backdrop-filter: blur(20px);
        box-shadow: 0 -10px 36px rgba(22, 45, 35, .09);
    }

    .app-bottom-nav-inner {
        width: min(560px, 100%);
        margin-inline: auto;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        align-items: center;
    }

    .app-bottom-link {
        min-width: 0;
        min-height: 50px;
        padding: 5px 4px;
        border-radius: 13px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font-size: .64rem;
        font-weight: 800;
        line-height: 1;
        -webkit-tap-highlight-color: transparent;
    }

    .app-bottom-link svg {
        width: 21px;
        height: 21px;
    }

    .app-bottom-link.active {
        color: var(--primary-dark);
        background: var(--primary-soft);
    }

    .site-footer {
        display: none;
    }

    .app-toast {
        bottom: calc(var(--app-nav-height) + 18px + env(safe-area-inset-bottom, 0px));
    }

    .app-home-content {
        padding-block: 28px 44px;
    }

    .app-home-hero {
        margin-bottom: 16px;
    }

    .app-home-highlight {
        padding: 15px;
        border-radius: 17px;
    }

    .app-section-heading {
        margin-bottom: 15px;
    }

    .app-section-note {
        display: none;
    }

    .app-launcher {
        padding: 15px;
        border-radius: 20px;
    }

    .app-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .app-card,
    .app-card.app-card-featured {
        min-height: 154px;
        padding: 15px;
        gap: 10px;
        border-radius: 16px;
    }

    .app-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .app-card-body strong {
        font-size: .92rem;
        line-height: 1.2;
    }

    .app-card-body > span:last-child {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: .7rem;
    }

    .app-card-kicker,
    .app-card-arrow {
        display: none;
    }

    .app-home-info {
        margin-top: 14px;
    }

    .app-page .page-content {
        padding-top: 26px;
    }

    .app-page .page-heading,
    .app-page .hero {
        margin-bottom: 20px;
    }

    .app-page .page-heading h1,
    .app-page .hero h1 {
        margin-top: 7px;
        font-size: clamp(2rem, 10vw, 2.7rem);
    }
}

@media (max-width: 390px) {
    .app-card-grid {
        grid-template-columns: 1fr;
    }

    .app-card,
    .app-card.app-card-featured {
        min-height: 0;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }

    .app-card-body > span:last-child {
        -webkit-line-clamp: 1;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --app-nav-bg: rgba(24, 31, 28, .94);
    }

    .app-desktop-nav,
    .app-icon-action {
        background: rgba(27, 34, 31, .72);
    }
}

@media (max-width: 720px) {
    body.app-login-page {
        padding-bottom: 0;
    }
}

/* v2.0.1 — normalização de endereço e catálogo de produtos */
.product-original-name {
    display: block;
    margin-top: .35rem;
    color: var(--muted, #66756f);
    font-size: .8rem;
    line-height: 1.35;
}

.address-source-note {
    display: block;
    margin-top: .35rem;
    color: var(--muted, #66756f);
    font-size: .78rem;
    line-height: 1.4;
}

.product-photo-notice {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    padding: 6px 8px;
    border-radius: 9px;
    background: rgba(17, 36, 29, .84);
    color: #fff;
    font-size: .65rem;
    line-height: 1.35;
    text-align: center;
    backdrop-filter: blur(6px);
}


.external-consultation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid rgba(23, 107, 77, .24);
    border-radius: 16px;
    background: var(--primary-soft);
}

.external-consultation[hidden] {
    display: none;
}

.external-consultation strong,
.external-consultation p {
    margin: 0;
}

.external-consultation p {
    margin-top: 5px;
    color: var(--muted);
}

@media (max-width: 680px) {
    .external-consultation {
        align-items: stretch;
        flex-direction: column;
    }
}

/* v2.2.0 - contas pessoais e histórico por usuário */
.app-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    max-width: 190px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}

.app-user-chip svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-user-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-switch {
    margin: 18px 0 0 !important;
    text-align: center;
    font-size: .9rem;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 800;
}

.account-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 18px 20px;
}

.account-callout h2,
.account-callout p {
    margin: 0;
}

.account-callout p {
    margin-top: 5px;
    color: var(--muted);
}

.account-callout-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

@media (max-width: 900px) {
    .app-user-chip span {
        display: none;
    }

    .app-user-chip {
        width: 40px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .app-user-chip {
        display: none;
    }

    .account-callout {
        align-items: stretch;
        flex-direction: column;
    }

    .account-callout-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* v2.3.0 - painel analitico e historico administrativo */
.dashboard-content {
    display: grid;
    gap: 22px;
}

.dashboard-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 0;
}

.dashboard-heading > div:first-child {
    min-width: 0;
}

.dashboard-user-filter {
    width: min(360px, 100%);
    flex: 0 0 auto;
    padding: 16px;
    box-shadow: none;
}

.dashboard-user-filter .field > span {
    margin-bottom: 6px;
}

.dashboard-user-filter select {
    min-height: 44px;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-kpi {
    min-width: 0;
    min-height: 138px;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(22, 45, 35, .055);
}

.dashboard-kpi span,
.dashboard-kpi small {
    display: block;
    color: var(--muted);
}

.dashboard-kpi span {
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dashboard-kpi strong {
    display: block;
    margin: 13px 0 9px;
    overflow-wrap: anywhere;
    font-size: clamp(1.45rem, 2.7vw, 2.15rem);
    line-height: 1;
    letter-spacing: -.055em;
}

.dashboard-kpi small {
    font-size: .73rem;
    line-height: 1.4;
}

.dashboard-kpi-primary {
    border-color: transparent;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.dashboard-kpi-primary span,
.dashboard-kpi-primary small {
    color: rgba(255, 255, 255, .76);
}

.dashboard-kpi-alert {
    border-color: #efc3be;
    background: var(--danger-soft);
}

.dashboard-grid {
    display: grid;
    gap: 22px;
}

.dashboard-grid-main {
    grid-template-columns: minmax(0, 1.85fr) minmax(250px, .65fr);
    align-items: stretch;
}

.dashboard-panel-heading {
    align-items: center;
}

.dashboard-delta {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 900;
}

.dashboard-delta.up,
.dashboard-variation.up,
#metric-variation.up {
    color: var(--danger);
}

.dashboard-delta.up {
    background: var(--danger-soft);
}

.dashboard-delta.down,
.dashboard-variation.down,
#metric-variation.down {
    color: var(--primary-dark);
}

.dashboard-delta.down {
    background: var(--primary-soft);
}

.dashboard-chart {
    min-height: 310px;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background:
        linear-gradient(180deg, rgba(23, 107, 77, .04), transparent 70%),
        var(--surface-strong);
}

.dashboard-chart-svg {
    display: block;
    width: 100%;
    min-width: 620px;
    height: auto;
    color: var(--primary);
}

.dashboard-chart-grid line {
    stroke: var(--line);
    stroke-width: 1;
}

.dashboard-chart-labels text {
    fill: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.dashboard-chart-area {
    fill: rgba(23, 107, 77, .1);
}

.dashboard-chart-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-chart-points circle {
    fill: var(--surface-strong);
    stroke: currentColor;
    stroke-width: 3;
    cursor: help;
}

.dashboard-chart-points circle:focus {
    outline: none;
    stroke-width: 5;
}

.dashboard-chart-empty,
.dashboard-insufficient {
    min-height: 250px;
    display: grid;
    place-content: center;
    gap: 8px;
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

.dashboard-insufficient strong {
    color: var(--text);
    font-size: 1.05rem;
}

.dashboard-insufficient p {
    max-width: 460px;
    margin: 0;
    line-height: 1.55;
}

.dashboard-method {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: .73rem;
    line-height: 1.5;
}

.dashboard-profile-card {
    display: flex;
    flex-direction: column;
}

.dashboard-profile-card h2 {
    margin: 7px 0 20px;
    font-size: 1.55rem;
    letter-spacing: -.04em;
}

.dashboard-profile-card dl {
    display: grid;
    gap: 0;
    margin: 0 0 22px;
}

.dashboard-profile-card dl > div {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.dashboard-profile-card dt {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dashboard-profile-card dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-weight: 750;
}

.dashboard-profile-card .button {
    margin-top: auto;
}

.dashboard-product-picker {
    width: min(400px, 100%);
}

.dashboard-product-picker > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}

.dashboard-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 18px;
    align-items: stretch;
}

.dashboard-product-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.dashboard-product-metrics > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-strong);
}

.dashboard-product-metrics span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}

.dashboard-product-metrics strong {
    text-align: right;
    font-size: .92rem;
}

.dashboard-ranking-table td:first-child {
    min-width: 280px;
}

.dashboard-ranking-table td:first-child small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.dashboard-product-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-weight: 800;
}

.dashboard-product-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.history-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(150px, .65fr)) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
    padding: 18px;
}

.history-toolbar .button {
    min-height: 48px;
}

.history-toolbar-actions {
    display: flex;
    gap: 8px;
}

.history-owner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--info);
    font-weight: 800;
}

.history-owner::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.history-result-count {
    margin: -8px 0 16px;
    color: var(--muted);
    font-size: .82rem;
}

.admin-receipt-owner {
    margin: 0 0 18px;
    padding: 13px 15px;
    border: 1px solid #bdd2fb;
    border-radius: 13px;
    background: var(--info-soft);
    color: var(--info);
    line-height: 1.5;
}

.app-user-chip {
    text-decoration: none;
}

@media (max-width: 1100px) {
    .dashboard-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .history-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-toolbar-actions {
        grid-column: span 2;
    }
}

@media (max-width: 820px) {
    .dashboard-heading,
    .dashboard-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-user-filter,
    .dashboard-product-picker {
        width: 100%;
    }

    .dashboard-grid-main,
    .dashboard-product-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-product-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-kpi:last-child {
        grid-column: span 2;
    }

    .dashboard-chart {
        overflow-x: auto;
        min-height: 270px;
    }

    .dashboard-product-metrics,
    .history-toolbar {
        grid-template-columns: 1fr;
    }

    .history-toolbar-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-color-scheme: dark) {
    .dashboard-kpi {
        box-shadow: none;
    }

    .dashboard-chart-area {
        fill: rgba(77, 191, 145, .1);
    }

    .dashboard-kpi-alert {
        border-color: #6b3935;
    }
}

/* v2.3.1 - cesta por cupom e histórico unitário na consulta */
.dashboard-product-access-panel p {
    max-width: 860px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.dashboard-product-name {
    color: var(--text);
    font-weight: 800;
}

.receipt-product-history-trigger {
    appearance: none;
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.receipt-product-history-trigger > span {
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 3px;
}

.receipt-product-history-trigger > small {
    color: var(--primary);
    font-size: .7rem;
    font-weight: 800;
}

.receipt-product-history-trigger:hover > span,
.receipt-product-history-trigger:focus-visible > span,
.receipt-product-history-trigger.active > span {
    color: var(--primary);
    text-decoration-color: currentColor;
}


.receipt-product-history-panel {
    scroll-margin-top: 90px;
}

.receipt-product-history-panel[hidden] {
    display: none;
}

@media (max-width: 620px) {
    .receipt-product-history-panel .dashboard-product-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* v2.4.0 - cesta basica pessoal com unidades normalizadas */
.dashboard-basic-basket-grid {
    align-items: start;
}

.dashboard-basket-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.dashboard-basket-metrics > div,
.dashboard-basic-basket-stats > div {
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-strong);
}

.dashboard-basket-metrics span,
.dashboard-basic-basket-stats span,
.dashboard-recurring-prices span,
.dashboard-recurring-prices small {
    display: block;
    color: var(--muted);
}

.dashboard-basket-metrics span,
.dashboard-basic-basket-stats span {
    margin-bottom: 6px;
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.dashboard-basket-metrics strong {
    font-size: 1rem;
}

.dashboard-basic-basket-summary h2 {
    margin: 7px 0 16px;
    font-size: 1.35rem;
    letter-spacing: -.035em;
}

.dashboard-basic-basket-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.dashboard-basic-basket-stats strong {
    font-size: 1.18rem;
}

.dashboard-basket-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--line);
}

.dashboard-basket-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.dashboard-basket-list > div > span {
    min-width: 0;
    font-weight: 800;
}

.dashboard-basket-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .67rem;
    font-weight: 650;
    line-height: 1.35;
}

.dashboard-basket-list strong {
    flex: 0 0 auto;
    font-size: .82rem;
    text-align: right;
}

.dashboard-recurring-prices {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--primary-soft);
}

.dashboard-recurring-prices span {
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.dashboard-recurring-prices strong {
    display: block;
    margin: 8px 0 6px;
    color: var(--primary-dark);
    font-size: 1.45rem;
    letter-spacing: -.04em;
}

.dashboard-recurring-prices small {
    font-size: .7rem;
    line-height: 1.45;
}

@media (max-width: 820px) {
    .dashboard-basket-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .dashboard-basic-basket-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* Inteligência financeira, perfil familiar e privacidade — v2.5.0 */
.finance-content,
.profile-content,
.privacy-content,
.legal-content {
    display: grid;
    gap: 1.25rem;
}

.finance-insights,
.insight-list,
.lesson-list,
.rank-list {
    display: grid;
    gap: 0.85rem;
}

.insight-card,
.lesson-list article {
    border: 1px solid var(--border, rgba(120, 130, 140, 0.24));
    border-radius: 1rem;
    padding: 1rem;
    background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
}

.insight-card p,
.lesson-list p {
    margin: 0.45rem 0;
}

.insight-card details {
    margin-top: 0.65rem;
}

.insight-card pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.78rem;
}

.rank-list > div {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border, rgba(120, 130, 140, 0.2));
}

.rank-list > div > span {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--soft, rgba(23, 107, 77, 0.1));
}

.data-table td small,
.lesson-list small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted, #65736d);
}

.data-table progress {
    width: min(12rem, 100%);
    height: 0.75rem;
}

.finance-definition-list {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0;
}

.finance-definition-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border, rgba(120, 130, 140, 0.2));
}

.finance-definition-list dt {
    color: var(--muted, #65736d);
}

.finance-definition-list dd {
    margin: 0;
    font-weight: 800;
}

.profile-grid,
.privacy-grid {
    align-items: start;
}

.profile-form,
.danger-form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.four-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    border: 0;
    padding: 0;
    margin: 0;
}

.choice-group legend {
    width: 100%;
    margin-bottom: 0.25rem;
    font-weight: 800;
}

.choice-group label,
.check-field {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    cursor: pointer;
}

.choice-group label {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border, rgba(120, 130, 140, 0.24));
    border-radius: 0.8rem;
}

.check-field input,
.choice-group input {
    margin-top: 0.2rem;
    flex: 0 0 auto;
}

.privacy-grid .panel,
.danger-zone {
    display: grid;
    gap: 0.85rem;
}

.danger-zone {
    border-color: rgba(174, 50, 50, 0.45);
}

.button.danger {
    background: #a92f2f;
    color: #fff;
    border-color: #a92f2f;
}

.legal-document {
    max-width: 880px;
    margin-inline: auto;
}

.legal-document h2 {
    margin-top: 1.75rem;
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .form-grid.four-columns,
    .form-grid.three-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .form-grid.four-columns,
    .form-grid.three-columns {
        grid-template-columns: 1fr;
    }

    .rank-list > div {
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .rank-list b {
        grid-column: 2;
    }
}

/* Ajustes do painel financeiro - v2.5.1 */
.finance-grid-overview {
    align-items: start;
}

.finance-grid-overview > .panel {
    min-height: 0;
}

.insight-card > strong {
    display: block;
    line-height: 1.35;
}

.insight-evidence {
    margin-top: 0.75rem;
    border-top: 1px solid var(--line, rgba(120, 130, 140, 0.2));
    padding-top: 0.7rem;
}

.insight-evidence summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-dark, #125c42);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    list-style: none;
}

.insight-evidence summary::-webkit-details-marker {
    display: none;
}

.insight-evidence summary::before {
    content: '+';
    display: grid;
    place-items: center;
    width: 1.15rem;
    height: 1.15rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1;
}

.insight-evidence[open] summary::before {
    content: '−';
}

.insight-evidence dl {
    display: grid;
    gap: 0;
    margin: 0.75rem 0 0;
    border: 1px solid var(--line, rgba(120, 130, 140, 0.2));
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--surface-strong, #fff);
}

.insight-evidence dl > div {
    display: grid;
    grid-template-columns: minmax(7rem, 0.9fr) minmax(0, 1.1fr);
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.insight-evidence dl > div + div {
    border-top: 1px solid var(--line, rgba(120, 130, 140, 0.16));
}

.insight-evidence dt {
    color: var(--muted, #65736d);
    font-size: 0.72rem;
    line-height: 1.4;
}

.insight-evidence dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text, #1f2c27);
    font-size: 0.75rem;
    font-weight: 750;
    line-height: 1.4;
}

.finance-data-warning {
    display: grid;
    gap: 0.25rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e7d6a2;
    border-radius: 0.9rem;
    background: #fff9e8;
    color: #65511f;
    line-height: 1.45;
}

.finance-data-warning strong {
    color: #4f3e13;
    font-size: 0.84rem;
}

.finance-data-warning span {
    font-size: 0.78rem;
}

.finance-inline-empty {
    display: grid;
    gap: 0.35rem;
    min-height: 12rem;
    place-content: center;
    padding: 1.5rem;
    text-align: center;
    color: var(--muted, #65736d);
}

.finance-inline-empty strong {
    color: var(--text, #1f2c27);
}

.finance-inline-empty p {
    max-width: 28rem;
    margin: 0;
    line-height: 1.5;
}

.finance-chart-forming {
    min-height: 250px;
}

.finance-chart-forming-value {
    display: inline-flex;
    justify-self: center;
    margin-top: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: var(--primary-soft, rgba(23, 107, 77, 0.1));
    color: var(--primary-dark, #125c42);
    font-size: 0.82rem;
    font-weight: 850;
}

.finance-stores-panel,
.rank-list,
.rank-list > .rank-item {
    min-width: 0;
}

.rank-list > .rank-item {
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: start;
}

.rank-list > .rank-item > span {
    grid-row: 1 / span 2;
    align-self: start;
}

.rank-list > .rank-item > strong {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.rank-list > .rank-item > b {
    grid-column: 2;
    color: var(--primary-dark, #125c42);
    font-size: 0.84rem;
    line-height: 1.25;
}

@media (max-width: 620px) {
    .insight-evidence dl > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

@media (prefers-color-scheme: dark) {
    .finance-data-warning {
        border-color: #65551f;
        background: #2f2a18;
        color: #eadcae;
    }

    .finance-data-warning strong {
        color: #fff0b8;
    }
}

/* ConectaNF 2.5.6 - navegação única e cabeçalho uniforme */
body.app-page {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

/* O nome do produto é o único texto da marca em todas as telas. */
.app-shell-header .brand > span:last-child {
    display: flex;
    align-items: center;
    min-width: 0;
}

.app-shell-header .brand strong {
    white-space: nowrap;
}

/* Em celulares reais, PWA, WebView e modo "site para computador", a navegação
   principal continua sendo a mesma. Não há uma segunda barra de atalhos. */
@media (max-width: 720px) {
    .app-shell-header .header-inner {
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 10px;
        padding-block: 9px 8px;
    }

    .app-shell-header .brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .app-shell-header .brand-mark {
        width: 36px;
        height: 36px;
    }

    .app-shell-header .brand strong {
        font-size: .96rem;
    }

    .app-header-tools {
        grid-column: 2;
        grid-row: 1;
        gap: 6px;
    }

    .app-desktop-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 4px;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 2px;
        border-radius: 14px;
    }

    .app-nav-link {
        min-width: 0;
        min-height: 42px;
        padding: 0;
        justify-content: center;
        gap: 0;
    }

    .app-nav-link svg {
        width: 21px;
        height: 21px;
    }

    .app-nav-link span {
        display: none;
    }

    .app-user-chip {
        width: 40px;
        min-height: 40px;
        padding: 0;
        display: inline-flex;
        justify-content: center;
    }

    .app-user-chip span {
        display: none;
    }

    .app-toast {
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 390px) {
    .app-shell-header .header-inner {
        gap: 7px;
    }

    .app-desktop-nav {
        gap: 1px;
        padding-inline: 3px;
    }

    .app-nav-link {
        min-height: 40px;
    }

    .app-nav-link svg {
        width: 20px;
        height: 20px;
    }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.profile-content-v255 {
    gap: 22px;
}

.profile-hero-v255 {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    padding: 30px;
    overflow: hidden;
    border: 1px solid rgba(23, 107, 77, .14);
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 8%, rgba(23, 107, 77, .18), transparent 17rem),
        linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(232, 245, 239, .76));
    box-shadow: 0 18px 45px rgba(22, 45, 35, .08);
}

.profile-hero-v255::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -95px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(23, 107, 77, .07);
    pointer-events: none;
}

.profile-hero-copy-v255,
.profile-hero-actions-v255 {
    position: relative;
    z-index: 1;
}

.profile-hero-copy-v255 h1 {
    max-width: 720px;
    margin: 8px 0 12px;
    font-size: clamp(2.35rem, 5vw, 4.25rem);
    line-height: .98;
    letter-spacing: -.065em;
}

.profile-hero-copy-v255 > p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.profile-privacy-note-v255 {
    max-width: 760px;
    margin-top: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.5;
}

.profile-privacy-note-v255 > span:first-child {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
}

.profile-hero-actions-v255 {
    min-width: 220px;
    display: grid;
    gap: 9px;
}

.profile-hero-actions-v255 .button {
    width: 100%;
}

.profile-overview-v255 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.profile-overview-v255 article {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-strong);
    box-shadow: 0 12px 30px rgba(22, 45, 35, .055);
}

.profile-overview-v255 span,
.profile-overview-v255 small {
    display: block;
    color: var(--muted);
}

.profile-overview-v255 span {
    margin-bottom: 8px;
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.profile-overview-v255 strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 1.18rem;
    letter-spacing: -.03em;
}

.profile-overview-v255 small {
    margin-top: 6px;
    font-size: .7rem;
    line-height: 1.4;
}

.profile-layout-v255 {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
    gap: 22px;
    align-items: start;
}

.profile-family-card-v255 {
    padding: 0;
    overflow: hidden;
}

.profile-card-heading-v255 {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 26px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(145deg, var(--primary-soft), rgba(255, 255, 255, .92));
}

.profile-card-heading-v255 h2,
.profile-account-heading-v255 h2,
.profile-card-heading-compact-v255 h2 {
    margin: 6px 0 7px;
    font-size: 1.45rem;
    letter-spacing: -.04em;
}

.profile-card-heading-v255 p,
.profile-account-heading-v255 p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.5;
}

.profile-card-icon-v255 {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 15px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 24px rgba(23, 107, 77, .2);
}

.profile-card-icon-v255 svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-form-section-v255 {
    padding: 26px;
    border-bottom: 1px solid var(--line);
}

.profile-section-heading-v255 {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.profile-section-heading-v255 > span {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 900;
}

.profile-section-heading-v255 h3 {
    margin: 1px 0 4px;
    font-size: 1.05rem;
    letter-spacing: -.02em;
}

.profile-section-heading-v255 p {
    margin: 0;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.45;
}

.profile-counter-grid-v255 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.profile-counter-v255 {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    background: var(--surface-strong);
}

.profile-counter-symbol-v255 {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
}

.profile-counter-copy-v255 {
    min-width: 0;
}

.profile-counter-copy-v255 strong,
.profile-counter-copy-v255 small {
    display: block;
}

.profile-counter-copy-v255 strong {
    font-size: .82rem;
}

.profile-counter-copy-v255 small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .63rem;
    line-height: 1.3;
}

.profile-counter-v255 input {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-weight: 850;
    text-align: center;
}

.profile-choice-fieldset-v255 {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.profile-age-grid-v255,
.profile-goal-grid-v255 {
    display: grid;
    gap: 9px;
}

.profile-age-grid-v255 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-goal-grid-v255 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-choice-tile-v255 {
    position: relative;
    min-width: 0;
    min-height: 54px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-strong);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.profile-choice-tile-v255:hover {
    border-color: rgba(23, 107, 77, .32);
    transform: translateY(-1px);
}

.profile-choice-tile-v255:has(input:checked) {
    border-color: rgba(23, 107, 77, .48);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(23, 107, 77, .08);
}

.profile-choice-tile-v255 input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.profile-choice-tile-v255:focus-within {
    outline: 3px solid rgba(23, 107, 77, .18);
    outline-offset: 2px;
}

.profile-choice-indicator-v255 {
    position: relative;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 1.5px solid #9cada5;
    border-radius: 7px;
    background: var(--surface-strong);
}

.profile-choice-tile-v255 input:checked + .profile-choice-indicator-v255 {
    border-color: var(--primary);
    background: var(--primary);
}

.profile-choice-tile-v255 input:checked + .profile-choice-indicator-v255::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.profile-age-tile-v255 > span:last-child {
    min-width: 0;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.25;
}

.profile-goal-copy-v255 {
    min-width: 0;
}

.profile-goal-copy-v255 strong,
.profile-goal-copy-v255 small {
    display: block;
}

.profile-goal-copy-v255 strong {
    font-size: .82rem;
}

.profile-goal-copy-v255 small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .66rem;
    line-height: 1.35;
}

.profile-context-grid-v255 {
    display: grid;
    grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) 84px;
    gap: 12px;
}

.profile-notes-field-v255 {
    margin-top: 14px;
}

.profile-save-bar-v255 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 26px;
    background: rgba(232, 245, 239, .62);
}

.profile-save-bar-v255 p {
    margin: 0;
}

.profile-save-bar-v255 p strong,
.profile-save-bar-v255 p span {
    display: block;
}

.profile-save-bar-v255 p strong {
    font-size: .82rem;
}

.profile-save-bar-v255 p span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .7rem;
}

.profile-save-bar-v255 .button {
    flex: 0 0 auto;
}

.profile-account-column-v255 {
    display: grid;
    gap: 16px;
}

.profile-account-card-v255,
.profile-governance-card-v255 {
    display: grid;
    gap: 18px;
}

.profile-account-heading-v255 {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.profile-avatar-v255 {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(23, 107, 77, .2);
}

.profile-account-form-v255 {
    gap: 13px;
}

.profile-card-heading-compact-v255 {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.profile-card-heading-compact-v255 h2 {
    font-size: 1.25rem;
}

.profile-shield-v255 {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
}

.profile-governance-list-v255 {
    display: grid;
    gap: 0;
    margin: 0;
}

.profile-governance-list-v255 > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.profile-governance-list-v255 dt {
    color: var(--muted);
    font-size: .75rem;
}

.profile-governance-list-v255 dd {
    margin: 0;
    font-size: .75rem;
    font-weight: 850;
    text-align: right;
}

.profile-governance-list-v255 dd.status-on {
    color: var(--primary-dark);
}

.profile-governance-list-v255 dd.status-off {
    color: var(--warning);
}

.profile-account-actions-v255 {
    display: grid;
    gap: 9px;
}

@media (max-width: 1040px) {
    .profile-overview-v255 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-layout-v255 {
        grid-template-columns: 1fr;
    }

    .profile-account-column-v255 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .profile-hero-v255 {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .profile-hero-actions-v255 {
        min-width: 0;
        grid-template-columns: 1fr 1fr;
    }

    .profile-counter-grid-v255,
    .profile-age-grid-v255 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-context-grid-v255 {
        grid-template-columns: 1fr 84px;
    }

    .profile-field-wide-v255 {
        grid-column: 1 / -1;
    }

    .profile-account-column-v255 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .profile-content-v255 {
        gap: 14px;
    }

    .profile-hero-v255 {
        padding: 19px;
        border-radius: 20px;
    }

    .profile-hero-copy-v255 h1 {
        font-size: 2.55rem;
    }

    .profile-hero-actions-v255,
    .profile-overview-v255,
    .profile-goal-grid-v255 {
        grid-template-columns: 1fr;
    }

    .profile-card-heading-v255,
    .profile-form-section-v255,
    .profile-save-bar-v255 {
        padding-inline: 18px;
    }

    .profile-card-heading-v255 {
        padding-block: 20px;
    }

    .profile-form-section-v255 {
        padding-block: 21px;
    }

    .profile-save-bar-v255 {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-save-bar-v255 .button {
        width: 100%;
    }
}

@media (prefers-color-scheme: dark) {
    .profile-hero-v255 {
        border-color: rgba(85, 200, 153, .2);
        background:
            radial-gradient(circle at 92% 8%, rgba(85, 200, 153, .12), transparent 17rem),
            linear-gradient(145deg, rgba(27, 34, 31, .98), rgba(23, 60, 46, .62));
    }

    .profile-card-heading-v255 {
        background: linear-gradient(145deg, var(--primary-soft), rgba(27, 34, 31, .92));
    }

    .profile-save-bar-v255 {
        background: rgba(23, 60, 46, .46);
    }
}

/* ConectaNF 2.5.7 - painéis responsivos para telas pequenas */
body.app-dashboard-page {
    overflow-x: hidden;
    overflow-x: clip;
}

.app-dashboard-page .dashboard-content,
.app-dashboard-page .dashboard-content > *,
.app-dashboard-page .dashboard-grid,
.app-dashboard-page .dashboard-grid > *,
.app-dashboard-page .panel,
.app-dashboard-page .table-wrap,
.app-dashboard-page .dashboard-chart {
    min-width: 0;
    max-width: 100%;
}

/* O SVG passa a usar a largura real do painel; não força mais 620 px. */
.app-dashboard-page .dashboard-chart-svg {
    width: 100%;
    min-width: 0;
    height: auto;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) and (max-width: 1200px) {
    .app-dashboard-page .dashboard-content {
        gap: 14px;
    }

    .app-dashboard-page .dashboard-heading,
    .app-dashboard-page .dashboard-panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .app-dashboard-page .dashboard-heading {
        margin-bottom: 2px;
    }

    .app-dashboard-page .dashboard-heading h1 {
        max-width: 19ch;
        margin-block: 6px 9px;
        font-size: clamp(2rem, 7.2vw, 2.65rem);
        line-height: 1.02;
        letter-spacing: -.052em;
        text-wrap: balance;
    }

    .app-dashboard-page .dashboard-heading p {
        max-width: 62ch;
        font-size: .94rem;
        line-height: 1.5;
    }

    .app-dashboard-page .dashboard-heading-action,
    .app-dashboard-page .dashboard-heading > .button {
        width: auto;
        align-self: flex-start;
        min-height: 42px;
        padding-inline: 15px;
    }

    .app-dashboard-page .dashboard-user-filter {
        width: 100%;
        padding: 13px;
        border-radius: 16px;
    }

    .app-dashboard-page .dashboard-user-filter select {
        min-height: 44px;
    }

    /* Um cartão principal em largura total e quatro indicadores em uma grade 2x2. */
    .app-dashboard-page .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .app-dashboard-page .dashboard-kpi {
        min-height: 116px;
        padding: 15px;
        border-radius: 17px;
        box-shadow: 0 8px 22px rgba(22, 45, 35, .045);
    }

    .app-dashboard-page .dashboard-kpi-primary {
        grid-column: 1 / -1;
        min-height: 122px;
    }

    .app-dashboard-page .dashboard-kpi:last-child {
        grid-column: auto;
    }

    .app-dashboard-page .dashboard-kpi span {
        font-size: .67rem;
        line-height: 1.25;
    }

    .app-dashboard-page .dashboard-kpi strong {
        margin: 10px 0 7px;
        font-size: clamp(1.38rem, 5.5vw, 1.9rem);
        line-height: 1.04;
    }

    .app-dashboard-page .dashboard-kpi small {
        font-size: .69rem;
        line-height: 1.35;
    }

    .app-dashboard-page .dashboard-grid-main,
    .app-dashboard-page .dashboard-product-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .app-dashboard-page .panel {
        padding: 18px;
        border-radius: 19px;
    }

    .app-dashboard-page .panel-heading {
        gap: 12px;
        margin-bottom: 16px;
    }

    .app-dashboard-page .panel-heading h2,
    .app-dashboard-page .dashboard-profile-card h2,
    .app-dashboard-page .dashboard-basic-basket-summary h2,
    .app-dashboard-page .finance-insights h2 {
        font-size: clamp(1.3rem, 4.7vw, 1.62rem);
        line-height: 1.08;
        text-wrap: balance;
    }

    .app-dashboard-page .dashboard-delta {
        align-self: flex-start;
        min-height: 34px;
        padding-inline: 11px;
        font-size: .8rem;
    }

    .app-dashboard-page .dashboard-chart {
        min-height: 245px;
        overflow: hidden;
        border-radius: 14px;
    }

    .app-dashboard-page .dashboard-chart-labels text {
        font-size: 10px;
    }

    .app-dashboard-page .dashboard-method {
        margin-top: 10px;
        font-size: .7rem;
        line-height: 1.45;
    }

    .app-dashboard-page .dashboard-profile-card dl {
        margin-bottom: 16px;
    }

    .app-dashboard-page .dashboard-profile-card dl > div {
        display: grid;
        grid-template-columns: minmax(6rem, .7fr) minmax(0, 1.3fr);
        gap: 10px;
        align-items: baseline;
        padding-block: 10px;
    }

    .app-dashboard-page .dashboard-profile-card dd {
        margin: 0;
        text-align: right;
    }

    .app-dashboard-page .dashboard-basket-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .app-dashboard-page .dashboard-basket-metrics > div,
    .app-dashboard-page .dashboard-basic-basket-stats > div {
        padding: 11px;
    }

    .app-dashboard-page .dashboard-basket-list > div {
        align-items: flex-start;
        gap: 10px;
    }

    .app-dashboard-page .dashboard-basket-list strong {
        max-width: 42%;
        overflow-wrap: anywhere;
    }

    .app-dashboard-page .dashboard-product-access-panel p {
        font-size: .9rem;
        line-height: 1.55;
    }

    .app-dashboard-page .finance-insights,
    .app-dashboard-page .insight-list,
    .app-dashboard-page .lesson-list {
        gap: 10px;
    }

    .app-dashboard-page .insight-card,
    .app-dashboard-page .lesson-list article {
        padding: 13px;
        border-radius: 14px;
    }

    .app-dashboard-page .insight-card p,
    .app-dashboard-page .lesson-list p {
        font-size: .88rem;
        line-height: 1.5;
    }

    .app-dashboard-page .finance-definition-list > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: baseline;
        gap: 10px;
    }

    .app-dashboard-page .finance-definition-list dd {
        text-align: right;
    }

    .app-dashboard-page .rank-list > .rank-item {
        padding-block: 10px;
    }

    /* As tabelas viram cartões sem perder os nomes dos campos. */
    .app-dashboard-page .responsive-data-table,
    .app-dashboard-page .responsive-data-table tbody {
        display: block;
        width: 100%;
    }

    .app-dashboard-page .responsive-data-table thead {
        display: none;
    }

    .app-dashboard-page .responsive-data-table tbody {
        display: grid;
        gap: 10px;
    }

    .app-dashboard-page .responsive-data-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 14px;
        width: 100%;
        margin: 0;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: var(--surface-strong);
    }

    .app-dashboard-page .responsive-data-table td {
        display: block;
        min-width: 0;
        width: auto;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
        text-align: left !important;
    }

    .app-dashboard-page .responsive-data-table td::before {
        content: attr(data-label);
        display: block;
        min-width: 0;
        margin: 0 0 4px;
        color: var(--muted);
        font-size: .64rem;
        font-weight: 850;
        letter-spacing: .04em;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .app-dashboard-page .responsive-data-table td:first-child {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .app-dashboard-page .responsive-data-table td:first-child::before {
        display: none;
    }

    .app-dashboard-page .dashboard-ranking-table td {
        font-size: .88rem;
        font-weight: 750;
    }

    .app-dashboard-page .finance-category-table td:nth-child(2) {
        grid-column: 1 / -1;
    }

    .app-dashboard-page .finance-category-table progress {
        width: 100%;
        max-width: none;
    }

    .app-dashboard-page .table-wrap {
        overflow: visible;
    }
}

@media (max-width: 520px) {
    .app-dashboard-page .shell {
        width: min(100% - 18px, 1180px);
    }

    .app-dashboard-page .page-content {
        padding-top: 20px;
    }

    .app-dashboard-page .dashboard-heading h1 {
        max-width: none;
        font-size: clamp(1.85rem, 9vw, 2.25rem);
    }

    .app-dashboard-page .dashboard-heading p {
        font-size: .88rem;
    }

    .app-dashboard-page .dashboard-kpis {
        gap: 8px;
    }

    .app-dashboard-page .dashboard-kpi {
        min-height: 108px;
        padding: 13px;
        border-radius: 15px;
    }

    .app-dashboard-page .dashboard-kpi-primary {
        min-height: 114px;
    }

    .app-dashboard-page .dashboard-kpi strong {
        font-size: clamp(1.28rem, 7vw, 1.72rem);
    }

    .app-dashboard-page .panel {
        padding: 15px;
        border-radius: 17px;
    }

    .app-dashboard-page .dashboard-chart {
        min-height: 230px;
    }

    .app-dashboard-page .dashboard-profile-card dl > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .app-dashboard-page .dashboard-profile-card dd {
        text-align: left;
    }

    .app-dashboard-page .dashboard-basket-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .app-dashboard-page .responsive-data-table tr {
        gap: 11px 10px;
        padding: 12px;
    }

    .app-dashboard-page .finance-definition-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .app-dashboard-page .finance-definition-list dd {
        text-align: left;
    }
}

@media (max-width: 340px) {
    .app-dashboard-page .dashboard-kpis,
    .app-dashboard-page .dashboard-basket-metrics,
    .app-dashboard-page .dashboard-basic-basket-stats,
    .app-dashboard-page .responsive-data-table tr {
        grid-template-columns: 1fr;
    }

    .app-dashboard-page .dashboard-kpi,
    .app-dashboard-page .dashboard-kpi-primary,
    .app-dashboard-page .dashboard-kpi:last-child,
    .app-dashboard-page .responsive-data-table td,
    .app-dashboard-page .finance-category-table td:nth-child(2) {
        grid-column: auto;
    }
}

/* ConectaNF 2.5.8 - privacidade responsiva e orientada a ações */
.privacy-page-v258 {
    overflow-x: hidden;
    overflow-x: clip;
}

.privacy-content-v258,
.privacy-content-v258 > * {
    min-width: 0;
    max-width: 100%;
}

.privacy-content-v258 {
    gap: 18px;
}

.privacy-hero-v258 {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(250px, .6fr);
    gap: 32px;
    align-items: center;
    overflow: hidden;
    padding: 34px;
    border: 1px solid rgba(23, 107, 77, .18);
    border-radius: 26px;
    background:
        radial-gradient(circle at 88% 10%, rgba(23, 107, 77, .14), transparent 18rem),
        linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(232, 245, 239, .82));
    box-shadow: var(--shadow);
}

.privacy-hero-copy-v258 {
    min-width: 0;
}

.privacy-hero-copy-v258 h1 {
    max-width: 14ch;
    margin: 8px 0 13px;
    font-size: clamp(2.4rem, 5.6vw, 4.35rem);
    line-height: .96;
    letter-spacing: -.064em;
    text-wrap: balance;
}

.privacy-hero-copy-v258 p {
    max-width: 66ch;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.62;
}

.privacy-hero-actions-v258 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 22px;
}

.privacy-text-link-v258 {
    color: var(--primary-dark);
    font-size: .82rem;
    font-weight: 850;
    text-underline-offset: 4px;
}

.privacy-hero-visual-v258 {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: center;
    min-height: 230px;
    padding: 20px;
}

.privacy-shield-v258 {
    grid-column: 1 / -1;
    display: grid;
    width: 104px;
    height: 104px;
    place-items: center;
    justify-self: center;
    border-radius: 32px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 24px 48px rgba(23, 107, 77, .26);
    transform: rotate(-3deg);
}

.privacy-shield-v258 svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.privacy-hero-badge-v258 {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid rgba(23, 107, 77, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 850;
    box-shadow: 0 8px 22px rgba(22, 45, 35, .06);
}

.privacy-hero-badge-v258:last-child {
    grid-column: 1 / -1;
    justify-self: center;
}

.privacy-feedback-v258 {
    margin: 0;
}

.privacy-status-grid-v258 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.privacy-status-card-v258 {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(22, 45, 35, .05);
}

.privacy-status-icon-v258,
.privacy-action-icon-v258,
.privacy-notice-icon-v258,
.privacy-danger-icon-v258 {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.privacy-status-icon-v258 {
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.privacy-status-icon-v258 svg,
.privacy-action-icon-v258 svg,
.privacy-notice-icon-v258 svg,
.privacy-danger-icon-v258 svg,
.privacy-right-card-v258 svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.privacy-status-card-v258 > div {
    min-width: 0;
}

.privacy-status-card-v258 span:not(.privacy-status-icon-v258),
.privacy-status-card-v258 strong,
.privacy-status-card-v258 small {
    display: block;
    overflow-wrap: anywhere;
}

.privacy-status-card-v258 span:not(.privacy-status-icon-v258) {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.privacy-status-card-v258 strong {
    margin-top: 4px;
    font-size: .94rem;
    line-height: 1.25;
}

.privacy-status-card-v258 small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .68rem;
    line-height: 1.35;
}

.privacy-status-card-v258.status-on {
    border-color: rgba(23, 107, 77, .26);
}

.privacy-status-card-v258.status-pending {
    border-color: #e4c46b;
    background: var(--warning-soft);
}

.privacy-status-card-v258.status-pending .privacy-status-icon-v258 {
    background: #fff0bd;
    color: var(--warning);
}

.privacy-notice-card-v258 {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 17px;
    align-items: center;
    padding: 22px;
    border: 1px solid #e4c46b;
    border-radius: 21px;
    background: linear-gradient(145deg, var(--warning-soft), var(--surface));
    box-shadow: 0 12px 30px rgba(90, 67, 17, .06);
}

.privacy-notice-icon-v258 {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: #fff0bd;
    color: var(--warning);
}

.privacy-notice-copy-v258 {
    min-width: 0;
}

.privacy-notice-copy-v258 h2,
.privacy-action-heading-v258 h2,
.privacy-section-heading-v258 h2,
.privacy-danger-heading-v258 h2 {
    margin: 5px 0 0;
    letter-spacing: -.04em;
    line-height: 1.08;
}

.privacy-notice-copy-v258 h2 {
    font-size: 1.35rem;
}

.privacy-notice-copy-v258 p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.5;
}

.privacy-notice-actions-v258 {
    display: flex;
    align-items: center;
    gap: 9px;
}

.privacy-notice-actions-v258 form {
    margin: 0;
}

.privacy-actions-grid-v258 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.privacy-action-card-v258 {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.privacy-action-heading-v258 {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.privacy-action-icon-v258 {
    width: 48px;
    height: 48px;
    border-radius: 16px;
}

.privacy-action-heading-v258 > div {
    min-width: 0;
}

.privacy-action-heading-v258 h2 {
    font-size: 1.45rem;
    text-wrap: balance;
}

.privacy-action-card-v258 > p {
    margin: 16px 0;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.58;
}

.privacy-consent-form-v258,
.privacy-export-form-v258 {
    margin-top: auto;
}

.privacy-consent-form-v258 {
    display: grid;
    gap: 14px;
}

.privacy-consent-control-v258 {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
    cursor: pointer;
}

.privacy-consent-control-v258 input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.privacy-switch-v258 {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5d0;
    transition: background .18s ease;
}

.privacy-switch-v258::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    transition: transform .18s ease;
}

.privacy-consent-control-v258 input:checked + .privacy-switch-v258 {
    background: var(--primary);
}

.privacy-consent-control-v258 input:checked + .privacy-switch-v258::after {
    transform: translateX(20px);
}

.privacy-consent-control-v258 input:focus-visible + .privacy-switch-v258 {
    outline: 3px solid rgba(23, 107, 77, .22);
    outline-offset: 3px;
}

.privacy-consent-copy-v258 {
    min-width: 0;
}

.privacy-consent-copy-v258 strong,
.privacy-consent-copy-v258 small {
    display: block;
}

.privacy-consent-copy-v258 strong {
    font-size: .83rem;
    line-height: 1.35;
}

.privacy-consent-copy-v258 small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.4;
}

.privacy-export-list-v258 {
    display: grid;
    gap: 9px;
    margin: 0 0 19px;
    padding: 0;
    list-style: none;
}

.privacy-export-list-v258 li {
    position: relative;
    padding-left: 24px;
    color: var(--text);
    font-size: .82rem;
    line-height: 1.45;
}

.privacy-export-list-v258 li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .65rem;
    font-weight: 900;
}

.privacy-rights-panel-v258 {
    display: grid;
    grid-template-columns: minmax(220px, .48fr) minmax(0, 1.52fr);
    gap: 24px;
    align-items: start;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.privacy-section-heading-v258 p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.5;
}

.privacy-section-heading-v258 h2 {
    font-size: 1.55rem;
}

.privacy-rights-grid-v258 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.privacy-right-card-v258 {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.privacy-right-card-v258:hover {
    transform: translateY(-1px);
    border-color: rgba(23, 107, 77, .35);
    box-shadow: 0 9px 22px rgba(22, 45, 35, .06);
}

.privacy-right-card-v258 > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.privacy-right-card-v258 strong,
.privacy-right-card-v258 small {
    display: block;
    overflow-wrap: anywhere;
}

.privacy-right-card-v258 strong {
    font-size: .8rem;
    line-height: 1.35;
}

.privacy-right-card-v258 small {
    margin-top: 4px;
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.4;
}

.privacy-danger-zone-v258 {
    display: grid;
    gap: 16px;
    padding: 25px;
    border: 1px solid rgba(180, 35, 24, .36);
    border-radius: 22px;
    background: linear-gradient(145deg, var(--danger-soft), var(--surface));
    box-shadow: 0 16px 36px rgba(100, 25, 20, .06);
}

.privacy-danger-heading-v258 {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.privacy-danger-icon-v258 {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(180, 35, 24, .11);
    color: var(--danger);
}

.privacy-danger-heading-v258 > div {
    min-width: 0;
}

.privacy-danger-heading-v258 h2 {
    font-size: 1.5rem;
}

.privacy-danger-heading-v258 p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.5;
}

.privacy-delete-disclosure-v258 {
    border: 1px solid rgba(180, 35, 24, .23);
    border-radius: 16px;
    background: var(--surface-strong);
    overflow: hidden;
}

.privacy-delete-disclosure-v258 summary {
    position: relative;
    padding: 16px 48px 16px 17px;
    color: var(--danger);
    cursor: pointer;
    font-size: .84rem;
    font-weight: 850;
    list-style: none;
}

.privacy-delete-disclosure-v258 summary::-webkit-details-marker {
    display: none;
}

.privacy-delete-disclosure-v258 summary::after {
    content: '+';
    position: absolute;
    right: 17px;
    top: 50%;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    transform: translateY(-50%);
}

.privacy-delete-disclosure-v258[open] summary::after {
    content: '−';
}

.privacy-delete-content-v258 {
    display: grid;
    gap: 16px;
    padding: 0 17px 17px;
    border-top: 1px solid rgba(180, 35, 24, .16);
}

.privacy-delete-warning-v258 {
    padding: 14px;
    border-radius: 13px;
    background: var(--danger-soft);
}

.privacy-delete-warning-v258 strong {
    color: var(--danger);
    font-size: .78rem;
}

.privacy-delete-warning-v258 p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.5;
}

.privacy-danger-form-v258 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.privacy-danger-form-v258 .button {
    grid-column: 1 / -1;
    justify-self: start;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) and (max-width: 1200px) {
    .privacy-content-v258 {
        gap: 14px;
    }

    .privacy-hero-v258 {
        grid-template-columns: minmax(0, 1fr) 190px;
        gap: 16px;
        padding: 25px;
        border-radius: 22px;
    }

    .privacy-hero-copy-v258 h1 {
        max-width: 17ch;
        font-size: clamp(2.1rem, 7vw, 3.1rem);
    }

    .privacy-hero-visual-v258 {
        min-height: 190px;
        padding: 10px;
    }

    .privacy-shield-v258 {
        width: 84px;
        height: 84px;
        border-radius: 26px;
    }

    .privacy-shield-v258 svg {
        width: 39px;
        height: 39px;
    }

    .privacy-status-grid-v258 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .privacy-status-card-v258:last-child {
        grid-column: 1 / -1;
    }

    .privacy-notice-card-v258 {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .privacy-notice-actions-v258 {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .privacy-rights-panel-v258 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .privacy-page-v258 .shell {
        width: min(100% - 18px, 1180px);
    }

    .privacy-content-v258 {
        padding-top: 20px;
    }

    .privacy-hero-v258 {
        grid-template-columns: 1fr;
        padding: 20px;
        border-radius: 19px;
    }

    .privacy-hero-copy-v258 h1 {
        max-width: none;
        font-size: clamp(2rem, 10.5vw, 2.65rem);
        line-height: .98;
    }

    .privacy-hero-copy-v258 p {
        font-size: .88rem;
        line-height: 1.55;
    }

    .privacy-hero-actions-v258 {
        display: grid;
        grid-template-columns: 1fr;
        margin-top: 18px;
    }

    .privacy-hero-actions-v258 .button,
    .privacy-text-link-v258 {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .privacy-hero-visual-v258 {
        display: none;
    }

    .privacy-status-grid-v258 {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .privacy-status-card-v258,
    .privacy-status-card-v258:last-child {
        grid-column: auto;
        padding: 14px;
        border-radius: 16px;
    }

    .privacy-notice-card-v258 {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 18px;
        border-radius: 18px;
    }

    .privacy-notice-icon-v258 {
        width: 43px;
        height: 43px;
    }

    .privacy-notice-copy-v258 h2 {
        font-size: 1.2rem;
    }

    .privacy-notice-actions-v258 {
        display: grid;
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .privacy-notice-actions-v258 .button,
    .privacy-notice-actions-v258 form {
        width: 100%;
    }

    .privacy-actions-grid-v258 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .privacy-action-card-v258,
    .privacy-rights-panel-v258,
    .privacy-danger-zone-v258 {
        padding: 18px;
        border-radius: 18px;
    }

    .privacy-action-heading-v258 h2,
    .privacy-section-heading-v258 h2,
    .privacy-danger-heading-v258 h2 {
        font-size: 1.3rem;
    }

    .privacy-action-icon-v258,
    .privacy-danger-icon-v258 {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .privacy-consent-control-v258 {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        padding: 13px;
    }

    .privacy-consent-control-v258 > input {
        grid-column: 1;
    }

    .privacy-switch-v258 {
        grid-column: 1;
        margin-top: 2px;
    }

    .privacy-consent-copy-v258 {
        grid-column: 2;
    }

    .privacy-consent-form-v258 .button,
    .privacy-export-form-v258 .button {
        width: 100%;
    }

    .privacy-rights-grid-v258 {
        grid-template-columns: 1fr;
    }

    .privacy-danger-heading-v258 {
        gap: 11px;
    }

    .privacy-danger-form-v258 {
        grid-template-columns: 1fr;
    }

    .privacy-danger-form-v258 .button {
        grid-column: auto;
        width: 100%;
    }
}

@media (max-width: 350px) {
    .privacy-action-heading-v258,
    .privacy-danger-heading-v258 {
        display: grid;
        grid-template-columns: 1fr;
    }

    .privacy-consent-control-v258 {
        grid-template-columns: 1fr;
    }

    .privacy-switch-v258,
    .privacy-consent-copy-v258 {
        grid-column: auto;
    }
}

@media (prefers-color-scheme: dark) {
    .privacy-hero-v258 {
        border-color: rgba(85, 200, 153, .2);
        background:
            radial-gradient(circle at 88% 10%, rgba(85, 200, 153, .11), transparent 18rem),
            linear-gradient(145deg, rgba(27, 34, 31, .98), rgba(23, 60, 46, .5));
    }

    .privacy-hero-badge-v258 {
        border-color: rgba(85, 200, 153, .2);
        background: rgba(27, 34, 31, .88);
    }

    .privacy-status-card-v258.status-pending,
    .privacy-notice-card-v258 {
        border-color: #65551f;
        background: linear-gradient(145deg, #2f2a18, var(--surface));
    }

    .privacy-status-card-v258.status-pending .privacy-status-icon-v258,
    .privacy-notice-icon-v258 {
        background: #3d3216;
    }

    .privacy-danger-zone-v258 {
        background: linear-gradient(145deg, #351d1b, var(--surface));
    }
}

/* ConectaNF 2.6.0 - rede familiar com convite e compartilhamento agregado */
.family-network-content {
    display: grid;
    gap: 24px;
}

.family-network-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
    gap: 24px;
    align-items: center;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 12%, rgba(23, 107, 77, .14), transparent 22rem),
        linear-gradient(145deg, var(--surface), rgba(236, 247, 242, .88));
    box-shadow: var(--shadow-sm);
}

.family-network-hero h1 {
    max-width: 820px;
    margin: 8px 0 12px;
    font-size: clamp(2rem, 4.4vw, 4.3rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.family-network-hero p {
    max-width: 800px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    line-height: 1.65;
}

.family-privacy-badge {
    display: grid;
    gap: 8px;
    padding: 20px;
    border: 1px solid rgba(23, 107, 77, .18);
    border-radius: 20px;
    background: rgba(255, 255, 255, .78);
}

.family-privacy-badge strong {
    color: var(--brand-dark);
    font-size: 1.05rem;
}

.family-privacy-badge span {
    color: var(--muted);
    line-height: 1.55;
}

.family-invitations-panel,
.family-members-panel,
.family-summary-main,
.family-sharing-card,
.family-create-card,
.family-how-card,
.family-invite-card,
.family-rename-card,
.family-outgoing-card,
.family-danger-card {
    min-width: 0;
}

.family-invitation-list,
.family-member-list,
.family-outgoing-list {
    display: grid;
    gap: 12px;
}

.family-invitation-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
    gap: 20px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
}

.family-invitation-card p,
.family-invitation-card small {
    display: block;
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.family-invitation-actions {
    display: grid;
    gap: 12px;
}

.family-invitation-actions > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.family-consent-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: var(--text);
    font-size: .94rem;
    line-height: 1.45;
}

.family-consent-check input {
    width: 19px;
    height: 19px;
    margin: 1px 0 0;
    accent-color: var(--brand);
}

.family-consent-emphasis {
    padding: 14px;
    border: 1px solid rgba(23, 107, 77, .2);
    border-radius: 14px;
    background: var(--brand-soft);
}

.family-start-grid,
.family-summary-grid,
.family-management-grid {
    display: grid;
    gap: 20px;
    align-items: start;
}

.family-start-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
}

.family-create-card,
.family-how-card,
.family-sharing-card,
.family-invite-card,
.family-rename-card,
.family-outgoing-card {
    display: grid;
    gap: 14px;
}

.family-create-card h2,
.family-how-card h2,
.family-sharing-card h2,
.family-invite-card h2,
.family-rename-card h2,
.family-outgoing-card h2 {
    margin: 0;
}

.family-how-card ol {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-left: 22px;
    color: var(--text);
}

.family-how-card li::marker {
    color: var(--brand);
    font-weight: 800;
}

.family-summary-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
}

.family-summary-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.family-summary-title h2 {
    margin: 5px 0 0;
    font-size: clamp(1.7rem, 3vw, 2.8rem);
}

.family-summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.family-summary-metrics > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface-soft);
}

.family-summary-metrics span {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.family-summary-metrics strong {
    font-size: 1.55rem;
}

.family-dashboard-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.family-management-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
}

.family-side-column {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.family-member-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--surface-soft);
}

.family-member-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

.family-member-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.family-member-copy strong,
.family-member-copy span,
.family-member-copy small {
    overflow-wrap: anywhere;
}

.family-member-copy span,
.family-member-copy small {
    color: var(--muted);
}

.family-member-status {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.family-member-actions {
    position: relative;
}

.family-member-actions summary,
.family-danger-card summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 750;
}

.family-member-actions[open] {
    width: min(320px, 76vw);
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.family-member-actions form + form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.family-outgoing-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.family-outgoing-list > div:last-child {
    border-bottom: 0;
}

.family-outgoing-list span {
    display: grid;
    gap: 3px;
}

.family-outgoing-list small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.family-danger-card {
    border-color: rgba(179, 64, 64, .25);
}

.family-danger-card[open] {
    display: grid;
    gap: 14px;
}

.profile-family-network-v260 {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 20px 22px;
}

.profile-family-network-copy-v260 {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.profile-family-network-copy-v260 h2 {
    margin: 4px 0;
}

.profile-family-network-copy-v260 p {
    margin: 0;
    color: var(--muted);
}

.profile-family-network-icon-v260 {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 17px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 1.5rem;
}

.profile-family-network-actions-v260 {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.family-scope-actions-v260 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.family-scope-switch-v260 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.family-scope-switch-v260 button {
    min-height: 40px;
    padding: 8px 13px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.family-scope-switch-v260 button.active {
    background: var(--brand);
    color: #fff;
}

.family-analysis-context-v260 {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) repeat(2, minmax(130px, .7fr)) auto;
    gap: 10px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(23, 107, 77, .2);
    border-radius: 18px;
    background: var(--brand-soft);
}

.family-analysis-context-v260 > div {
    display: grid;
    gap: 2px;
}

.family-analysis-context-v260 span {
    color: var(--muted);
    font-size: .79rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 750;
}

.family-analysis-context-v260 strong {
    overflow-wrap: anywhere;
}

.family-analysis-context-v260 a {
    color: var(--brand-dark);
    font-weight: 800;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    .family-network-hero,
    .family-start-grid,
    .family-summary-grid,
    .family-management-grid {
        grid-template-columns: 1fr;
    }

    .family-network-hero {
        padding: 24px;
        border-radius: 22px;
    }

    .family-network-hero h1 {
        font-size: clamp(2rem, 8vw, 3.2rem);
    }

    .family-invitation-card {
        grid-template-columns: 1fr;
    }

    .family-analysis-context-v260 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .family-analysis-context-v260 a {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .family-network-content {
        gap: 16px;
    }

    .family-network-hero,
    .family-invitations-panel,
    .family-create-card,
    .family-how-card,
    .family-summary-main,
    .family-sharing-card,
    .family-members-panel,
    .family-invite-card,
    .family-rename-card,
    .family-outgoing-card,
    .family-danger-card {
        border-radius: 18px;
    }

    .family-network-hero {
        padding: 20px;
    }

    .family-network-hero h1 {
        font-size: 2.25rem;
        line-height: 1.02;
    }

    .family-summary-title,
    .profile-family-network-v260 {
        display: grid;
        grid-template-columns: 1fr;
    }

    .family-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .family-summary-metrics > div:first-child {
        grid-column: 1 / -1;
    }

    .family-dashboard-links,
    .family-dashboard-links .button,
    .family-invitation-actions > div,
    .family-invitation-actions .button,
    .profile-family-network-actions-v260,
    .profile-family-network-actions-v260 .button {
        width: 100%;
    }

    .family-dashboard-links,
    .family-invitation-actions > div,
    .profile-family-network-actions-v260 {
        display: grid;
        grid-template-columns: 1fr;
    }

    .family-member-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .family-member-status {
        grid-column: 1 / -1;
        justify-items: stretch;
    }

    .family-member-status .status-pill {
        justify-content: center;
        text-align: center;
    }

    .family-member-actions,
    .family-member-actions[open] {
        width: 100%;
    }

    .family-outgoing-list > div {
        grid-template-columns: 1fr;
    }

    .family-outgoing-list form,
    .family-outgoing-list .button {
        width: 100%;
    }

    .profile-family-network-copy-v260 {
        align-items: flex-start;
    }

    .family-scope-actions-v260 {
        width: 100%;
        justify-content: stretch;
    }

    .family-scope-switch-v260,
    .family-scope-actions-v260 .button,
    .family-scope-actions-v260 .dashboard-user-filter {
        width: 100%;
    }

    .family-analysis-context-v260 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
    }

    .family-analysis-context-v260 > div:first-child,
    .family-analysis-context-v260 a {
        grid-column: 1 / -1;
    }
}

@media (prefers-color-scheme: dark) {
    .family-network-hero {
        background:
            radial-gradient(circle at 88% 12%, rgba(85, 200, 153, .12), transparent 22rem),
            linear-gradient(145deg, rgba(27, 34, 31, .98), rgba(23, 60, 46, .42));
    }

    .family-privacy-badge {
        background: rgba(27, 34, 31, .82);
        border-color: rgba(85, 200, 153, .2);
    }
}
