/* Nodly floating surfaces
   A shared visual language for dialogs without changing their behavior. */
#modalBackdrop{
  background:rgba(23,35,58,.5);
  backdrop-filter:blur(7px);
}
#modalBackdrop>.modal{
  width:min(590px,100%);
  padding:30px;
  border:1px solid rgba(216,224,236,.96);
  border-radius:20px;
  background:#fffdf9;
  color:#17233a;
  font-family:Inter,"DM Sans",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  box-shadow:0 28px 80px rgba(23,35,58,.24);
}
#modalBackdrop>.modal.modal-wide{width:min(1040px,100%)}
#modalBackdrop .modal-close{
  z-index:8;
  top:15px;
  right:15px;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:1px solid transparent;
  border-radius:50%;
  background:#f1f4f8;
  color:#405f8f;
  font:500 18px/1 Inter,sans-serif;
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}
#modalBackdrop .modal-close:hover{background:#e7edf6;border-color:#cfd9e8;transform:translateY(-1px)}
#modalBackdrop .modal-close:focus-visible{outline:3px solid rgba(195,154,66,.32);outline-offset:2px}
#modalContent{font-family:inherit}
#modalContent>h2,
#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) h2{
  margin:7px 42px 7px 0;
  color:#17233a;
  font:700 clamp(22px,2.4vw,27px)/1.14 Inter,"DM Sans",sans-serif;
  letter-spacing:-.035em;
}
#modalContent>p,
#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) p{
  max-width:62ch;
  margin:0 42px 20px 0;
  color:#64738a;
  font-size:13px;
  line-height:1.55;
}
#modalContent>.eyebrow,
#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) .eyebrow{
  display:flex;
  align-items:center;
  gap:0;
  width:max-content;
  max-width:calc(100% - 45px);
  padding-left:10px;
  border-left:3px solid #c39a42;
  color:#405f8f;
  font:750 10px/1.2 Inter,sans-serif;
  letter-spacing:.115em;
  text-transform:uppercase;
}
#modalContent>.eyebrow::before,
#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) .eyebrow::before{
  display:none!important;
  content:none!important;
}
#modalContent>.eyebrow::after,
#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) .eyebrow::after{
  display:none!important;
  content:none!important;
}
#modalBackdrop .form-group{gap:7px}
#modalBackdrop .form-group label{color:#34445e;font-size:12px;font-weight:700;line-height:1.35}
#modalBackdrop .form-group input,
#modalBackdrop .form-group select,
#modalBackdrop .form-group textarea{
  border-color:#cfd9e8;
  border-radius:11px;
  background:#fff;
  color:#25344d;
  font:500 13px/1.45 Inter,sans-serif;
}
#modalBackdrop .form-group textarea{resize:vertical}
#modalBackdrop .form-group :is(input,select,textarea):focus{
  border-color:#7892ba;
  outline:0;
  box-shadow:0 0 0 3px rgba(64,95,143,.13);
}
#modalBackdrop .modal-actions{
  align-items:center;
  gap:9px;
  margin-top:24px;
  padding-top:17px;
  border-top:1px solid #e1e6ee;
}
#modalBackdrop .modal-actions :is(button,a){min-height:42px;font-family:Inter,sans-serif;font-size:12px;font-weight:700}

.nodly-written-confirmation-backdrop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:18px;background:rgba(23,35,58,.58);backdrop-filter:blur(7px)}
.nodly-written-confirmation{position:relative;box-sizing:border-box;width:min(510px,100%);max-height:calc(100dvh - 36px);overflow-y:auto;padding:26px;border:1px solid #d8e0ec;border-radius:20px;background:#fffdf9;color:#17233a;box-shadow:0 28px 80px rgba(23,35,58,.24);font-family:Inter,"DM Sans",sans-serif}
.nodly-written-confirmation .eyebrow{display:block;width:max-content;max-width:calc(100% - 46px);padding-left:10px;border-left:3px solid #c39a42;color:#405f8f;font-size:10px;font-weight:750;letter-spacing:.1em}
.nodly-written-confirmation h2{margin:9px 36px 9px 0;font-size:clamp(21px,4vw,26px);line-height:1.17;letter-spacing:-.025em}
.nodly-written-confirmation p{margin:0 0 16px;color:#526278;font-size:13px;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}
.nodly-written-confirmation-close{position:absolute;top:16px;right:16px;display:grid;place-items:center;width:38px;height:38px;border:0;border-radius:11px;background:#f1f4f8;color:#405f8f;font-size:20px;cursor:pointer}
.nodly-written-confirmation-recipient{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:17px;padding:12px 13px;border:1px solid #d9e5e5;border-radius:11px;background:#f4faf8;font-size:12px}
.nodly-written-confirmation-recipient span{min-width:0;overflow-wrap:anywhere;color:#405f8f}
.nodly-written-confirmation form{display:grid;gap:8px}
.nodly-written-confirmation form label{font-size:12px;font-weight:700;line-height:1.4}
.nodly-written-confirmation form input{box-sizing:border-box;width:100%;min-height:46px;padding:10px 12px;border:1px solid #cfd9e8;border-radius:11px;background:#fff;color:#17233a;font:500 16px/1.4 Inter,sans-serif}
.nodly-written-confirmation form input:focus{outline:0;border-color:#7892ba;box-shadow:0 0 0 3px rgba(64,95,143,.15)}
.nodly-written-confirmation form small{min-height:18px;color:#ad413b;font-size:11px}
.nodly-written-confirmation-actions{display:grid;grid-template-columns:1fr 1.15fr;gap:9px;margin-top:11px;padding-top:16px;border-top:1px solid #e1e6ee}
.nodly-written-confirmation-actions button{min-width:0;min-height:46px;white-space:normal}
.nodly-written-confirmation-actions .primary-button{background:#405f8f!important;color:#fff!important;border:1px solid #405f8f!important;font-size:14px!important}
.nodly-written-confirmation-actions .secondary-button{background:#fffdf9!important;color:#263650!important;border:1px solid #cfd9e8!important;font-size:14px!important}
.nodly-written-confirmation .nodly-written-confirmation-close{width:44px;height:44px;font-size:20px!important}
@media(max-width:768px){.nodly-written-confirmation-backdrop{align-items:end;padding:0}.nodly-written-confirmation{width:100%;max-height:92dvh;padding:22px 16px calc(18px + env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0}.nodly-written-confirmation-actions button{min-height:48px}}

/* Approved collection reminder: the reference surface for action modals. */
#modalBackdrop>.modal.collection-reminder-modal{width:min(610px,100%);padding:29px 30px 25px}
.collection-modal-head{position:relative;display:grid;grid-template-columns:44px minmax(0,1fr);gap:13px;align-items:start;padding-right:40px}
.collection-modal-symbol{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:12px 18px 13px 17px;
  background:#e7edf6;
  color:#405f8f;
  transform:rotate(-1.5deg);
}
.collection-modal-symbol svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;transform:rotate(1.5deg)}
.collection-modal-head .eyebrow{position:relative;display:flex;align-items:center;margin:2px 0 6px;padding-left:10px;border-left:3px solid #c39a42;color:#405f8f;font:750 10px/1.2 Inter,sans-serif;letter-spacing:.12em;text-transform:uppercase}
.collection-modal-head .eyebrow::before,.collection-modal-head .eyebrow::after{display:none!important;content:none!important}
.collection-modal-head h2{margin:0 0 5px;color:#17233a;font:700 25px/1.12 Inter,sans-serif;letter-spacing:-.035em}
.collection-modal-head p{margin:0;color:#64738a;font-size:13px;line-height:1.5}
.collection-reminder-modal .debt-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:21px 0 17px;overflow:hidden;border:1px solid #d8e0ec;border-radius:13px;background:#f6f8fc}
.collection-reminder-modal .debt-summary>div{min-width:0;padding:13px 14px;background:transparent}
.collection-reminder-modal .debt-summary>div+div{border-left:1px solid #d8e0ec}
.collection-reminder-modal .debt-summary small{display:block;margin-bottom:5px;color:#728097;font-size:10px;line-height:1.25}
.collection-reminder-modal .debt-summary strong{display:block;overflow:hidden;color:#25344d;font-size:13px;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.collection-reminder-modal .collection-toggle{display:flex;align-items:flex-start;gap:10px;margin:0;padding:10px 3px 15px;border-bottom:1px solid #e1e6ee}
.collection-reminder-modal .collection-toggle input{width:17px;height:17px;margin:1px 0 0;accent-color:#405f8f}
.collection-reminder-modal .collection-toggle strong{display:block;color:#25344d;font-size:12px;line-height:1.35}
.collection-reminder-modal .collection-toggle small{display:block;margin-top:3px;color:#728097;font-size:10px;line-height:1.4}
.collection-reminder-modal .form-group{margin-top:16px}
.collection-reminder-modal .form-group textarea{min-height:116px;padding:12px 13px}
.collection-reminder-modal .collection-channels{display:grid;gap:8px;margin-top:14px}
.collection-reminder-modal .collection-channels button{min-height:50px;display:grid;grid-template-columns:31px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 12px;border:1px solid #d8e0ec;border-radius:12px;background:#fff;color:#25344d;text-align:left;transition:border-color .16s ease,background .16s ease,transform .16s ease}
.collection-reminder-modal .collection-channels button:hover{border-color:#9eafc7;background:#f6f8fc;transform:translateY(-1px)}
.collection-reminder-modal .collection-channels button.selected{border-color:#7892ba;background:#edf2fa}
.collection-reminder-modal .collection-channel-icon{width:31px;height:31px;display:grid;place-items:center;border-radius:10px;background:#e8eef6;color:#405f8f}
.collection-reminder-modal .collection-channel-icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.collection-reminder-modal .collection-channels strong{display:block;font-size:12px;line-height:1.3}
.collection-reminder-modal .collection-channels small{display:block;margin-top:2px;color:#728097;font-size:10px;line-height:1.35}
.collection-reminder-modal .collection-channel-check{width:18px;height:18px;display:grid;place-items:center;border:1px solid #c7d2e1;border-radius:50%;color:transparent;font-size:11px}
.collection-reminder-modal .collection-channels button.selected .collection-channel-check{border-color:#405f8f;background:#405f8f;color:#fff}
.collection-bot-option{display:flex;align-items:center;gap:10px;margin-top:9px;padding:10px 12px;border:1px solid #d7e0ec;border-radius:12px;background:#f1f5fb;color:#25344d}
.collection-bot-option .nodly-bot-mark{width:31px;height:31px;display:grid;place-items:center;flex:0 0 31px;border-radius:10px 13px 9px 12px;background:#e1e9f5;color:#405f8f}
.nodly-bot-mark svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.collection-bot-option strong{font-size:12px}.collection-bot-option small{margin-left:auto;padding:5px 8px;border-radius:999px;background:#fff;color:#64738a;font-size:10px;font-weight:700}
.collection-reminder-modal .modal-actions{display:grid;grid-template-columns:auto minmax(142px,1fr) minmax(150px,.88fr);gap:9px}
.collection-reminder-modal .modal-actions button{min-height:43px;border-radius:10px;padding:0 15px}
.collection-reminder-modal .collection-cancel{border:1px solid #d8e0ec;background:#fffdf9;color:#34445e}
.collection-reminder-modal .collection-cancel:hover{background:#f3f5f9}
.collection-reminder-modal .collection-whatsapp{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid #bdc9db;background:#e7edf6;color:#405f8f}
.collection-reminder-modal .collection-whatsapp:hover{background:#dbe5f2}
.collection-reminder-modal .collection-whatsapp svg{width:16px;height:16px;fill:currentColor}
.collection-reminder-modal .collection-bot-send{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;background:#405f8f;color:#fff}
.collection-reminder-modal .collection-bot-send:hover{background:#334f79}
.collection-reminder-modal .collection-bot-send .nodly-bot-mark{width:21px;height:21px;flex-basis:21px;border-radius:7px;background:rgba(255,255,255,.15);color:#fff}
.collection-reminder-modal .collection-bot-send .nodly-bot-mark svg{width:12px;height:12px}

@media(max-width:640px){
  #modalBackdrop{align-items:end;padding:10px}
  #modalBackdrop>.modal,#modalBackdrop>.modal.collection-reminder-modal{width:100%;max-height:calc(100dvh - 20px);padding:24px 18px calc(18px + env(safe-area-inset-bottom));border-radius:20px}
  #modalBackdrop>.modal.modal-wide{width:100%}
  #modalContent>h2,#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) h2{font-size:22px}
  #modalContent>p,#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) p{font-size:12px}
  #modalContent>.eyebrow::before,#modalContent>:is(.package-modal-head,.permission-modal-head,.patient-form-head) .eyebrow::before{width:27px;flex-basis:27px}
  .collection-modal-head{grid-template-columns:40px minmax(0,1fr);gap:11px;padding-right:30px}
  .collection-modal-symbol{width:40px;height:40px}
  .collection-modal-head .eyebrow::before{width:20px;flex-basis:20px}
  .collection-modal-head h2{font-size:22px}.collection-modal-head p{font-size:12px}
  .collection-reminder-modal .debt-summary{grid-template-columns:1fr 1fr;margin-top:17px}
  .collection-reminder-modal .debt-summary>div:nth-child(3){grid-column:1/-1;border-top:1px solid #d8e0ec;border-left:0}
  .collection-reminder-modal .debt-summary strong{white-space:normal}
  .collection-reminder-modal .modal-actions{grid-template-columns:1fr 1fr}
  .collection-reminder-modal .collection-bot-send{grid-column:1/-1;grid-row:1}
  .collection-reminder-modal .collection-cancel{grid-column:1}.collection-reminder-modal .collection-whatsapp{grid-column:2}
  #modalBackdrop .modal-actions{padding-bottom:max(0px,env(safe-area-inset-bottom))}
}
/* Individual communication forms retain a reachable touch target after removing phrase inputs. */
body.authenticated #modalContent :is([data-google-email-test-confirmation],[data-patient-invitation-form]) .modal-actions>button{min-height:44px}
@media(max-width:390px){
  #modalBackdrop{padding:0}
  #modalBackdrop>.modal,#modalBackdrop>.modal.collection-reminder-modal{max-height:100dvh;border-radius:18px 18px 0 0}
  .collection-reminder-modal .collection-channels small{font-size:9px}
}
