/* Compact entry sheet; keep native controls and the visual-viewport sizing. */
#entryDialog .sheet {
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: end;
  padding: 8px max(18px, env(safe-area-inset-left)) calc(20px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-right));
  border-color: #d9e9f3;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -8px 36px #264b6712;
  color: #264b67;
}

#entryDialog .sheet-handle {
  width: 30px;
  height: 4px;
  margin-bottom: 8px;
  background: #d8e8f1;
}

#entryDialog .sheet-header {
  top: -8px;
  min-height: 44px;
  padding: 0;
  margin-bottom: 12px;
  border: 0;
  background: #fff;
}

#entryDialog .sheet-header .eyebrow { display: none; }
#entryDialog h2 { color: #264b67; font-size: 20px; line-height: 1.4; }
#entryDialog .close-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: #f2f8fc;
  color: #6e8c9f;
  box-shadow: none;
  font-size: 25px;
}

#entryDialog .segmented {
  padding: 3px;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid #e3eef5;
  border-radius: 13px;
  background: #f1f7fb;
  box-shadow: none;
}
#entryDialog .segmented button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #6e8c9f;
  font-size: 14px;
  text-shadow: none;
  box-shadow: none;
}
#entryDialog .segmented button.active {
  border-color: #dbeaf3;
  background: #fff;
  color: #348ab9;
  box-shadow: 0 2px 5px #264b6709;
}

#entryDialog label > span,
#entryDialog .person-field > span,
#entryDialog .quick-note-field > span {
  margin-bottom: 6px;
  color: #6e8c9f;
  font-size: 12px;
  line-height: 1.5;
}

#entryDialog .amount-field {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 0 7px;
  border-bottom: 1px solid #e6f0f6;
}
#entryDialog .amount-field > span { margin: 0; }
#entryDialog .amount-field > div { min-width: 0; gap: 6px; padding: 0; border: 0; }
#entryDialog .amount-field i { color: #77a8c3; font-size: 22px; }
#entryDialog .amount-field input {
  height: 48px;
  min-width: 0;
  padding: 0;
  color: #264b67;
  font-size: 36px;
  line-height: 1.25;
  letter-spacing: -.8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#entryDialog .amount-field input::placeholder { color: #b7cedc; font-size: 36px; }
#entryDialog .amount-field:focus-within { border-bottom-color: #77bde1; box-shadow: 0 1px 0 #77bde1; }
#entryDialog .amount-field:focus-within > span { color: #348ab9; }
#entryDialog .amount-field input:focus { outline: none; }
#entryDialog #amountInput::-webkit-inner-spin-button,
#entryDialog #amountInput::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#entryDialog .person-field { margin-bottom: 12px; }
#entryDialog .person-picker { gap: 8px; }
#entryDialog .person-option {
  justify-content: center;
  min-height: 56px;
  gap: 1px;
  padding: 7px 5px;
  border: 1px solid #dfeaf2;
  border-radius: 12px;
  background: #fff;
  color: #42627a;
  box-shadow: none;
}
#entryDialog .person-avatar { display: none; }
#entryDialog .person-option b { padding-inline: 7px; font-size: 13px; font-weight: 550; }
#entryDialog .person-option small { color: #839eaf; font-size: 10px; }
#entryDialog .person-option.active { border-color: #7dbde0; background: #edf7ff; color: #287faa; }
#entryDialog .person-option.active:after { top: 3px; right: 5px; color: #3b9dd3; font-size: 10px; }

#entryDialog .date-field,
#entryForm > label:not(.amount-field):not(.date-field) {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#entryDialog .date-field { margin-bottom: 12px; }
#entryDialog .date-field > span,
#entryForm > label:not(.amount-field):not(.date-field) > span { margin: 0; }

#entryDialog input:not([type="hidden"]):not(#amountInput) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  padding: 9px 11px;
  border: 1px solid #d9e9f3;
  border-radius: 11px;
  background: #f9fcff;
  color: #264b67;
  font-size: 16px;
  line-height: 24px;
  box-shadow: none;
}
#entryDialog input:focus { outline-color: #77bde1; border-color: #77bde1; }
#entryDialog #noteInput::placeholder { color: #99afbd; font-size: 13px; }

/* WebKit date controls otherwise retain an intrinsic width on iOS. */
#entryDialog #dateInput {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  min-inline-size: 0;
  inline-size: 100%;
  max-inline-size: 100%;
  text-align: left;
}
#entryDialog #dateInput::-webkit-date-and-time-value {
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  text-align: left;
}
#entryDialog #dateInput::-webkit-datetime-edit { display: block; min-width: 0; padding: 0; }
#entryDialog #dateInput::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }

#entryDialog .quick-note-field { margin-top: 12px; }
#entryDialog .quick-note-picker { gap: 6px; }
#entryDialog .quick-note {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #e1edf5;
  border-radius: 10px;
  background: #f7fbfe;
  color: #63859b;
  box-shadow: none;
  font-size: 12px;
}
#entryDialog .quick-note.active { border-color: #9bcce6; background: #eaf6ff; color: #2d8bbd; }
#entryDialog .no-quick-notes { color: #91a8b7; }
#entryDialog .sheet > .primary-button {
  min-height: 48px;
  margin-top: 14px;
  padding: 11px 16px;
  border: 1px solid #348fc3;
  border-radius: 13px;
  background: linear-gradient(180deg, #51b1df, #3b9dd3);
  color: #fff;
  box-shadow: inset 0 1px 0 #ffffff3b, 0 5px 12px #3b9dd31a;
  text-shadow: none;
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 360px) {
  #entryDialog .sheet { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  #entryDialog .person-picker { gap: 6px; }
  #entryDialog .person-option b { padding-inline: 4px; font-size: 12px; }
  #entryDialog .amount-field input,
  #entryDialog .amount-field input::placeholder { font-size: 34px; }
  #entryDialog .quick-note { padding-inline: 10px; }
}

@media (min-width: 700px) {
  #entryDialog .sheet { border-radius: 24px; border-bottom: 1px solid #d9e9f3; }
}
