dialog {
  border: 1px solid #dfe4d2;
  border-radius: 18px;
  background: #fffffd;
  color: var(--ink);
  padding: 35px;
  width: 440px;
  max-width: calc(100% - 30px);
  box-shadow: 0 25px 100px #00000030;
}
dialog::backdrop {
  background: #00000040;
  backdrop-filter: blur(4px);
}
#modal:focus { outline: none; }
.modal-close {
  position: absolute;
  right: 17px;
  top: 13px;
  font-size: 28px;
  color: #6b7858;
}
.modal-icon {
  font-size: 39.2px;
  color: var(--green);
}
dialog h2 {
  font-size: 34.72px;
  margin-top: 17px;
}
dialog p {
  font-size: 13.44px;
  color: #6a7759;
  line-height: 1.85;
}
.amount-options {
  display: flex;
  gap: 9px;
  margin: 25px 0;
}
.amount-options button {
  flex: 1;
  border: 1px solid #d3dcc5;
  border-radius: 8px;
  padding: 12px;
  font-size: 13.44px;
}
.amount-options button.selected {
  border-color: var(--fill);
  background: #e8f1dc;
  color: #3b5127;
}
.primary-button {
  width: 100%;
  background: var(--fill);
  color: white;
  padding: 13px;
  border-radius: 8px;
}
.contact-link {
  display: block;
  text-align: center;
}
.secondary-button {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #d3dcc5;
  border-radius: 8px;
  color: #3b5127;
}
.modal-small {
  font-size: 11.2px !important;
  text-align: center;
  margin-bottom: 0;
}
.info-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e2e7d9;
  padding: 15px 0;
  font-size: 13.44px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: calc(50% + 100px);
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  background: #33422a;
  color: white;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 13.44px;
  z-index: 30;
  transition: 0.25s;
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.attachment-chip {
  background: #eaf1dc;
  padding: 8px 12px;
  border-radius: 8px;
  width: max-content;
  max-width: 100%;
  font-size: 12.32px;
  margin-bottom: 9px;
  overflow-wrap: anywhere;
}
.attachment-chip button {
  margin-left: 12px;
  font-size: 16.8px;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.attachment-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.attachment-chip span {
  min-width: 0;
}
.attachment-chip button {
  flex-shrink: 0;
  margin-left: auto;
}
.message-photo {
  display: block;
  max-width: min(100%, 320px);
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
}

.auth-form { display: grid; gap: 12px; margin-top: 20px; }
.auth-form label { font-size: 14px; color: var(--green); }
.auth-form input {
  width: 100%; min-width: 0; box-sizing: border-box;
  border: 1px solid #d3dcc5; border-radius: 10px; padding: 13px 14px;
  background: white; color: var(--ink); font: inherit; font-size: 16px;
}
.auth-form textarea {
  width: 100%; min-width: 0; box-sizing: border-box; min-height: 140px; resize: vertical;
  border: 1px solid #d1dbc2; border-radius: 10px; padding: 13px 14px;
  background: white; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.5;
}
.auth-form input:focus, .auth-form textarea:focus { outline: 2px solid #7e9561; outline-offset: 2px; }
.contact-count { margin-top: -6px; font-size: 12px; color: #626f4f; text-align: right; }
.contact-count-warn { color: #a10000; }
#auth-code { letter-spacing: .35em; font-size: 24px; }
dialog .auth-error { color: #a50000; margin: 0; overflow-wrap: anywhere; }
.auth-error:empty { display: none; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 18px; font-size: 13px; color: var(--green); }
.auth-actions button { border-radius: 6px; padding: 4px; }
.auth-note a { color: var(--green); text-underline-offset: 3px; }
#account-email, #auth-recipient { overflow-wrap: anywhere; }
.auth-logout {
  margin-top: 20px;
  margin-left: -12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--green);
}
button:disabled { cursor: default; opacity: .55; }
.profile-identity { flex: 1; min-width: 0; }
#profile-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The native modal keeps focus inside the viewer and closes with Escape. */
.photo-expandable { cursor: zoom-in; }
.photo-expandable:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
dialog.photo-viewer {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  padding: 64px 20px 24px;
  border: 0;
  border-radius: 0;
  background: #000000f5;
  overflow: hidden;
}
dialog.photo-viewer[open] { display: grid; place-items: center; }
.photo-viewer > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 88px);
  object-fit: contain;
}
.photo-viewer-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 0;
  outline: none;
  color: white;
  background: transparent;
  font-size: 32px;
  line-height: 1;
}
.photo-viewer-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }

/* Price list opened from "/#pricing" by a signed-in user. */
#modal-content .landing-price-grid { grid-template-columns: 1fr; gap: 10px; margin: 16px 0; }
#modal-content .landing-price-table-wrap { overflow-x: auto; }
