.pix-modal-card.ae-card {
  width: min(1180px, 100%);
  height: min(860px, calc(100svh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  height: min(860px, calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height: calc(100svh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #fffdf9;
}
.ae-card > .ae-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #eadbd0;
}
.ae-header > div { min-width: 0; }
.ae-header > .ae-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.ae-header h2 { margin: 2px 0 0; }
.ae-header small { color: #8d3348; }
.ae-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; }
.ae-nav { display: flex; flex-direction: column; gap: 8px; padding: 16px 12px; background: #f8f1eb; border-right: 1px solid #eadbd0; overflow-y: auto; }
.ae-nav button { width: 100%; padding: 12px; text-align: left; color: #57483f; background: transparent; border: 1px solid transparent; border-radius: 8px; font-weight: 750; }
.ae-nav button[aria-current="page"] { color: #fff; background: #8d3348; }
.ae-content { min-width: 0; min-height: 0; overflow: auto; padding: 22px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.ae-content h3 { margin: 0 0 8px; font-size: 1.22rem; }
.ae-content h4 { margin: 0 0 8px; font-size: 1rem; }
.ae-content p { margin: 0; line-height: 1.5; }
.ae-lead { color: #75665d; margin-bottom: 18px !important; }
.ae-stack { display: grid; gap: 16px; min-width: 0; }
.ae-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.ae-span { grid-column: 1 / -1; }
.ae-box { min-width: 0; padding: 16px; border: 1px solid #eadbd0; border-radius: 10px; background: #fff; }
.ae-box + .ae-box { margin-top: 14px; }
.ae-stack > .ae-box + .ae-box { margin-top: 0; }
.ae-form { display: grid; gap: 14px; min-width: 0; }
.ae-form label { min-width: 0; gap: 6px; font-size: .86rem; color: #66584f; }
.ae-form input, .ae-form textarea, .ae-form select, .ae-toolbar input, .ae-toolbar select { min-width: 0; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d9c7ba; border-radius: 7px; background: #fffdf9; color: #2c2622; font: inherit; font-size: 1rem; }
.ae-form textarea { min-height: 100px; resize: vertical; }
.ae-form input[type="file"] { padding: 8px; font-size: .875rem; }
.ae-check { display: flex !important; align-items: flex-start; gap: 10px !important; line-height: 1.45; }
.ae-check input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 2px 0 0; accent-color: #8d3348; }
.ae-actions, .ae-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ae-toolbar { margin-bottom: 16px; }
.ae-toolbar label { flex: 1 1 180px; min-width: 0; }
.ae-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 14px; border: 1px solid #cdb9aa; border-radius: 7px; background: #fffaf6; color: #6f293b; font: inherit; font-weight: 750; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.ae-button.is-primary { background: #8d3348; border-color: #8d3348; color: #fff; }
.ae-button.is-danger { color: #94273e; border-color: #e6b4be; }
.ae-button:disabled { opacity: .55; cursor: not-allowed; }
.ae-button:focus-visible, .ae-nav button:focus-visible, .ae-form :focus-visible { outline: 3px solid #8d3348; outline-offset: 2px; }
.ae-close { flex: 0 0 44px; width: 44px; padding: 8px; font-size: 1.2rem; }
.ae-status { min-height: 44px; margin: 0; padding: 10px 22px; color: #57483f; border-top: 1px solid #eadbd0; background: #fbf6f1; font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere; }
.ae-status.is-error { color: #9b253a; background: #fff2f2; }
.ae-status.is-success { color: #276342; background: #f0f8f2; }
.ae-note { padding: 12px 14px; color: #705015; background: #fff6df; border: 1px solid #ead7a5; border-radius: 8px; font-size: .875rem; line-height: 1.5; }
.ae-muted { color: #75665d; font-size: .875rem; }
.ae-empty { padding: 24px 16px; text-align: center; color: #75665d; border: 1px dashed #d9c7ba; border-radius: 8px; }
.ae-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ae-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid #eadbd0; border-radius: 8px; background: #fff; }
.ae-item > div { flex: 1 1 180px; min-width: 0; }
.ae-item p { margin-top: 4px; color: #75665d; font-size: .875rem; overflow-wrap: anywhere; }
.ae-item .ae-actions { flex: 0 1 auto; }
.ae-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; color: #675449; background: #f4eae1; font-size: .75rem; font-weight: 750; line-height: 1.4; }
.ae-badge.is-good { color: #28633c; background: #eaf6ed; }
.ae-badge.is-off { color: #8a4522; background: #fff0dc; }
.ae-service-editor { border: 1px solid #eadbd0; border-radius: 8px; background: #fff; }
.ae-service-editor > summary { padding: 14px; cursor: pointer; font-weight: 750; }
.ae-service-editor > .ae-grid { padding: 0 14px 16px; }
.ae-photo-preview { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #f8f2ec; border: 1px solid #eadbd0; border-radius: 7px; }
.ae-photo-preview.is-portrait { max-width: 180px; }
.ae-service-photos { display: grid; gap: 16px; min-width: 0; }
.ae-service-photo-card { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); align-items: center; gap: 20px; padding: 18px; border: 1px solid #eadbd0; border-radius: 12px; background: #fff; }
.ae-service-photo-card.is-selected { border-color: #b36e7e; box-shadow: 0 0 0 2px rgba(141, 51, 72, .08); }
.ae-service-photo-preview { display: grid; place-items: center; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid #eadbd0; border-radius: 9px; background: #f8f2ec; }
.ae-service-photo-preview .ae-photo-preview { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; object-fit: contain; }
.ae-service-photo-empty { display: grid; place-items: center; align-content: center; gap: 8px; min-width: 0; padding: 16px; color: #75665d; text-align: center; }
.ae-service-photo-empty > span { font-size: 2rem; line-height: 1; color: #a67c63; }
.ae-service-photo-empty > p { font-size: .8rem; }
.ae-service-photo-info { display: grid; gap: 12px; min-width: 0; }
.ae-service-photo-info h4 { margin: 0; overflow-wrap: anywhere; }
.ae-service-photo-input { display: none !important; }
.ae-photo-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 16px; border: 1px solid #dfc9bb; border-radius: 10px; background: #fffaf4; box-shadow: 0 -4px 18px rgba(77, 48, 31, .07); }
.ae-photo-save > div:first-child { flex: 1 1 240px; min-width: 0; }
.ae-photo-save strong { display: block; margin-bottom: 5px; color: #57483f; font-size: .9rem; }
.ae-photo-save > .ae-actions { flex: 0 1 auto; }
.ae-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.ae-gallery-card { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #eadbd0; border-radius: 8px; }
.ae-gallery-card img { height: 160px; }
.ae-faq-editor { display: grid; gap: 10px; padding: 14px; border: 1px solid #eadbd0; border-radius: 8px; }
.ae-week { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.ae-week.is-day { grid-template-columns: minmax(0, 1fr); }
.ae-day { min-width: 0; padding: 12px; background: #fbf6f1; border: 1px solid #eadbd0; border-radius: 8px; }
.ae-day h4 { padding-bottom: 10px; border-bottom: 1px solid #eadbd0; }
.ae-appointment { display: grid; gap: 6px; width: 100%; min-width: 0; margin-top: 10px; padding: 12px; text-align: left; color: #2c2622; background: #fff; border: 1px solid #d8c8ba; border-left: 4px solid #8d3348; border-radius: 7px; overflow-wrap: anywhere; }
.ae-appointment small { font-size: .8rem; color: #75665d; text-transform: none; }
.ae-appointment.is-cancelled { opacity: .7; border-left-color: #8c8986; }
.ae-appointment.is-completed { border-left-color: #488459; }
.ae-access-result { display: grid; gap: 10px; padding: 14px; border: 1px solid #bad7c3; border-radius: 8px; background: #f3faf5; }
.ae-access-result input { width: 100%; min-width: 0; font-size: .875rem; }
.ae-copy-fallback { display: block; width: 100%; min-height: 140px; margin-top: 14px; padding: 12px; font-size: 1rem; line-height: 1.5; }
.ae-choice-list { display: grid; gap: 8px; max-height: 280px; overflow: auto; padding: 4px; }
.ae-choice-list .ae-check { padding: 10px; border: 1px solid #eadbd0; border-radius: 7px; }
.ae-capabilities { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 18px; }
.ae-capability { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid #eadbd0; border-radius: 8px; }
.ae-stat { font-size: 1.25rem; font-weight: 850; }
@media (max-width: 800px) {
  .ae-modal { padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .pix-modal-card.ae-card { width: 100%; height: calc(100svh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100svh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .ae-card > .ae-header { padding: 12px; }
  .ae-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ae-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 8px; border-right: 0; border-bottom: 1px solid #eadbd0; }
  .ae-nav button { width: auto; flex: 0 0 auto; padding: 10px 12px; text-align: center; }
  .ae-content { padding: 14px; }
  .ae-grid { grid-template-columns: minmax(0, 1fr); }
  .ae-week { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .ae-status { padding: 9px 14px; }
  .ae-service-photo-card { grid-template-columns: minmax(90px, 140px) minmax(0, 1fr); gap: 14px; padding: 14px; }
}
@media (max-width: 420px) {
  .ae-card > .ae-header h2 { font-size: 1.1rem; }
  .ae-box { padding: 12px; }
  .ae-content .ae-actions > .ae-button { flex: 1 1 140px; }
  .ae-service-photo-card { grid-template-columns: minmax(0, 1fr); }
  .ae-service-photo-preview { width: 100%; max-width: 240px; justify-self: center; }
  .ae-photo-save { position: static; padding: 12px; }
}
@media (max-height: 600px) {
  .ae-photo-save { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .ae-content { scroll-behavior: auto; }
}
