/* QRBCERTO / Encontrar, entender, salvar. Shared application components. */
:root {
  --bg: #f3f5f4; --surface: #fff; --surface-2: #f5f8f6; --surface-3: #eaf0ed;
  --ink: #172b24; --ink-secondary: #334a40; --muted: #596e63;
  --line: #dce5df; --line-strong: #bbcdc1;
  --primary-brand: #146747; --primary-brand-hover: #10553b; --green: #146747;
  --accent-green: #278263; --accent-green-alpha: #2782631a;
  --ux-sage: #e4efe8; --ux-warning: #7a4b13; --ux-warning-bg: #fff6e5;
  --r-card: 20px; --r-control: 13px; --ux-shadow: 0 4px 24px #18362b06;
}
body.theme-dark {
  --bg: #101916; --surface: #192620; --surface-2: #202f27; --surface-3: #293c31;
  --ink: #edf5ef; --ink-secondary: #ceded3; --muted: #a9bcb0;
  --line: #314339; --line-strong: #516b5b;
  --primary-brand: #81c6a0; --primary-brand-hover: #9cdbb6; --green: #81c6a0;
  --accent-green: #81c6a0; --accent-green-alpha: #81c6a01c;
  --ux-sage: #253d30; --ux-warning: #f1c77f; --ux-warning-bg: #342d20;
  --ux-shadow: 0 4px 24px #00000016;
}
body { background: var(--bg); color: var(--ink); letter-spacing: -.015em; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary-brand); outline-offset: 3px;
}
button:disabled { opacity: .55; cursor: wait; }
.hidden, [hidden] { display: none !important; }
.main { width: 100%; min-width: 0; }
.content { width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 28px 120px; }
.topbar { min-height: 76px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: none; backdrop-filter: none; padding: 14px 28px; }
.topbar h2 { font-size: 18px; font-weight: 650; letter-spacing: -.035em; }
.topbar .eyebrow { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.topbar .icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); }
.sidebar { background: #13271e; }
.sidebar .nav > button { min-height: 44px; border-radius: 12px; font-weight: 550; }
.sidebar .nav > button.active { background: #315b43; color: #fff; }
.sidebar .nav-section { font-size: 10px; color: #aac4b1; letter-spacing: .1em; }
.panel, .profile-panel { border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--ux-shadow); background: var(--surface); }
.panel { padding: 22px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 12px; font-size: 16px; min-height: 48px; box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
textarea { min-height: 100px; line-height: 1.55; }
label { color: var(--ink-secondary); font-weight: 550; line-height: 1.45; }
button.primary, .primary { min-height: 48px; background: var(--primary-brand); border: 1px solid transparent; color: #fff; border-radius: 13px; font-weight: 650; box-shadow: none; }
body.theme-dark button.primary { color: #12291d; }
button.secondary { min-height: 44px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 12px; font-weight: 550; }
button.primary:hover { background: var(--primary-brand-hover); }
.list-row { padding: 17px; border-color: var(--line); background: var(--surface); border-radius: 14px; }
.list-row strong { font-weight: 650; letter-spacing: -.02em; }
.list-row small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.tag { font-weight: 550; font-size: 12px; border-radius: 7px; padding: 5px 8px; }
.toolbar { gap: 14px; margin-bottom: 20px; }
.toolbar h3, .panel > h3 { font-size: 19px; letter-spacing: -.025em; }
.search-hero { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; box-shadow: var(--ux-shadow); }
.search-hero input { border: 0 !important; background: transparent !important; }
.ux-eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .14em; color: var(--primary-brand); margin: 0 0 12px; }
.field-home { max-width: 920px; margin: 0 auto; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 8px 0 28px; }
.field-heading h2, .ux-page-head h2 { font-size: clamp(26px, 3.5vw, 36px); line-height: 1.16; font-weight: 650; letter-spacing: -.055em; margin: 0 0 10px; }
.field-heading p:not(.ux-eyebrow), .ux-page-head > p:not(.ux-eyebrow) { color: var(--muted); line-height: 1.5; font-size: 15px; margin: 0; }
.brand-medallion { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid var(--line); color: var(--primary-brand); background: var(--surface); border-radius: 20px; flex: 0 0 auto; }
.search-launch { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--ux-shadow); }
.search-launch label { display: block; font-size: 13px; margin: 0 0 13px; font-weight: 650; }
.launch-input { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 15px; padding: 7px 7px 7px 16px; color: var(--primary-brand); }
.launch-input:focus-within { outline: 2px solid var(--primary-brand); outline-offset: 2px; }
.launch-input input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 7px 0; height: 46px; outline: 0 !important; box-shadow: none !important; }
.launch-input > svg { flex: 0 0 auto; }
.launch-input button { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border: 0; border-radius: 11px; background: var(--primary-brand); color: #fff; }
body.theme-dark .launch-input button { color: #13271e; }
.launch-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 10px; }
.launch-footer > span { color: var(--muted); font-size: 12px; }
.launch-footer button, .ux-text-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--primary-brand); font-size: 13px; font-weight: 650; min-height: 44px; padding: 5px 0; }
.home-sync { margin: 15px 0 30px; }
.connection-state { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; line-height: 1.5; }
.connection-state.is-warning { color: var(--ux-warning); }
.connection-state svg { flex: 0 0 auto; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-label h3 { font-size: 15px; font-weight: 650; margin: 0; }
.section-label > span { color: var(--muted); font-size: 12px; }
.quick-access { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 26px; }
.quick-access button { display: grid; justify-items: start; gap: 16px; padding: 20px; border: 1px solid var(--line); background: var(--surface); border-radius: 17px; text-align: left; color: var(--ink); }
.quick-access button > span { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 13px; background: var(--ux-sage); color: var(--primary-brand); }
.quick-access strong { font-size: 14px; font-weight: 600; }
.field-register { width: 100%; display: flex; align-items: center; gap: 17px; padding: 24px; margin: 0 0 30px; text-align: left; border: 1px solid #305840; border-radius: 19px; background: #173e2b; color: #f4faf5; }
.register-orb { display: grid; place-items: center; width: 48px; height: 48px; background: #ffffff14; border: 1px solid #ffffff20; border-radius: 15px; flex: 0 0 auto; }
.field-register > span:nth-child(2) { flex: 1; }
.field-register strong { display: block; font-size: 17px; font-weight: 600; }
.field-register small { display: block; color: #c3d9cb; font-size: 13px; margin-top: 5px; line-height: 1.5; }
.field-register > svg { flex: 0 0 auto; }
.ux-action-list { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.ux-action { width: 100%; display: flex; align-items: center; gap: 15px; padding: 18px; text-align: left; border: 0; background: var(--surface); color: var(--ink); min-height: 80px; }
.ux-action-list .ux-action + .ux-action { border-top: 1px solid var(--line); }
.ux-action-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--primary-brand); }
.ux-action > span:nth-child(2) { flex: 1; min-width: 0; }
.ux-action strong { display: block; font-size: 14px; font-weight: 600; }
.ux-action small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.ux-action > svg { color: var(--muted); flex: 0 0 auto; }
.ux-action:hover, .quick-access button:hover { background: var(--surface-2); }
.ux-footnote { display: flex; justify-content: center; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); line-height: 1.6; margin: 25px 0 0; }
.ux-page-head { margin: 5px 0 28px; max-width: 700px; }
.register-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.register-option { display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); padding: 25px; text-align: left; }
.register-option.featured { border-color: var(--primary-brand); background: var(--ux-sage); }
.register-option strong { font-size: 18px; font-weight: 650; }
.register-option p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); flex: 1; }
.option-cta { display: flex; gap: 14px; justify-content: space-between; color: var(--primary-brand); font-size: 13px; font-weight: 650; margin-top: 10px; }
.ux-save-explainer { display: flex; gap: 15px; padding: 22px; margin: 22px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.ux-save-explainer > svg { flex: 0 0 auto; color: var(--primary-brand); }
.ux-save-explainer strong { font-size: 14px; }
.ux-save-explainer p { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 6px 0; }
.advanced-register { border: 1px solid var(--line); border-radius: 16px; }
.explore-group { margin: 0 0 27px; }
.explore-group h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.app-dock { position: fixed; z-index: 110; bottom: 14px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4,1fr); width: min(440px,calc(100% - 32px)); padding: 7px; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); box-shadow: 0 8px 40px #15291f1f; }
.app-dock button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 8px 3px; min-height: 60px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 550; }
.app-dock button.active { color: var(--primary-brand); background: var(--ux-sage); font-weight: 700; }
.quick-field-fab { display: none !important; }
.busca-mode { margin: 0 0 20px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.busca-mode-opt { border-radius: 11px; min-height: 56px; }
.busca-mode-opt.on { background: var(--surface); color: var(--primary-brand); box-shadow: 0 2px 6px #12291c08; border-color: var(--line); }
.busca-mode .bm-txt strong { font-size: 14px; }
.busca-mode .bm-txt small { font-size: 11px; }
.search-refine { margin-top: 12px; }
.search-refine > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 7px; color: var(--primary-brand); font-size: 13px; font-weight: 600; list-style: none; }
.search-refine > summary::after { content: '+'; margin-left: auto; font-size: 22px; font-weight: 400; }
.search-refine[open] > summary::after { content: '−'; }
.search-refine > summary::-webkit-details-marker { display: none; }
.busca-chip { min-height: 40px; }
.busca-filters { border-top: 1px solid var(--line); padding-top: 15px; }
.busca-hit { margin-top: 8px; min-height: 68px; }
.search-coverage { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ux-empty { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 38px 22px; text-align: center; }
.ux-empty > span { display: inline-grid; place-items: center; background: var(--ux-sage); color: var(--primary-brand); width: 68px; height: 68px; border-radius: 22px; }
.ux-empty h3 { font-size: 20px; margin: 22px 0 10px; }
.ux-empty p { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.outbox-toolbar { display: flex; align-items: center; gap: 15px; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.outbox-toolbar button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; }
.outbox-item { display: flex; gap: 15px; margin-bottom: 12px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; }
.outbox-item h3 { font-size: 16px; margin: 8px 0; }
.outbox-item p { font-size: 13px; color: var(--muted); margin: 5px 0; line-height: 1.55; }
.ux-state-label { display: inline-block; padding: 4px 8px; color: var(--ux-warning); background: var(--ux-warning-bg); font-size: 11px; border-radius: 6px; font-weight: 600; }
.ux-inline-warning, .outbox-item .outbox-error { color: var(--ux-warning); background: var(--ux-warning-bg); padding: 12px; border-radius: 10px; }
.record-context { padding: 16px; margin: 17px 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.record-context-head { display: flex; align-items: center; gap: 8px; color: var(--ux-warning); }
.record-context-head strong { font-size: 13px; font-weight: 650; }
.record-context dl { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 14px 0 0; }
.record-context dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.record-context dd { font-size: 13px; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.record-context p { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 13px 0 0; }
.sheet { border: 1px solid var(--line); background: var(--surface); border-radius: 24px 24px 0 0; color: var(--ink); }
.sheet-body { padding: 26px; }
.sheet-title { font-size: 23px; font-weight: 650; letter-spacing: -.04em; padding-right: 30px; }
.sheet-close { width: 44px; height: 44px; top: 12px; right: 12px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); border-radius: 50%; }
.sheet .ptac-ficha, .sheet .resumo { background: var(--surface); color: var(--ink); }
.sheet .ptac-title, .sheet .ptac-name, .sheet .ptac-val, .sheet .resumo-head-txt > strong { color: var(--ink); }
.sheet .ptac-item, .sheet .resumo-fact, .sheet .ptac-card { border-color: var(--line); background: var(--surface-2); }
.sheet .ptac-label, .sheet .resumo-sub { color: var(--muted); }
.sheet .ptac-pill, .sheet .ptac-ficha .ficha-actions button { background: var(--surface-2); color: var(--ink); border-color: var(--line); min-height: 44px; border-radius: 12px; }
.sheet .ptac-ficha .ficha-actions button.primary { background: var(--primary-brand); color: #fff; }
.sheet-form { gap: 18px; }
.sheet-form label { font-size: 13px; }
.modal-actions { gap: 12px; padding-top: 14px; }
.modal-actions button { min-height: 48px; }
.rr-gps { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.rr-foto-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rr-row { gap: 12px; }
.discard-confirm { padding: 16px; margin-top: 16px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--ux-warning-bg); color: var(--ux-warning); }
.discard-confirm p { font-size: 14px; line-height: 1.5; }
.outbox-badge { bottom: calc(107px + env(safe-area-inset-bottom, 0px)); z-index: 105; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; max-width: calc(100% - 32px); }
#toastHost { bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
.login-shell { background: var(--bg); }
.login-panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--ux-shadow); border-radius: 24px; }
.login-brand h1 { letter-spacing: -.065em; }
.google-btn-wrap:has(.google-hint) { display: none; }
@media (min-width: 1041px) {
  .app-dock { bottom: 18px; }
  .explore-group .ux-action-list { display: grid; grid-template-columns: 1fr 1fr; }
  .explore-group .ux-action-list .ux-action { border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .content { padding: 22px 18px calc(115px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 10px 18px; min-height: 68px; }
  .topbar .eyebrow { font-size: 9px; }
  .field-heading { align-items: flex-start; gap: 10px; margin: 5px 0 24px; }
  .field-heading h2 { max-width: 260px; font-size: 30px; }
  .field-heading p:not(.ux-eyebrow) { font-size: 13px; max-width: 255px; }
  .brand-medallion { width: 44px; height: 44px; border-radius: 14px; }
  .brand-medallion svg { width: 23px; }
  .search-launch { padding: 18px; border-radius: 18px; }
  .launch-input { padding-left: 12px; gap: 8px; }
  .launch-input input { font-size: 16px !important; }
  .launch-input > svg { width: 19px; }
  .launch-footer { display: block; }
  .launch-footer > span { display: block; line-height: 1.5; margin-top: 14px; }
  .launch-footer button { margin-top: 3px; }
  .home-sync { margin: 13px 0 27px; }
  .quick-access { gap: 8px; }
  .quick-access button { padding: 13px 5px; align-content: start; justify-items: center; gap: 10px; border-radius: 14px; }
  .quick-access button > span { width: 39px; height: 39px; border-radius: 12px; }
  .quick-access strong { font-size: 11px; }
  .section-label > span { display: none; }
  .field-register { padding: 19px 16px; gap: 12px; }
  .field-register strong { font-size: 15px; }
  .field-register small { font-size: 12px; }
  .register-orb { width: 42px; height: 42px; border-radius: 12px; }
  .app-dock { bottom: calc(9px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 28px); max-width: 440px; padding: 6px; border-radius: 21px; }
  .app-dock button { min-height: 57px; }
  .register-options { grid-template-columns: 1fr; gap: 12px; }
  .register-option { padding: 21px; display: grid; grid-template-columns: 45px 1fr; gap: 10px 15px; }
  .register-option .ux-action-icon { grid-row: span 3; }
  .register-option strong { font-size: 17px; }
  .register-option p, .register-option .option-cta { grid-column: 2; }
  .register-option p { font-size: 13px; }
  .option-cta { margin-top: 4px; }
  .ux-page-head { margin-bottom: 22px; }
  .ux-page-head h2 { font-size: 29px; }
  .ux-page-head > p:not(.ux-eyebrow) { font-size: 14px; }
  .panel { padding: 18px; }
  .sheet-body { padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .sheet { max-height: 92dvh; }
  .sheet-title { font-size: 22px; }
  .record-context dl { gap: 12px; }
  .ux-footnote { font-size: 11px; }
  .busca-mode .bm-txt small { font-size: 10px; }
  .busca-mode .bm-txt strong { font-size: 12px; }
  .busca-mode-opt { padding: 9px; gap: 6px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ux-action, .quick-access button, .register-option, .field-register, .app-dock button { transition: background .16s ease, border-color .16s ease, transform .16s ease; }
  .quick-access button:active, .register-option:active, .field-register:active { transform: scale(.985); }
}
@media print { .app-dock, .outbox-badge { display: none !important; } }
/* One document scroll container; avoid nested scrollbars on mobile. */
.app-shell, .main, .content { overflow: visible; }
body.view-map .map-tools { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
body.view-map .leaflet-bottom { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
