:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #16354a;
  background: #f3f6fa;
  font-size: 16px;
  line-height: 1.55;
  font-synthesis: none;
  --ink: #16354a;
  --muted: #5d7182;
  --green: #007f65;
  --line: #dce5ed;
  --surface: #ffffff;
  --header-height: 88px;
  --sidebar-width: 244px;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: var(--green); text-underline-offset: 3px; }
button, .button { overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(27px, 2.2vw, 34px); line-height: 1.2; letter-spacing: -.035em; margin: 8px 0 12px; }
h2 { font-size: 21px; line-height: 1.35; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 17px; line-height: 1.4; margin: 0 0 8px; }
p { margin: 8px 0 16px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 10px; }
small { font-size: 13px; line-height: 1.55; }
small, .muted, .helper-text { color: var(--muted); }
.helper-text { font-size: 14px; margin: 8px 0 0; }
strong { font-weight: 700; }
hr { height: 1px; background: var(--line); border: 0; margin: 24px 0; }
:focus-visible { outline: 3px solid #52b8a7; outline-offset: 3px; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 100; transform: translateY(-150%); border-radius: 8px; padding: 12px 18px; background: var(--ink); color: #fff; }
.skip-link:focus { transform: translateY(0); }

/* Shared header and public registration screens. */
.portal-header, body > header {
  min-height: var(--header-height);
  padding: 16px max(28px, calc((100vw - 1504px) / 2));
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.portal-active .portal-header { position: sticky; top: 0; z-index: 30; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; font-size: 27px; font-weight: 800; white-space: nowrap; color: #113351; text-decoration: none; }
.brand img { display: block; width: 146px; height: 38px; object-fit: contain; }
.brand b { color: #0877ed; }
.product-name { padding-left: 24px; border-left: 1px solid var(--line); font-size: 15px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; }
.rtu-guide-banner { display: flex; align-items: center; gap: 10px; flex: 1 1 410px; min-width: 0; max-width: 440px; min-height: 48px; padding: 8px 14px; border: 1px solid #338b7d; border-radius: 10px; background: linear-gradient(110deg, #10384f, #075345); color: #fff; text-decoration: none; animation: rtu-guide-pulse 2.4s ease-in-out 2; }
.rtu-guide-banner-copy { min-width: 0; }
.rtu-guide-banner-copy strong { display: block; font-size: 13px; line-height: 1.4; }
.rtu-guide-banner-copy > span { display: block; margin-top: 2px; font-size: 11px; line-height: 1.4; color: #d8f4ed; }
.rtu-guide-banner-copy b { color: #9affd6; white-space: nowrap; }
.rtu-guide-banner-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #9affd6; box-shadow: 0 0 0 4px #9affd619; }
.rtu-guide-banner:hover, .rtu-guide-banner:focus-visible { border-color: #007f65; box-shadow: 0 0 0 3px #007f6529; }
.rtu-guide-banner:hover b, .rtu-guide-banner:focus-visible b { text-decoration: underline; }
@keyframes rtu-guide-pulse { 0%, 100% { box-shadow: 0 0 0 0 #007f6500; } 50% { box-shadow: 0 0 0 5px #007f6545; border-color: #64d6ad; } }
#nav { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-left: auto; flex-shrink: 0; white-space: nowrap; }
#nav > a { font-size: 14px; font-weight: 600; text-decoration: none; }
#nav > a:hover { text-decoration: underline; }
.account-link { display: inline-flex; align-items: center; gap: 7px; color: #365970; }
.account-link svg { width: 19px; height: 19px; }
#nav button, #nav .button { min-height: 40px; padding: 9px 14px; font-size: 14px; }
.mobile-menu-toggle { display: none; }
.portal-main, body > main { max-width: 1180px; margin: 36px auto; padding: 0 28px; min-height: calc(100vh - 220px); }
.loading-text { padding: 32px 0; color: var(--muted); }
.eyebrow { display: block; font-size: 11px; font-weight: 800; line-height: 1.45; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.auth { display: grid; grid-template-columns: .95fr 1.1fr; gap: 30px; align-items: start; }
.intro { padding: 40px; border-radius: 20px; background: #0c334a; color: #fff; }
.intro h1 { font-size: clamp(32px, 3.5vw, 43px); margin: 20px 0; }
.intro p, .intro li { color: #d6e7eb; }
.intro ul { margin: 28px 0; }
.intro .eyebrow { color: #8ceac7; }
.tabs { display: flex; gap: 8px; margin: 0 0 24px; padding: 4px; background: #f1f5f8; border-radius: 11px; }
.tabs button { flex: 1; }
.tabs .secondary { background: transparent; }

/* Only the active section is rendered beside the persistent menu. */
.portal-active .portal-main { max-width: 1560px; padding: 0 28px; margin: 0 auto; }
.portal-layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: 32px; align-items: start; }
.sidebar { position: sticky; top: var(--header-height); display: flex; flex-direction: column; min-height: calc(100vh - var(--header-height)); max-height: calc(100vh - var(--header-height)); padding: 28px 18px 24px 0; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: thin; }
.sidebar-caption { color: #64798b; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; padding: 0 12px; margin: 0 0 12px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.menu-section { font-size: 11px; font-weight: 750; color: #738697; letter-spacing: .09em; text-transform: uppercase; margin: 22px 0 7px; padding: 0 12px; }
.menu-link { min-height: 47px; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid transparent; border-radius: 9px; color: #506578; text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
.menu-link:hover { background: #e8eef4; color: #123d57; }
.menu-link[aria-current="page"] { color: #006e58; background: #e2f2eb; border-color: #c8e6d8; font-weight: 750; }
.menu-icon { display: inline-flex; width: 20px; height: 20px; flex: 0 0 20px; align-items: center; justify-content: center; color: inherit; }
.menu-icon svg { width: 20px; height: 20px; }
.menu-label { min-width: 0; flex: 1; }
.menu-link .badge, .menu-link .status-pill { font-size: 10px; padding: 2px 5px; line-height: 1.5; white-space: nowrap; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 20px 12px 0; margin-top: auto; color: #64798b; font-size: 13px; }
.sidebar-foot p { margin: 3px 0 10px; }
.sidebar-foot strong { color: #274b62; }
.sidebar-foot a { font-weight: 650; text-decoration: none; }
.sidebar-foot a { display: flex; gap: 8px; align-items: center; }
.sidebar-foot a svg { width: 17px; height: 17px; }
.sidebar-foot small { display: block; margin-top: 9px; font-size: 11px; line-height: 1.65; }
.sidebar-foot a:hover { text-decoration: underline; }
.workspace { min-width: 0; padding: 26px 0 40px; }
.company-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); padding: 16px 20px; border-radius: 12px; margin-bottom: 28px; box-shadow: 0 2px 4px #17354a03; }
.company-bar label { flex: 1; min-width: 220px; max-width: 520px; font-size: 11px; color: #61778a; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.company-picker { min-width: 0; flex: 1; max-width: 660px; }
.company-bar .company-picker label { min-width: 0; }
.company-picker .company-meta { margin-top: 6px; }
.company-bar select { font-size: 14px; font-weight: 650; text-transform: none; letter-spacing: 0; min-height: 42px; margin-top: 4px; padding: 8px 34px 8px 10px; background-color: #f7f9fc; }
.company-bar .company-meta { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.company-bar > .button, .company-bar > button { margin-left: auto; min-height: 40px; padding: 9px 13px; font-size: 13px; white-space: nowrap; }
.view-content { min-width: 0; }
.setup-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0 0 24px; }
.setup-nav > a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; color: var(--ink); }
.setup-nav > a[aria-current="step"] { border-color: #80bfa9; background: #eaf7f1; box-shadow: inset 0 -2px #007f65; }
.setup-nav strong, .setup-nav small { display: block; }
.setup-nav strong { font-size: 15px; }
.setup-nav small { font-size: 12px; }
.step-number { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 29px; border-radius: 50%; color: #006950; background: #e2f2eb; font-size: 14px; font-weight: 800; }
.welcome-panel { display: flex; align-items: center; gap: 24px; justify-content: space-between; padding: 26px; border: 1px solid #cfdfeb; border-radius: 14px; background: #eaf2f7; }
.welcome-panel > div { max-width: 620px; }
.welcome-panel h2 { font-size: 25px; margin: 9px 0; }
.welcome-panel p { color: #456479; margin-bottom: 0; }
.welcome-panel > .button { flex-shrink: 0; }
.onboarding-steps { display: grid; gap: 10px; margin: 22px 0; }
.guide-step { margin: 0; border: 1px solid var(--line); background: #fff; border-radius: 12px; overflow: hidden; }
.guide-step > summary { display: flex; align-items: center; gap: 14px; padding: 18px 20px; font-size: 16px; color: var(--ink); list-style: none; }
.guide-step > summary::-webkit-details-marker { display: none; }
.guide-step > summary > span:nth-child(2) { flex: 1; }
.guide-step > summary::after { content: '+'; color: var(--green); font-size: 22px; font-weight: 500; }
.guide-step[open] > summary::after { content: '−'; }
.guide-step[open] > summary { margin: 0; }
.guide-step-body { padding: 0 22px 22px 63px; }
.guide-step-body p { color: #496477; margin: 0 0 14px; }
.help-disclosure { padding: 21px 25px; }
.help-disclosure > summary { font-size: 16px; }
.help-disclosure[open] > summary { margin-bottom: 22px; }
.cost-list, .field-help { margin: 16px 0; }
.cost-list > div, .field-help > div { display: grid; grid-template-columns: minmax(140px,.7fr) minmax(0,2fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cost-list > div:last-child, .field-help > div:last-child { border-bottom: 0; }
.cost-list dt, .field-help dt { font-weight: 700; color: var(--ink); }
.cost-list dd, .field-help dd { margin: 0; color: #496477; }
.next-step { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.company-record { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.tax-tips { margin-top: 5px; }
.supporting-card h3 { margin-top: 25px; }
.view-content:focus { outline: none; }
.page-heading { margin: 0 0 24px; }
.page-heading h1 { margin: 6px 0 9px; }
.page-heading p { color: var(--muted); max-width: 760px; margin: 0; }
.head .page-heading { margin: 0; }

/* Cards, status overview, and company management. */
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 25px; margin: 20px 0; box-shadow: 0 3px 12px #16354a03; }
.card > :last-child { margin-bottom: 0; }
.card > p:first-of-type { color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.head > div { min-width: 0; }
.head h2 { margin-bottom: 4px; }
.head > button, .head > .button { flex-shrink: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wide { grid-column: 1 / -1; }
.grid > .card { margin: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.summary-card { min-width: 0; padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.summary-card h2, .summary-card h3 { font-size: 15px; letter-spacing: 0; margin: 12px 0 10px; }
.summary-card p { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.summary-card a { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; }
.summary-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #eaf3f8; color: #326079; }
.summary-icon svg { width: 20px; height: 20px; }
.summary-value { display: block; font-size: 27px; font-weight: 750; letter-spacing: -.03em; margin: 12px 0 4px; }
.badge, .status-pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border-radius: 6px; background: #eaf5f0; color: #006746; padding: 4px 9px; font-size: 12px; font-weight: 650; line-height: 1.45; }
.badge.warning, .status-pill.warning { background: #fff5df; color: #85520a; }
.badge.neutral, .status-pill, .coming-soon .badge { background: #edf2f7; color: #65788a; }
.badge.error { background: #ffeded; color: #a92828; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.quick-link { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 20px; color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.quick-link:hover { background: #f7fcfa; border-color: #9bd1bd; }
.quick-link > svg { width: 23px; height: 23px; flex-shrink: 0; color: var(--green); }
.quick-link .menu-icon { margin-top: 3px; color: var(--green); }
.quick-link strong { display: block; margin-bottom: 5px; font-size: 15px; color: var(--ink); }
.quick-link > span { min-width: 0; flex: 1; }
.quick-link > svg:last-child { width: 18px; height: 18px; align-self: center; margin-left: auto; }
.quick-link p, .quick-link small, .quick-link span:not(.menu-icon) { font-size: 13px; color: var(--muted); }
.quick-link p { margin: 0; }
.empty-state { padding: 42px 24px; text-align: center; }
.empty-state p { margin: 8px auto 20px; color: var(--muted); max-width: 540px; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 0 auto 18px; background: #edf4f8; color: #53758c; border-radius: 18px; }
.empty-icon svg { width: 30px; height: 30px; }
.company-list { display: grid; gap: 16px; margin-top: 22px; }
.section-actions { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.section-actions p { margin: 0; }
.company-card { padding: 23px; margin: 0; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.company-card.is-selected { border-color: #79bfa8; box-shadow: inset 3px 0 #008366; }
.company-title { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.company-title h2, .company-title h3 { margin: 0; font-size: 18px; }
.company-title > div { flex: 1; min-width: 150px; }
.company-title p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.company-details { display: flex; gap: 8px 22px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 10px; }
.company-details p { margin: 0; }
.company-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.company-actions .button, .company-actions button { font-size: 13px; min-height: 40px; padding: 9px 14px; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 26px; margin: 22px 0; }
.details-grid dl, dl.details-grid { margin-top: 0; margin-bottom: 0; }
.details-grid dt { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.details-grid dd { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.coming-soon { display: flex; align-items: center; gap: 16px; margin: 20px 0 0; padding: 18px 20px; border: 1px dashed #cddae5; border-radius: 11px; color: #5e7487; }
.coming-soon .status-pill, .coming-soon .badge { flex-shrink: 0; margin: 0; }
.coming-soon strong { font-size: 14px; }
.coming-soon p { margin: 3px 0 0; font-size: 13px; }

/* Forms keep company setup, certificate and Serpro configuration independent. */
label { display: block; font-size: 14px; font-weight: 650; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: 6px; border: 1px solid #bdcedb; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fff; font-size: 15px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #7c8f9f; opacity: 1; }
input:disabled, select:disabled { background: #f1f5f8; color: #778b9b; }
input[type="checkbox"] { display: inline-block; width: 18px; min-height: 18px; height: 18px; margin-right: 8px; vertical-align: middle; accent-color: var(--green); }
input[type="file"] { font-size: 13px; padding: 7px; }
input[type="file"]::file-selector-button { border: 0; border-radius: 5px; margin-right: 10px; padding: 6px 10px; color: #244b64; background: #edf3f8; font: inherit; font-weight: 650; cursor: pointer; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 8px; background: var(--green); color: #fff; padding: 11px 17px; font-size: 14px; font-weight: 700; line-height: 1.45; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover, .button:hover { background: #006e57; }
button:disabled { opacity: .55; cursor: wait; }
button svg, .button svg { width: 18px; height: 18px; }
.secondary { background: #edf3f7; border-color: #e3eaf1; color: #25475f; }
.secondary:hover { background: #e1ebf2; border-color: #cbdce8; }
.danger { background: #fff0ef; border-color: #f6d9d6; color: #a02a23; }
.danger:hover { background: #ffe3e0; border-color: #e9b7b1; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: start; gap: 22px; }
.two-column > .card { margin: 0; }
.two-column .grid { gap: 16px; }
.two-column .card > h2 { font-size: 19px; }
.form-section { margin-top: 22px; }
.form-section > label + label { margin-top: 18px; }
.form-section + .form-section { padding-top: 22px; margin-top: 24px; border-top: 1px solid var(--line); }
.form-heading { font-size: 16px; margin: 0 0 16px; }
.form-heading h2 { margin-bottom: 10px; }
.supporting-card { background: #f8fafc; }
.supporting-card > .summary-icon { margin-bottom: 17px; }
.supporting-card > p, .supporting-card li { font-size: 14px; }
.text-link { font-size: 14px; font-weight: 650; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.note { padding: 15px 17px; border-radius: 9px; background: #f0f8f5; border: 1px solid #c9e4d8; color: #305648; margin: 18px 0; font-size: 14px; }
.note p:last-child { margin-bottom: 0; }
.note.warning, .note.attention { background: #fff9eb; border-color: #efddb2; color: #765619; }
.instruction-list { list-style: none; counter-reset: instruction; margin: 20px 0; padding: 0; }
.instruction-list li { position: relative; padding-left: 37px; margin-bottom: 20px; font-size: 14px; color: #516a7d; }
.instruction-list li::before { counter-increment: instruction; content: counter(instruction); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; background: #e7f2ee; color: #08775e; font-size: 12px; font-weight: 800; }
.instruction-list strong { color: var(--ink); }
.instruction-list strong, .instruction-list li > span { display: block; }
.instruction-list li > span { margin-top: 4px; }
details { margin-top: 18px; }
summary { cursor: pointer; color: var(--green); font-weight: 700; font-size: 14px; }
details[open] summary { margin-bottom: 15px; }
dialog { max-width: 720px; width: calc(100% - 32px); max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid #c6d8e1; border-radius: 16px; color: var(--ink); box-shadow: 0 24px 100px #051a3540; }
dialog::backdrop { background: #0825369c; backdrop-filter: blur(3px); }
dialog .head { margin-bottom: 24px; }
dialog .head h2 { margin: 0; }
dialog button[aria-label="Fechar"] { min-width: 42px; padding: 8px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* History tables scroll within their card, never the complete page. */
.table { width: 100%; overflow: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 14px; border-bottom: 1px solid #e6edf3; vertical-align: middle; }
th { background: #f7f9fc; color: #627789; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 750; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td .button, td button { font-size: 12px; min-height: 34px; padding: 7px 10px; white-space: nowrap; }
td:last-child { min-width: 120px; }
td small { display: block; margin-top: 4px; }
.filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.filters label { min-width: 160px; max-width: 340px; flex: 1; }
.filters select, .filters input { min-height: 42px; font-size: 14px; }
#guides > p, #services > p { color: var(--muted); }

/* Shared feedback stays centered above the page and any company editor. */
body.feedback-open { overflow: hidden; }
#feedback-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(520px, calc(100% - 32px));
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  padding: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #c8ddd4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 100px #051a3559;
}
#feedback-dialog::backdrop { background: #082536ab; backdrop-filter: blur(3px); }
#feedback-dialog .feedback-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
#feedback-dialog .feedback-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #007657; background: #e5f5ee; font-size: 26px; font-weight: 750; }
#feedback-dialog .feedback-dismiss { width: 44px; height: 44px; padding: 0; min-height: 44px; color: #426072; background: #f0f4f7; font-size: 28px; line-height: 1; }
#feedback-title { margin: 0 0 14px; padding: 0; font-size: 23px; line-height: 1.3; }
#feedback-message { margin: 0; font-size: 16px; line-height: 1.65; color: #365366; white-space: pre-line; overflow-wrap: anywhere; }
#feedback-dialog .feedback-actions { margin-top: 26px; display: flex; justify-content: flex-end; }
#feedback-close { min-width: 130px; min-height: 46px; }
#feedback-dialog[data-kind="error"] { border-color: #ebc7c1; }
#feedback-dialog[data-kind="error"] .feedback-symbol { background: #fff0ed; color: #a23428; }
input[aria-invalid="true"] { border-color: #b94032; }
.certificate-offer { margin: 22px 0; padding: 22px; border: 1px solid #b9dacb; border-radius: 12px; background: #edf8f2; }
.certificate-offer h3 { margin-top: 9px; color: var(--ink); }
.certificate-offer .offer-price { margin: 12px 0 4px; color: #08654f; }
.certificate-offer .offer-price strong { font-size: 32px; line-height: 1.3; letter-spacing: -.03em; }
.certificate-offer .offer-price span { font-size: 15px; }
.certificate-offer .button { display: flex; justify-content: center; width: 100%; margin-top: 18px; text-align: center; }
.certificate-offer > p:last-child { margin-bottom: 0; }
.emission-cost-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.emission-cost-item { min-width: 0; padding: 20px; border: 1px solid #d5e1eb; border-radius: 11px; background: #f5f8fc; }
.emission-cost-item.is-free { background: #edf8f2; border-color: #bddccc; }
.emission-cost-item > p:last-child { margin-bottom: 0; }
.emission-price { margin: 8px 0 14px; color: var(--ink); }
.emission-price strong { display: block; font-size: 27px; line-height: 1.3; letter-spacing: -.025em; }
.emission-price span { font-size: 14px; color: var(--muted); }
.emission-cost-item.is-free .emission-price { color: #08654f; }
@media (max-width: 720px) {
  .emission-cost-grid { grid-template-columns: minmax(0, 1fr); }
  .certificate-offer, .emission-cost-item { padding: 18px; }
}
@media (max-width: 480px) {
  #feedback-dialog { padding: 22px; }
  #feedback-title { font-size: 21px; }
  #feedback-close { width: 100%; }
}
.portal-footer, body > footer { max-width: 1180px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding: 20px 28px; margin: 0 auto; color: #738595; font-size: 12px; border-top: 1px solid var(--line); }
.portal-footer > span { margin-right: auto; }
.portal-footer a { color: #526d80; text-decoration: none; }
.portal-footer a:hover { text-decoration: underline; }
.portal-active .portal-footer { max-width: 1560px; padding-left: calc(var(--sidebar-width) + 60px); }

@media (min-width: 1500px) {
  .portal-layout { gap: 40px; }
  .portal-active .portal-footer { padding-left: calc(var(--sidebar-width) + 68px); }
}

@media (max-width: 1200px) {
  :root { --sidebar-width: 218px; }
  .portal-layout { gap: 24px; }
  .portal-active .portal-main { padding: 0 22px; }
  .portal-header { padding-left: 22px; padding-right: 22px; gap: 16px; }
  .product-name { padding-left: 16px; }
  .sidebar { padding-right: 14px; }
  .menu-link { padding: 10px; gap: 9px; font-size: 13px; }
  .two-column { grid-template-columns: minmax(0, 1fr); }
  .summary-grid { gap: 12px; }
  .summary-card { padding: 18px; }
  .card { padding: 22px; }
  .company-bar { gap: 12px; padding: 14px 17px; }
  .company-bar label { max-width: 100%; }
  .portal-active .portal-footer { padding-left: calc(var(--sidebar-width) + 46px); }
}

@media (max-width: 980px) {
  :root { --header-height: 72px; }
  .portal-header { gap: 17px; min-height: var(--header-height); padding: 14px 22px; }
  .portal-header { flex-wrap: wrap; row-gap: 12px; }
  .rtu-guide-banner { order: 1; flex-basis: 100%; max-width: none; }
  .brand img { width: 122px; height: 32px; }
  .product-name { font-size: 13px; padding-left: 17px; }
  .portal-active .mobile-menu-toggle { display: flex; width: 100%; gap: 9px; justify-content: flex-start; min-height: 44px; margin-top: 18px; padding: 10px 14px; border-color: #d6e3ec; background: #fff; }
  .mobile-menu-toggle > span { margin-left: auto; font-size: 13px; font-weight: 500; color: #61778a; }
  .mobile-menu-toggle svg { width: 19px; height: 19px; }
  .portal-layout { display: block; }
  .sidebar { position: static; display: none; min-height: 0; max-height: none; margin: 10px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .sidebar.is-open { display: flex; }
  .side-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
  .menu-section { grid-column: 1 / -1; margin-top: 15px; }
  .sidebar-foot { margin-top: 18px; padding-top: 15px; }
  .sidebar-caption { padding-left: 10px; }
  .menu-link { font-size: 14px; }
  .workspace { padding-top: 22px; }
  .portal-active .portal-footer { padding-left: 22px; }
  .two-column { grid-template-columns: minmax(0, 1.1fr) minmax(270px, .9fr); gap: 18px; }
  .two-column .grid { grid-template-columns: 1fr; }
  .two-column .grid .wide { grid-column: auto; }
}

@media (max-width: 720px) {
  .welcome-panel { display: block; padding: 22px; }
  .welcome-panel > .button { margin-top: 20px; width: 100%; }
  .setup-nav { gap: 7px; }
  .setup-nav > a { display: block; text-align: center; padding: 11px 5px; }
  .setup-nav .step-number { margin-bottom: 7px; width: 25px; height: 25px; }
  .setup-nav strong { font-size: 13px; }
  .setup-nav small { font-size: 11px; }
  .guide-step > summary { gap: 10px; padding: 16px 13px; font-size: 15px; }
  .guide-step > summary .badge { display: none; }
  .guide-step-body { padding: 0 18px 20px; font-size: 15px; }
  .cost-list > div, .field-help > div { grid-template-columns: 1fr; gap: 7px; }
  .tax-tips { gap: 2px; }
  .portal-header, body > header { gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
  .brand img { width: 113px; height: 31px; }
  .product-name { font-size: 12px; border: 0; padding-left: 0; }
  #nav { gap: 9px; }
  #nav > a { font-size: 12px; }
  #nav button, #nav .button { padding: 8px 10px; min-height: 37px; font-size: 12px; }
  .portal-active .product-name { display: none; }
  .portal-active .mobile-menu-toggle span { display: inline; }
  .portal-main, body > main { padding: 0 16px; margin: 24px auto; }
  .portal-active .portal-main { padding: 0 16px; margin: 0 auto; }
  .auth { grid-template-columns: 1fr; gap: 20px; }
  .intro { padding: 28px; }
  .intro h1 { font-size: 33px; }
  .intro ul { margin: 20px 0; }
  .auth > .card { margin-top: 0; }
  .workspace { padding: 18px 0 28px; }
  .company-bar { margin-bottom: 22px; padding: 14px; gap: 10px; }
  .company-bar label { min-width: 100%; }
  .company-picker { flex-basis: 100%; max-width: 100%; }
  .company-bar .company-meta { font-size: 12px; }
  .company-bar > .button, .company-bar > button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
  .company-bar select { font-size: 14px; }
  .page-heading { margin-bottom: 21px; }
  .page-heading p { font-size: 14px; }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  .head { flex-wrap: wrap; align-items: flex-start; gap: 14px; }
  .card { padding: 20px; margin: 17px 0; }
  .grid, .two-column { grid-template-columns: minmax(0, 1fr); }
  .wide { grid-column: auto; }
  .summary-grid { grid-template-columns: 1fr; gap: 10px; margin: 20px 0; }
  .summary-card { padding: 18px; }
  .summary-card .summary-icon { float: right; margin-left: 10px; }
  .summary-card h2, .summary-card h3 { margin-top: 0; }
  .summary-value { margin-top: 0; }
  .summary-card a { margin-top: 10px; }
  .quick-grid { gap: 10px; }
  .quick-link { flex-direction: column; gap: 10px; padding: 17px; }
  .quick-link strong { font-size: 14px; }
  .details-grid { gap: 20px; }
  .company-card { padding: 20px; }
  .company-title h2, .company-title h3 { font-size: 17px; }
  .company-details { flex-direction: column; gap: 5px; }
  .empty-state { padding: 32px 15px; }
  .coming-soon { padding: 17px; align-items: flex-start; flex-wrap: wrap; gap: 9px; }
  .actions { gap: 10px; margin-top: 22px; }
  .actions button, .actions .button { flex: 1 1 auto; }
  .table { margin-top: 18px; }
  th, td { padding: 12px; }
  .portal-footer, body > footer, .portal-active .portal-footer { padding: 20px 16px; gap: 10px 18px; font-size: 12px; }
  .portal-footer > span { width: 100%; }
  dialog { padding: 22px; width: calc(100% - 24px); }
  .instruction-list li { margin-bottom: 18px; }
}

@media (max-width: 390px) {
  .portal-header { gap: 9px; }
  .portal-active .brand img { width: 96px; }
  #nav { gap: 7px; }
  #nav > a { font-size: 11px; }
  .side-nav { grid-template-columns: 1fr; }
  .quick-grid, .details-grid { grid-template-columns: 1fr; }
  .quick-link { flex-direction: row; }
  .portal-active .mobile-menu-toggle { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .rtu-guide-banner { animation: none; }
}

/* Daily issuance keeps the form visible; instructions live in a reusable dialog. */
.term-example { margin: 20px 0 24px; }
.term-example figcaption { padding: 9px 12px; background: #edf3f7; border: 1px solid #c7d3de; border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 12px; font-weight: 750; text-align: center; }
.term-example-paper { border: 1px solid #536477; background: #fff; color: #182b3b; }
.term-example-title { padding: 13px; font-size: 15px; font-weight: 700; line-height: 1.65; }
.term-example-title > span { text-transform: uppercase; }
.term-example-registration { padding: 10px 13px; border-top: 1px solid #536477; font-size: 14px; }
.term-example-section { padding: 8px 13px; font-size: 13px; font-weight: 750; border-top: 1px solid #536477; border-bottom: 1px solid #536477; background: #f8fafc; }
.term-example-taxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.term-example-taxes > div { padding: 13px 8px; text-align: center; font-size: 14px; min-width: 0; }
.term-example-taxes > div + div { border-left: 1px solid #536477; }
.term-example-taxes > div > span { display: block; min-height: 44px; }
.term-example-taxes strong { display: inline-flex; margin: 10px 0 6px; }
.term-example-taxes small { display: block; font-size: 11px; }
.term-highlight { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 5px; white-space: nowrap; }
.term-marker { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; font-family: inherit; font-weight: 800; flex-shrink: 0; }
.term-number { color: #634800; background: #fff0a9; }
.term-date { color: #07527e; background: #e1f1fd; }
.term-federal { color: #4f3684; background: #eee6ff; }
.term-state { color: #075e46; background: #dff6e8; }
.term-field-map { list-style: none; padding: 0; margin: 16px 0 20px; }
.term-field-map li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.term-field-map .term-marker { width: 28px; height: 28px; }
.term-field-map strong { font-size: 14px; }
.term-field-map p { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
@media (max-width: 480px) {
  .term-example-title { font-size: 13px; padding: 10px; }
  .term-example-registration { padding: 10px; }
  .term-example-taxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .term-example-taxes .term-example-product { grid-column: 1 / -1; border-bottom: 1px solid #536477; padding: 10px; }
  .term-example-product > span { min-height: 0 !important; }
  .term-example-product strong { margin: 2px 0; }
  .term-example-taxes .term-example-federal { border-left: 0; }
  .term-example-taxes > div { font-size: 13px; padding: 10px 5px; }
  .term-example-taxes > div > span { min-height: 40px; }
  .term-highlight { gap: 4px; padding: 3px 4px; }
  .term-field-map li { gap: 9px; }
}
.sidebar-foot .support-whatsapp, .portal-footer .support-whatsapp { color: var(--green); font-weight: 700; }
.sidebar-foot .support-phone { margin: 5px 0 16px; }
#feedback-support { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 650; }
#feedback-support[hidden] { display: none; }
.emission-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.emission-heading > div { min-width: 0; }
.emission-heading > button { flex-shrink: 0; }
.emission-form-card { margin-top: 0; padding: 26px; }
.emission-fields { gap: 22px 26px; }
.emission-submit { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.emission-submit .actions, .emission-submit .helper-text { margin: 0; }
.emission-submit button { min-width: 148px; }
.emission-history-link { display: flex; justify-content: flex-end; margin-top: 16px; }
.emission-setup { margin-bottom: 20px; }
body.emission-help-open { overflow: hidden; }
#emission-help-dialog { width: min(780px, calc(100% - 32px)); max-width: 780px; max-height: min(820px, calc(100dvh - 40px)); padding: 0; overflow: hidden; }
#emission-help-dialog[open] { display: flex; flex-direction: column; }
.emission-help-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 28px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.emission-help-heading h2 { margin: 6px 0 0; font-size: 25px; }
.emission-help-heading button { flex-shrink: 0; width: 42px; height: 42px; min-height: 42px; padding: 0; font-size: 25px; }
.emission-help-content { overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px; min-height: 0; }
.emission-help-content > p:first-child { margin-top: 0; color: var(--muted); }
.emission-help-steps { padding-left: 23px; margin: 24px 0; }
.emission-help-steps li { padding-left: 8px; margin-bottom: 16px; }
.emission-help-steps li::marker { color: var(--green); font-weight: 750; }
.emission-help-steps li > strong, .emission-help-steps li > span { display: block; }
.emission-help-steps li > span { margin-top: 3px; color: var(--muted); }
.emission-help-costs { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #f4f8fb; }
.emission-help-costs h3 { margin: 0 0 12px; }
.emission-help-costs p { font-size: 14px; margin: 10px 0 0; }
.emission-help-scope { font-size: 14px; }
.emission-help-content #term-help, .emission-help-details { box-shadow: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0; margin: 0; }
.emission-help-content #term-help summary, .emission-help-details summary { font-size: 15px; }
.emission-help-links { display: flex; gap: 12px 24px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; }
.emission-help-actions { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; background: #fff; border-top: 1px solid var(--line); }
.emission-help-actions .helper-text { margin: 0; font-size: 12px; }
.emission-help-actions button { flex-shrink: 0; }
@media (max-width: 640px) {
  .emission-heading { flex-wrap: wrap; gap: 12px; }
  .emission-heading > button { padding: 8px 12px; min-height: 38px; }
  .emission-form-card { padding: 20px; }
  .emission-fields { gap: 18px; }
  .emission-submit .actions { width: 100%; }
  .emission-submit button { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .emission-submit .helper-text { font-size: 12px; }
  #emission-help-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); }
  .emission-help-heading { padding: 18px; gap: 10px; }
  .emission-help-heading h2 { font-size: 21px; }
  .emission-help-content { padding: 18px; }
  .emission-help-actions { padding: 14px 18px; flex-direction: column; gap: 8px; align-items: stretch; }
  .emission-help-actions .helper-text { text-align: center; }
  .emission-help-costs { padding: 14px; }
}
@media print {
  .portal-header, .sidebar, .company-bar, .portal-footer, #feedback-dialog, .actions { display: none !important; }
  .portal-layout { display: block; }
  .portal-main { max-width: none; margin: 0; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
