#dialog.address-editor { width: min(640px, 100vw); padding: 0; background: #f5f5f5; }
#dialog.address-editor .dialog-header { justify-content: center; position: sticky; top: 0; z-index: 2; background: #fafafa; padding: 17px 50px; border-bottom: 1px solid #e9e9e9; }
#dialog.address-editor .dialog-header h2 { font-size: 20px; font-weight: 500; text-align: center; }
#dialog.address-editor .dialog-header button { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
#dialog.address-editor .dialog-content { padding: 10px 0 24px; }
.address-fields { background: white; padding: 0 14px; }
.address-editor-form .address-field { display: flex; align-items: center; min-height: 58px; margin: 0; gap: 12px; border-bottom: 1px solid #eee; font-size: 16px; font-weight: 400; color: #555; }
.address-field > span, .address-field > label { flex: 0 0 80px; }
.address-editor-form .address-field input:not([type=checkbox]), .address-editor-form .address-field textarea { width: 0; flex: 1; min-width: 0; background: white; border: 0; border-radius: 0; box-shadow: none; padding: 15px 0; color: #333; font-size: 16px; line-height: 1.5; }
.address-editor-form input::placeholder, .address-editor-form textarea::placeholder { color: #aaa; font-weight: 400; }
.address-field textarea { resize: none; }
.address-region-open { color: #dba62c; border: 0; background: white; padding: 10px 0 10px 4px; font-size: 26px; min-width: 36px; }
.address-editor-form .address-default { justify-content: space-between; border: 0; }
.address-default > span { flex-basis: auto; }
.address-default input { appearance: none; position: relative; width: 48px; height: 28px; border-radius: 20px; border: 1px solid #ddd; background: #eee; transition: background .15s; cursor: pointer; }
.address-default input::after { content: ""; position: absolute; top: 1px; left: 1px; width: 24px; height: 24px; background: white; border-radius: 50%; box-shadow: 0 1px 4px #0003; transition: transform .15s; }
.address-default input:checked { background: #ff5358; border-color: #ff5358; }
.address-default input:checked::after { transform: translateX(20px); }
.address-recognition { margin-top: 12px; padding: 16px 14px; display: flex; gap: 12px; align-items: center; background: white; }
.address-recognition > label { flex: 0 0 80px; font-size: 16px; color: #555; }
.address-recognition > div { flex: 1; min-width: 0; }
.address-editor-form .address-recognition textarea { width: 100%; min-height: 115px; border: 0; padding: 0; resize: vertical; box-shadow: none; background: white; font-size: 15px; line-height: 1.7; }
.address-recognition-actions { display: flex; justify-content: flex-end; gap: 18px; margin-top: 10px; }
.address-recognition-actions button { border: 0; background: white; color: #f45a60; padding: 7px 10px; font-size: 16px; }
.address-recognition-actions button:last-child { color: white; background: #ff5358; border-radius: 24px; padding-inline: 19px; }
.address-editor-status { padding: 0 16px; color: #777; font-size: 13px; }
.address-editor-status:not(:empty) { padding-top: 12px; }
.address-editor-form .form-error { margin: 12px 16px; }
.address-save { padding: 24px 16px; }
.address-save .button { width: 100%; min-height: 48px; background: #ff5358; border-color: #ff5358; font-size: 18px; font-weight: 400; }
.address-region-overlay { position: fixed; inset: 0; z-index: 10; background: #0005; display: flex; align-items: flex-end; }
.address-region-overlay[hidden] { display: none; }
.address-region-sheet { width: 100%; background: white; padding-bottom: env(safe-area-inset-bottom, 0px); }
.address-region-sheet header { display: flex; justify-content: space-between; align-items: center; padding: 12px 10px; border-bottom: 1px solid #eee; }
.address-region-sheet header strong { font-size: 17px; font-weight: 500; }
.address-region-sheet button { border: 0; background: white; font: inherit; }
.address-region-sheet header button { padding: 8px; color: #777; }
.address-region-sheet header button:last-child { color: #1c9e49; }
.address-region-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: min(250px, 38dvh); }
.address-region-column { overflow-y: auto; overscroll-behavior: contain; padding: 8px 2px; scrollbar-width: thin; }
.address-region-column button { display: block; width: 100%; min-height: 44px; padding: 10px 3px; font-size: 16px; color: #888; overflow-wrap: anywhere; }
.address-region-column button[aria-pressed=true] { color: #222; background: #fff1f1; font-weight: 600; border-radius: 4px; }
.address-region-sheet .address-region-manual { width: 100%; padding: 12px; border-top: 1px solid #eee; color: #777; font-size: 13px; }
.address-editor-form input:focus-visible, .address-editor-form textarea:focus-visible, .address-editor-form button:focus-visible { outline: 2px solid #ed777a; outline-offset: 1px; }
@media (max-width: 640px) {
  #dialog.address-editor { inset: 0; margin: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; overflow-y: auto; }
  #dialog.address-editor .dialog-header { padding-top: max(17px, env(safe-area-inset-top)); }
  #dialog.address-editor .dialog-content { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
