:root {
  --bg: #f3f6f6;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee6;
  --brand: #126b5f;
  --brand-strong: #0d4f47;
  --blue: #2563eb;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.app-view:not([hidden]) {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p {
  margin: 0;
}

.public-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(rgba(246, 248, 248, 0.72), rgba(246, 248, 248, 0.72)),
    linear-gradient(rgba(18, 107, 95, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 107, 95, 0.08) 1px, transparent 1px),
    var(--public-blue-marble-url, none),
    #f6f8f8;
  background-size: auto, 36px 36px, 36px 36px, cover, auto;
  background-position: center;
}

.signup-view {
  min-height: 100vh;
  padding: 28px 16px;
  background: #f6f8f8;
}

.signup-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.signup-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.signup-heading .public-logo {
  margin-bottom: 14px;
}

.signup-heading h1 {
  color: var(--ink);
  font-size: 34px;
  line-height: 1.08;
}

.signup-form {
  display: grid;
  gap: 14px;
}

.signup-section {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.signup-section h2 {
  color: var(--ink);
  font-size: 18px;
}

.terms-box {
  height: min(360px, 48vh);
  min-height: 220px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.terms-download {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-strong);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--brand-strong);
  font-weight: 800;
}

.terms-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 4px;
  background: #fff;
}

.terms-fallback {
  margin-top: 8px;
}

.terms-check {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
}

.terms-check input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.signup-actions {
  justify-content: flex-end;
  align-items: center;
}

.public-hero {
  width: min(760px, 100%);
  display: grid;
  justify-items: start;
}

.example-report-link {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 5;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 6px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.example-report-link:hover,
.example-report-link:focus-visible {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand);
}

.public-logo {
  width: 138px;
  height: auto;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.public-hero h1 {
  max-width: 720px;
  font-size: 52px;
  line-height: 1.06;
}

.public-copy {
  max-width: 560px;
  margin-top: 14px;
  color: #536273;
  font-size: 18px;
  line-height: 1.45;
}

.public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-button,
.ghost-button,
.google-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 6px;
  padding: 0 15px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--brand-strong);
  background: var(--brand);
  color: #fff;
}

.ghost-button,
.google-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.google-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  font-weight: 800;
}

.auth-form {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.auth-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.auth-dialog .auth-form {
  width: 100%;
  max-height: calc(100dvh - 32px);
  margin: 0;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
}

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

.auth-actions .primary-button {
  margin-left: auto;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #eef6f7;
  color: var(--ink);
}

.order-option {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
}

.order-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.form-note,
.form-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-message {
  min-height: 18px;
  color: var(--brand-strong);
}

.form-message.is-error {
  min-height: 0;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #dc2626;
  border-left-width: 4px;
  border-radius: 6px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
}

.form-message.is-busy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-message.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid #b8d8d2;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

input:-webkit-autofill {
  animation-name: autofill-start;
  animation-duration: 0.01s;
}

@keyframes autofill-start {
  from {
    box-shadow: 0 0 0 1000px #fff inset;
  }
  to {
    box-shadow: 0 0 0 1000px #fff inset;
  }
}

.simple-topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.simple-topbar h1 {
  font-size: 24px;
}

.topbar-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.topbar-spacer {
  flex: 1;
}

.profile-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.profile-button:hover {
  border-color: var(--line);
  background: #fff;
}

.profile-avatar,
.account-avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #e7f3f1;
  color: var(--brand-strong);
  font-weight: 800;
}

.profile-avatar {
  width: 31px;
  height: 31px;
  font-size: 13px;
}

.account-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  font-size: 24px;
}

.profile-avatar img,
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.registration-layout {
  width: min(1180px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  margin: 16px auto;
}

.step-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.step-card h2 {
  font-size: 17px;
}

.step-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

#emailCodeForm {
  grid-template-columns: auto minmax(160px, 1fr) auto;
}

.code-row {
  margin-top: 4px;
}

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

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.orders-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 16px;
}

.map-panel,
.orders-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.map-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.orders-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.order-panel-form,
.manual-edit-panel,
.sigef-selection-panel,
.order-review-panel {
  position: relative;
  z-index: 2;
  min-height: 0;
}

.orders-list {
  position: relative;
  z-index: 1;
  min-height: 0;
}

.orders-panel.is-creating {
  grid-template-rows: auto minmax(0, 1fr);
}

.orders-panel.is-creating .orders-list {
  display: none;
}

.orders-panel.is-creating .order-panel-form,
.orders-panel.is-creating .manual-edit-panel,
.orders-panel.is-creating .sigef-selection-panel,
.orders-panel.is-creating .order-review-panel {
  align-self: stretch;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.orders-panel.is-creating .sigef-selected-list {
  max-height: min(34vh, 320px);
}

.orders-panel.is-creating .order-panel-form:not([hidden]),
.orders-panel.is-creating .manual-edit-panel:not([hidden]),
.orders-panel.is-creating .sigef-selection-panel:not([hidden]),
.orders-panel.is-creating .order-review-panel:not([hidden]) {
  grid-row: 2;
  grid-column: 1 / -1;
  align-self: stretch;
  min-height: 0;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.map-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.basemap-control,
.municipality-control {
  min-width: 160px;
  color: var(--muted);
}

.municipality-control {
  min-width: 82px;
}

.municipality-select-control {
  min-width: 230px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.map-frame {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #eef4f3;
  border-radius: 0 0 8px 8px;
}

#ordersMap {
  width: 100%;
  height: 100%;
  min-height: 0;
}

#ordersMap.is-drawing {
  cursor: crosshair;
}

.map-control-button {
  position: absolute;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.map-home-button {
  top: 74px;
  font-size: 14px;
}

.map-locate-button {
  top: 110px;
}

.layer-panel {
  position: absolute;
  top: 12px;
  right: 48px;
  z-index: 3;
  width: min(360px, calc(100% - 72px));
  max-height: calc(100% - 24px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

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

.layer-panel-header {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--brand-strong);
  color: #fff;
}

.layer-panel-header h3 {
  margin: 0;
  font-size: 15px;
}

.layer-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

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

.layer-group p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.layer-group label {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.layer-scale-hint {
  margin-left: auto;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.layer-group input {
  width: 16px;
  height: 16px;
}

.map-control-button:hover {
  background: #f4f6f8;
}

.map-control-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.draw-toolbar {
  position: absolute;
  left: 12px;
  bottom: 34px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.draw-toolbar[hidden] {
  display: none;
}

.draw-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.draw-selection-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.draw-selection-tools .icon-button {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  font-size: 18px;
}

.draw-selection-tools .is-active {
  border-color: var(--brand);
  background: #dbeafe;
  color: var(--brand-strong);
}

.envelope-review-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #0f172a;
}

.envelope-review-box[hidden] {
  display: none;
}

.envelope-review-box strong {
  font-size: 14px;
  color: #0f172a;
}

.envelope-review-box p {
  display: grid;
  gap: 3px;
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.envelope-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.orders-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.panel-header {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
}

.panel-header .legend {
  grid-column: 1 / -1;
}

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

.order-panel-form {
  border-bottom: 1px solid var(--line);
  background: #fbfefe;
  overflow-y: auto;
  max-height: 100%;
  overscroll-behavior: contain;
}

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

.order-panel-form .order-form {
  padding: 14px 16px;
}

.order-panel-form .dialog-heading {
  align-items: start;
}

.order-panel-form .dialog-heading h2 {
  margin: 0;
  font-size: 18px;
}

.area-methods {
  display: grid;
  gap: 8px;
}

.area-methods .ghost-button {
  width: 100%;
}

#orderCount {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e7f3f1;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 12px;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.order-pay-button,
.order-download-button,
.order-edit-button,
.order-delete-button {
  justify-self: end;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.order-download-button {
  border: 1px solid #99f6e4;
  background: var(--brand-strong);
  color: #fff;
}

.order-download-button:hover {
  background: #00685e;
}

.order-pay-button {
  border: 1px solid #99f6e4;
  color: var(--brand-strong);
}

.order-pay-button:hover {
  background: #ccfbf1;
}

.order-edit-button {
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.order-edit-button:hover {
  background: #dbeafe;
}

.order-delete-button {
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.order-delete-button:hover {
  background: #fee2e2;
}

.payment-dialog .order-form {
  width: min(560px, calc(100vw - 32px));
}

.order-report {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.order-report small {
  color: var(--muted);
  font-weight: 700;
}

.payment-order-name {
  font-weight: 800;
  color: var(--text);
}

.coupon-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.coupon-row input {
  min-width: 0;
  text-transform: uppercase;
}

.payment-methods-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  padding: 12px;
}

.payment-methods-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
}

.payment-methods-heading span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.payment-method-grid {
  display: grid;
  gap: 10px;
}

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

.payment-method-card {
  display: grid;
  gap: 10px;
  border: 1px solid #c8ebe3;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.payment-method-card h3 {
  margin: 0 0 4px;
  color: var(--brand-strong);
  font-size: 15px;
}

.payment-method-card p,
.payment-method-card small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.payment-method-card.is-muted {
  border-color: var(--line);
  background: #f5f7f7;
}

.payment-code-preview {
  overflow-wrap: anywhere;
  border: 1px dashed #99c9bf;
  border-radius: 6px;
  background: #f8fbfb;
  padding: 8px;
  color: var(--ink) !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px !important;
}

.pix-qr-box {
  width: min(220px, 100%);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pix-qr-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.pix-countdown {
  width: fit-content;
  padding: 6px 8px;
  border-radius: 6px;
  background: #e8f7f3;
  color: var(--brand-strong) !important;
  font-weight: 700;
}

.payment-method-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-paid-note {
  background: #eaf8f4;
  border: 1px solid #c8e8df;
  border-radius: 8px;
  color: #075844;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  padding: 10px 12px;
}

.payment-method-actions a,
.payment-method-card > .ghost-button,
.payment-method-card > .primary-button {
  width: fit-content;
  text-decoration: none;
}

@media (max-width: 640px) {
  .payment-choice-grid {
    grid-template-columns: 1fr;
  }
}

.orders-list {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.order-item {
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.order-item.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(18, 107, 95, 0.14);
}

.order-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order-name {
  font-weight: 700;
  line-height: 1.25;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.order-quote {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.order-quote div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.order-quote span {
  color: var(--muted);
}

.order-quote strong {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

.order-quote.is-pending {
  color: var(--muted);
}

.order-quote-total {
  margin-top: 2px;
  font-size: 13px;
}

.order-payment {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f0fdfa;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.order-payment small {
  color: var(--muted);
  font-weight: 600;
}

.order-payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.order-payment-actions a,
.order-payment-actions button {
  border: 1px solid #99c9bf;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-strong);
  padding: 5px 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.account-dialog,
.order-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.order-dialog {
  width: min(620px, calc(100vw - 32px));
}

.account-form,
.order-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.account-heading,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.account-heading p,
.dialog-heading p,
.draw-choice p {
  color: var(--muted);
  font-size: 14px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.file-drop {
  min-height: 112px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  border: 1px dashed #9fb4bd;
  border-radius: 8px;
  background: #f8fbfb;
  padding: 18px;
  color: var(--ink);
  text-align: center;
}

.file-drop input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-drop-title {
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 800;
}

.file-drop-text {
  color: var(--muted);
  font-size: 13px;
}

.mag-package-selector {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.mag-package-selector legend {
  padding: 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.mag-package-selector .order-option {
  margin: 0;
}

.mag-package-selector .is-locked {
  color: var(--muted);
}

.mag-package-preview {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mag-package-preview strong {
  color: var(--brand-strong);
  font-size: 18px;
}

.mag-package-preview small {
  color: var(--muted);
}

.draw-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.draw-choice h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  border-radius: 999px;
  background: #e7f3f1;
  color: var(--brand-strong);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.municipality-select-control select:disabled {
  color: #e9e9e9;
  background-color: #f8fafc;
  cursor: not-allowed;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .app-view:not([hidden]) {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .public-view {
    min-height: 100svh;
    align-items: start;
    padding: 24px 16px;
  }

  .example-report-link {
    position: static;
    justify-self: end;
    margin-bottom: 18px;
  }

  .signup-view {
    min-height: 100svh;
    padding: 16px 10px;
  }

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

  .signup-heading h1 {
    font-size: 28px;
  }

  .public-logo {
    width: 116px;
    margin-bottom: 18px;
  }

  .public-hero h1 {
    font-size: 36px;
  }

  .public-copy {
    font-size: 16px;
  }

  .public-actions,
  .auth-actions,
  .form-actions,
  .panel-actions,
  .order-actions,
  .draw-choice {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .google-button,
  .order-pay-button,
  .order-download-button,
  .order-edit-button,
  .order-delete-button {
    width: 100%;
    min-height: 44px;
  }

  .auth-actions .primary-button {
    margin-left: 0;
  }

  .simple-topbar {
    min-height: auto;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }

  .simple-topbar h1 {
    font-size: 20px;
  }

  .topbar-logo {
    width: 40px;
    height: 40px;
  }

  .topbar-spacer {
    display: none;
  }

  .profile-button {
    width: 100%;
    justify-content: flex-start;
    min-width: 0;
    padding: 6px 0;
  }

  .profile-button span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .registration-layout,
  .orders-layout {
    width: 100%;
    margin: 0;
    padding: 10px;
  }

  .registration-layout {
    gap: 10px;
  }

  .orders-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .form-grid,
  .inline-form,
  #emailCodeForm,
  .coupon-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .map-panel,
  .orders-panel {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .map-panel {
    order: 1;
  }

  .orders-panel {
    order: 2;
  }

  .orders-panel.is-creating {
    max-height: calc(100dvh - 120px);
    overflow: hidden;
  }

  .map-toolbar,
  .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .map-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
    gap: 8px;
  }

  .basemap-control,
  .municipality-control,
  .municipality-select-control {
    min-width: 0;
  }

  .map-tools .basemap-control,
  .map-tools .municipality-select-control,
  .map-tools #layerPanelButton {
    grid-column: 1 / -1;
  }

  .map-frame {
    height: min(62svh, 520px);
    min-height: 360px;
    border-radius: 0 0 8px 8px;
  }

  #ordersMap {
    height: 100%;
    min-height: 360px;
  }

  .layer-panel {
    inset: 10px;
    width: auto;
    max-height: calc(100% - 20px);
  }

  .draw-toolbar {
    left: 8px;
    right: 8px;
    bottom: 22px;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .draw-toolbar span,
  .draw-selection-tools,
  .envelope-review-box {
    grid-column: 1 / -1;
  }

  .order-panel-form {
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .orders-panel.is-creating .order-panel-form:not([hidden]),
  .orders-panel.is-creating .manual-edit-panel:not([hidden]),
  .orders-panel.is-creating .sigef-selection-panel:not([hidden]) {
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .orders-list {
    max-height: none;
    overflow: visible;
    padding: 8px;
  }

  .order-title-row,
  .order-report,
  .order-quote div {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-pill {
    align-self: flex-start;
  }

  .account-dialog,
  .order-dialog,
  .payment-dialog .order-form {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  .account-form,
  .order-form {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .public-hero h1 {
    font-size: 31px;
  }

  .map-tools {
    grid-template-columns: 1fr;
  }

  .map-frame,
  #ordersMap {
    min-height: 340px;
  }
}

@media (max-height: 760px) {
  .simple-topbar {
    min-height: 60px;
    padding: 8px 16px;
  }

  .simple-topbar h1 {
    font-size: 21px;
  }

  .topbar-logo {
    width: 38px;
    height: 38px;
  }

  .profile-avatar {
    width: 28px;
    height: 28px;
  }

  .orders-layout {
    gap: 10px;
    padding: 10px;
  }

  .map-toolbar,
  .panel-header {
    padding: 10px 12px;
  }

  .panel-header {
    min-height: 74px;
  }

  .panel-header h2,
  .map-toolbar h2 {
    font-size: 22px;
    line-height: 1.08;
  }

  .map-toolbar p,
  .legend {
    font-size: 12px;
  }

  .order-panel-form .order-form,
  .account-form,
  .order-form {
    gap: 9px;
    padding: 10px 12px;
  }

  .order-panel-form .dialog-heading h2,
  .sigef-selection-panel .dialog-heading h2,
  .sigef-selected-header h3 {
    font-size: 16px;
  }

  .file-drop {
    min-height: 82px;
    padding: 12px;
  }

  .form-note,
  .form-message,
  .dialog-heading p {
    font-size: 12px;
  }

  input,
  select,
  .primary-button,
  .ghost-button,
  .google-button {
    min-height: 34px;
  }
}


.sigef-selection-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfefe;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.order-review-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfefe;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.sigef-selection-panel .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-inline: -16px;
  padding: 10px 16px 0;
  background: #fbfefe;
  border-top: 1px solid var(--line);
}

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

.sigef-selection-panel .dialog-heading {
  align-items: start;
}

.sigef-selection-panel .dialog-heading h2,
.sigef-selected-header h3 {
  margin: 0;
  font-size: 18px;
}

.sigef-search-actions,
.sigef-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sigef-results,
.sigef-selected-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.sigef-result-item,
.sigef-selected-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sigef-result-item strong,
.sigef-selected-item strong {
  color: var(--brand-strong);
}

.sigef-result-meta {
  color: var(--muted);
  font-size: 12px;
}


.manual-edit-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfefe;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.manual-edit-panel .dialog-heading h2 {
  margin: 0;
  font-size: 16px;
}

.manual-edit-panel .dialog-heading p {
  margin-top: 2px;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.25;
}

.manual-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}


.manual-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.manual-tool-grid .ghost-button,
.manual-edit-actions .ghost-button,
.manual-edit-actions .primary-button {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.manual-tool-grid .is-active {
  border-color: var(--brand);
  background: #e7f3f1;
  color: var(--brand-strong);
}

.manual-snap-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

@media (max-height: 760px) {
  .sigef-selection-panel,
  .manual-edit-panel {
    gap: 8px;
    padding: 10px 12px;
  }

  .sigef-selection-panel .dialog-heading h2,
  .sigef-selected-header h3,
  .manual-edit-panel .dialog-heading h2 {
    font-size: 16px;
    line-height: 1.15;
  }

  .sigef-results,
  .sigef-selected-list {
    max-height: min(24dvh, 150px);
  }

  .manual-tool-grid,
  .manual-edit-actions {
    gap: 6px;
  }
}

.mag-landing {
  --mag-navy: #1d385f;
  --mag-navy-deep: #061c2b;
  --mag-navy-deeper: #04141f;
  --mag-teal: #337f82;
  --mag-teal-bright: #3fa8a2;
  --mag-teal-soft: #74cec8;
  --mag-ink: #142a3d;
  --mag-muted: #617481;
  --mag-line: #d8e2e5;
  --mag-paper: #f5f8f8;
  display: block;
  min-height: 100vh;
  padding: 0;
  background: #fff;
  color: var(--mag-ink);
}

.mag-landing h1,
.mag-landing h2,
.mag-landing h3,
.mag-landing p {
  margin: 0;
}

.mag-site-header {
  position: relative;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid rgba(216, 226, 229, 0.78);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.mag-hero-shade {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.mag-topbar {
  position: relative;
  width: min(1440px, calc(100% - 64px));
  margin: auto;
}

.mag-topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.mag-brand img {
  width: 138px;
  height: auto;
  display: block;
  border-radius: 4px;
}

.mag-main-nav,
.mag-hero-ctas {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mag-main-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--mag-navy-deep);
  font-weight: 800;
}

.mag-main-nav > a:not(.mag-btn) {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
}

.mag-main-nav > a:not(.mag-btn):hover,
.mag-main-nav > a:not(.mag-btn):focus-visible {
  background: #eef6f7;
  color: var(--mag-teal);
}

.mag-menu-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 1px solid var(--mag-line);
  border-radius: 8px;
  background: #fff;
  color: var(--mag-navy);
  font-size: 25px;
  font-weight: 850;
}

.mag-hero {
  position: relative;
  min-height: calc(100svh - 86px);
  overflow: hidden;
  background:
    linear-gradient(rgba(246, 248, 248, 0.72), rgba(246, 248, 248, 0.72)),
    linear-gradient(rgba(18, 107, 95, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 107, 95, 0.08) 1px, transparent 1px),
    var(--public-blue-marble-url, none),
    #f6f8f8;
  background-size: auto, 36px 36px, 36px 36px, cover, auto;
  background-position: center;
  color: var(--mag-ink);
}

.mag-hero-grid {
  position: relative;
  z-index: 2;
  width: min(1440px, calc(100% - 64px));
  margin: auto;
}

.mag-hero-ctas {
  flex-wrap: wrap;
  margin-top: 27px;
  gap: 12px;
}

.mag-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 750;
  line-height: 1;
  transition: transform 0.17s ease, background 0.17s ease, border-color 0.17s ease;
}

.mag-btn:hover,
.mag-btn:focus-visible {
  transform: translateY(-1px);
}

.mag-btn-primary {
  background: linear-gradient(135deg, #287b7c, #399a94);
  color: #fff;
  box-shadow: 0 12px 30px rgba(24, 120, 115, 0.22);
}

.mag-btn-primary:hover,
.mag-btn-primary:focus-visible {
  background: linear-gradient(135deg, #318989, #43aaa3);
}

.mag-btn-ghost,
.mag-btn-outline {
  border-color: rgba(18, 107, 95, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: var(--mag-ink);
}

.mag-btn-ghost:hover,
.mag-btn-ghost:focus-visible,
.mag-btn-outline:hover,
.mag-btn-outline:focus-visible {
  border-color: var(--mag-teal);
  background: rgba(255, 255, 255, 0.94);
}

.mag-btn-large {
  min-height: 50px;
  padding: 0 24px;
}

.mag-hero-grid {
  min-height: calc(100svh - 86px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  align-items: center;
  gap: clamp(48px, 6.5vw, 105px);
  padding: 20px 0 62px;
}

.mag-hero-copy {
  max-width: 740px;
}

.mag-kicker {
  margin-bottom: 14px;
  color: var(--mag-teal);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
}

.mag-hero h1 {
  max-width: 720px;
  color: #17202a;
  font-size: clamp(48px, 5vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.mag-hero h1 span {
  display: block;
  margin-top: 8px;
  color: var(--mag-teal);
}

.mag-lead {
  max-width: 690px;
  margin-top: 25px;
  color: #344456;
  font-size: 19px;
  line-height: 1.5;
}

.mag-manifesto {
  margin-top: 25px;
  padding: 19px 22px;
  border: 1px solid rgba(51, 127, 130, 0.24);
  border-left: 4px solid var(--mag-teal-bright);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.mag-manifesto strong {
  color: #17202a;
  font-size: 18px;
  line-height: 1.35;
}

.mag-manifesto p {
  margin-top: 7px;
  color: #536273;
  font-size: 14.5px;
  line-height: 1.48;
}

.mag-hero-panel {
  max-width: 590px;
  justify-self: end;
  padding: 28px;
  border: 1px solid rgba(51, 127, 130, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 24px 75px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(13px);
}

.mag-panel-kicker {
  color: var(--mag-teal);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.mag-hero-panel h2 {
  margin: 7px 0 20px;
  color: var(--mag-navy);
  font-size: 29px;
  line-height: 1.12;
}

.mag-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.mag-mini-grid article {
  min-height: 126px;
  padding: 17px;
  border: 1px solid rgba(51, 127, 130, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.mag-mini-grid b {
  display: block;
  margin-bottom: 7px;
  color: var(--mag-navy);
}

.mag-mini-grid p {
  color: #536273;
  font-size: 12.5px;
  line-height: 1.42;
}

.mag-panel-note {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(20, 42, 61, 0.1);
  color: #536273;
  font-size: 12.5px;
}

.mag-report-dialog {
  --mag-navy: #1d385f;
  --mag-teal: #337f82;
  --mag-ink: #142a3d;
  --mag-muted: #617481;
  --mag-line: #d8e2e5;
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--mag-ink);
}

.mag-report-dialog::backdrop {
  background: rgba(6, 28, 43, 0.55);
  backdrop-filter: blur(2px);
}

.mag-report-dialog-card {
  padding: 28px;
  border: 1px solid rgba(51, 127, 130, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.mag-report-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.mag-report-dialog-head h2 {
  color: var(--mag-navy);
  font-size: 29px;
  line-height: 1.12;
}

.mag-report-dialog-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--mag-line);
  border-radius: 8px;
  background: #fff;
  color: var(--mag-navy);
  font-size: 26px;
  line-height: 1;
}

.mag-report-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mag-report-options a {
  display: grid;
  gap: 7px;
  min-height: 142px;
  padding: 18px;
  border: 1px solid rgba(51, 127, 130, 0.2);
  border-radius: 8px;
  background: #f7fbfb;
  color: var(--mag-ink);
}

.mag-report-options a:hover,
.mag-report-options a:focus-visible {
  border-color: var(--mag-teal);
  background: #eef8f8;
  transform: translateY(-1px);
}

.mag-report-options span {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #e1f1f0;
  color: var(--mag-teal);
  font-size: 13px;
  font-weight: 850;
}

.mag-report-options strong {
  color: var(--mag-navy);
  font-size: 18px;
  line-height: 1.22;
}

.mag-report-options small {
  align-self: end;
  color: var(--mag-muted);
  font-size: 13px;
}

.mag-report-example-trigger.mag-text-link {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.mag-package-grid {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: auto;
}

.mag-package-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--mag-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(19, 50, 67, 0.045);
}

.mag-package-report-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.mag-package-report-link:hover,
.mag-package-report-link:focus-visible {
  border-color: rgba(0, 133, 135, 0.45);
  box-shadow: 0 16px 38px rgba(19, 50, 67, 0.12);
  transform: translateY(-2px);
}

.mag-package-report-link:focus-visible {
  outline: 3px solid rgba(0, 150, 150, 0.24);
  outline-offset: 3px;
}

.mag-package-card span {
  width: fit-content;
  margin-bottom: 24px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e7f3f2;
  color: var(--mag-teal);
  font-size: 13px;
  font-weight: 850;
}

.mag-package-card h3 {
  margin-bottom: 11px;
  color: var(--mag-navy);
  font-size: 25px;
  line-height: 1.12;
}

.mag-package-card p {
  color: var(--mag-muted);
  font-size: 15px;
  line-height: 1.58;
}

.mag-package-modules {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.mag-package-modules li {
  position: relative;
  padding-left: 18px;
  color: #3f5263;
  font-size: 14px;
  line-height: 1.35;
}

.mag-package-modules li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mag-teal);
}

.mag-package-card-featured {
  background: linear-gradient(145deg, var(--mag-navy), #167077);
  color: #fff;
}

.mag-package-card-featured span {
  background: rgba(255, 255, 255, 0.14);
  color: #c6fffb;
}

.mag-package-card-featured h3,
.mag-package-card-featured p,
.mag-package-card-featured .mag-package-modules li {
  color: #fff;
}

.mag-package-card-featured .mag-package-modules li::before {
  background: #c6fffb;
}

.mag-fire-wrap {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: 54px;
  margin: auto;
}

.mag-fire-wrap h2 {
  margin-bottom: 14px;
  color: var(--mag-navy);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.04;
}

.mag-fire-wrap p {
  color: var(--mag-muted);
  font-size: 18px;
  line-height: 1.62;
}

.mag-fire-points {
  display: grid;
  gap: 14px;
}

.mag-fire-points article {
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(51, 127, 130, 0.2);
  border-left: 4px solid var(--mag-teal);
  border-radius: 8px;
  background: #f7fbfb;
}

.mag-fire-points strong {
  color: var(--mag-navy);
  font-size: 18px;
}

.mag-fire-points span {
  color: var(--mag-muted);
  line-height: 1.5;
}

.mag-section {
  padding: 88px 32px;
  background: #fff;
}

.mag-section-alt {
  padding: 88px 32px;
  background: #fff;
}

.mag-section-head {
  width: min(1040px, 100%);
  margin: 0 auto 44px;
  text-align: center;
}

.mag-section-head h2,
.mag-soil-copy h2,
.mag-roadmap h2,
.mag-example h2 {
  margin-bottom: 14px;
  color: var(--mag-navy);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.mag-section-head p,
.mag-roadmap p,
.mag-example p {
  color: var(--mag-muted);
  font-size: 17px;
  line-height: 1.65;
}

.mag-analysis-grid {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: auto;
}

.mag-analysis-card {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--mag-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(19, 50, 67, 0.045);
}

.mag-analysis-card span {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #e7f3f2;
  color: var(--mag-teal);
  font-weight: 850;
}

.mag-analysis-card h3 {
  margin-bottom: 9px;
  color: var(--mag-navy);
  font-size: 18px;
}

.mag-analysis-card p {
  color: var(--mag-muted);
  font-size: 14px;
  line-height: 1.55;
}

.mag-soil-wrap {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 70px;
  margin: auto;
}

.mag-soil-copy {
  max-width: 690px;
}

.mag-big-copy {
  color: #334b5b;
  font-size: 20px;
}

.mag-soil-copy p {
  color: var(--mag-muted);
  font-size: 16px;
  line-height: 1.65;
}

.mag-quote {
  margin: 25px 0 18px;
  padding: 21px 23px;
  border-left: 4px solid var(--mag-teal);
  border-radius: 8px;
  background: #e8f2f2;
  color: #254653;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.mag-text-link {
  color: var(--mag-teal);
  font-weight: 800;
}

.mag-text-link:hover,
.mag-text-link:focus-visible {
  text-decoration: underline;
}

.mag-soil-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mag-soil-facts article {
  min-height: 155px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 23px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--mag-navy), #174b58);
  color: #fff;
}

.mag-soil-facts strong {
  margin-bottom: 8px;
  font-size: 24px;
}

.mag-soil-facts span {
  color: #d7e5e8;
  font-size: 13px;
  line-height: 1.45;
}

.mag-roadmap-box {
  width: min(1440px, 100%);
  margin: auto;
  padding: 42px;
  border: 1px solid #d8e5e6;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #f1f7f7);
}

.mag-roadmap-box > div:first-child {
  max-width: 850px;
}

.mag-roadmap-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.mag-roadmap-flow div {
  padding: 12px 16px;
  border: 1px solid #bcd6d6;
  border-radius: 8px;
  background: #fff;
  color: var(--mag-navy);
  font-weight: 800;
}

.mag-roadmap-flow i {
  color: var(--mag-teal);
  font-size: 22px;
  font-style: normal;
}

.mag-openness-grid {
  width: min(1440px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: auto;
}

.mag-openness-card {
  padding: 28px;
  border: 1px solid var(--mag-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(19, 50, 67, 0.045);
}

.mag-openness-card h3 {
  margin-bottom: 10px;
  color: var(--mag-navy);
  font-size: 21px;
}

.mag-openness-card p {
  color: var(--mag-muted);
  font-size: 15px;
  line-height: 1.6;
}

.mag-example-wrap {
  width: min(1440px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  margin: auto;
}

.mag-example-wrap > div {
  max-width: 780px;
}

.mag-footer {
  padding: 56px 0 24px;
  background: #000;
  color: #d6e4ed;
}

.mag-footer-container {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
}

.mag-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 34px;
}

.mag-footer-brand {
  display: inline-flex;
  margin-bottom: 18px;
}

.mag-footer-brand img {
  width: 96px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.93;
}

.mag-footer p {
  max-width: 430px;
  color: #d6e4ed;
  font-size: 16px;
  line-height: 1.55;
}

.mag-footer h3 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 15px;
}

.mag-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mag-footer a {
  color: inherit;
}

.mag-footer .social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mag-footer .social-link::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  background: currentColor;
  -webkit-mask: var(--social-icon) center / contain no-repeat;
  mask: var(--social-icon) center / contain no-repeat;
}

.mag-footer .social-linkedin {
  --social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.98 3.5C4.98 4.88 3.86 6 2.5 6S0 4.88 0 3.5 1.12 1 2.5 1s2.48 1.12 2.48 2.5zM.34 8h4.32v15H.34V8zm7.48 0h4.14v2.05h.06c.58-1.1 1.99-2.26 4.1-2.26 4.38 0 5.19 2.88 5.19 6.63V23h-4.32v-7.61c0-1.82-.03-4.16-2.53-4.16-2.54 0-2.93 1.98-2.93 4.02V23H7.82V8z'/%3E%3C/svg%3E");
}

.mag-footer .social-facebook {
  --social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22.68 12.07C22.68 5.98 17.74 1.04 11.65 1.04S.62 5.98.62 12.07c0 5.5 4.03 10.06 9.3 10.89v-7.7H7.12v-3.19h2.8V9.64c0-2.76 1.64-4.29 4.16-4.29 1.2 0 2.46.22 2.46.22v2.71h-1.39c-1.37 0-1.8.85-1.8 1.72v2.07h3.06l-.49 3.19h-2.57v7.7c5.28-.83 9.33-5.39 9.33-10.89z'/%3E%3C/svg%3E");
}

.mag-footer .social-instagram {
  --social-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 2h9A5.5 5.5 0 0 1 22 7.5v9a5.5 5.5 0 0 1-5.5 5.5h-9A5.5 5.5 0 0 1 2 16.5v-9A5.5 5.5 0 0 1 7.5 2zm0 2A3.5 3.5 0 0 0 4 7.5v9A3.5 3.5 0 0 0 7.5 20h9a3.5 3.5 0 0 0 3.5-3.5v-9A3.5 3.5 0 0 0 16.5 4h-9zM12 7a5 5 0 1 1 0 10 5 5 0 0 1 0-10zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6zm5.25-2.5a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z'/%3E%3C/svg%3E");
}

.mag-footer a:hover,
.mag-footer a:focus-visible {
  color: #fff;
}

.mag-footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9fb1bf;
  font-size: 14px;
}

.auth-google-button {
  width: 100%;
  min-height: 40px;
}

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

.mag-hero {
  min-height: 100svh;
}

.mag-hero-grid {
  min-height: calc(100svh - 124px);
}

@media (max-width: 1180px) {
  .mag-topbar {
    width: min(1440px, calc(100% - 64px));
  }

  .mag-menu-toggle {
    display: none;
  }
}

@media (max-width: 1120px) {
  .mag-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
    gap: 36px;
  }

  .mag-hero h1 {
    font-size: clamp(46px, 5.8vw, 64px);
  }

  .mag-hero-panel {
    padding: 22px;
  }

  .mag-mini-grid article {
    min-height: 136px;
    padding: 14px;
  }

  .mag-mini-grid p {
    font-size: 12.5px;
  }

  .mag-analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mag-package-grid {
    grid-template-columns: 1fr;
  }

  .mag-soil-wrap {
    grid-template-columns: 1fr;
  }

  .mag-fire-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .mag-hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .mag-hero-panel {
    max-width: none;
    justify-self: stretch;
  }

}

@media (max-width: 980px) {
  .mag-openness-grid {
    grid-template-columns: 1fr;
  }

  .mag-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .mag-hero-grid {
    width: min(100% - 28px, 1440px);
  }

  .mag-topbar {
    height: auto;
    min-height: 112px;
    width: min(100% - 28px, 1440px);
    padding: 12px 0;
  }

  .mag-brand img {
    width: 92px;
  }

  .mag-top-actions {
    justify-content: flex-end;
    max-width: 285px;
    gap: 6px;
  }

  .mag-top-actions .mag-btn {
    min-height: 39px;
    padding: 0 11px;
    font-size: 12px;
  }

  .mag-hero {
    min-height: auto;
  }

  .mag-hero-grid {
    padding-top: 42px;
    padding-bottom: 52px;
    gap: 28px;
  }

  .mag-hero h1 {
    font-size: clamp(40px, 11vw, 56px);
    line-height: 1.02;
  }

  .mag-lead {
    font-size: 17px;
  }

  .mag-mini-grid,
  .mag-analysis-grid,
  .mag-package-grid,
  .mag-soil-facts,
  .mag-openness-grid {
    grid-template-columns: 1fr;
  }

  .mag-package-card {
    min-height: auto;
    padding: 23px;
  }

  .mag-package-card span {
    margin-bottom: 22px;
  }

  .mag-fire-points article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mag-section,
  .mag-section-alt {
    padding: 64px 20px;
  }

  .mag-example-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .mag-roadmap-box {
    padding: 28px 22px;
  }

  .mag-footer {
    padding: 46px 0 22px;
  }

  .mag-footer-container {
    width: calc(100% - 30px);
  }

  .mag-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .mag-footer-bottom {
    margin-top: 28px;
  }

  .mag-report-dialog-card {
    padding: 22px;
  }

  .mag-report-dialog-head h2 {
    font-size: 24px;
  }

  .mag-report-options {
    grid-template-columns: 1fr;
  }

  .mag-report-options a {
    min-height: 0;
  }
}

/* Local MAG /analise correction: full-viewport BlueMarble top and blue footer. */
body:has(.mag-landing) {
  overflow-x: hidden;
  background: #fff;
}

.mag-landing.public-view {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: #fff;
}

.mag-landing .mag-hero {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
}

.mag-landing .mag-topbar,
.mag-landing .mag-hero-grid,
.mag-landing .mag-footer-container {
  width: min(1440px, calc(100vw - 64px));
  max-width: none;
}

.mag-landing .mag-topbar {
  min-height: 124px;
}

.mag-landing .mag-topbar .mag-brand img {
  width: 132px;
  max-width: 132px;
}

.mag-landing .mag-footer {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  background: #0a3049;
}

@media (max-width: 1120px) {
  .mag-landing .mag-topbar,
  .mag-landing .mag-hero-grid,
  .mag-landing .mag-footer-container {
    width: min(1440px, calc(100vw - 40px));
  }
}

@media (max-width: 720px) {
  .mag-landing .mag-topbar,
  .mag-landing .mag-hero-grid,
  .mag-landing .mag-footer-container {
    width: calc(100vw - 28px);
  }

  .mag-landing .mag-topbar {
    min-height: 112px;
  }

  .mag-landing .mag-topbar .mag-brand img {
    width: 98px;
    max-width: 98px;
  }
}
