/* Presentation overrides kept separate from operational styles. */
.app :is([data-task-location-accept] button, [data-scan-start], #start-qr-scan, [data-whatsapp-form] button[type="submit"], [data-whatsapp-invite] button[type="submit"], [data-copy-value], .leader-form button[type="submit"], .profile-photo-submit) {
  background: #087d68; color: #fff; border: 1px solid #087d68; border-radius: 6px;
  min-height: 44px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
.app :is([data-task-location-accept] button, [data-scan-start], #start-qr-scan, [data-whatsapp-form] button, [data-copy-value]):disabled { opacity: .6; cursor: not-allowed; }
.app button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.app textarea.ui-invite-text { display: block; width: 100%; box-sizing: border-box; min-height: 100px; height: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; resize: vertical; font: inherit; line-height: 1.5; }
.app .leader-row > div, .app .person-heading > div, .app .supporter-share-actions { min-width: 0; }
.app .leader-row :is(p, strong), .app .president-rep-list :is(strong, small) { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.app .president-rep-list a { min-width: 0; }
.movement-context { font-weight: 700; color: #526674; font-size: 13px; }
.mobile-role-context { display: block; margin-top: 4px; color: #cce9df; font-size: 12px; font-weight: 400; }
.app :is([data-task-track-start], [data-current-finish] button, #start-tracking, #stop-tracking) { background: #087d68; color: #fff; border: 1px solid #087d68; border-radius: var(--radius-control); min-height: 44px; padding: 10px 16px; font: inherit; font-weight: 700; }
.app :is([data-task-track-start], [data-current-finish] button, #start-tracking, #stop-tracking):disabled { opacity: .6; cursor: not-allowed; }
.logout-form [role="alert"] { max-width: 240px; white-space: normal; color: inherit; font-size: 12px; }
.supporter-header-identity { display: grid; gap: 4px; margin: 8px 12px 12px; padding: 12px; border: 1px solid #536575; border-radius: 6px; background: #263442; color: #fff; overflow-wrap: anywhere; }
.supporter-header-identity > span { font-size: 12px; line-height: 1.5; }
.supporter-header-identity > strong { font-size: 15px; line-height: 1.4; }
.supporter-header-name { font-size: 14px; line-height: 1.4; }
.supporter-header-name strong { font-size: inherit; }
.supporter-personal-editor { margin-top: 12px; }
.supporter-personal-editor > summary { cursor: pointer; color: #065e4f; font-weight: 700; min-height: 44px; padding: 12px; box-sizing: border-box; }
.supporter-personal-editor .leader-form { margin-block: 12px 20px; }
.page-apoiador .supporter-personal-details > summary { cursor: pointer; padding: 12px; min-height: 44px; box-sizing: border-box; color: #065e4f; background: #ddf4ec; border-radius: 6px; font-weight: 700; }
.supporter-photo-editor { position: relative; flex-shrink: 0; }
.supporter-photo-editor > summary { cursor: pointer; min-width: 44px; min-height: 44px; display: grid; justify-items: center; gap: 4px; }
.supporter-photo-editor > summary span { color: #065e4f; font-size: 12px; }
.supporter-photo-controls { position: absolute; top: 100%; left: 0; z-index: 10; width: min(300px, calc(100vw - 64px)); padding: 16px; box-sizing: border-box; border: 1px solid #c8d3d9; border-radius: 6px; background: #fff; box-shadow: 0 6px 18px #0002; }
.supporter-photo-controls .profile-file-picker { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px; box-sizing: border-box; border: 1px dashed #087d68; border-radius: 6px; color: #065e4f; font-weight: 700; text-align: center; cursor: pointer; }
.supporter-photo-controls .profile-file-picker input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.supporter-photo-controls .profile-photo-submit { width: 100%; margin-top: 8px; }
.supporter-photo-controls .profile-photo-remove-form button { width: 100%; margin-top: 8px; }
.supporter-attendance-count { padding: 10px 12px; background: #ddf4ec; border-radius: 6px; color: #065e4f; }
.supporter-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.supporter-facts > div { min-width: 0; padding: 10px 0; border-bottom: 1px solid #d8e1e5; }
.supporter-facts small, .supporter-facts strong { display: block; overflow-wrap: anywhere; }
.supporter-facts small { color: #526674; font-size: 11px; }
.supporter-facts strong { color: #17252f; font-size: 14px; line-height: 1.35; }
.supporter-invite-link-row { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.supporter-invite-link-row .copy-link { flex: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.supporter-invite-link-row .button { flex: 0 0 auto; }
.supporter-invite-link-row .ui-invite-text { height: auto; min-height: 108px; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; font: inherit; line-height: 1.5; }
.affiliate-panel { overflow-x: visible; background: #fff; }
.referral-group { padding: 12px 0 18px; }
.leader-work-sections { display: grid; gap: 28px; }
.leader-work-sections > div { min-width: 0; }
.leader-work-sections > div + div { border-top: 1px solid #d8e1e5; padding-top: 20px; }
.task-group-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 17px; }
.task-summary-list { border-top: 1px solid #d8e1e5; }
.task-summary-row { padding: 14px 2px; border-bottom: 1px solid #d8e1e5; min-width: 0; overflow-wrap: anywhere; }
.task-summary-row > p { margin: 4px 0 10px; }
.task-summary-row .inline-action-form { display: inline-block; margin: 3px 8px 3px 0; }
.task-summary-row button { min-height: 40px; }
.task-summary-row .pill { margin-left: 8px; }
.task-summary-row .muted { overflow-wrap: anywhere; }
.task-summary-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.task-summary-head strong { font-size: 15px; }
.task-summary-head .pill { margin-left: 0; }
.task-summary-meta { color: #526674; font-size: 13px; line-height: 1.45; }
.task-summary-schedule { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; line-height: 1.45; }
.task-summary-schedule span { min-width: 0; }
.task-summary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.task-summary-actions .inline-action-form { margin: 0; }
.task-summary-actions button:disabled { max-width: 100%; white-space: normal; text-align: left; }
.task-summary-hint { margin: 0; color: #526674; font-size: 13px; line-height: 1.45; }
.referral-group + .referral-group { border-top: 1px solid #d8e1e5; }
.referral-leader, .referral-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.referral-leader { padding: 8px 12px 14px; border-bottom: 1px solid #d8e1e5; }
.referral-leader > span:nth-child(2), .referral-person-name { display: grid; gap: 2px; min-width: 0; flex: 1; }
.referral-leader strong, .referral-person strong { color: #17252f; overflow-wrap: anywhere; }
.referral-leader small, .referral-person small { color: #526674; font-size: 12px; overflow-wrap: anywhere; }
.referral-leader .avatar, .referral-person .avatar { width: 40px; height: 40px; flex: none; }
.referral-list { list-style: none; margin: 8px 0 0 31px; padding: 0 0 0 20px; border-left: 2px solid #a9c9be; }
.referral-list > li { position: relative; min-width: 0; padding: 3px 0 6px 8px; }
.referral-list > li::before { content: ""; position: absolute; top: 26px; left: -20px; width: 20px; border-top: 2px solid #a9c9be; }
.referral-person { min-height: 52px; padding: 8px 10px; border-bottom: 1px solid #e1e8ea; }
.referral-person .pill { flex: none; }
.referral-entry > summary { list-style: none; cursor: pointer; }
.referral-entry > summary::-webkit-details-marker { display: none; }
.referral-entry > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.referral-count { color: #065e4f; font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) {
  .referral-leader, .referral-person { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px 8px; }
  .referral-leader .avatar, .referral-person .avatar { grid-column: 1; grid-row: 1; }
  .referral-leader > span:nth-child(2), .referral-person-name { grid-column: 2; grid-row: 1; }
  .referral-leader .pill, .referral-person .pill { grid-column: 2; grid-row: 2; justify-self: start; margin-left: 0; }
  .referral-count { grid-column: 2; grid-row: 3; margin-left: 0; }
  .referral-list { margin-left: 12px; padding-left: 12px; }
  .referral-list > li { padding-left: 4px; }
  .referral-list > li::before { left: -12px; width: 12px; }
  .referral-list .referral-list .referral-list .referral-list { margin-left: 0; padding-left: 8px; border-left: 0; }
  .referral-list .referral-list .referral-list .referral-list > li::before { display: none; }
}
.page-apoiadores .referral-hierarchy {
  list-style: none;
  margin: 0;
  padding: 0;
}
.page-apoiadores .referral-hierarchy .referral-list {
  list-style: none;
  margin: 0 0 0 20px;
  padding: 0 0 0 20px;
  border-left: 2px solid #a9c9be;
}
.page-apoiadores .referral-hierarchy .referral-list > li {
  position: relative;
  min-width: 0;
  padding: 4px 0 4px 8px;
}
.page-apoiadores .referral-hierarchy .referral-list > li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 28px;
  width: 20px;
  border-top: 2px solid #a9c9be;
}
.page-apoiadores .referral-hierarchy .referral-group {
  padding: 4px 0;
  border: 0;
}
.page-apoiadores .referral-hierarchy .referral-entry {
  min-width: 0;
}
.page-apoiadores .referral-hierarchy .referral-entry > summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding-right: 34px;
}
.page-apoiadores .referral-hierarchy .referral-entry > summary::-webkit-details-marker { display: none; }
.page-apoiadores .referral-hierarchy .referral-entry > summary::after {
  content: "";
  position: absolute;
  top: 24px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
}
.page-apoiadores .referral-hierarchy .referral-entry:not([open]) > summary::after { transform: rotate(-45deg); }
.page-apoiadores .referral-hierarchy .referral-node {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.page-apoiadores .referral-hierarchy .referral-node .avatar { width: 40px; height: 40px; }
.page-apoiadores .referral-hierarchy .referral-person-name { display: grid; gap: 2px; min-width: 0; }
.page-apoiadores .referral-hierarchy .referral-person-name strong { overflow-wrap: anywhere; }
.page-apoiadores .referral-hierarchy .referral-person-name small { color: var(--muted); }
.page-apoiadores .referral-hierarchy .referral-node-meta { display: grid; gap: 2px; justify-items: end; min-width: 0; }
.page-apoiadores .referral-hierarchy .referral-count { color: var(--primary); font-weight: 700; white-space: nowrap; }
.page-apoiadores .referral-hierarchy .referral-status { color: var(--text); font-size: var(--type-xs); }
.page-apoiadores .referral-hierarchy .referral-origin {
  justify-self: start;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 8px;
  font-size: var(--type-xs);
  font-weight: 700;
}
.page-apoiadores .referral-limit-note { margin: 8px 12px; color: var(--muted); font-size: var(--type-sm); }
@media (min-width: 1100px) {
  .page-apoiadores .referral-entry--coordinator > .referral-list {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
    margin: 16px 0 0;
    padding: 16px 0 0;
    border-top: 2px solid #a9c9be;
    border-left: 0;
  }
  .page-apoiadores .referral-entry--coordinator > .referral-list::before {
    content: "";
    position: absolute;
    top: -18px;
    left: 50%;
    height: 16px;
    border-left: 2px solid #a9c9be;
  }
  .page-apoiadores .referral-entry--coordinator > .referral-list > li::before { display: none; }
}
@media (max-width: 760px) {
  .page-apoiadores .referral-hierarchy .referral-list { margin-left: 10px; padding-left: 10px; }
  .page-apoiadores .referral-hierarchy .referral-list .referral-list .referral-list .referral-list {
    margin-left: 0;
    padding-left: 4px;
    border-left: 2px solid #a9c9be;
  }
  .page-apoiadores .referral-hierarchy .referral-list > li { padding-left: 4px; }
  .page-apoiadores .referral-hierarchy .referral-list > li::before { left: -10px; width: 10px; }
  .page-apoiadores .referral-hierarchy .referral-list .referral-list .referral-list .referral-list > li { padding-left: 0; }
  .page-apoiadores .referral-hierarchy .referral-list .referral-list .referral-list .referral-list > li::before {
    display: block;
    left: -4px;
    width: 4px;
  }
  .page-apoiadores .referral-hierarchy .referral-node {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 10px 8px;
  }
  .page-apoiadores .referral-hierarchy .referral-node-meta { grid-column: 2; justify-items: start; }
  .page-apoiadores .referral-hierarchy .referral-count { grid-column: auto; grid-row: auto; margin-left: 0; }
  .page-apoiadores .referral-hierarchy .referral-entry > summary { min-height: 44px; }
  .page-apoiadores .supporter-list-panel .leader-metrics { display: grid; grid-template-columns: minmax(0, 1fr); }
}
.leader-mobile-heading { display: none; }
.leader-back-link { display: inline-flex; align-items: center; min-height: 44px; color: #065e4f; font-weight: 700; text-decoration: none; }
.task-card .leader-back-link { display: flex; width: fit-content; margin-bottom: 8px; }
.page-role-lider [data-task-location-accept] button { background: #087d68; color: #fff; border: 1px solid #087d68; border-radius: 6px; padding: 10px 16px; min-height: 44px; font-weight: 700; cursor: pointer; }
.page-role-lider [data-task-location-accept] button:hover { background: #065e4f; }
.page-role-lider [data-task-location-accept] button:disabled { cursor: wait; opacity: .65; }
.supporter-photo-controls input { max-width: 100%; }
.page-apoiador { font-family: var(--font-ui); }
.page-apoiador textarea { box-sizing: border-box; width: 100%; max-width: 100%; min-height: 104px; height: auto; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; }
.page-apoiador #invite-message { min-height: 152px; }
.page-apoiador .supporter-report-history { margin-top: 24px; padding-top: 20px; border-top: 1px solid #c8d3d9; }
.page-apoiador .supporter-report-history h3 { margin: 0 0 16px; }
.page-apoiador .supporter-primary { background: #087d68; color: #fff; border: 1px solid #087d68; min-height: 44px; padding: 12px 18px; border-radius: var(--radius-control); font: inherit; font-weight: 700; cursor: pointer; }
.page-apoiador .supporter-primary:hover { background: #065e4f; }
.page-apoiador .supporter-primary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.mobile-bottom-nav { display: none; }
.mobile-nav-shell > summary { min-height: 44px; }
.pill[data-ui-tone="waiting"] { background: #fff3c4; color: #654500; }
.pill[data-ui-tone="active"] { background: #dcecff; color: #174477; }
.pill[data-ui-tone="success"] { background: #d9f6e6; color: #145332; }
.pill[data-ui-tone="danger"] { background: #ffe1e3; color: #8b2031; }
.ui-map-pending { background: #edf1f3; position: relative; }
.ui-map-pending::after { content: 'Carregando mapa…'; position: absolute; inset: 0; display: grid; place-items: center; color: #495862; font-size: 14px; }
@media (min-width: 761px) {
  .mobile-nav-shell > summary { display: none; }
}
@media (max-width: 760px) {
  .page-role-lider .module-title { background: none; box-shadow: none; border: 0; border-bottom: 1px solid #c8d3d9; border-radius: 0; padding: 0 0 12px; margin: 0 0 16px; color: #17252f; font-size: 18px; }
  .page-role-lider .module-title::before { content: none; }
  .mobile-nav-shell.bottom-nav-complete,
  .mobile-nav-shell .nav .bottom-nav-duplicate { display: none; }
  .leader-mobile-heading { display: block; padding: 8px 12px 12px; font-size: 14px; color: #fff; font-weight: 700; }
  .page-role-lider .leader-back-link { margin: -4px 0 4px; }
  .page-role-lider .supporter-facts { grid-template-columns: 1fr; }
  .page-role-lider .supporter-invite-link-row { flex-direction: column; }
  .page-role-lider .supporter-invite-link-row .ui-invite-text { flex: none; width: 100%; box-sizing: border-box; font: 16px/1.5 var(--font-ui); }
  .page-role-lider .supporter-invite-link-row .button { width: 100%; }
  .page-apoiador .mobile-nav-shell { display: none; }
  .page-apoiador .content label { font-size: 14px; line-height: 1.5; }
  .page-apoiador .content input, .page-apoiador .content select, .page-apoiador .content textarea { font-size: 16px; }
  .page-apoiador .content .panel-title { margin-bottom: 16px; }
  .page-apoiador .module-title { background: none; box-shadow: none; border: 0; border-bottom: 1px solid #c8d3d9; border-radius: 0; padding: 0 0 12px; margin: 0 0 16px; color: #17252f; font-size: 18px; }
  .page-apoiador .module-title::before { content: none; }
  .page-apoiador .mobile-nav-shell > summary { height: 44px; box-sizing: border-box; }
  html { scroll-padding-top: 150px; scroll-padding-bottom: 90px; }
  html, body { overflow-x: clip; }
  .app { display: block; overflow: visible; font-family: var(--font-ui); }
  .sidebar {
    --header-safe-top: env(safe-area-inset-top, 0px);
    position: sticky; top: 0; z-index: 1001; height: auto; overflow: visible;
    padding-top: var(--header-safe-top); background: #0f172a;
  }
  /* Cover the inset above a sticky header when iOS offsets the scroll viewport. */
  .sidebar::before {
    content: ''; position: absolute; left: 0; right: 0;
    top: calc(-1 * var(--header-safe-top)); height: var(--header-safe-top);
    background: #0f172a; pointer-events: none;
  }
  .sidebar .brand { min-height: 56px; padding: 8px 12px; }
  .sidebar .brand .app-mark { width: 38px; height: 38px; object-fit: contain; }
  .sidebar .brand-copy p { font-size: 11px; line-height: 1.25; max-width: 210px; margin: 2px 0 0; }
  .mobile-header-compact .sidebar .brand-copy p { display: none; }
  .mobile-header-compact .sidebar .brand { min-height: 48px; padding-block: 4px; }
  .mobile-nav-shell { position: relative; padding: 0 12px 8px; }
  .mobile-nav-shell > summary { display: flex; align-items: center; gap: 12px; padding: 8px 12px; color: white; background: #263442; border-radius: 6px; cursor: pointer; }
  .mobile-nav-shell > summary strong { margin-left: auto; white-space: normal; text-align: right; font-size: 14px; }
  .mobile-nav-shell > summary span { letter-spacing: 0; }
  .mobile-nav-shell .nav { display: grid; position: absolute; top: 100%; left: 12px; right: 12px; max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain; background: #182633; padding: 8px; border-radius: 6px; box-shadow: 0 6px 18px #0003; }
  .mobile-nav-shell:not([open]) .nav { display: none; }
  .mobile-nav-shell .nav a { width: 100%; white-space: normal; }
  .mobile-bottom-nav { display: flex; position: fixed; inset: auto 0 0; z-index: 1002; background: #fff; border-top: 1px solid #c8d3d9; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); gap: 4px; }
  .mobile-bottom-nav a { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 6px 3px; font-size: 12px; font-weight: 700; line-height: 1.3; color: #374650; text-align: center; text-decoration: none; border-radius: 6px; overflow-wrap: anywhere; }
  .mobile-bottom-nav a.active { color: #065e4f; background: #ddf4ec; box-shadow: inset 0 3px #087d68; }
  .topbar { position: static; padding: 12px; gap: 8px; box-shadow: none; }
  .topbar h1 { font-size: var(--type-mobile-title); line-height: 1.35; }
  .top-actions { display: flex; flex-wrap: wrap; overflow: visible; gap: 8px; }
  .top-actions .button { white-space: normal; width: auto; font-size: 12px; }
  .content { padding: var(--space-2) var(--space-2) calc(88px + env(safe-area-inset-bottom)); }
  .content > .panel, .content > .hero { padding: var(--space-3); margin-bottom: var(--space-3); border-radius: var(--radius-panel); box-shadow: none; }
  .content h2, .module-title { font-size: var(--type-mobile-title); line-height: 1.3; letter-spacing: 0; }
  .content h1, .content h2, .content h3 { font-family: var(--font-ui); }
  .content h3 { font-size: var(--type-section); line-height: 1.4; }
  .content p { font-size: var(--type-sm); line-height: 1.5; }
  .content .eyebrow { font-size: var(--type-xs); letter-spacing: 0; line-height: 1.4; }
  .content .muted { color: #4e606e; }
  button, .button, .nav a, summary, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
  button, .button { min-width: 44px; }
  .app button, .app input, .app select, .app textarea { font: inherit; }
  .sidebar .logout-chip { min-width: 44px; min-height: 44px; height: auto; }
  button, .button, summary, a { touch-action: manipulation; }
  .leader-row, .leader-row > div, .leader-metrics { min-width: 0; }
  .leader-row { gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-panel); }
  .leader-row strong { overflow-wrap: anywhere; }
  .leader-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
  .leader-metrics > span { flex: 1 1 110px; min-width: 0; padding: 10px; border-radius: var(--radius-control); }
  .leader-metrics strong { font-size: 17px; }
  .panel-head { gap: var(--space-2); margin-bottom: var(--space-3); }
  .panel-head h2 { margin: 0; }
  .pill { min-height: 24px; line-height: 1.4; font-size: var(--type-xs); padding: 3px 8px; }
  .leaflet-control-zoom a { display: block; box-sizing: border-box; min-width: 44px; min-height: 44px; line-height: 44px; }
  .leaflet-control-attribution { max-width: calc(100vw - 24px); font-size: var(--type-xs); line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
  :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
  .sidebar :focus-visible, .mobile-nav-shell .nav :focus-visible { outline-color: #fff; }
}
