:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #5d6963;
  --line: #d8dfda;
  --line-strong: #bcc8c0;
  --surface: #ffffff;
  --surface-soft: #f4f6f4;
  --page: #eaeeeb;
  --green: #176b4a;
  --green-dark: #0e4f36;
  --green-soft: #e5f1eb;
  --coral: #c84f38;
  --focus: #1f78c1;
  --sidebar-width: 250px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  padding: 24px 18px;
  background: #13251d;
  color: #f4f7f5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #628173;
  border-radius: 6px;
  color: #cfe8da;
  font-size: 13px;
  font-weight: 800;
}

.brand div {
  display: grid;
}

.brand strong {
  font-size: 16px;
}

.brand span:last-child {
  color: #aebdb6;
  font-size: 13px;
}

.record-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #395247;
  border-radius: 6px;
  background: #1a3026;
}

.record-summary span {
  color: #9fb2a9;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.record-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-summary strong + span {
  margin-top: 10px;
}

.section-nav {
  display: grid;
  gap: 6px;
}

.section-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  color: #b9c7c0;
  text-decoration: none;
}

.section-nav a:hover,
.section-nav a.active {
  border-left-color: #6fd09f;
  background: #1c3529;
  color: #ffffff;
}

.section-nav a span {
  color: #7f978c;
  font-size: 11px;
  font-weight: 800;
}

.progress-box {
  margin-top: auto;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #c6d3cd;
  font-size: 12px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #31493e;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #6fd09f;
  transition: width 180ms ease;
}

.workspace {
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 0 34px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
  margin: 0 -34px;
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
  background: rgb(234 238 235 / 94%);
  backdrop-filter: blur(12px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 25px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.access-back-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.access-back-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.icon-button,
.text-button,
.primary-button,
.collapse-button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.text-button,
.primary-button {
  padding: 0 14px;
  font-size: 13px;
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.icon-button:hover,
.text-button:hover,
.collapse-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.primary-button:hover {
  background: var(--green-dark);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1180px;
  margin: 24px auto 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.status-strip > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px 16px;
}

.status-strip > div + div {
  border-left: 1px solid var(--line);
}

.status-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-strip strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#diagnosis-form {
  max-width: 1180px;
  margin: 22px auto 0;
}

.form-section {
  margin-bottom: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  scroll-margin-top: 116px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

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

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field.is-missing {
  margin: -10px;
  padding: 10px;
  border: 2px solid #b42318;
  border-radius: 6px;
  background: #fff1f0;
}

.field.is-missing > label,
.field.is-missing > .field-label {
  color: #8f1d15;
}

.field.is-missing input[type="text"],
.field.is-missing input[type="date"],
.field.is-missing input[type="number"],
.field.is-missing input[type="url"],
.field.is-missing input[type="file"],
.field.is-missing select,
.field.is-missing textarea,
.field.is-missing .choice {
  border-color: #c9473d;
}

.missing-field-note {
  display: block;
  margin-top: 7px;
  color: #a1261c;
  font-size: 12px;
  font-weight: 800;
}

.field[hidden],
.schema-group[hidden],
.conditional-block[hidden] {
  display: none;
}

.field > label,
.field > .field-label {
  display: block;
  margin-bottom: 7px;
  color: #26332d;
  font-size: 13px;
  font-weight: 700;
}

.required-mark {
  margin-left: 3px;
  color: var(--coral);
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="url"],
select,
textarea {
  padding: 10px 12px;
}

input[type="file"] {
  padding: 8px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #87988e;
}

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

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

.choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: #34413b;
  font-size: 13px;
}

.choice:has(input:checked) {
  border-color: #69a589;
  background: var(--green-soft);
  color: var(--green-dark);
}

.choice input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.field-hint,
.file-selection {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.file-selection.needs-selection {
  color: #a54131;
  font-weight: 700;
}

.file-selection a {
  color: #176846;
  font-weight: 700;
  text-underline-offset: 2px;
}

.repeat-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.repeat-item {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
}

.repeat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f9f7;
}

.repeat-title {
  display: grid;
  min-width: 0;
}

.repeat-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.repeat-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapse-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  font-size: 19px;
}

.repeat-body {
  padding: 22px;
}

.repeat-body[hidden] {
  display: none;
}

.schema-group + .schema-group {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.group-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 17px;
}

.group-heading span {
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 6px;
  background: #17211d;
  color: #fff;
  box-shadow: 0 12px 28px rgb(18 33 26 / 20%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 210px;
  }

  .workspace {
    padding-inline: 22px;
  }

  .topbar {
    margin-inline: -22px;
    padding-inline: 22px;
  }

  .field-grid.two,
  .choice-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
  }

  .record-summary,
  .progress-box {
    display: none;
  }

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

  .section-nav a {
    justify-content: center;
    min-width: 0;
    padding: 8px 4px;
    border-bottom: 3px solid transparent;
    border-left: 0;
    font-size: 12px;
  }

  .section-nav a:hover,
  .section-nav a.active {
    border-bottom-color: #6fd09f;
    border-left: 0;
  }

  .workspace {
    margin-left: 0;
    padding: 0 12px 36px;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    margin: 0 -12px;
    padding: 16px 12px;
  }

  .actions {
    max-width: 190px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  .status-strip > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .form-section {
    padding: 20px 16px;
  }

  .section-heading {
    gap: 12px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .repeat-body {
    padding: 18px 14px;
  }
}

@media (max-width: 470px) {
  .topbar {
    display: grid;
  }

  .actions {
    max-width: none;
    justify-content: flex-start;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 21px;
  }

  .section-nav a span {
    display: none;
  }
}

@media print {
  body {
    background: #fff;
    font-size: 11px;
  }

  .sidebar,
  .actions,
  .status-strip,
  .collapse-button,
  .toast {
    display: none !important;
  }

  .workspace {
    margin: 0;
    padding: 0;
  }

  .topbar {
    position: static;
    min-height: auto;
    margin: 0 0 16px;
    padding: 0 0 12px;
    background: #fff;
  }

  #diagnosis-form {
    max-width: none;
    margin: 0;
  }

  .form-section {
    break-inside: avoid-page;
    margin-bottom: 12px;
    padding: 16px;
  }

  .repeat-item,
  .schema-group,
  .field {
    break-inside: avoid;
  }

  .repeat-body[hidden] {
    display: block;
  }

  input,
  select,
  textarea {
    border-color: #aaa !important;
    color: #000;
  }

  .choice {
    min-height: 0;
    padding: 5px;
  }
}

.home-page {
  min-width: 320px;
  background: #102118;
}

.home-hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 64px);
  overflow: hidden;
  align-items: center;
  background-color: #16251d;
  background-image: url("/hero-reciclagem-desktop.webp");
  background-image: image-set(
    url("/hero-reciclagem-desktop.avif") type("image/avif"),
    url("/hero-reciclagem-desktop.webp") type("image/webp")
  );
  background-position: center;
  background-size: cover;
}

.home-hero::before {
  position: absolute;
  inset: 0;
  background: rgb(10 24 17 / 72%);
  content: "";
}

.home-account-actions {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-account-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgb(255 255 255 / 64%);
  border-radius: 6px;
  background: rgb(16 33 24 / 78%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.home-account-button.secondary {
  background: rgb(16 33 24 / 48%);
}

.home-account-button.admin {
  border-color: #b9ccef;
  background: rgb(31 63 120 / 84%);
}

.home-account-button:hover,
.home-account-button:focus-visible {
  border-color: #fff;
  background: #176b4a;
}

.home-account-button[hidden] {
  display: none;
}

.home-content {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 48px));
  margin-left: clamp(24px, 9vw, 150px);
  padding: 48px 0;
  color: #fff;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 52px;
  font-size: 15px;
  font-weight: 800;
}

.home-brand .brand-mark {
  border-color: #8bb7a0;
  color: #e7f4eb;
}

.home-kicker {
  margin-bottom: 10px;
  color: #cdebd8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-content h1 {
  max-width: 620px;
  margin-bottom: 18px;
  font-size: 48px;
  line-height: 1.04;
}

.home-lede {
  max-width: 570px;
  margin-bottom: 34px;
  color: #e1e9e4;
  font-size: 18px;
}

.entry-actions {
  display: grid;
  width: min(600px, 100%);
  gap: 10px;
}

.entry-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  min-height: 66px;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgb(231 244 235 / 45%);
  border-radius: 6px;
  background: rgb(16 33 24 / 72%);
  color: #fff;
  text-decoration: none;
}

.entry-link[hidden] {
  display: none;
}

.entry-link:hover,
.entry-link:focus-visible {
  border-color: #fff;
  background: #176b4a;
}

.entry-link span {
  color: #b7d8c2;
  font-size: 12px;
  font-weight: 800;
}

.entry-link strong {
  min-width: 0;
  font-size: 16px;
}

.entry-link b {
  font-size: 23px;
  font-weight: 400;
}

.home-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  background: #f2f5f2;
  color: #45544c;
  font-size: 13px;
  text-align: center;
}

/* Acompanhamento do Programa */
.program-page {
  min-width: 320px;
  min-height: 100vh;
  background: #eef3ef;
}

.program-main {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 68px 0 84px;
}

.program-heading {
  max-width: 720px;
  margin-bottom: 36px;
}

.program-heading .eyebrow {
  color: #176846;
}

.program-heading h1 {
  margin: 7px 0 14px;
  color: #183127;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.08;
}

.program-heading p:last-child {
  margin: 0;
  color: #5d6c64;
  font-size: 17px;
  line-height: 1.65;
}

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

.program-action {
  display: grid;
  min-height: 240px;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 26px;
  border: 1px solid #c9d5ce;
  border-radius: 8px;
  background: #fff;
  color: #183127;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.program-action:hover,
.program-action:focus-visible {
  border-color: #176846;
  box-shadow: 0 14px 34px rgb(17 67 46 / 12%);
  transform: translateY(-3px);
}

.program-action-number {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #e3f0e8;
  color: #176846;
  font-size: 12px;
  font-weight: 900;
}

.program-action strong {
  align-self: center;
  font-size: 22px;
  line-height: 1.25;
}

.program-action-arrow {
  color: #176846;
  font-size: 25px;
}

.program-placeholder {
  display: grid;
  min-height: calc(100vh - 76px);
  place-items: center;
  padding: 56px 24px;
}

.program-placeholder-card {
  width: min(680px, 100%);
  padding: 46px;
  border: 1px solid #c9d5ce;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgb(17 67 46 / 9%);
}

.program-placeholder-card h1 {
  margin: 8px 0 15px;
  color: #183127;
  font-size: clamp(29px, 5vw, 42px);
  line-height: 1.12;
}

.program-placeholder-card p:not(.eyebrow) {
  margin: 0 0 28px;
  color: #5d6c64;
  font-size: 16px;
  line-height: 1.65;
}

.program-placeholder-card .map-return {
  display: inline-flex;
}

/* Edição de diagnósticos */
.diagnosis-edit-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.diagnosis-edit-heading {
  max-width: 900px;
}

.diagnosis-edit-summary {
  display: grid;
  grid-template-columns: 190px 190px minmax(260px, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.diagnosis-edit-summary > div,
.diagnosis-edit-summary > label {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid #cad6ce;
  border-radius: 8px;
  background: #fff;
}

.diagnosis-edit-summary span {
  color: #64736b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.diagnosis-edit-summary strong {
  color: #173f2f;
  font-size: 25px;
}

.diagnosis-edit-summary input {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #aebdb4;
  border-radius: 5px;
  color: #182b22;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.diagnosis-edit-summary input:focus {
  border-color: #176846;
  box-shadow: 0 0 0 3px rgb(23 104 70 / 13%);
  outline: 0;
}

.diagnosis-edit-message {
  margin-bottom: 18px;
  padding: 13px 15px;
  border: 1px solid #9bc4ad;
  border-radius: 6px;
  background: #eaf5ee;
  color: #174c35;
  font-size: 13px;
  font-weight: 750;
}

.diagnosis-edit-message.error {
  border-color: #dfaaa2;
  background: #fbecea;
  color: #852e22;
}

.diagnosis-edit-message[hidden] {
  display: none;
}

.diagnosis-edit-results > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px 18px;
  border-bottom: 1px solid #ccd7d0;
}

.diagnosis-edit-results h2 {
  margin: 5px 0 0;
  color: #203b30;
  font-size: 24px;
}

.diagnosis-edit-results > header > p {
  margin: 0;
  color: #68766e;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.diagnosis-edit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
}

.diagnosis-edit-card {
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid #c9d5ce;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(17 67 46 / 6%);
}

.diagnosis-edit-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.diagnosis-edit-card h3 {
  margin: 4px 0 3px;
  color: #183127;
  font-size: 22px;
  line-height: 1.2;
}

.diagnosis-edit-card header p {
  margin: 0;
  color: #718078;
  font-size: 12px;
  font-weight: 650;
}

.diagnosis-edit-region {
  color: #176846;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.diagnosis-edit-version {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #e4f1e9;
  color: #176846;
  font-size: 11px;
  font-weight: 900;
}

.diagnosis-edit-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.diagnosis-edit-details > div {
  min-width: 0;
  padding: 11px;
  border-radius: 6px;
  background: #f2f6f3;
}

.diagnosis-edit-details dt {
  color: #718078;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.diagnosis-edit-details dd {
  margin: 5px 0 0;
  color: #263a31;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.diagnosis-edit-card > footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 17px;
  border-top: 1px solid #e0e7e2;
}

.diagnosis-edit-secondary {
  color: #526159;
  font-size: 12px;
  font-weight: 800;
  text-underline-offset: 3px;
}

.diagnosis-edit-primary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #176846;
  border-radius: 6px;
  background: #176846;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.diagnosis-edit-primary:hover,
.diagnosis-edit-primary:focus-visible {
  background: #0f5638;
}

.diagnosis-edit-primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.diagnosis-edit-workflow {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.diagnosis-edit-workflow small {
  color: #6d7972;
  font-size: 10px;
  font-weight: 650;
}

.diagnosis-edit-state {
  display: grid;
  grid-column: 1 / -1;
  min-height: 190px;
  place-content: center;
  gap: 7px;
  padding: 28px;
  border: 1px dashed #b7c5bc;
  border-radius: 8px;
  color: #66756d;
  text-align: center;
}

.diagnosis-edit-state strong {
  color: #284036;
  font-size: 17px;
}

.diagnosis-edit-state.error strong {
  color: #852e22;
}

.activity-main {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.activity-page-heading {
  display: grid;
  max-width: 820px;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 20px;
  margin-bottom: 34px;
}

.activity-step {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: #176846;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.activity-page-heading h1 {
  margin: 6px 0 12px;
  color: #17362a;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.08;
}

.activity-page-heading div > p:last-child {
  max-width: 700px;
  margin: 0;
  color: #5d6b64;
  font-size: 16px;
  line-height: 1.6;
}

.activity-form {
  display: grid;
  gap: 18px;
}

.activity-form-section {
  overflow: hidden;
  border: 1px solid #cad5ce;
  border-radius: 9px;
  background: #fff;
}

.activity-section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 26px;
  border-bottom: 1px solid #dbe2dd;
  background: #f8faf8;
}

.activity-section-heading > span {
  color: #176846;
  font-size: 12px;
  font-weight: 900;
}

.activity-section-heading p {
  margin: 0 0 2px;
  color: #758079;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-section-heading h2,
.activity-section-heading h3 {
  margin: 0;
  color: #233b31;
  font-size: 19px;
}

.activity-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 20px;
  padding: 28px 26px 32px;
}

.activity-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #263c32;
  font-size: 13px;
  font-weight: 800;
}

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

.activity-field b,
.activity-binary-question b {
  color: #a13d2d;
}

.activity-field input,
.activity-field select,
.activity-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #aebdb4;
  border-radius: 6px;
  background: #fff;
  color: #182b22;
  font: inherit;
  font-weight: 600;
}

.activity-field textarea {
  min-height: 138px;
  resize: vertical;
  line-height: 1.55;
}

.activity-field input:focus,
.activity-field select:focus,
.activity-field textarea:focus {
  border-color: #176846;
  box-shadow: 0 0 0 3px rgb(23 104 70 / 13%);
  outline: 0;
}

.activity-field select:disabled {
  background: #f1f4f2;
  color: #6a756f;
}

.activity-field small {
  margin: 0;
  color: #738078;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.activity-other-field {
  margin-top: 10px;
}

.activity-question-list {
  display: grid;
  padding: 0 26px;
}

.activity-binary-question {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid #e0e6e2;
}

.activity-binary-question:last-child {
  border-bottom: 0;
}

.activity-binary-question legend {
  display: contents;
  color: #2d4037;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.activity-radio-group {
  display: flex;
  gap: 7px;
}

.activity-radio-group label {
  position: relative;
  cursor: pointer;
}

.activity-radio-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.activity-radio-group span {
  display: inline-flex;
  min-width: 68px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8c5bd;
  border-radius: 5px;
  background: #fff;
  color: #46564e;
  font-size: 12px;
  font-weight: 850;
}

.activity-radio-group input:focus-visible + span {
  outline: 3px solid rgb(23 104 70 / 20%);
  outline-offset: 2px;
}

.activity-radio-group input:checked + span {
  border-color: #176846;
  background: #176846;
  color: #fff;
}

.activity-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px 22px;
  margin: 6px 26px 28px;
  padding: 19px;
  border: 1px dashed #8aac99;
  border-radius: 7px;
  background: #f3f8f5;
}

.activity-upload[hidden],
.activity-other-field[hidden],
.program-info-conditional[hidden] {
  display: none;
}

.activity-upload strong {
  color: #214a38;
  font-size: 13px;
}

.activity-upload p {
  margin: 4px 0 0;
  color: #6a786f;
  font-size: 11px;
  line-height: 1.45;
}

.activity-photo-upload {
  margin-top: 0;
}

.activity-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.activity-file-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid #176846;
  border-radius: 5px;
  background: #fff;
  color: #176846;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.activity-file-button:hover,
.activity-file-button:focus-visible {
  background: #e7f2eb;
  outline: 3px solid rgb(23 104 70 / 20%);
  outline-offset: 2px;
}

.activity-file-name {
  grid-column: 1 / -1;
  color: #54635b;
  font-size: 11px;
  font-weight: 700;
}

.activity-notes {
  margin: 0 26px 30px;
}

.activity-notes small {
  text-align: right;
}

.activity-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

.activity-form-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 14px;
  color: #5c6962;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.activity-form-actions button {
  min-width: 132px;
  min-height: 46px;
  padding: 9px 22px;
  border: 1px solid #176846;
  border-radius: 6px;
  background: #176846;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.activity-form-actions button:hover,
.activity-form-actions button:focus-visible {
  background: #0f5638;
}

.activity-form-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.activity-message {
  padding: 14px 16px;
  border: 1px solid #9bc4ad;
  border-radius: 6px;
  background: #eaf5ee;
  color: #174c35;
  font-size: 13px;
  font-weight: 750;
}

.activity-message.error {
  border-color: #dfaaa2;
  background: #fbecea;
  color: #852e22;
}

.activity-message[hidden] {
  display: none;
}

/* Visualização de atividades */
.activities-view-main {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.activities-view-heading {
  max-width: 880px;
}

.activities-dashboard {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.activities-filter-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid #c9d5ce;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(17 67 46 / 7%);
}

.activities-filter-panel h2,
.activities-results-heading h2 {
  margin: 5px 0 0;
  color: #203b30;
  font-size: 21px;
}

.activities-filter-panel form {
  display: grid;
  gap: 17px;
  margin-top: 25px;
}

.activities-filter-panel label {
  display: grid;
  gap: 7px;
  color: #2d4037;
  font-size: 12px;
  font-weight: 850;
}

.activities-filter-panel select,
.activities-filter-panel input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #aebdb4;
  border-radius: 6px;
  background: #fff;
  color: #182b22;
  font: inherit;
  font-weight: 650;
}

.activities-filter-panel select:focus,
.activities-filter-panel input:focus {
  border-color: #176846;
  box-shadow: 0 0 0 3px rgb(23 104 70 / 13%);
  outline: 0;
}

.activities-presence-filter {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.activities-presence-filter legend {
  padding: 0;
  color: #2d4037;
  font-size: 12px;
  font-weight: 850;
}

.activities-presence-filter > p {
  margin: -3px 0 2px;
  color: #68766e;
  font-size: 11px;
  font-weight: 650;
}

.activities-presence-options {
  display: grid;
  overflow: hidden;
  border: 1px solid #aebdb4;
  border-radius: 6px;
  background: #fff;
}

.activities-filter-panel .activities-presence-options label {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.activities-filter-panel .activities-presence-options label + label {
  border-top: 1px solid #e1e8e4;
}

.activities-filter-panel .activities-presence-options label:hover {
  background: #f3f7f4;
}

.activities-filter-panel .activities-presence-options input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  padding: 0;
  accent-color: #176846;
}

.activities-filter-panel .activities-presence-options label:has(input:focus-visible) {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px #176846;
}

.activities-custom-period {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.activities-custom-period[hidden] {
  display: none;
}

.activities-filter-panel button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #176846;
  border-radius: 6px;
  background: #176846;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.activities-filter-panel button:hover,
.activities-filter-panel button:focus-visible {
  background: #0f5638;
}

.activities-filter-panel .activities-clear-filters {
  margin-top: -8px;
  border-color: transparent;
  background: transparent;
  color: #647169;
}

.activities-filter-panel .activities-clear-filters:hover,
.activities-filter-panel .activities-clear-filters:focus-visible {
  background: #edf3ef;
}

.activities-results {
  min-width: 0;
}

.activities-results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 3px 2px 18px;
  border-bottom: 1px solid #ccd7d0;
}

.activities-results-heading > p {
  margin: 0;
  color: #68766e;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.activities-list {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.activities-state {
  display: grid;
  min-height: 220px;
  place-content: center;
  gap: 5px;
  padding: 32px;
  border: 1px dashed #b9c7be;
  border-radius: 9px;
  background: #f8faf8;
  color: #536159;
  text-align: center;
}

.activities-state strong {
  color: #294438;
  font-size: 16px;
}

.activities-state span {
  font-size: 13px;
}

.activities-state.error {
  border-color: #dfaaa2;
  background: #fbecea;
  color: #852e22;
}

.activity-record {
  overflow: hidden;
  border: 1px solid #cbd6cf;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(17 67 46 / 6%);
}

.activity-record-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 21px 23px;
  border-bottom: 1px solid #dce4df;
  background: #f8faf8;
}

.activity-record-date {
  display: grid;
  width: 58px;
  min-height: 58px;
  place-content: center;
  border-radius: 7px;
  background: #176846;
  color: #fff;
  text-align: center;
}

.activity-record-date strong {
  font-size: 23px;
  line-height: 1;
}

.activity-record-date span {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 800;
}

.activity-record-title {
  min-width: 0;
}

.activity-record-type {
  display: block;
  margin-bottom: 4px;
  overflow: hidden;
  color: #176846;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.activity-record-title h3 {
  margin: 0;
  color: #203a2f;
  font-size: 20px;
}

.activity-record-title p {
  margin: 4px 0 0;
  color: #6c7972;
  font-size: 11px;
  font-weight: 700;
}

.activity-record-attendees {
  padding: 7px 10px;
  border-radius: 999px;
  background: #e7f2eb;
  color: #176846;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.activity-record-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 20px 23px;
  border-bottom: 1px solid #e1e7e3;
}

.activity-record-detail {
  display: grid;
  gap: 4px;
}

.activity-record-detail dt {
  color: #77827c;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.activity-record-detail dd {
  margin: 0;
  color: #263d33;
  font-size: 13px;
  font-weight: 800;
}

.activity-record-participation,
.activity-record-notes {
  padding: 20px 23px;
  border-bottom: 1px solid #e1e7e3;
}

.activity-record-participation h4,
.activity-record-notes h4 {
  margin: 0 0 13px;
  color: #33483e;
  font-size: 12px;
}

.activity-record-participation ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-record-participation li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4c5b53;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.activity-record-answer {
  min-width: 34px;
  color: #176846;
  font-size: 10px;
  font-weight: 900;
}

.activity-record-participation li.no .activity-record-answer {
  color: #8a4337;
}

.activity-record-notes p {
  margin: 0;
  color: #536159;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.activity-record-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 23px;
  color: #77827c;
  font-size: 10px;
  font-weight: 700;
}

.activities-view-message {
  margin-top: 16px;
}

.activity-record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.activity-record-attachments {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.activity-record-attachments a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #aac3b4;
  border-radius: 5px;
  color: #176846;
  font-size: 10px;
  font-weight: 850;
  text-decoration: none;
}

.activity-record-attachments a:hover,
.activity-record-attachments a:focus-visible {
  background: #e7f2eb;
}

.activity-record-edit {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #176846;
  border-radius: 5px;
  background: #176846;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
}

.activity-record-edit:hover,
.activity-record-edit:focus-visible {
  background: #0f5638;
  outline: 3px solid rgb(23 104 70 / 16%);
  outline-offset: 2px;
}

.activity-edit-dialog {
  width: min(820px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: #f3f6f4;
  box-shadow: -18px 0 60px rgb(10 30 20 / 24%);
}

.activity-edit-dialog::backdrop {
  background: rgb(10 24 17 / 58%);
}

.activity-edit-panel {
  display: grid;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr);
}

.activity-edit-panel-heading {
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
  padding: 24px 28px;
  border-bottom: 1px solid #cad5ce;
  background: #fff;
}

.activity-edit-panel-heading h2 {
  margin: 5px 0 6px;
  color: #17362a;
  font-size: clamp(24px, 4vw, 31px);
}

.activity-edit-panel-heading > div > p:last-child {
  margin: 0;
  color: #6a786f;
  font-size: 12px;
  font-weight: 700;
}

.activity-edit-panel-heading > button {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #bdc9c1;
  border-radius: 50%;
  background: #fff;
  color: #31453b;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.activity-edit-panel-heading > button:hover,
.activity-edit-panel-heading > button:focus-visible {
  border-color: #176846;
  background: #edf5f0;
  outline: 3px solid rgb(23 104 70 / 14%);
}

.activity-edit-form {
  overflow-y: auto;
  padding: 22px 24px 28px;
}

.activity-edit-current-file {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  padding-top: 13px;
  border-top: 1px solid #cadbd0;
  color: #5d6b63;
  font-size: 11px;
  font-weight: 700;
}

.activity-edit-current-file[hidden] {
  display: none;
}

.activity-edit-current-file > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.activity-edit-current-file a {
  color: #176846;
  font-weight: 850;
  text-underline-offset: 3px;
}

.activity-edit-current-file small {
  color: #6f7c74;
  font-weight: 600;
}

.activity-edit-panel-footer {
  position: sticky;
  bottom: -28px;
  display: grid;
  gap: 12px;
  margin: 0 -24px -28px;
  padding: 16px 24px 20px;
  border-top: 1px solid #cad5ce;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 -10px 24px rgb(17 67 46 / 7%);
}

.activity-edit-panel-footer .activity-form-actions {
  padding-top: 0;
}

.activity-form-actions .activity-edit-cancel {
  min-width: 112px;
  border-color: #aebdb4;
  background: #fff;
  color: #506057;
}

.activity-form-actions .activity-edit-cancel:hover,
.activity-form-actions .activity-edit-cancel:focus-visible {
  border-color: #7f9186;
  background: #edf2ef;
  color: #2d4037;
}

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

  .activities-filter-panel {
    position: static;
  }

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

  .diagnosis-edit-summary > label {
    grid-column: 1 / -1;
  }

  .diagnosis-edit-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .program-actions {
    grid-template-columns: 1fr;
  }

  .program-action {
    min-height: 180px;
  }

}

@media (max-width: 600px) {
  .program-main {
    width: min(100% - 32px, 1040px);
    padding: 44px 0 60px;
  }

  .program-placeholder-card {
    padding: 30px 24px;
  }

  .activity-main {
    width: min(100% - 28px, 980px);
    padding: 38px 0 60px;
  }

  .diagnosis-edit-main {
    width: min(100% - 28px, 1120px);
    padding: 38px 0 60px;
  }

  .diagnosis-edit-summary {
    grid-template-columns: 1fr;
  }

  .diagnosis-edit-summary > label {
    grid-column: auto;
  }

  .diagnosis-edit-results > header,
  .diagnosis-edit-card > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .diagnosis-edit-results > header > p {
    text-align: left;
  }

  .diagnosis-edit-details {
    grid-template-columns: 1fr;
  }

  .diagnosis-edit-workflow {
    justify-items: stretch;
  }

  .activity-page-heading {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .activity-step {
    width: 42px;
    height: 42px;
  }

  .activity-field-grid {
    grid-template-columns: 1fr;
    padding: 24px 18px 27px;
  }

  .activity-field-wide {
    grid-column: 1;
  }

  .activity-section-heading {
    padding: 18px;
  }

  .activity-question-list {
    padding: 0 18px;
  }

  .activity-binary-question {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .activity-upload {
    grid-template-columns: 1fr;
    margin: 4px 18px 25px;
  }

  .activity-file-name {
    grid-column: 1;
  }

  .activity-notes {
    margin: 0 18px 26px;
  }

  .activity-form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .activity-form-actions a,
  .activity-form-actions button {
    justify-content: center;
    width: 100%;
  }

  .activities-view-main {
    width: min(100% - 28px, 1200px);
    padding: 38px 0 60px;
  }

  .activities-results-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .activities-results-heading > p {
    text-align: left;
  }

  .activity-record-header {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
  }

  .activity-record-attendees {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .activity-record-details,
  .activity-record-participation ul {
    grid-template-columns: 1fr;
  }

  .activity-record-details,
  .activity-record-participation,
  .activity-record-notes {
    padding-right: 18px;
    padding-left: 18px;
  }

  .activity-record-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 18px;
  }

  .activity-record-attachments {
    justify-content: flex-start;
  }

  .activity-record-actions {
    justify-content: flex-start;
  }

  .activity-edit-panel-heading {
    padding: 19px 18px;
  }

  .activity-edit-form {
    padding: 14px 14px 24px;
  }

  .activity-edit-panel-footer {
    bottom: -24px;
    margin: 0 -14px -24px;
    padding: 14px 14px 18px;
  }
}

/* Sobre o Programa */
.about-page {
  min-width: 320px;
  background: #f2f5f2;
}

.about-hero {
  position: relative;
  display: flex;
  min-height: 300px;
  align-items: end;
  overflow: hidden;
  padding: 48px max(24px, calc((100% - 1040px) / 2));
  background-color: #16251d;
  background-image: url("/hero-reciclagem-desktop.webp");
  background-image: image-set(
    url("/hero-reciclagem-desktop.avif") type("image/avif"),
    url("/hero-reciclagem-desktop.webp") type("image/webp")
  );
  background-position: center 42%;
  background-size: cover;
  color: #fff;
}

.about-hero::before {
  position: absolute;
  inset: 0;
  background: rgb(10 24 17 / 72%);
  content: "";
}

.about-hero > div {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
}

.about-hero .eyebrow {
  color: #cdebd8;
}

.about-hero h1 {
  margin: 6px 0 0;
  font-size: 42px;
  line-height: 1.08;
}

.about-content {
  width: min(100% - 48px, 900px);
  margin: 0 auto;
  padding: 46px 0 64px;
  color: #26352d;
  font-size: 17px;
  line-height: 1.75;
}

.about-content p {
  margin: 0;
}

.about-content p + p {
  margin-top: 24px;
}

.about-content a {
  color: #0d6242;
  font-weight: 700;
}

.about-external-link {
  overflow-wrap: anywhere;
}

@media (max-width: 660px) {
  .about-hero {
    min-height: 240px;
    padding: 36px 20px;
  }

  .about-hero h1 {
    font-size: 30px;
  }

  .about-content {
    width: min(100% - 36px, 900px);
    padding: 34px 0 48px;
    font-size: 15px;
  }
}

/* Administração de usuários */
.admin-page {
  min-width: 320px;
  min-height: 100vh;
  background: #edf1ee;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #cfd8d2;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(10px);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.admin-brand > span:last-child {
  display: grid;
}

.admin-brand strong {
  font-size: 15px;
}

.admin-brand small {
  color: var(--muted);
  font-size: 12px;
}

.admin-account-nav {
  display: flex;
  gap: 8px;
}

.access-back-button.danger {
  border-color: #d5b2ac;
  color: #8c3024;
}

.admin-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.admin-heading {
  margin-bottom: 28px;
}

.admin-heading h1 {
  font-size: 31px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 30px;
  border-top: 1px solid #cbd5ce;
  border-bottom: 1px solid #cbd5ce;
}

.admin-metrics div {
  padding: 18px 20px;
  border-left: 1px solid #cbd5ce;
}

.admin-metrics div:first-child {
  border-left: 0;
}

.admin-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-metrics dd {
  margin: 4px 0 0;
  color: #1d3e31;
  font-size: 25px;
  font-weight: 800;
}

.admin-metrics .admin-metric-status {
  padding-top: 5px;
  font-size: 16px;
}

.admin-metric-status[data-state="healthy"],
.admin-metric-status[data-state="running"] {
  color: #17613f;
}

.admin-metric-status[data-state="failed"],
.admin-metric-status[data-state="overdue"],
.admin-metric-status[data-state="never"],
.admin-metric-status[data-state="not_configured"] {
  color: #973727;
}

.admin-backup-alert {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid #d9a198;
  border-left: 4px solid #a33e2e;
  border-radius: 4px;
  background: #fbedeb;
  color: #812b20;
  font-size: 13px;
  font-weight: 750;
}

.admin-backup-alert[hidden] {
  display: none;
}

.admin-tabs {
  display: flex;
  align-items: end;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid #aebbb4;
  scrollbar-width: thin;
}

.admin-tabs button {
  position: relative;
  min-height: 46px;
  padding: 8px 1px 11px;
  border: 0;
  background: transparent;
  color: #5b6961;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
}

.admin-tabs button.is-active {
  color: #163f2e;
}

.admin-tabs button.is-active::after {
  background: #176b4a;
}

.admin-tabs button span {
  display: inline-grid;
  min-width: 21px;
  min-height: 21px;
  margin-left: 5px;
  place-items: center;
  border-radius: 50%;
  background: #dbe3de;
  color: #33443b;
  font-size: 10px;
}

.admin-panel {
  padding-top: 12px;
}

.admin-panel[hidden] {
  display: none;
}

.admin-user-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 6px 0 20px;
  padding: 18px 0 20px;
  border-bottom: 1px solid #cbd5ce;
}

.admin-user-toolbar h2 {
  margin: 0;
  font-size: 20px;
}

.admin-user-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 220px) minmax(180px, 220px);
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #cbd5ce;
}

.admin-filters label,
.admin-dialog label,
.admin-level-field {
  display: grid;
  gap: 6px;
  color: #334039;
  font-size: 12px;
  font-weight: 800;
}

.admin-filters input,
.admin-filters select,
.admin-dialog input,
.admin-dialog select,
.admin-level-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

.admin-message {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #9ac5ae;
  border-radius: 5px;
  background: #e8f4ed;
  color: #124e34;
  font-size: 13px;
}

.admin-message.error {
  border-color: #e2afa7;
  background: #fbedeb;
  color: #832d21;
}

.admin-message[hidden] {
  display: none;
}

.admin-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 12px;
}

.admin-list-heading h2 {
  margin: 0;
  font-size: 20px;
}

.admin-list-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-request-list {
  display: grid;
  gap: 10px;
}

.admin-request {
  overflow: hidden;
  border: 1px solid #c8d2cc;
  border-radius: 6px;
  background: #fff;
}

.admin-request.expired {
  background: #f7f8f7;
  opacity: 0.82;
}

.admin-request-heading {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid #dce2de;
}

.admin-request-identity {
  display: grid;
  min-width: 0;
}

.admin-request-identity strong {
  color: #1c2c24;
  font-size: 14px;
}

.admin-request-identity span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.admin-request-status,
.admin-run-status,
.admin-backup-state {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #d3b46f;
  border-radius: 4px;
  background: #fff7df;
  color: #755311;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-request-status.expired,
.admin-run-status.failed,
.admin-backup-state[data-state="failed"],
.admin-backup-state[data-state="overdue"],
.admin-backup-state[data-state="never"],
.admin-backup-state[data-state="not_configured"] {
  border-color: #d7aaa3;
  background: #faece9;
  color: #8b3225;
}

.admin-run-status.succeeded,
.admin-backup-state[data-state="healthy"] {
  border-color: #a7cab7;
  background: #e9f4ed;
  color: #17613f;
}

.admin-run-status.running,
.admin-backup-state[data-state="running"] {
  border-color: #b4c5df;
  background: #edf3fb;
  color: #315887;
}

.admin-request-data {
  display: grid;
  grid-template-columns: 1fr 1.5fr 0.8fr 0.8fr;
  margin: 0;
  padding: 0 18px;
}

.admin-request-data > div {
  min-width: 0;
  padding: 13px 15px 13px 0;
}

.admin-request-data dt,
.admin-backup-summary dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-request-data dd,
.admin-backup-summary dd {
  margin: 4px 0 0;
  color: #293830;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-municipality-data dd > strong {
  display: block;
}

.admin-municipality-data details {
  margin-top: 5px;
}

.admin-municipality-data summary {
  cursor: pointer;
  color: #176846;
  font-size: 11px;
  font-weight: 800;
}

.admin-municipality-data details p {
  margin: 7px 0 0;
  color: #4c5b53;
  font-weight: 600;
  line-height: 1.55;
}

.admin-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 18px;
  border-top: 1px solid #e0e5e2;
  background: #fafbfa;
}

.admin-button.admin {
  border-color: #355b8f;
  background: #355b8f;
}

.admin-audit-search,
.admin-export-row label {
  display: grid;
  gap: 6px;
  color: #334039;
  font-size: 12px;
  font-weight: 800;
}

.admin-audit-search {
  width: min(440px, 100%);
  margin-bottom: 16px;
}

.admin-audit-search input,
.admin-export-row select {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

.admin-audit-wrap {
  overflow-x: auto;
  border-block: 1px solid #cbd5ce;
}

.admin-audit-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: #fff;
  font-size: 11px;
}

.admin-audit-table th,
.admin-audit-table td {
  padding: 11px 12px;
  border-right: 1px solid #e0e5e2;
  border-bottom: 1px solid #e0e5e2;
  text-align: left;
  vertical-align: top;
}

.admin-audit-table th:last-child,
.admin-audit-table td:last-child {
  border-right: 0;
}

.admin-audit-table th {
  background: #e7ede9;
  color: #536159;
  font-size: 9px;
  text-transform: uppercase;
}

.admin-operation-section {
  padding: 18px 0 34px;
  border-bottom: 1px solid #cbd5ce;
}

.admin-operation-section:last-child {
  border-bottom: 0;
}

.admin-content-intro {
  margin: 10px 0 2px;
  padding: 13px 15px;
  border-left: 4px solid #b58a24;
  background: #fff8e7;
  color: #58471d;
  font-size: 12px;
  line-height: 1.55;
}

.admin-content-heading {
  align-items: end;
}

.admin-content-heading p {
  max-width: 720px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-content-search {
  display: grid;
  max-width: 480px;
  gap: 6px;
  margin: 14px 0;
  color: #334039;
  font-size: 12px;
  font-weight: 800;
}

.admin-content-search input {
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #aab8b0;
  border-radius: 4px;
  background: #fff;
}

.admin-content-table {
  min-width: 860px;
}

.admin-content-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-button.compact {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 11px;
}

.admin-backup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-backup-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 20px;
  border-block: 1px solid #d2dad5;
}

.admin-backup-summary > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid #d2dad5;
}

.admin-backup-summary > div:last-child {
  border-right: 0;
}

.admin-backup-error {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-export-row {
  display: grid;
  max-width: 720px;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-loading {
  padding: 32px 0;
  color: var(--muted);
  text-align: center;
}

.admin-user {
  overflow: hidden;
  border: 1px solid #ced7d1;
  border-radius: 6px;
  background: #fff;
}

.admin-user[hidden] {
  display: none;
}

.admin-user summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 1fr) 130px 118px;
  min-height: 72px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
}

.admin-user summary::-webkit-details-marker {
  display: none;
}

.admin-user summary::after {
  position: absolute;
  right: 10px;
  color: var(--muted);
  content: "+";
  font-size: 18px;
}

.admin-user[open] summary::after {
  content: "−";
}

.admin-user[open] summary {
  border-bottom: 1px solid #d8dfda;
  background: #f7f9f7;
}

.admin-user-identity {
  display: grid;
  min-width: 0;
}

.admin-user-identity strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity small,
.admin-user-institution {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-level,
.admin-status {
  display: inline-flex;
  width: fit-content;
  min-height: 27px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #cbd6cf;
  border-radius: 4px;
  background: #f4f6f4;
  color: #3e4b45;
  font-size: 11px;
  font-weight: 800;
}

.admin-level.level-3 {
  border-color: #b9c8e5;
  background: #edf2fb;
  color: #284a83;
}

.admin-status.active {
  border-color: #a9cdb9;
  background: #e8f4ed;
  color: #17613f;
}

.admin-status.inactive {
  border-color: #d7b6b0;
  background: #f9edeb;
  color: #8b3529;
}

.admin-user-content {
  padding: 24px 20px 28px;
}

.admin-subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-subheading h3 {
  font-size: 15px;
}

.admin-subheading > span {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border-radius: 4px;
  background: #e7ece9;
  color: #3c4c44;
  font-size: 11px;
  font-weight: 800;
}

.admin-user-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #dde3df;
}

.admin-user-data > div {
  min-width: 0;
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid #dde3df;
}

.admin-user-data dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-user-data dd {
  margin: 4px 0 0;
  color: #26332d;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.admin-user-controls,
.admin-diagnoses {
  margin-top: 26px;
}

.admin-action-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto auto auto;
  align-items: end;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid #dde3df;
  border-bottom: 1px solid #dde3df;
}

.admin-button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.admin-button.secondary {
  border-color: #9eaaa3;
  background: #fff;
  color: #34423b;
}

.admin-button.danger {
  border-color: #aa4a3c;
  background: #aa4a3c;
}

.admin-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-protected-note,
.admin-empty {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-table-wrap {
  overflow-x: auto;
  border-top: 1px solid #dde3df;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e7e4;
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.admin-table a {
  color: var(--green-dark);
  font-weight: 800;
}

.admin-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 26px;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgb(15 31 23 / 28%);
}

.admin-dialog::backdrop {
  background: rgb(10 24 17 / 68%);
}

.admin-dialog h2 {
  font-size: 24px;
}

.admin-dialog > form > p:not(.eyebrow):not(.admin-delete-target):not(.admin-inline-message) {
  color: var(--muted);
}

.admin-delete-target {
  display: grid;
  margin: 18px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-delete-target span {
  color: var(--muted);
  font-size: 13px;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.admin-create-user-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.admin-create-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.admin-create-user-wide {
  grid-column: 1 / -1;
}

.admin-create-municipalities {
  margin-top: 20px;
}

.admin-create-municipalities-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #334039;
  font-size: 12px;
}

.admin-create-municipalities-heading span {
  color: #176846;
  font-weight: 850;
}

.admin-inline-message {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid #9ac5ae;
  border-radius: 5px;
  background: #e8f4ed;
  color: #124e34;
  font-size: 13px;
}

.admin-inline-message.error {
  border-color: #e2afa7;
  background: #fbedeb;
  color: #832d21;
}

.admin-inline-message[hidden] {
  display: none;
}

.admin-municipality-dialog {
  width: min(720px, calc(100% - 32px));
}

.admin-municipality-count {
  margin-top: 12px;
  color: #176846;
  font-size: 12px;
  font-weight: 850;
}

.admin-municipality-options {
  display: grid;
  max-height: 360px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 16px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 10px 8px 10px 0;
  border-block: 1px solid var(--line);
}

.submission-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 28px;
  border: 0;
  border-top: 5px solid #b42318;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgb(15 31 23 / 28%);
}

.submission-dialog::backdrop {
  background: rgb(10 24 17 / 68%);
}

.submission-dialog h2 {
  margin: 6px 0 12px;
  color: #2b342f;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
}

.submission-dialog > form > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.submission-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

@media (max-width: 900px) {
  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-metrics div:nth-child(4) {
    border-left: 0;
  }

  .admin-metrics div:nth-child(n + 4) {
    border-top: 1px solid #cbd5ce;
  }

  .admin-request-data {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user summary {
    grid-template-columns: minmax(220px, 1fr) 130px 118px;
  }

  .admin-user-institution {
    display: none;
  }

  .admin-user-data {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-action-row {
    grid-template-columns: minmax(180px, 1fr) 1fr 1fr;
  }

  .admin-action-row .admin-button.danger {
    grid-column: 3;
  }
}

@media (max-width: 660px) {
  .admin-topbar {
    padding: 10px 14px;
  }

  .admin-brand small {
    display: none;
  }

  .admin-account-nav .access-back-button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .admin-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }

  .admin-heading h1 {
    font-size: 25px;
  }

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

  .admin-metrics div:nth-child(odd) {
    border-left: 0;
  }

  .admin-metrics div:nth-child(even) {
    border-left: 1px solid #cbd5ce;
  }

  .admin-metrics div:nth-child(n + 3) {
    border-top: 1px solid #cbd5ce;
  }

  .admin-tabs {
    gap: 20px;
  }

  .admin-request-heading {
    align-items: flex-start;
  }

  .admin-request-data,
  .admin-backup-summary {
    grid-template-columns: 1fr;
  }

  .admin-request-data > div,
  .admin-backup-summary > div {
    padding: 11px 0;
    border-right: 0;
    border-bottom: 1px solid #e1e6e3;
  }

  .admin-request-data > div:last-child,
  .admin-backup-summary > div:last-child {
    border-bottom: 0;
  }

  .admin-request-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-export-row {
    grid-template-columns: 1fr;
  }

  .admin-backup-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-backup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-backup-state {
    align-self: flex-start;
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }

  .admin-user-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .admin-create-user-grid {
    grid-template-columns: 1fr;
  }

  .admin-create-user-wide {
    grid-column: auto;
  }

  .admin-create-municipalities-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .admin-create-user-dialog .admin-municipality-options {
    grid-template-columns: 1fr;
  }

  .admin-user summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-right: 30px;
  }

  .admin-level {
    justify-self: end;
  }

  .admin-status {
    grid-column: 1 / -1;
  }

  .admin-user-content {
    padding: 20px 16px 24px;
  }

  .admin-user-data,
  .admin-action-row {
    grid-template-columns: 1fr;
  }

  .admin-action-row .admin-button.danger {
    grid-column: auto;
  }

  .admin-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Acesso e administração de usuários */
.auth-page {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  background-color: #16251d;
  background-image: url("/hero-reciclagem-desktop.webp");
  background-image: image-set(
    url("/hero-reciclagem-desktop.avif") type("image/avif"),
    url("/hero-reciclagem-desktop.webp") type("image/webp")
  );
  background-position: center;
  background-size: cover;
}

.auth-page::before {
  position: fixed;
  inset: 0;
  background: rgb(10 24 17 / 76%);
  content: "";
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100% - 32px, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  place-items: center;
}

.auth-back {
  position: fixed;
  top: 24px;
  left: 28px;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 6px;
  background: rgb(16 33 24 / 78%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.auth-back:hover {
  border-color: #fff;
}

.auth-panel {
  width: min(100%, 660px);
  padding: 30px;
  border: 1px solid #d7dfda;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 48px rgb(5 18 11 / 28%);
}

.compact-auth-panel {
  width: min(100%, 520px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand > span:last-child {
  display: grid;
}

.auth-brand strong {
  color: #17211d;
  font-size: 15px;
}

.auth-brand small {
  color: #66736c;
  font-size: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-tab.is-active {
  border-bottom-color: var(--green);
  color: var(--green-dark);
}

.auth-heading {
  margin-bottom: 24px;
}

.auth-heading h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

.auth-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

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

.auth-form label[hidden] {
  display: none;
}

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

.auth-form label > span {
  color: #34433b;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input,
.auth-form textarea,
.auth-form select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

.auth-form input {
  min-height: 46px;
  padding: 0 12px;
}

.auth-form select {
  min-height: 46px;
  padding: 0 38px 0 12px;
}

.auth-form textarea {
  min-height: 118px;
  padding: 11px 12px;
  resize: vertical;
}

.auth-field {
  min-width: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.auth-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.auth-field-heading > span {
  color: #34433b;
  font-size: 13px;
  font-weight: 800;
}

.auth-field-heading small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.regional-jurisdictions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.regional-jurisdictions[hidden] {
  display: none;
}

.regional-jurisdictions-title {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.jurisdiction-search {
  margin-bottom: 10px;
}

.jurisdiction-options {
  max-height: 290px;
  overflow-y: auto;
  padding-right: 8px;
  border-top: 1px solid #e3e8e5;
  border-bottom: 1px solid #e3e8e5;
}

.jurisdiction-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 14px;
  padding: 10px 0;
  border-bottom: 1px solid #e3e8e5;
}

.jurisdiction-group:last-child {
  border-bottom: 0;
}

.jurisdiction-group h3 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--coral);
  font-size: 11px;
  text-transform: uppercase;
}

.jurisdiction-choice {
  display: flex !important;
  min-width: 0;
  min-height: 34px;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 8px !important;
  padding: 6px 2px;
  color: #34433b;
  font-size: 12px;
}

.jurisdiction-choice input {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 1px 0 0;
}

.jurisdiction-choice span {
  min-width: 0;
  font-weight: 600 !important;
  overflow-wrap: anywhere;
}

.jurisdiction-choice[hidden],
.jurisdiction-group[hidden] {
  display: none !important;
}

.jurisdiction-loading {
  margin: 0;
  padding: 18px 2px;
  color: var(--muted);
  font-size: 12px;
}

.profile-municipality-pending {
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid #ddc37d;
  border-left: 4px solid #b58a24;
  border-radius: 4px;
  background: #fff7df;
  color: #6f500d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.profile-municipality-pending[hidden] {
  display: none;
}

.error-text {
  color: #832d21;
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
  border-color: var(--green);
}

.auth-submit {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.auth-submit:hover {
  background: var(--green-dark);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-submit.danger-action {
  border-color: #a33a2c;
  background: #a33a2c;
}

.auth-secondary-action {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.auth-secondary-action:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.auth-message {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #b9c8c0;
  border-radius: 5px;
  background: #f3f6f4;
  color: #314139;
  font-size: 13px;
}

.auth-message.success {
  border-color: #9ac5ae;
  background: #e8f4ed;
  color: #124e34;
}

.auth-message.error {
  border-color: #e2afa7;
  background: #fbedeb;
  color: #832d21;
}

.profile-shell {
  padding-block: 38px;
}

.profile-panel {
  width: min(100%, 860px);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-back,
.profile-password,
.profile-logout {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.profile-back:hover,
.profile-password:hover,
.profile-logout:hover {
  border-color: var(--green);
  color: var(--green);
}

.profile-logout {
  border-color: #d0aaa4;
  color: #8c3024;
}

.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-heading {
  margin-bottom: 18px;
}

.profile-readonly-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-readonly-grid > div {
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-readonly-grid > div:nth-child(3n) {
  border-right: 0;
}

.profile-readonly-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.profile-readonly-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-readonly-grid dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-form {
  margin-top: 26px;
}

.workflow-strip {
  margin: 18px 26px 0;
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--green);
  background: #fff;
}

.workflow-heading,
.profile-workflows-heading,
.workflow-fields,
.workflow-action-buttons,
.profile-workflow-meta,
.profile-workflow-actions {
  display: flex;
  align-items: center;
}

.workflow-heading,
.profile-workflows-heading {
  justify-content: space-between;
  gap: 18px;
}

.workflow-heading h2,
.profile-workflows-heading h2 {
  margin: 3px 0 0;
  font-size: 21px;
}

.workflow-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid #b9c7bf;
  border-radius: 4px;
  background: #eef2ef;
  color: #33443b;
  font-size: 12px;
  font-weight: 800;
}

.workflow-status.status-submitted { background: #edf4f8; border-color: #a9c4d3; color: #24566d; }
.workflow-status.status-in_review { background: #fff6df; border-color: #ddc37d; color: #71530b; }
.workflow-status.status-approved { background: #edf7ef; border-color: #9ec3a6; color: #246033; }
.workflow-status.status-published { background: #176846; border-color: #176846; color: #fff; }

.workflow-fields {
  gap: 22px;
  margin-top: 17px;
}

.workflow-fields label {
  display: grid;
  flex: 1 1 420px;
  gap: 6px;
  color: #3e4d45;
  font-size: 13px;
  font-weight: 700;
}

.workflow-fields select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  padding: 0 11px;
  color: var(--ink);
  font: inherit;
}

.workflow-sync {
  display: grid;
  flex: 0 1 260px;
  gap: 4px;
}

.workflow-sync span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.workflow-sync strong {
  color: #33443b;
  font-size: 13px;
}

.workflow-comments,
.workflow-review-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.workflow-comments h3,
.workflow-review-actions label {
  margin: 0 0 10px;
  color: #27352e;
  font-size: 14px;
  font-weight: 800;
}

.workflow-comments ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-comments li {
  padding-left: 12px;
  border-left: 3px solid #b8c8bf;
}

.workflow-comments li strong,
.workflow-comments li time {
  display: block;
}

.workflow-comments li time {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.workflow-comments li p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.workflow-review-actions textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

.workflow-action-buttons {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.danger-text {
  color: #9d372a;
  border-color: #d7a49d;
}

.profile-workflows {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.profile-workflow-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.profile-workflow-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 18px;
  padding: 15px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
}

.profile-workflow-item h3 {
  margin: 0;
  font-size: 16px;
}

.profile-workflow-meta {
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.profile-workflow-actions {
  align-self: center;
  gap: 8px;
}

.profile-workflow-actions a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid #8ba698;
  border-radius: 4px;
  padding: 6px 11px;
  color: #185d41;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.profile-workflow-empty {
  margin: 0;
  padding: 18px 0 4px;
  color: var(--muted);
}

.profile-delete-account {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.profile-delete-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #a33a2c;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.profile-delete-confirmation {
  max-width: 680px;
}

.profile-delete-confirmation h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.profile-delete-confirmation p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.profile-delete-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  line-height: 1.45;
}

.profile-delete-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #a33a2c;
  flex: 0 0 auto;
}

.profile-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.danger-button {
  min-height: 42px;
  border: 1px solid #a33a2c;
  border-radius: 5px;
  padding: 0 16px;
  background: #a33a2c;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.danger-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.auth-view[hidden],
.auth-message[hidden],
.auth-form[hidden] {
  display: none;
}

.repository-page {
  min-height: 100vh;
  background: #eef2ef;
}

.repository-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.back-link {
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.repository-heading {
  margin: 56px 0 24px;
}

.repository-heading h1 {
  margin: 0;
  font-size: 34px;
}

.repository-panel {
  display: grid;
  min-height: 340px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 700px) {
  .home-account-actions {
    top: 16px;
    right: 16px;
    gap: 6px;
  }

  .home-account-button {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .home-hero {
    min-height: calc(100vh - 72px);
    background-position: 63% center;
  }

  .home-content {
    width: min(100% - 32px, 620px);
    margin: 0 auto;
  }

  .home-brand {
    margin-bottom: 38px;
  }

  .home-content h1 {
    font-size: 34px;
  }

  .home-lede {
    font-size: 16px;
  }

  .entry-link {
    grid-template-columns: 28px minmax(0, 1fr) 20px;
    min-height: 62px;
  }

  .entry-link strong {
    font-size: 14px;
  }

  .repository-shell {
    width: min(100% - 32px, 1160px);
    padding-top: 24px;
  }

  .auth-shell {
    align-items: start;
    padding: 82px 0 24px;
  }

  .auth-back {
    top: 16px;
    left: 16px;
  }

  .auth-panel {
    padding: 24px 20px;
  }

  .auth-form-grid,
  .regional-jurisdictions,
  .jurisdiction-group,
  .admin-municipality-options {
    grid-template-columns: 1fr;
  }

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

  .profile-header {
    align-items: flex-start;
  }

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

  .profile-readonly-grid > div,
  .profile-readonly-grid > div:nth-child(3n),
  .profile-readonly-grid > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-readonly-grid > div:last-child {
    border-bottom: 0;
  }
}

/* Repositório cartográfico */
.repository-page {
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: #f4f6f4;
}

.repository-topbar {
  position: relative;
  z-index: 900;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 24px;
  border-bottom: 1px solid #253d32;
  background: #13251d;
  color: #f4f7f5;
}

.repository-brand {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.repository-brand > span:last-child {
  display: grid;
}

.repository-brand strong {
  font-size: 15px;
}

.repository-brand small {
  color: #aebdb6;
  font-size: 12px;
}

.repository-totals {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #b9c8c0;
  font-size: 12px;
}

.repository-totals span {
  white-space: nowrap;
}

.repository-totals strong {
  margin-right: 5px;
  color: #fff;
  font-size: 18px;
}

.repository-topbar .access-back-button {
  min-height: 38px;
  margin-left: auto;
  border-color: #557063;
  background: #1c3529;
  color: #fff;
}

.repository-topbar .access-back-button:hover {
  border-color: #8db5a1;
  color: #fff;
}

.filters-toggle,
.filters-close {
  display: none;
}

.repository-layout {
  display: grid;
  min-height: calc(100vh - 70px);
  grid-template-columns: 320px minmax(0, 1fr);
}

.filters-panel {
  z-index: 800;
  display: flex;
  height: calc(100vh - 70px);
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 24px 22px 18px;
  border-right: 1px solid #cbd3ce;
  background: #fff;
}

.filters-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.filters-heading .eyebrow,
.municipality-shell .eyebrow,
.municipality-placeholder .eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.filters-heading h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group > label,
.filter-label-row label {
  color: #27372f;
  font-size: 12px;
  font-weight: 800;
}

.filter-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-label-row span {
  color: var(--muted);
  font-size: 11px;
}

.filters-panel select,
.filters-panel input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #bfc9c3;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.program-filter-group {
  min-height: 190px;
}

.program-options {
  display: grid;
  max-height: 205px;
  gap: 1px;
  overflow-y: auto;
  border-block: 1px solid #e0e5e2;
  scrollbar-color: #9daaa3 #eef1ef;
  scrollbar-width: thin;
}

.program-option {
  display: grid;
  min-height: 34px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 4px;
  color: #34423b;
  font-size: 12px;
}

.program-option[hidden] {
  display: none;
}

.program-option:hover {
  background: #f1f4f2;
}

.program-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.clear-filters {
  min-height: 40px;
  border: 1px solid #8ba096;
  border-radius: 5px;
  background: #edf3ef;
  color: #174e37;
  font-size: 12px;
  font-weight: 800;
}

.clear-filters:hover {
  border-color: var(--green);
  background: #e1eee6;
}

.map-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #dde3df;
  color: #6b7771;
  font-size: 10px;
}

.map-source a {
  color: var(--green);
  font-weight: 700;
}

.map-workspace {
  position: relative;
  display: grid;
  min-width: 0;
  height: calc(100vh - 70px);
  grid-template-rows: auto minmax(0, 1fr);
  background: #f5f7f5;
}

.repository-viewbar {
  position: relative;
  z-index: 600;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 18px;
  border-bottom: 1px solid #cbd3ce;
  background: #f9faf9;
}

.repository-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  padding: 3px;
  border: 1px solid #b9c4be;
  border-radius: 6px;
  background: #edf1ee;
}

.repository-tabs button {
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4d5d54;
  font-size: 12px;
  font-weight: 800;
}

.repository-tabs button.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgb(24 43 33 / 14%);
  color: #153a2a;
}

.repository-actions,
.repository-export {
  display: flex;
  align-items: center;
}

.repository-actions {
  gap: 18px;
}

.repository-updated {
  color: #66736c;
  font-size: 10px;
  white-space: nowrap;
}

.repository-updated strong {
  color: #2b3931;
}

.repository-export {
  gap: 5px;
}

.repository-export > span {
  margin-right: 3px;
  color: #68756e;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.repository-export button {
  min-width: 48px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #aebbb4;
  border-radius: 4px;
  background: #fff;
  color: #254537;
  font-size: 11px;
  font-weight: 800;
}

.repository-export button:hover {
  border-color: #47705d;
  background: #eaf1ed;
}

.repository-view[hidden] {
  display: none;
}

.repository-map-view {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.map-bar {
  position: relative;
  z-index: 500;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 18px;
  border-bottom: 1px solid #d7ded9;
  background: #fff;
}

.map-bar p {
  margin: 0;
  color: #47564e;
  font-size: 12px;
  font-weight: 700;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 13px;
  color: #59665f;
  font-size: 10px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.map-legend i {
  width: 15px;
  height: 11px;
  border: 1px solid #829088;
}

.legend-selected {
  background: #d5dad7;
}

.legend-unselected {
  background: #fff;
}

.map-legend .legend-regional {
  height: 0;
  border-width: 0 0 2px;
  border-color: var(--green);
}

#repository-map {
  width: 100%;
  min-height: 440px;
  background: #f5f7f5;
}

.analytics-view {
  min-width: 0;
  overflow-y: auto;
  padding: 30px 32px 52px;
  background: #fff;
}

.analytics-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #24372e;
}

.analytics-intro .eyebrow,
.analytics-section .eyebrow {
  margin: 0 0 5px;
  color: #a4482b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.analytics-intro h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.analytics-intro > p {
  margin: 0;
  color: #647069;
  font-size: 12px;
  font-weight: 800;
}

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 34px;
  border-block: 1px solid #cbd3ce;
}

.indicator-grid article {
  display: grid;
  min-width: 0;
  min-height: 138px;
  align-content: center;
  padding: 19px 22px;
  border-right: 1px solid #d7ded9;
  border-bottom: 1px solid #d7ded9;
  background: #fff;
}

.indicator-grid article:nth-child(3n) {
  border-right: 0;
}

.indicator-grid article:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.indicator-grid span {
  color: #536159;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.indicator-grid strong {
  margin-top: 6px;
  color: #16261e;
  font-size: 34px;
  line-height: 1;
}

.indicator-grid small {
  margin-top: 7px;
  color: #77827c;
  font-size: 10px;
}

.analytics-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.analytics-section {
  min-width: 0;
  padding: 26px 0 30px;
  border-top: 1px solid #aeb9b3;
}

.analytics-section-heading {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.analytics-section h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.chart-metric-control {
  display: grid;
  min-width: 205px;
  gap: 4px;
}

.chart-metric-control span {
  color: #647069;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.chart-metric-control select,
.comparison-selectors select {
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid #b8c3bd;
  border-radius: 4px;
  background: #fff;
  color: #26372e;
  font-size: 11px;
}

.chart-frame {
  display: grid;
  width: 100%;
  min-height: 270px;
  aspect-ratio: 2.42 / 1;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #e2e7e4;
  background: #fbfcfb;
}

.chart-frame svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-grid-line {
  stroke: #d8dfdb;
  stroke-width: 1;
}

.chart-axis-label,
.chart-axis-value {
  fill: #66736c;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 10px;
}

.chart-bar {
  fill: #17734f;
}

.chart-line {
  fill: none;
  stroke: #b15332;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-point {
  fill: #fff;
  stroke: #b15332;
  stroke-width: 3;
}

.chart-empty,
.comparison-empty {
  margin: 0;
  color: #76817b;
  font-size: 12px;
}

.comparison-section {
  margin-top: 12px;
  padding-bottom: 0;
}

.comparison-heading {
  min-height: 78px;
}

.comparison-selectors {
  display: grid;
  width: min(720px, 68%);
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 7px;
}

.comparison-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-block: 1px solid #cbd3ce;
}

.comparison-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 11px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 14px;
  border-right: 1px solid #dce2de;
  border-bottom: 1px solid #e2e7e4;
  text-align: left;
  vertical-align: top;
}

.comparison-table tr:last-child th,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: 0;
}

.comparison-table thead th {
  background: #eaf0ec;
  color: #1c3d2e;
  font-size: 12px;
}

.comparison-table tbody th {
  width: 190px;
  background: #f7f9f8;
  color: #536159;
  font-weight: 800;
}

.comparison-table a {
  color: #145b3e;
  text-decoration: none;
}

.comparison-table a:hover {
  text-decoration: underline;
}

.leaflet-container {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.leaflet-control-zoom a {
  color: #173227;
}

.leaflet-control-attribution {
  color: #6a756f;
  font-size: 9px;
}

.leaflet-control-attribution a {
  color: #31614a;
}

.regional-label {
  border: 0;
  background: rgb(255 255 255 / 76%);
  box-shadow: none;
  color: #2f6048;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
  text-transform: uppercase;
}

.regional-label::before {
  display: none;
}

.municipality-tooltip {
  min-width: 220px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #20342a;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(16 33 24 / 20%);
  color: var(--ink);
}

.municipality-tooltip::before {
  border-top-color: #20342a;
}

.tooltip-municipality {
  padding: 10px 12px;
  background: #183328;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.municipality-tooltip dl {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 12px;
}

.municipality-tooltip dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.municipality-tooltip dt {
  color: #657169;
  font-size: 10px;
}

.municipality-tooltip dd {
  margin: 0;
  color: #1f2c25;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.map-empty {
  position: absolute;
  z-index: 520;
  top: 72px;
  left: 50%;
  width: min(360px, calc(100% - 40px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 1px solid #c2cbc6;
  border-radius: 5px;
  background: #fff;
  color: #4e5a54;
  font-size: 12px;
  text-align: center;
}

.filters-backdrop {
  position: fixed;
  z-index: 750;
  inset: 70px 0 0;
  background: rgb(10 24 17 / 44%);
}

.municipality-page {
  min-width: 320px;
  min-height: 100vh;
  background: #f1f4f2;
}

.map-return {
  color: #d3e6da;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.map-return:hover {
  color: #fff;
}

.municipality-shell {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.municipality-shell h1 {
  margin: 0 0 30px;
  font-size: 42px;
  line-height: 1.1;
}

.municipality-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-block: 1px solid #c8d1cc;
}

.municipality-summary div {
  min-width: 0;
  padding: 18px 22px 18px 0;
}

.municipality-summary div + div {
  padding-left: 22px;
  border-left: 1px solid #c8d1cc;
}

.municipality-summary dt {
  color: #647069;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.municipality-summary dd {
  margin: 7px 0 0;
  color: #1c2b23;
  font-size: 18px;
  font-weight: 800;
}

.municipality-placeholder {
  margin-top: 54px;
  padding: 32px 0;
  border-top: 3px solid var(--green);
}

.municipality-placeholder h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.municipality-placeholder > p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .repository-layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: fixed;
    top: 70px;
    bottom: 0;
    left: 0;
    width: min(340px, calc(100% - 44px));
    height: auto;
    transform: translateX(-105%);
    box-shadow: 12px 0 32px rgb(10 24 17 / 20%);
    transition: transform 180ms ease;
  }

  .filters-panel.is-open {
    transform: translateX(0);
  }

  .filters-toggle {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #557063;
    border-radius: 5px;
    background: #1c3529;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
  }

  .filters-toggle > span:first-child {
    font-size: 18px;
    line-height: 1;
  }

  .filters-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 0;
    background: transparent;
    color: #435149;
    font-size: 26px;
    line-height: 1;
  }

  .map-workspace {
    height: calc(100vh - 70px);
  }

  .analytics-history-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .comparison-heading {
    display: grid;
  }

  .comparison-selectors {
    width: 100%;
  }
}

@media (max-width: 660px) {
  .repository-topbar {
    min-height: 64px;
    gap: 8px;
    padding: 8px 12px;
  }

  .repository-brand {
    min-width: 0;
  }

  .repository-brand .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .repository-brand strong {
    font-size: 13px;
  }

  .repository-brand small {
    font-size: 10px;
  }

  .repository-totals {
    display: none;
  }

  .repository-topbar .access-back-button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .repository-layout {
    min-height: calc(100vh - 64px);
  }

  .filters-panel {
    top: 64px;
  }

  .filters-backdrop {
    inset-block-start: 64px;
  }

  .map-workspace {
    height: calc(100vh - 64px);
  }

  .repository-viewbar {
    min-height: 104px;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    padding: 8px 10px;
  }

  .repository-tabs {
    width: 100%;
  }

  .repository-actions {
    justify-content: space-between;
    gap: 8px;
  }

  .repository-updated {
    overflow: hidden;
    max-width: 150px;
    text-overflow: ellipsis;
  }

  .repository-export > span {
    display: none;
  }

  .repository-export button {
    min-width: 45px;
  }

  .map-bar {
    align-items: flex-start;
    gap: 4px;
    padding: 8px 10px;
  }

  .map-bar p {
    max-width: 130px;
    line-height: 1.25;
  }

  .map-legend {
    max-width: 190px;
    gap: 4px 9px;
    line-height: 1.2;
  }

  #repository-map {
    min-height: 390px;
  }

  .analytics-view {
    padding: 22px 16px 42px;
  }

  .analytics-intro {
    display: grid;
    gap: 9px;
  }

  .analytics-intro h1 {
    font-size: 26px;
  }

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

  .indicator-grid article,
  .indicator-grid article:nth-child(3n),
  .indicator-grid article:nth-last-child(-n + 3) {
    border-right: 1px solid #d7ded9;
    border-bottom: 1px solid #d7ded9;
  }

  .indicator-grid article:nth-child(2n) {
    border-right: 0;
  }

  .indicator-grid article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .indicator-grid strong {
    font-size: 29px;
  }

  .analytics-section-heading {
    display: grid;
    gap: 12px;
  }

  .chart-metric-control {
    width: 100%;
  }

  .chart-frame {
    min-height: 220px;
  }

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

  .regional-label {
    font-size: 6px;
  }

  .municipality-shell {
    width: min(100% - 32px, 980px);
    padding-top: 42px;
  }

  .municipality-shell h1 {
    font-size: 32px;
  }

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

  .municipality-summary div,
  .municipality-summary div + div {
    padding: 14px 0;
    border-left: 0;
  }

  .municipality-summary div + div {
    border-top: 1px solid #d8dfdb;
  }

  .municipality-summary dd {
    font-size: 16px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  body.panorama-print {
    min-width: 0;
    overflow: visible;
    background: #fff;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .panorama-print .repository-topbar,
  .panorama-print .filters-panel,
  .panorama-print .repository-viewbar,
  .panorama-print .repository-map-view,
  .panorama-print .comparison-selectors,
  .panorama-print .comparison-empty,
  .panorama-print .filters-backdrop {
    display: none !important;
  }

  .panorama-print .repository-layout,
  .panorama-print .map-workspace,
  .panorama-print .analytics-view {
    display: block !important;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .panorama-print .analytics-view {
    padding: 0;
  }

  .panorama-print .analytics-intro::before {
    content: "Panorama das Informações | Programa Lixo e Cidadania";
    display: block;
    grid-column: 1 / -1;
    margin-bottom: 10px;
    color: #506058;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .panorama-print .indicator-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    break-inside: avoid;
  }

  .panorama-print .indicator-grid article {
    min-height: 105px;
  }

  .panorama-print .analytics-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    break-inside: avoid;
  }

  .panorama-print .chart-frame {
    min-height: 210px;
  }

  .panorama-print .comparison-section {
    break-before: page;
  }
}

/* Consulta consolidada e histórico dos diagnósticos */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.data-page {
  min-width: 320px;
  background: #eef1ef;
}

.data-topbar {
  position: sticky;
  z-index: 50;
  top: 0;
}

.data-account-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.data-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 30px;
  border-bottom: 1px solid #cbd3ce;
}

.data-intro h1 {
  margin: 3px 0 8px;
  font-size: 34px;
  line-height: 1.12;
}

.data-intro > div > p:last-child {
  max-width: 760px;
  margin: 0;
  color: #5c6962;
}

.data-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0;
  padding: 3px;
  border: 1px solid #bdc8c1;
  border-radius: 6px;
  background: #fff;
}

.data-tabs button {
  min-height: 40px;
  padding: 7px 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4d5b53;
  font-size: 13px;
  font-weight: 800;
}

.data-tabs button[aria-selected="true"] {
  background: #173328;
  color: #fff;
}

.data-panel[hidden] {
  display: none;
}

.data-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  min-height: 650px;
  border: 1px solid #c8d1cb;
  background: #fff;
}

.query-sidebar {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid #c8d1cb;
  background: #f8faf8;
}

.filter-heading {
  margin-bottom: 16px;
}

.filter-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-heading span,
.filter-heading strong {
  color: #25352d;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-heading strong {
  color: #176b4a;
  font-size: 11px;
}

.filter-heading p {
  margin: 6px 0 0;
  color: #6b776f;
  font-size: 12px;
}

.geography-heading {
  margin-top: 28px;
  padding-top: 23px;
  border-top: 1px solid #d5ddd8;
}

.data-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin-bottom: 14px;
}

.data-field > span {
  color: #4e5b54;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-field input,
.data-field select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #b9c5bd;
  border-radius: 4px;
  background: #fff;
  color: #1c2b23;
}

.variable-list {
  max-height: 340px;
  overflow-y: auto;
  border-block: 1px solid #d5ddd8;
  background: #fff;
}

.variable-group {
  padding: 15px 12px;
  border-bottom: 1px solid #e0e5e2;
}

.variable-group:last-child {
  border-bottom: 0;
}

.variable-group h3 {
  margin: 0 0 9px;
  color: #6c7871;
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
}

.variable-option {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  color: #24342b;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.variable-option input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #176b4a;
}

.variable-option:has(input:disabled) {
  color: #909a94;
  cursor: not-allowed;
}

.variable-search-empty {
  margin: 0;
  padding: 18px 12px;
  color: #6c7871;
  font-size: 12px;
}

.data-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.data-query-button {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.data-query-button:disabled,
#submit-diagnosis-btn:disabled {
  opacity: 0.62;
  cursor: wait;
}

.query-results {
  min-width: 0;
  padding: 30px;
}

.data-empty-state,
.history-empty {
  display: grid;
  min-height: 360px;
  align-content: center;
  justify-items: center;
  padding: 36px;
  color: #627067;
  text-align: center;
}

.data-empty-state h2,
.history-empty h3 {
  margin: 5px 0 7px;
  color: #24342b;
  font-size: 23px;
}

.data-empty-state > p:last-child,
.history-empty p {
  max-width: 530px;
  margin: 0;
}

.data-result-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.data-result-header h2 {
  margin: 3px 0 0;
  font-size: 24px;
}

.data-result-header > p {
  max-width: 340px;
  margin: 0;
  color: #647168;
  font-size: 12px;
  text-align: right;
}

.data-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 26px;
  border-block: 1px solid #ccd5cf;
}

.data-metrics div {
  padding: 15px 18px 15px 0;
}

.data-metrics div + div {
  padding-left: 18px;
  border-left: 1px solid #ccd5cf;
}

.data-metrics dt {
  color: #69766e;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-metrics dd {
  margin: 2px 0 0;
  color: #153e2d;
  font-size: 24px;
  font-weight: 800;
}

.variable-summaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 28px;
  border-top: 1px solid #d4dcd7;
}

.variable-summary {
  min-width: 0;
  padding: 17px 20px 17px 0;
  border-bottom: 1px solid #d4dcd7;
}

.variable-summary:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid #d4dcd7;
}

.variable-summary h3 {
  margin: 0 0 6px;
  color: #25362d;
  font-size: 13px;
  line-height: 1.4;
}

.variable-summary p {
  margin: 0;
  color: #647168;
  font-size: 12px;
  line-height: 1.5;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #cbd4ce;
}

.data-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.data-table th {
  padding: 11px 12px;
  border-bottom: 1px solid #bfcac3;
  background: #eef2ef;
  color: #56635b;
  font-size: 10px;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  max-width: 300px;
  padding: 11px 12px;
  border-bottom: 1px solid #e0e5e2;
  color: #26352d;
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #f7f9f7;
}

.data-table a {
  color: #0d6242;
  font-weight: 800;
}

.answer-cell {
  white-space: pre-line;
}

.history-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  padding: 28px 30px;
  border: 1px solid #c8d1cb;
  background: #fff;
}

.history-controls h2 {
  margin: 3px 0 6px;
  font-size: 24px;
}

.history-controls > div > p:last-child {
  max-width: 630px;
  margin: 0;
  color: #647168;
}

.history-municipality-field {
  width: min(460px, 44%);
  margin: 0;
}

.history-empty {
  margin-top: 18px;
  border: 1px solid #c8d1cb;
  background: #fff;
}

.history-output {
  margin-top: 18px;
  padding: 28px 30px 32px;
  border: 1px solid #c8d1cb;
  background: #fff;
}

.history-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.history-title-row span {
  color: #176b4a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-title-row h3 {
  margin: 3px 0 0;
  font-size: 22px;
}

.history-title-row > strong {
  color: #5e6c64;
  font-size: 12px;
}

.history-table {
  min-width: 760px;
}

.table-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border: 1px solid #91aa9d;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .data-shell {
    width: min(100% - 32px, 1480px);
    padding-top: 30px;
  }

  .data-workbench {
    grid-template-columns: 1fr;
  }

  .query-sidebar {
    border-right: 0;
    border-bottom: 1px solid #c8d1cb;
  }

  .variable-list {
    max-height: 260px;
  }

  .history-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .history-municipality-field {
    width: 100%;
  }
}

@media (max-width: 660px) {
  .data-account-nav {
    gap: 4px;
  }

  .data-account-nav .map-return:nth-child(2) {
    display: none;
  }

  .data-shell {
    width: min(100% - 24px, 1480px);
    padding: 24px 0 46px;
  }

  .data-intro h1 {
    font-size: 28px;
  }

  .data-tabs {
    display: grid;
    width: 100%;
  }

  .data-tabs button {
    padding-inline: 10px;
    font-size: 12px;
  }

  .query-sidebar,
  .query-results,
  .history-controls,
  .history-output {
    padding: 20px 16px;
  }

  .data-date-range,
  .data-metrics,
  .variable-summaries {
    grid-template-columns: 1fr;
  }

  .data-metrics div,
  .data-metrics div + div {
    padding: 11px 0;
    border-top: 1px solid #d4dcd7;
    border-left: 0;
  }

  .data-metrics div:first-child {
    border-top: 0;
  }

  .variable-summary,
  .variable-summary:nth-child(even) {
    padding: 14px 0;
    border-left: 0;
  }

  .data-result-header,
  .history-title-row {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .data-result-header > p {
    text-align: left;
  }
}

/* Leitura pública do Diagnóstico */
.municipality-detail-shell {
  width: min(1240px, calc(100% - 48px));
  padding-top: 42px;
}

.municipality-identity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.municipality-identity h1 {
  margin-bottom: 0;
}

.diagnosis-update {
  margin: 0 0 5px;
  color: #536159;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.diagnosis-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 22px;
  overflow: hidden;
  border: 1px solid #ccd7d0;
  border-radius: 8px;
  background: #ccd7d0;
}

.diagnosis-metadata[hidden] {
  display: none;
}

.diagnosis-metadata > div {
  min-width: 0;
  padding: 16px 18px;
  background: #f8faf8;
}

.diagnosis-metadata dt {
  margin-bottom: 5px;
  color: #718078;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.diagnosis-metadata dd {
  margin: 0;
  color: #203a2f;
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 680px) {
  .diagnosis-metadata {
    grid-template-columns: 1fr;
  }
}

.municipality-detail-summary {
  grid-template-columns: 1.15fr 1fr 0.9fr 0.9fr;
}

.municipality-program-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 0;
}

.municipality-program-details dd {
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.municipality-empty {
  margin-top: 58px;
  padding: 42px 0;
  border-top: 3px solid #77857e;
}

.municipality-empty h2 {
  margin: 0 0 10px;
  font-size: 29px;
}

.municipality-empty > p:last-child {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
}

.diagnosis-reader {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 42px;
  margin-top: 54px;
  align-items: start;
}

.diagnosis-index {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding-right: 16px;
}

.diagnosis-index > span {
  padding-bottom: 10px;
  border-bottom: 1px solid #cbd3ce;
  color: #647069;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.diagnosis-index nav {
  display: grid;
  gap: 2px;
}

.diagnosis-index a {
  display: block;
  padding: 7px 9px;
  border-left: 2px solid transparent;
  color: #546159;
  font-size: 12px;
  line-height: 1.3;
  text-decoration: none;
}

.diagnosis-index a:hover,
.diagnosis-index a.is-active {
  border-left-color: var(--green);
  background: #e8efeb;
  color: #123f2c;
}

.diagnosis-content {
  min-width: 0;
  background: #fff;
}

.diagnosis-section {
  scroll-margin-top: 18px;
  padding: 30px 34px 38px;
  border-top: 1px solid #cdd5d0;
}

.diagnosis-section:first-child {
  border-top: 3px solid var(--green);
}

.diagnosis-section > header,
.diagnosis-subsection > header {
  margin-bottom: 24px;
}

.diagnosis-section > header p,
.diagnosis-subsection > header p,
.diagnosis-part-heading p {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.diagnosis-section > header h2,
.diagnosis-part-heading h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.diagnosis-subsection > header h3 {
  margin: 0;
  font-size: 18px;
}

.diagnosis-part-heading {
  padding: 22px 34px;
  border-top: 1px solid #29483a;
  background: #173328;
  color: #fff;
}

.diagnosis-part-heading p {
  color: #b8dac6;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #dde3df;
}

.answer-item {
  min-width: 0;
  padding: 16px 20px 17px 0;
  border-bottom: 1px solid #dde3df;
}

.answer-item:nth-child(even):not(.answer-wide) {
  padding-left: 20px;
  border-left: 1px solid #dde3df;
}

.answer-wide {
  grid-column: 1 / -1;
}

.answer-item dt {
  margin-bottom: 6px;
  color: #68746d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.answer-item dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #1d2b24;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

.diagnosis-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  border-block: 1px solid #cfd7d2;
}

.diagnosis-metrics div {
  display: grid;
  gap: 2px;
  padding: 16px 18px 16px 0;
}

.diagnosis-metrics div + div {
  padding-left: 18px;
  border-left: 1px solid #cfd7d2;
}

.diagnosis-metrics strong {
  color: #153e2d;
  font-size: 23px;
}

.diagnosis-metrics span {
  color: #657169;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-list-readonly {
  border-top: 1px solid #d8dfdb;
}

.activity-readonly {
  padding: 22px 0 28px;
  border-bottom: 1px solid #d8dfdb;
}

.activity-readonly h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.activity-readonly .answer-grid {
  border-top: 0;
}

.diagnosis-subsection {
  padding: 28px 0 6px;
  border-top: 1px solid #cfd7d2;
}

.diagnosis-subsection:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.attachment-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.attachment-list li {
  padding-left: 2px;
}

.attachment-list a {
  color: #176846;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .workflow-strip {
    margin: 14px 16px 0;
    padding: 17px 15px;
  }

  .workflow-heading,
  .workflow-fields,
  .profile-workflows-heading,
  .profile-workflow-item {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-fields {
    display: grid;
  }

  .workflow-fields label,
  .workflow-sync {
    flex-basis: auto;
  }

  .profile-workflow-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-workflow-actions {
    justify-content: flex-start;
  }
}

.section-empty-text {
  margin: 0;
  color: #6a756f;
  font-size: 13px;
}

@media (max-width: 980px) {
  .municipality-detail-shell {
    width: min(100% - 36px, 980px);
  }

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

  .municipality-detail-summary div:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid #d8dfdb;
    border-left: 0;
  }

  .municipality-detail-summary div:nth-child(4) {
    border-top: 1px solid #d8dfdb;
  }

  .diagnosis-reader {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .diagnosis-index {
    position: sticky;
    z-index: 20;
    top: 0;
    display: block;
    max-height: none;
    overflow: hidden;
    padding: 8px 0;
    border-block: 1px solid #cbd3ce;
    background: #f1f4f2;
  }

  .diagnosis-index > span {
    display: none;
  }

  .diagnosis-index nav {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .diagnosis-index a {
    flex: 0 0 auto;
    border-bottom: 2px solid transparent;
    border-left: 0;
    white-space: nowrap;
  }

  .diagnosis-index a:hover,
  .diagnosis-index a.is-active {
    border-bottom-color: var(--green);
    border-left-color: transparent;
  }
}

@media (max-width: 660px) {
  .municipality-detail-shell {
    width: min(100% - 28px, 980px);
    padding-top: 34px;
  }

  .municipality-identity {
    display: grid;
    gap: 8px;
  }

  .diagnosis-update {
    white-space: normal;
  }

  .municipality-detail-summary {
    grid-template-columns: 1fr;
  }

  .municipality-detail-summary div,
  .municipality-detail-summary div + div,
  .municipality-detail-summary div:nth-child(3),
  .municipality-detail-summary div:nth-child(4) {
    padding: 13px 0;
    border-top: 1px solid #d8dfdb;
    border-left: 0;
  }

  .municipality-detail-summary div:first-child {
    border-top: 0;
  }

  .diagnosis-reader {
    margin-top: 38px;
  }

  .diagnosis-section {
    padding: 25px 19px 32px;
  }

  .diagnosis-part-heading {
    padding: 19px;
  }

  .diagnosis-section > header h2,
  .diagnosis-part-heading h2 {
    font-size: 21px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .answer-item,
  .answer-item:nth-child(even):not(.answer-wide) {
    grid-column: 1;
    padding: 14px 0;
    border-left: 0;
  }

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

  .diagnosis-metrics div,
  .diagnosis-metrics div + div {
    padding: 12px 0;
    border-top: 1px solid #d8dfdb;
    border-left: 0;
  }

  .diagnosis-metrics div:first-child {
    border-top: 0;
  }
}

@media (max-width: 760px) {
  .home-hero,
  .about-hero,
  .auth-page {
    background-image: url("/hero-reciclagem-mobile.webp");
    background-image: image-set(
      url("/hero-reciclagem-mobile.avif") type("image/avif"),
      url("/hero-reciclagem-mobile.webp") type("image/webp")
    );
  }
}
