:root {
    --portal-navy: #0b1b30;
    --portal-navy-2: #132943;
    --portal-teal: #20c9c3;
    --portal-teal-dark: #0b8f89;
    --portal-bg: #eef3f7;
    --portal-card: #ffffff;
    --portal-text: #102239;
    --portal-muted: #687b91;
    --portal-line: #dbe4eb;
    --portal-danger: #a23232;
    --portal-success: #0a7d68;
    --portal-radius: 18px;
    --portal-shadow: 0 16px 42px rgba(12, 34, 56, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; color: var(--portal-text); background: var(--portal-bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.portal-container { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.portal-body { min-height: 100vh; }
.portal-main { min-height: calc(100vh - 84px); padding: 34px 0 64px; }
.portal-auth-main { min-height: 100vh; display: grid; place-items: center; padding: 34px 18px; background: radial-gradient(circle at top left, #153453 0, #0b1b30 42%, #071426 100%); }

.portal-header { position: sticky; top: 0; z-index: 20; background: rgba(11, 27, 48, .98); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(12px); }
.portal-header-inner { min-height: 84px; display: flex; align-items: center; gap: 24px; }
.portal-brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; padding: 9px 12px; text-decoration: none; background: #fff; border-radius: 15px; }
.portal-brand img { width: 118px; height: auto; display: block; }
.portal-brand span { padding-left: 12px; border-left: 1px solid #d7e0e7; color: #30465e; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.portal-nav { display: flex; gap: 4px; min-width: 0; }
.portal-nav a { padding: 11px 13px; color: #b8c6d5; text-decoration: none; border-radius: 10px; font-size: .88rem; font-weight: 750; white-space: nowrap; }
.portal-nav a:hover, .portal-nav a.is-active { color: #fff; background: rgba(255,255,255,.08); }
.portal-account { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.portal-account-copy { display: grid; min-width: 0; max-width: 180px; margin-right: 4px; }
.portal-account-copy strong, .portal-account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-account-copy strong { color: #fff; font-size: .8rem; }
.portal-account-copy small { color: #99acc0; font-size: .7rem; }
.portal-header-button, .portal-logout { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; color: #d8e3ed; background: transparent; text-decoration: none; font-size: .76rem; font-weight: 800; cursor: pointer; }
.portal-logout { color: #071426; background: var(--portal-teal); border-color: var(--portal-teal); }

.portal-page-shell { padding-top: 10px; }
.portal-narrow-shell { max-width: 800px; }
.portal-page-heading { margin: 0 0 24px; }
.portal-page-heading-split { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.portal-page-heading h1 { margin: 4px 0 8px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.04; letter-spacing: -.045em; }
.portal-page-heading p:not(.portal-kicker) { margin: 0; color: var(--portal-muted); }
.portal-kicker { margin: 0; color: var(--portal-teal-dark); font-size: .74rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.portal-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; background: #dff7f4; color: #07695f; font-size: .76rem; font-weight: 850; }

.portal-card { background: var(--portal-card); border: 1px solid var(--portal-line); border-radius: var(--portal-radius); box-shadow: var(--portal-shadow); padding: 24px; }
.portal-card-spaced { margin-top: 22px; }
.portal-card-heading { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.portal-card-heading h2 { margin: 4px 0 0; font-size: 1.35rem; }
.portal-card-heading p:not(.portal-kicker) { color: var(--portal-muted); }

.portal-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.portal-stat-card { min-height: 122px; display: grid; align-content: center; gap: 10px; padding: 20px; background: #fff; border: 1px solid var(--portal-line); border-radius: 16px; }
.portal-stat-card span { color: var(--portal-muted); font-size: .78rem; }
.portal-stat-card strong { font-size: 2rem; letter-spacing: -.03em; }
.portal-stat-card .portal-stat-word { font-size: 1rem; line-height: 1.25; }
.portal-dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; }

.portal-data-list { display: grid; gap: 0; margin: 0; }
.portal-data-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--portal-line); }
.portal-data-list > div:first-child { border-top: 0; }
.portal-data-list dt { color: var(--portal-muted); font-size: .78rem; font-weight: 800; }
.portal-data-list dd { margin: 0; overflow-wrap: anywhere; }

.portal-module-list { display: grid; gap: 10px; }
.portal-module-list a, .portal-module-coming { display: grid; gap: 5px; padding: 15px 16px; border: 1px solid var(--portal-line); border-radius: 13px; text-decoration: none; }
.portal-module-list a:hover { border-color: #b7ddd9; background: #f1fbfa; }
.portal-module-list span { color: var(--portal-muted); font-size: .8rem; line-height: 1.5; }
.portal-module-coming { opacity: .72; }

.portal-form { display: grid; gap: 17px; }
.portal-field { display: grid; gap: 7px; }
.portal-field label { font-size: .78rem; font-weight: 850; }
.portal-field small { color: var(--portal-muted); font-size: .74rem; }
.portal-field input, .portal-field select, .portal-field textarea { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--portal-text); background: #fff; border: 1px solid #cbd7e0; border-radius: 11px; outline: 0; }
.portal-field textarea { min-height: 130px; resize: vertical; }
.portal-field input:focus, .portal-field select:focus, .portal-field textarea:focus { border-color: var(--portal-teal-dark); box-shadow: 0 0 0 3px rgba(11,143,137,.10); }
.portal-code-input { text-align: center; font-size: 1.8rem; letter-spacing: .22em; font-weight: 900; }
.portal-check-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 13px; background: #f7f9fb; border-radius: 12px; }
.portal-check-row input { margin-top: 4px; }
.portal-check-row strong, .portal-check-row small { display: block; }
.portal-check-row small { margin-top: 3px; color: var(--portal-muted); }

.portal-primary-button, .portal-secondary-button, .portal-small-button { border: 0; cursor: pointer; text-decoration: none; font-weight: 850; border-radius: 11px; }
.portal-primary-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: #071426; background: var(--portal-teal); }
.portal-secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; color: var(--portal-text); background: #edf2f6; border: 1px solid #d5dfe7; }
.portal-small-button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; color: var(--portal-text); background: #f1f5f8; border: 1px solid #d7e0e7; font-size: .76rem; }
.portal-inline-button { width: auto; }
.portal-text-button { border: 0; background: none; color: var(--portal-teal-dark); font-weight: 800; cursor: pointer; }

.portal-alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 12px; font-size: .86rem; line-height: 1.55; }
.portal-alert p { margin: 0; }
.portal-alert p + p { margin-top: 5px; }
.portal-alert-error { color: #8d2929; background: #fff0f0; border: 1px solid #f0c8c8; }
.portal-alert-success { color: #086455; background: #e9faf6; border: 1px solid #c3e9df; }
.portal-alert-info { color: #25526f; background: #eff7fc; border: 1px solid #cce2ef; }

.portal-auth-shell { width: min(520px, 100%); }
.portal-auth-brand { display: flex; align-items: center; gap: 14px; margin: 0 0 15px; color: #c8d7e5; text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; font-weight: 850; }
.portal-auth-brand a { display: inline-flex; padding: 8px 10px; background: #fff; border-radius: 12px; }
.portal-auth-brand img { width: 130px; display: block; }
.portal-auth-card { padding: clamp(24px, 5vw, 38px); background: #fff; border-radius: 22px; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.portal-auth-card h1 { margin: 7px 0 12px; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.05; letter-spacing: -.04em; }
.portal-auth-card > p:not(.portal-kicker) { margin: 0 0 22px; color: var(--portal-muted); line-height: 1.65; }
.portal-auth-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--portal-line); color: var(--portal-muted); font-size: .76rem; }
.portal-resend-form { margin-top: 14px; text-align: center; }

.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; }
.portal-table th, .portal-table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--portal-line); vertical-align: top; }
.portal-table th { color: var(--portal-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.portal-table td { font-size: .84rem; }
.portal-table td strong, .portal-table td small { display: block; }
.portal-table td small { margin-top: 4px; color: var(--portal-muted); }

.portal-permissions h2 { margin: 4px 0 12px; font-size: 1.1rem; }
.portal-permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portal-permission-option { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; padding: 12px; background: #f7f9fb; border: 1px solid #e2e9ee; border-radius: 11px; }
.portal-permission-option input { margin-top: 4px; }
.portal-permission-option strong, .portal-permission-option small { display: block; }
.portal-permission-option small { margin-top: 3px; color: var(--portal-muted); font-size: .72rem; }
.portal-password-panel { display: grid; gap: 14px; padding: 17px; background: #f7f9fb; border: 1px solid #e2e9ee; border-radius: 13px; }
.portal-password-panel p { margin: 0; color: var(--portal-muted); font-size: .76rem; line-height: 1.55; }
.portal-error-card { text-align: center; }
.portal-error-card h1 { margin: 7px 0 12px; }
.portal-error-card p:not(.portal-kicker) { color: var(--portal-muted); }

@media (max-width: 1050px) {
    .portal-header-inner { flex-wrap: wrap; padding: 10px 0; }
    .portal-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
    .portal-account-copy { display: none; }
    .portal-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .portal-dashboard-grid { grid-template-columns: 1fr; }
    .portal-page-heading-split { align-items: flex-start; flex-direction: column; }
    .portal-permission-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .portal-container { width: min(100% - 24px, 1180px); }
    .portal-header-inner { gap: 10px; }
    .portal-account { width: 100%; flex-wrap: wrap; }
    .portal-account > * { flex: 1 1 auto; }
    .portal-account form .portal-logout { width: 100%; }
    .portal-brand img { width: 102px; }
    .portal-brand span { font-size: .68rem; }
    .portal-stat-grid { grid-template-columns: 1fr; }
    .portal-data-list > div { grid-template-columns: 1fr; gap: 4px; }
    .portal-card { padding: 18px; }
}


/* ==========================================================================
   PATCH 026A — Touch targets, tabelas e WebKit
   ========================================================================== */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.portal-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.portal-table {
    min-width: 680px;
}

@media (hover: none), (pointer: coarse) {
    .portal-header-button,
    .portal-logout,
    .portal-primary-button,
    .portal-secondary-button,
    .portal-small-button {
        min-height: 44px;
    }

    .portal-nav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}


/* PATCH 027 — Espaço Cliente / Espaço Parceiro */
.portal-auth-shell.is-partner-space .portal-auth-card{box-shadow:0 28px 80px rgba(0,0,0,.25),inset 0 4px 0 rgba(32,201,195,.55)}
.portal-auth-shell.is-client-space .portal-auth-card{box-shadow:0 28px 80px rgba(0,0,0,.25),inset 0 4px 0 rgba(255,107,0,.42)}
.portal-space-switch{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding-top:16px;border-top:1px solid var(--portal-line);color:var(--portal-muted);font-size:.76rem}
.portal-space-switch a,.portal-back-public{color:var(--portal-teal-dark);font-weight:850;text-decoration:none}
.portal-space-switch a:hover,.portal-back-public:hover{text-decoration:underline}
.portal-space-switch-dual{justify-content:flex-start}
.portal-space-switch-dual a{display:inline-flex;min-height:40px;align-items:center;padding:0 12px;border:1px solid var(--portal-line);border-radius:10px;background:#f5f8fa}
.portal-back-public{display:inline-flex;margin-top:16px;color:#bfd0df}
@media(max-width:560px){.portal-space-switch{align-items:flex-start;flex-direction:column}}


/* ==========================================================================
   FEATURE 028 — Catálogo, contratos e subscrições
   ========================================================================== */

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

.portal-service-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 20px;
    box-shadow: var(--portal-shadow);
}

.portal-service-card.has-subscription {
    border-color: rgba(16, 157, 148, .26);
}

.portal-service-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.portal-service-card h2,
.portal-service-side-card h2 {
    margin: 0;
}

.portal-service-card > p,
.portal-service-side-card > p {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.7;
}

.portal-service-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef3f7;
    color: #40556e;
    font-size: .72rem;
    font-weight: 850;
    white-space: nowrap;
}

.portal-service-status-active { background: #ddf8f1; color: #08715f; }
.portal-service-status-pending { background: #fff3d5; color: #7a5200; }
.portal-service-status-suspended { background: #fde7e7; color: #922828; }
.portal-service-status-cancelled { background: #eef1f4; color: #667485; }
.portal-service-status-available { background: #e7f7fb; color: #126277; }

.portal-service-meta {
    display: grid;
    gap: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--portal-line);
}

.portal-service-meta span { color: var(--portal-muted); }

.portal-service-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.portal-service-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
    gap: 20px;
    align-items: start;
}

.portal-prose {
    color: #455b73;
    line-height: 1.8;
}

.portal-service-current {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
}

.portal-service-current > div {
    padding: 14px;
    background: #f5f8fa;
    border-radius: 14px;
}

.portal-service-current span {
    display: block;
    margin-bottom: 4px;
    color: var(--portal-muted);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.portal-service-subscribe-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.portal-terms-block {
    border: 1px solid var(--portal-line);
    border-radius: 14px;
    background: #f8fafb;
}

.portal-terms-block summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 800;
}

.portal-terms-block > div {
    max-height: 320px;
    overflow-y: auto;
    padding: 0 16px 16px;
    color: #52677e;
    line-height: 1.7;
    white-space: normal;
}

.portal-check-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: #40556e;
    line-height: 1.55;
}

.portal-check-row input {
    margin-top: 4px;
}

.portal-empty-state {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
    padding: 28px;
    border: 1px dashed var(--portal-line);
    border-radius: 18px;
    color: var(--portal-muted);
}

@media (max-width: 900px) {
    .portal-service-grid,
    .portal-service-detail-grid {
        grid-template-columns: 1fr;
    }

    .portal-service-current {
        grid-template-columns: 1fr;
    }
}


/* ========================================================================== 
   FEATURE 029 — Gestão delegada de parceiros
   ========================================================================== */

.portal-access-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.portal-access-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eaf8f6;
    color: #08736e;
    font-size: .72rem;
    font-weight: 850;
}

.partner-client-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 760px) {
    .partner-client-summary {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FEATURE 030 — Infraestrutura / CMDB no Portal
   ========================================================================== */

.cmdb-portal-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cmdb-health {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 850;
    white-space: nowrap;
    background: #edf2f6;
    color: #52677c;
}

.cmdb-health-healthy {
    background: #dff7f1;
    color: #087568;
}

.cmdb-health-attention {
    background: #fff3d9;
    color: #875300;
}

.cmdb-health-degraded {
    background: #ffe8d1;
    color: #9a4700;
}

.cmdb-health-critical {
    background: #ffe1e1;
    color: #a21c1c;
}

.cmdb-health-unknown {
    background: #edf2f6;
    color: #52677c;
}

.cmdb-portal-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 20px;
    align-items: start;
}

.cmdb-health-components {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cmdb-health-components > div {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--portal-line);
    border-radius: 12px;
    background: #f7fafc;
}

.cmdb-health-components span {
    color: var(--portal-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 800;
}

.portal-note {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: #f2f8f7;
    line-height: 1.65;
}

.portal-note p {
    margin: 8px 0 0;
}

@media (max-width: 980px) {
    .cmdb-portal-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cmdb-portal-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .cmdb-portal-stats,
    .cmdb-health-components {
        grid-template-columns: 1fr;
    }
}


/* FEATURE 031 — suporte com contrato */
.portal-support-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); gap:20px; align-items:start; }
.portal-support-thread { display:grid; gap:12px; }
.portal-support-message { padding:16px; border:1px solid var(--portal-line); border-radius:14px; background:#f8fafc; }
.portal-support-message.is-staff { background:#effaf8; border-color:#c9ebe5; }
.portal-support-message header { display:flex; justify-content:space-between; gap:14px; margin-bottom:10px; }
.portal-support-message time { color:var(--portal-muted); font-size:.75rem; }
.portal-support-reply { margin-top:22px; padding-top:20px; border-top:1px solid var(--portal-line); }
.portal-data-list { display:grid; gap:12px; margin:0; }
.portal-data-list div { padding-top:12px; border-top:1px solid var(--portal-line); }
.portal-data-list dt { color:var(--portal-muted); font-size:.75rem; font-weight:800; text-transform:uppercase; }
.portal-data-list dd { margin:4px 0 0; font-weight:750; }
.portal-service-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:20px; }
.portal-service-facts div { padding:14px; border-radius:12px; background:#f5f8fb; }
.portal-service-facts span { display:block; color:var(--portal-muted); font-size:.75rem; }
.portal-service-facts strong { display:block; margin-top:4px; }
@media(max-width:900px){.portal-support-grid,.portal-service-facts{grid-template-columns:1fr;}}


/* FEATURE 032 — Loja B2B */

.portal-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.portal-form-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.portal-form-actions{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.portal-grid{display:grid;gap:18px}
.shop-filter-card{margin-bottom:20px}.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.shop-product-card{overflow:hidden;background:#fff;border:1px solid rgba(11,29,52,.10);border-radius:20px;box-shadow:0 14px 36px rgba(8,21,40,.05)}.shop-product-image{display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;background:#f4f7fa;overflow:hidden}.shop-product-image img{width:100%;height:100%;object-fit:contain;padding:14px}.shop-product-image span,.shop-gallery-placeholder{font-size:2rem;font-weight:900;color:#91a0b2}.shop-product-copy{padding:18px}.shop-product-copy h2{font-size:1.05rem;margin:7px 0 10px;line-height:1.35}.shop-product-copy h2 a{color:#0b1d34;text-decoration:none}.shop-product-copy p{color:#66798f;font-size:.88rem;line-height:1.6}.shop-product-brand{font-size:.72rem;font-weight:850;text-transform:uppercase;letter-spacing:.08em;color:#008e88}.shop-product-footer{display:flex;justify-content:space-between;gap:12px;align-items:end;margin-top:16px}.shop-product-footer a{font-weight:800;color:#008e88;text-decoration:none;font-size:.85rem}.shop-source-note{margin:22px 0 0;color:#7a8899;font-size:.78rem;line-height:1.65}.shop-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(320px,.8fr);gap:20px}.shop-gallery-main{display:flex;align-items:center;justify-content:center;min-height:380px}.shop-gallery-main img{max-width:100%;max-height:460px;object-fit:contain}.shop-gallery-thumbs{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.shop-gallery-thumbs img{width:72px;height:72px;object-fit:contain;border:1px solid #dde5ec;border-radius:10px;padding:4px;background:#fff}.shop-gallery-placeholder{display:flex;align-items:center;justify-content:center;min-height:380px;background:#f4f7fa;border-radius:16px}.shop-meta-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.shop-meta-grid div{padding:12px;border-radius:12px;background:#f5f8fb}.shop-meta-grid span{display:block;color:#73849a;font-size:.72rem;text-transform:uppercase;font-weight:800}.shop-meta-grid strong{display:block;margin-top:4px}.shop-description{margin:20px 0;color:#4e6278;line-height:1.75}.shop-price-block{display:grid;gap:5px;margin:20px 0;padding:18px;border-radius:16px;background:#eef9f8}.shop-price-block>span{font-size:.75rem;text-transform:uppercase;font-weight:800;color:#557}.shop-price-block>strong{font-size:1.55rem}.shop-price-block small{color:#60758a;line-height:1.5}.shop-add-form{display:flex;align-items:end;gap:12px}.shop-add-form .portal-field{max-width:120px}.shop-qty-input{max-width:90px}.shop-cart-update{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:16px}.shop-submit-card{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:30px;margin-top:20px}.shop-cart-total{display:block;margin:10px 0;font-size:1.8rem}.portal-checkbox{display:flex;gap:10px;align-items:flex-start;line-height:1.55}.portal-checkbox input{margin-top:4px}.portal-definition-list{display:grid;gap:12px}.portal-definition-list div{border-top:1px solid #e5ebf0;padding-top:12px}.portal-definition-list dt{font-size:.72rem;text-transform:uppercase;font-weight:800;color:#7b899a}.portal-definition-list dd{margin:4px 0 0}.portal-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:1000px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.shop-detail-grid,.shop-submit-card{grid-template-columns:1fr}}@media(max-width:850px){.portal-form-grid-3{grid-template-columns:1fr 1fr}}@media(max-width:650px){.shop-grid,.portal-grid-2,.portal-form-grid,.portal-form-grid-3{grid-template-columns:1fr}.shop-product-footer,.shop-cart-update,.shop-add-form{align-items:stretch;flex-direction:column}.shop-meta-grid{grid-template-columns:1fr}}


/* ==========================================================================
   FEATURE 033 — Especificações de produto
   ========================================================================== */

.shop-specifications {
    margin-top: 22px;
}

.shop-spec-groups {
    display: grid;
    gap: 22px;
}

.shop-spec-group h3 {
    margin: 0 0 10px;
    font-size: .95rem;
}

.shop-spec-group dl {
    margin: 0;
    border: 1px solid var(--portal-line, rgba(11,29,52,.10));
    border-radius: 14px;
    overflow: hidden;
}

.shop-spec-group dl > div {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr);
    gap: 18px;
    padding: 11px 14px;
    background: #fff;
}

.shop-spec-group dl > div + div {
    border-top: 1px solid rgba(11,29,52,.08);
}

.shop-spec-group dt {
    color: var(--portal-muted, #67788c);
    font-size: .82rem;
}

.shop-spec-group dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.shop-spec-group dd span {
    margin-left: 3px;
    color: var(--portal-muted, #67788c);
    font-weight: 500;
}

@media (max-width: 680px) {
    .shop-spec-group dl > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}


/* FEATURE 035 — Nextweb Backup */
.portal-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.portal-meta-grid > div { padding:14px; border:1px solid rgba(11,29,52,.09); border-radius:14px; background:#f8fafc; }
.portal-meta-grid span { display:block; color:#73849a; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.portal-meta-grid strong { display:block; margin-top:5px; color:#0b1d34; overflow-wrap:anywhere; }
@media(max-width:900px){.portal-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:620px){.portal-meta-grid{grid-template-columns:1fr;}}

/* ==========================================================================
   PATCH 035A — Navegação por secções + ajuda contextual
   ========================================================================== */

.portal-header-inner {
    position: relative;
}

.portal-nav {
    align-items: center;
    overflow: visible;
}

.portal-nav-direct,
.portal-nav-group {
    flex: 0 0 auto;
}

.portal-nav-group {
    position: relative;
    margin: 0;
}

.portal-nav-group > summary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    color: #b8c6d5;
    border-radius: 10px;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    font-size: .84rem;
    font-weight: 800;
    user-select: none;
}

.portal-nav-group > summary::-webkit-details-marker {
    display: none;
}

.portal-nav-group > summary:hover,
.portal-nav-group > summary:focus-visible,
.portal-nav-group.is-active > summary,
.portal-nav-group[open] > summary {
    color: #fff;
    background: rgba(255,255,255,.08);
    outline: 0;
}

.portal-nav-group > summary:focus-visible {
    box-shadow: 0 0 0 3px rgba(32,201,195,.25);
}

.portal-nav-chevron {
    display: inline-block;
    font-size: .88rem;
    line-height: 1;
    transition: transform .16s ease;
}

.portal-nav-group[open] .portal-nav-chevron {
    transform: rotate(180deg);
}

.portal-nav-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    z-index: 100;
    min-width: 210px;
    display: grid;
    gap: 4px;
    padding: 9px;
    background: #102943;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 13px;
    box-shadow: 0 20px 45px rgba(0,0,0,.28);
}

.portal-nav .portal-nav-dropdown a {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 9px;
}

.portal-nav-toggle {
    display: none;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    color: #d8e3ed;
    background: transparent;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    cursor: pointer;
    font-size: .76rem;
    font-weight: 850;
}

.context-help-trigger {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 120;
    width: 50px;
    height: 50px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: #071426;
    background: var(--portal-teal);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 16px 38px rgba(7,20,38,.24);
    cursor: pointer;
    font-size: 1.45rem;
    font-weight: 950;
    line-height: 1;
}

.context-help-trigger:hover {
    transform: translateY(-2px);
}

.context-help-trigger:focus-visible {
    outline: 3px solid rgba(32,201,195,.30);
    outline-offset: 4px;
}

.context-help-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.context-help-modal.is-open {
    display: flex;
}

.context-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4,13,24,.70);
    backdrop-filter: blur(5px);
}

.context-help-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0,0,0,.34);
}

.context-help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 24px 18px;
    color: #fff;
    background: var(--portal-navy);
}

.context-help-header h2 {
    margin: 7px 0 0;
    font-size: clamp(1.45rem, 4vw, 2rem);
    line-height: 1.12;
    letter-spacing: -.025em;
}

.context-help-mode {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    padding: 0 9px;
    color: #071426;
    background: var(--portal-teal);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.context-help-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: #e3edf5;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 11px;
    cursor: pointer;
    font-size: 1.65rem;
    line-height: 1;
}

.context-help-close:hover,
.context-help-close:focus-visible {
    color: #fff;
    background: rgba(255,255,255,.15);
    outline: 0;
}

.context-help-body {
    overflow-y: auto;
    padding: 24px;
    overscroll-behavior: contain;
}

.context-help-intro {
    margin: 0 0 22px;
    color: var(--portal-muted);
    font-size: .96rem;
    line-height: 1.7;
}

.context-help-section + .context-help-section {
    margin-top: 22px;
}

.context-help-section h3 {
    margin: 0 0 10px;
    color: var(--portal-text);
    font-size: 1rem;
}

.context-help-section ul {
    margin: 0;
    padding-left: 20px;
    color: #405168;
    line-height: 1.6;
}

.context-help-section li + li {
    margin-top: 8px;
}

.context-help-notice {
    margin-top: 22px;
    padding: 14px 16px;
    color: #6d4b00;
    background: #fff8df;
    border: 1px solid #f0dea5;
    border-radius: 12px;
}

.context-help-notice strong,
.context-help-notice p {
    display: block;
}

.context-help-notice p {
    margin: 4px 0 0;
}

body.has-context-help {
    overflow: hidden;
}

@media (max-width: 1040px) {
    .portal-header-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 0;
    }

    .portal-nav-toggle {
        display: inline-flex;
        margin-left: auto;
        order: 2;
    }

    .portal-account {
        order: 3;
        margin-left: 0;
    }

    .portal-nav {
        position: absolute;
        top: calc(100% + 7px);
        left: 0;
        right: 0;
        z-index: 90;
        order: 4;
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 10px;
        overflow: visible;
        background: #102943;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 14px;
        box-shadow: 0 20px 45px rgba(0,0,0,.28);
    }

    .portal-nav.is-open {
        display: grid;
    }

    .portal-nav-direct,
    .portal-nav-group {
        width: 100%;
    }

    .portal-nav > a,
    .portal-nav-group > summary {
        width: 100%;
        min-height: 44px;
        justify-content: space-between;
        display: flex;
        align-items: center;
        padding: 0 13px;
        border: 1px solid rgba(255,255,255,.06);
    }

    .portal-nav-dropdown {
        position: static;
        min-width: 0;
        margin-top: 5px;
        padding: 5px 0 2px 10px;
        background: transparent;
        border: 0;
        border-left: 1px solid rgba(255,255,255,.12);
        border-radius: 0;
        box-shadow: none;
    }

    .portal-nav .portal-nav-dropdown a {
        min-height: 42px;
    }
}

@media (max-width: 700px) {
    .portal-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .portal-nav-toggle {
        min-height: 44px;
    }

    .context-help-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .context-help-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 18px;
    }

    .context-help-header,
    .context-help-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .context-help-trigger {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-nav-chevron,
    .context-help-trigger {
        transition: none;
    }
}
