/* The Areas of Interest modals (#aoi-method-modal "Add Area", #aoi-edit-modal "New / Edit Area", #aoi-share-modal,
   #aoi-modal), reimagined in the buoy modal's language (buoy_modal.css). Look only: what they show and do is app.js's,
   unchanged. Every rule is scoped by its modal's id, over the base rules in app.css, which stay as they were.

   - One family, as Configure Alert (alert_config.css): the panels' glass (app.css --bc-glass-*) at the buoy modal's
     18 px corners and shadow; a header ruled off as the farm card's: the area's glyph in a tinted icon chip, an Oxanium
     title over a quiet meta line, the actions quiet 28 px icon buttons; a foot ruled off, its buttons at the right:
     the step forward the brand's blue (buoy_modal.css .blue-pill-button.alarms-add), the rest quiet troughs.
   - Add Area: the two ways in as reading tiles, each led by its icon chip, a hint under its name, faint target rings
     (on the map) or a chart graticule (by coordinates) at its right. The coordinates: the format a segmented control
     (the group strip; it picks in the hidden select, app.js .aoi-fmt-seg), each axis one trough holding its degrees,
     minutes and seconds beside their marks and its hemisphere, so it reads as the coordinate it is; a value out of
     range red, with the range it must keep under it.
   - New / Edit Area: the name the big field (a shimmer in its place while it is looked up); the radius a reading
     (its value in Oxanium) over a brand-blue slider; each module a tile with a brand-blue switch, lit blue while on.
     Delete is red; armed ("Sure?") it says so, a fuse under it burning down the 2 s it stays armed.
   - Share area: the area named in the header; each contact a row, led by a person chip, its tick at the right, the
     row lit blue once picked; how many are picked at the foot (CSS counters).
   - Areas of Interest (the list; app.js no longer opens it, kept in step): each area a reading tile, its pin in a
     chip, its modules as quiet pills. */

/* ── The panels ─────────────────────────────────────────────────────────────────────────────────────────── */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) > .modal-backdrop { background: rgba(2, 6, 14, 0.55); }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .modal-content {
    width: 384px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    padding: 18px 20px 0;
    border-radius: 18px;
    background: var(--bc-glass-bg);
    -webkit-backdrop-filter: var(--bc-glass-blur);
    backdrop-filter: var(--bc-glass-blur);
    border: var(--bc-glass-border);
    box-shadow: var(--bc-glass-edge), 0 18px 44px rgba(0, 8, 22, 0.55);
    color: #e2e8f0;
    color-scheme: dark;   /* the browser's own parts (a select's list, the slider's track) dark too */
    font-family: Manrope, system-ui, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    animation: aoi-panel-in 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
#aoi-share-modal .modal-content { width: 404px; }
@keyframes aoi-panel-in {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}
/* Every control takes the panel's font (a button, input or select otherwise keeps the browser's). */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :where(button, input, select) { font-family: inherit; }
/* None of app.css's global button (navy fill, 18 px padding, clipped): each is set out below. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :where(button) { isolation: auto; overflow: visible; line-height: 1.2; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :where(button):focus-visible { outline: 2px solid #2e8eff; outline-offset: 2px; }

/* ── The header: the glyph in its chip, the title over its meta line, the icon buttons ─────────────────── */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .modal-header {
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-head-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(46, 142, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
    color: #60a5fa;
    font-size: 14px;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-head-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .modal-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: Oxanium, Manrope, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    color: #f8fafc;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-head-meta {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(203, 213, 225, 0.72);
}
/* Add Area's meta line: how to set the location while choosing, what to type once typing. */
#aoi-method-modal .aoi-method-prompt--coords,
#aoi-method-modal .show-coords .aoi-method-prompt { display: none; }
#aoi-method-modal .show-coords .aoi-method-prompt--coords { display: block; }
/* Share area's: the area shared, after its pin (as the buoy modal's coordinates). */
#aoi-share-modal .aoi-head-meta i { margin-right: 6px; font-size: 10px; color: #60a5fa; }
#aoi-share-modal .aoi-share-area-name { font-weight: 700; color: #e2e8f0; }

/* The icon buttons: the buoy modal's, quiet 28 px squares (the close keeping its x). */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .bc-btn-group {
    flex: none;
    align-self: flex-start;
    gap: 2px;
    margin: -2px -6px 0 0;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .bc-btn-group__btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(226, 232, 240, 0.65);
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .bc-btn-group__btn + .bc-btn-group__btn { border-left: 0; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .bc-btn-group__btn:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .bc-btn-group__btn i { font-size: 13px; }

/* Delete: red, quiet until hovered. Armed ("Sure?", app.js .aoi-delete-confirm): a red pill saying so, a fuse along
   its foot burning down the 2 s before it disarms; a second click deletes. */
#aoi-edit-modal #btn-aoi-delete { position: relative; color: rgba(248, 113, 113, 0.8); }
#aoi-edit-modal #btn-aoi-delete:hover { background: rgba(239, 68, 68, 0.14); color: #fecaca; }
#aoi-edit-modal #btn-aoi-delete i { font-size: 12px; }
#aoi-edit-modal #btn-aoi-delete.aoi-delete-confirm,
#aoi-edit-modal #btn-aoi-delete.aoi-delete-confirm:hover {
    width: auto;
    padding: 0 10px;
    overflow: hidden;
    background: rgba(239, 68, 68, 0.18);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55);
    color: #fecaca;
}
#aoi-edit-modal #btn-aoi-delete.aoi-delete-confirm:hover { background: rgba(239, 68, 68, 0.26); color: #ffffff; }
#aoi-edit-modal #btn-aoi-delete .adc-confirm-label { font-size: 12px; font-weight: 700; letter-spacing: 0.2px; line-height: 1; }
#aoi-edit-modal #btn-aoi-delete.aoi-delete-confirm::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 2px;
    border-radius: 1px;
    background: #f87171;
    transform-origin: left center;
    animation: aoi-fuse 2s linear forwards;
}
@keyframes aoi-fuse {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── Fields: troughs, one look across the four ─────────────────────────────────────────────────────────── */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-group { margin-bottom: 16px; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-label {
    display: block;
    margin: 0 0 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-transform: none;
    color: rgba(203, 213, 225, 0.72);
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :is(.aoi-form-input, .aoi-form-select) {
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: rgba(2, 10, 24, 0.5);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-input::placeholder { color: rgba(203, 213, 225, 0.4); font-weight: 500; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :is(.aoi-form-input, .aoi-form-select):hover { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :is(.aoi-form-input, .aoi-form-select):focus {
    outline: none;
    background: rgba(2, 10, 24, 0.6);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.5), 0 0 0 3px rgba(46, 142, 255, 0.12);
}
/* A select: no browser chrome, a slate chevron at its right. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-select option { background: #0b1626; color: #e2e8f0; }
/* Invalid (app.js .error): red, as Configure Alert's. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-input.error,
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-input.error:hover,
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-input.error:focus {
    background: rgba(239, 68, 68, 0.07);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.65), 0 0 0 3px rgba(239, 68, 68, 0.12);
}
/* What the field must hold, under it only while it doesn't. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-field-hint {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 7px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #fca5a5;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-field-hint::before { content: "\f06a" / ""; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 10px; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-group:has(.error) .aoi-field-hint { display: flex; }

/* ── The foot: ruled off, its buttons at the right ─────────────────────────────────────────────────────── */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 20px -20px 0;
    padding: 14px 20px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 10, 24, 0.18);
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 84px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
/* The quiet ones (Back, Cancel): a trough, ringed brighter on hover. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions .animated-button-cancel {
    background: rgba(2, 10, 24, 0.5);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions .animated-button-cancel:hover { background: rgba(2, 10, 24, 0.5); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45); color: #ffffff; }
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions .animated-button-cancel:active { background: rgba(2, 10, 24, 0.7); }
/* The step forward (Continue, Save, Add area): the brand's blue. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions :is(.animated-button, .button) {
    min-width: 96px;
    background: radial-gradient(circle at 50% 0%, #5aa8ff, #2e8eff 60%, #1f6fd6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px rgba(46, 142, 255, 0.3);
    color: #ffffff;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions :is(.animated-button, .button):hover:not(:disabled) {
    background: radial-gradient(circle at 50% 0%, #74b6ff, #4b9dff 60%, #2e8eff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 8px 22px rgba(46, 142, 255, 0.4);
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions :is(.animated-button, .button):active:not(:disabled) {
    background: radial-gradient(circle at 50% 0%, #4b9dff, #2380f0 60%, #1a62c2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 3px 10px rgba(46, 142, 255, 0.3);
}
/* Not yet (coordinates not valid, the name still being looked up, contacts loading): the blue, faded and flat. */
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions :is(.animated-button, .button):disabled {
    background: rgba(46, 142, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
    color: rgba(226, 232, 240, 0.45);
    cursor: not-allowed;
}
:is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions .text i { margin-right: 8px; font-size: 11px; }
/* Back steps back at the left; Continue carries an arrow, as Configure Alert's steps forward. */
#aoi-method-modal #aoi-coords-back { margin-right: auto; }
#aoi-method-modal #aoi-coords-back .text::before,
#aoi-method-modal #aoi-coords-continue .text::after { font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; }
#aoi-method-modal #aoi-coords-back .text::before { content: "\f060" / ""; margin-right: 8px; }
#aoi-method-modal #aoi-coords-continue .text::after { content: "\f061" / ""; margin-left: 8px; }

/* ── Add Area: the two ways in, as reading tiles ───────────────────────────────────────────────────────── */
#aoi-method-modal .aoi-method-content { max-width: calc(100vw - 32px); }
#aoi-method-modal .aoi-method-content:not(.show-coords) .aoi-method-view--chooser { display: grid; gap: 10px; padding-bottom: 20px; }
#aoi-method-modal .aoi-method-content:not(.show-coords) .aoi-method-view--chooser,
#aoi-method-modal .aoi-method-content.show-coords .aoi-method-view--coords { animation: aoi-view-in 0.2s ease; }
@keyframes aoi-view-in {
    from { opacity: 0; transform: translateX(6px); }
    to   { opacity: 1; transform: none; }
}
#aoi-method-modal .aoi-method-option {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 14px 14px 14px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    text-align: left;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
#aoi-method-modal .aoi-method-option:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
/* Behind each, at its right: faint target rings (where the circle drops) or a chart's graticule (where the numbers
   point), fading out to the left. */
#aoi-method-modal .aoi-method-option::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 85%);
    mask-image: linear-gradient(90deg, transparent 35%, #000 85%);
    opacity: 0.9;
    transition: opacity 0.2s ease;
}
#aoi-method-modal #aoi-method-map::before {
    background: repeating-radial-gradient(circle at calc(100% - 26px) 50%, rgba(96, 165, 250, 0.16) 0 1px, transparent 1px 14px);
}
#aoi-method-modal #aoi-method-coords::before {
    background:
        linear-gradient(rgba(148, 163, 184, 0.11) 1px, transparent 1px) 0 6px / 100% 16px,
        linear-gradient(90deg, rgba(148, 163, 184, 0.11) 1px, transparent 1px) right 2px top 0 / 16px 100%;
}
#aoi-method-modal .aoi-method-option:hover::before { opacity: 1; }
/* Its chip, name and hint, a chevron at its right nudging on with the hover. */
#aoi-method-modal .aoi-method-option .text {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 3px;
    align-items: center;
}
#aoi-method-modal .aoi-method-option .text > i {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0;
    border-radius: 10px;
    background: rgba(46, 142, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
    color: #60a5fa;
    font-size: 14px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
#aoi-method-modal .aoi-method-option:hover .text > i { background: rgba(46, 142, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45); }
#aoi-method-modal .aoi-method-option-label { grid-column: 2; font-size: 14px; font-weight: 700; line-height: 1.25; color: #f8fafc; }
#aoi-method-modal .aoi-method-option-hint { grid-column: 2; font-size: 12px; font-weight: 600; line-height: 1.3; color: rgba(203, 213, 225, 0.72); }
#aoi-method-modal .aoi-method-option .text::after {
    content: "\f054" / "";
    grid-column: 3;
    grid-row: 1 / 3;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.6);
    transition: transform 0.15s ease, color 0.15s ease;
}
#aoi-method-modal .aoi-method-option:hover .text::after { color: #93c5fd; transform: translateX(3px); }

/* ── Add Area: the coordinates ─────────────────────────────────────────────────────────────────────────── */
/* The format: the group strip (DDM, DMS, DD), the one picked lit; a line under it saying what it is. The select it
   picks in is app.js's, out of sight. */
#aoi-method-modal #aoi-entry-format-select { display: none; }
#aoi-method-modal .aoi-fmt-seg {
    display: flex;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(2, 10, 24, 0.5);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}
#aoi-method-modal .aoi-fmt-seg button {
    flex: 1 1 0;
    height: 28px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(226, 232, 240, 0.62);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
#aoi-method-modal .aoi-fmt-seg button:hover { background: rgba(255, 255, 255, 0.06); color: #f8fafc; }
#aoi-method-modal .aoi-fmt-seg button:focus-visible { outline-offset: 1px; }
#aoi-method-modal .entry-ddm .aoi-fmt-seg [data-fmt="ddm"],
#aoi-method-modal .entry-dms .aoi-fmt-seg [data-fmt="dms"],
#aoi-method-modal .entry-dd .aoi-fmt-seg [data-fmt="dd"] { background: rgba(46, 142, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.5); color: #ffffff; }
#aoi-method-modal .aoi-fmt-desc { display: none; margin: 8px 0 0; font-size: 12px; font-weight: 600; line-height: 1.35; color: rgba(203, 213, 225, 0.72); font-variant-numeric: tabular-nums; }
#aoi-method-modal .entry-ddm .aoi-fmt-desc[data-fmt="ddm"],
#aoi-method-modal .entry-dms .aoi-fmt-desc[data-fmt="dms"],
#aoi-method-modal .entry-dd .aoi-fmt-desc[data-fmt="dd"] { display: block; }
#aoi-method-modal .aoi-method-view--coords > .aoi-form-group:first-child { margin-bottom: 18px; }

/* Decimal degrees: latitude and longitude side by side. */
#aoi-method-modal .aoi-method-content.entry-dd .aoi-entry-dd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#aoi-method-modal .aoi-entry-dd .aoi-form-group { margin-bottom: 0; }
#aoi-method-modal .aoi-entry-dd .aoi-form-input { width: 100%; height: 40px; font-size: 14px; font-weight: 700; }
#aoi-method-modal .aoi-entry-fields .aoi-form-group:last-child { margin-bottom: 0; }

/* Degrees and minutes (and seconds): an axis is one trough, its numbers each set right against their mark (34° 42′
   50.3″) and its hemisphere a small pick at its end. The trough rings as a field does; a number out of range turns
   red in it, and rings it red. */
#aoi-method-modal .aoi-coord-row {
    gap: 0;
    height: 42px;
    padding: 4px;
    border-radius: 10px;
    background: rgba(2, 10, 24, 0.5);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
#aoi-method-modal .aoi-coord-row:hover { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
#aoi-method-modal .aoi-coord-row:focus-within { background: rgba(2, 10, 24, 0.6); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.5), 0 0 0 3px rgba(46, 142, 255, 0.12); }
#aoi-method-modal .aoi-coord-row:has(.error) { box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.65), 0 0 0 3px rgba(239, 68, 68, 0.12); }
#aoi-method-modal .aoi-coord-row .aoi-form-input,
#aoi-method-modal .aoi-coord-row .aoi-form-input:hover,
#aoi-method-modal .aoi-coord-row .aoi-form-input:focus {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 100%;
    padding: 0 1px 0 6px;
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    animation: none;   /* the trough rings red: no shake of one number inside it */
}
#aoi-method-modal .aoi-coord-row .aoi-form-input:hover { background: rgba(255, 255, 255, 0.04); }
#aoi-method-modal .aoi-coord-row .aoi-form-input:focus { background: rgba(46, 142, 255, 0.14); }
#aoi-method-modal .aoi-coord-row .aoi-form-input.error { background: rgba(239, 68, 68, 0.16); color: #fecaca; }
#aoi-method-modal .aoi-coord-unit {
    flex: none;
    width: 14px;
    margin: 0;
    padding-left: 1px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: rgba(148, 163, 184, 0.75);
    align-self: flex-start;
    padding-top: 8px;
}
#aoi-method-modal .aoi-coord-row .aoi-coord-hemi,
#aoi-method-modal .aoi-coord-row .aoi-coord-hemi:hover,
#aoi-method-modal .aoi-coord-row .aoi-coord-hemi:focus {
    flex: none;
    width: 48px;
    height: 100%;
    margin-left: 4px;
    padding: 0 20px 0 11px;
    border-radius: 7px;
    background-color: rgba(255, 255, 255, 0.07);
    background-position: right 8px center;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
    font-size: 13px;
    font-weight: 800;
}
#aoi-method-modal .aoi-coord-row .aoi-coord-hemi:hover { background-color: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
#aoi-method-modal .aoi-coord-row .aoi-coord-hemi:focus-visible { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.6); }

/* ── New / Edit Area ──────────────────────────────────────────────────────────────────────────────────── */
/* The name: the big field (Configure Alert's name), its look-up a shimmer in its place. */
#aoi-edit-modal #aoi-name { height: 44px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 700; }
#aoi-edit-modal .aoi-name-loading {
    gap: 10px;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background:
        linear-gradient(100deg, transparent 30%, rgba(96, 165, 250, 0.1) 50%, transparent 70%) 0 0 / 220% 100%,
        rgba(2, 10, 24, 0.5);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(203, 213, 225, 0.72);
    animation: aoi-shimmer 1.4s linear infinite;
}
@keyframes aoi-shimmer {
    from { background-position: 120% 0, 0 0; }
    to   { background-position: -120% 0, 0 0; }
}
:is(#aoi-edit-modal, #aoi-share-modal) .aoi-name-spinner { width: 14px; height: 14px; border-width: 2px; border-color: rgba(96, 165, 250, 0.25); border-top-color: #60a5fa; }

/* The radius: its label quiet, its value a reading (Oxanium); the slider in the brand's blue. (app.js sets the
   value's colour and weight inline: !important.) */
#aoi-edit-modal .toggle-row {
    position: relative;
    gap: 12px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.8);
}
#aoi-edit-modal .aoi-area-options .toggle-row { align-items: baseline; margin-bottom: 8px !important; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; color: rgba(203, 213, 225, 0.72); cursor: default; }
#aoi-edit-modal #aoi-radius-display,
#aoi-edit-modal .aoi-module-fields .toggle-row > span[id$="-display"] {
    font-family: Oxanium, Manrope, sans-serif;
    font-size: 15px;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    color: #f8fafc !important;
    font-variant-numeric: tabular-nums;
}
#aoi-edit-modal .aoi-module-fields .toggle-row > span[id$="-display"] { font-size: 13px; }
#aoi-edit-modal .aoi-form-range { display: block; width: 100%; height: 18px; margin: 0; accent-color: #2e8eff; cursor: pointer; }
#aoi-edit-modal .aoi-area-options .aoi-form-group { margin-bottom: 18px; }

/* A module: a reading tile, its switch at its right; lit blue while on. Its settings (if it has any), ruled off
   under it. */
#aoi-edit-modal .aoi-module-section {
    margin-top: 8px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
#aoi-edit-modal .aoi-module-section:hover { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
#aoi-edit-modal .aoi-module-section:has(.aoi-module-toggle:checked) {
    background: linear-gradient(180deg, rgba(46, 142, 255, 0.13), rgba(46, 142, 255, 0.04));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.38);
}
#aoi-edit-modal .aoi-module-section > .aoi-module-name {
    padding: 13px 14px;
    background: none;
    border-bottom: 0;
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
}
#aoi-edit-modal .aoi-module-body { padding: 0; border-top: 0; }
#aoi-edit-modal .aoi-module-fields:not(:empty) { margin: 0 14px; padding: 10px 0 12px; border-top: 1px solid rgba(148, 163, 184, 0.12); }
#aoi-edit-modal .aoi-module-fields .aoi-form-group { margin-bottom: 12px; }
#aoi-edit-modal .aoi-module-fields .aoi-form-group:last-child { margin-bottom: 0; }
#aoi-edit-modal .aoi-module-fields .toggle-row { margin-bottom: 6px; }
#aoi-edit-modal .aoi-module-fields .aoi-form-group > .toggle-row:only-child { margin-bottom: 0; }

/* The switches: the brand's blue when on. Their checkbox stays in reach of the keyboard (app.css hides it), out of
   sight; its focus rings the switch. */
#aoi-edit-modal .toggle-row input[type="checkbox"] {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
#aoi-edit-modal .toggle-switch {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
#aoi-edit-modal .toggle-switch::after { background: #cbd5e1; box-shadow: 0 1px 3px rgba(2, 10, 24, 0.45); }
#aoi-edit-modal .toggle-row input:checked + .toggle-switch { background: #2e8eff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 12px rgba(46, 142, 255, 0.35); }
#aoi-edit-modal .toggle-row input:checked + .toggle-switch::after { background: #ffffff; }
#aoi-edit-modal .toggle-row input:focus-visible + .toggle-switch { outline: 2px solid #2e8eff; outline-offset: 2px; }

/* ── Share area ───────────────────────────────────────────────────────────────────────────────────────── */
#aoi-share-modal .modal-content { counter-reset: aoi-contacts aoi-picked; }
#aoi-share-modal .aoi-share-intro { margin: 0 0 12px; font-size: 12.5px; font-weight: 500; line-height: 1.45; color: rgba(226, 232, 240, 0.8); }
#aoi-share-modal .aoi-share-contacts {
    max-height: min(320px, 46vh);
    gap: 6px;
    margin-right: -6px;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
/* A contact: a person chip, the name over its emails, the tick at the right; picked, lit blue. */
#aoi-share-modal .aoi-share-contact {
    flex: none;
    gap: 12px;
    min-height: 54px;
    padding: 10px 14px 10px 11px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    counter-increment: aoi-contacts;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
#aoi-share-modal .aoi-share-contact:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
#aoi-share-modal .aoi-share-contact:has(input:checked) {
    background: linear-gradient(180deg, rgba(46, 142, 255, 0.14), rgba(46, 142, 255, 0.05));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
    counter-increment: aoi-contacts aoi-picked;
}
#aoi-share-modal .aoi-share-contact::before {
    content: "\f007" / "";
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.1);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    color: rgba(203, 213, 225, 0.7);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 13px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
#aoi-share-modal .aoi-share-contact:has(input:checked)::before { content: "\f4fc" / ""; background: rgba(46, 142, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35); color: #60a5fa; }
#aoi-share-modal .aoi-share-contact-text { order: 1; flex: 1 1 auto; gap: 2px; }
#aoi-share-modal .aoi-share-contact-name,
#aoi-share-modal .aoi-share-contact-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#aoi-share-modal .aoi-share-contact-name { font-size: 13px; font-weight: 700; line-height: 1.3; color: #f1f5f9; }
#aoi-share-modal .aoi-share-contact-meta { font-size: 11.5px; font-weight: 600; line-height: 1.3; color: rgba(203, 213, 225, 0.65); }
#aoi-share-modal .aoi-share-contact-meta:empty { display: none; }
/* The tick: a trough box, the brand's blue with a white tick once picked. */
#aoi-share-modal .aoi-share-contact input[type="checkbox"] {
    order: 2;
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 6px;
    background: rgba(2, 10, 24, 0.55) center / 12px 12px no-repeat;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
#aoi-share-modal .aoi-share-contact:hover input[type="checkbox"]:not(:checked) { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.6); }
#aoi-share-modal .aoi-share-contact input[type="checkbox"]:checked {
    background-color: #2e8eff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 10px rgba(46, 142, 255, 0.35);
}
#aoi-share-modal .aoi-share-contact input[type="checkbox"]:focus-visible { outline: 2px solid #2e8eff; outline-offset: 2px; }
/* Loading, none to share with, or failed: one quiet box in the list's place, its glyph in a chip over the words. */
#aoi-share-modal :is(.aoi-share-loading, .aoi-share-empty) {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    padding: 18px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    background: rgba(2, 10, 24, 0.3);
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(203, 213, 225, 0.72);
}
#aoi-share-modal .aoi-share-empty { display: flex; }
#aoi-share-modal .aoi-share-empty::before {
    content: "\f0c0" / "";
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.1);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    color: rgba(203, 213, 225, 0.7);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 13px;
}
#aoi-share-modal .aoi-share-loading .aoi-name-spinner { width: 18px; height: 18px; }
/* How many are picked, at the foot's left (counted above); not while there are none to pick. */
#aoi-share-modal .aoi-modal-actions::before {
    content: counter(aoi-picked) " of " counter(aoi-contacts) " selected";
    margin-right: auto;
    font-size: 12px;
    font-weight: 600;
    color: rgba(203, 213, 225, 0.72);
    font-variant-numeric: tabular-nums;
}
#aoi-share-modal .aoi-share-contacts:not(:has(.aoi-share-contact)) ~ .aoi-modal-actions::before { content: none; }

/* ── Areas of Interest (the list) ─────────────────────────────────────────────────────────────────────── */
#aoi-modal #aoi-list {
    display: grid;
    gap: 8px;
    max-height: min(420px, 56vh);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
/* An area: a reading tile, its pin in a chip at its left, its name in Oxanium over its modules' pills. */
#aoi-modal .aoi-item {
    min-height: 58px;
    margin: 0;
    padding: 12px 14px 12px 58px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
#aoi-modal .aoi-item:hover { box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.4); }
#aoi-modal .aoi-item-info { gap: 7px; }
#aoi-modal .aoi-item-name {
    display: block;
    padding: 0;
    border-radius: 0;
    background: none;
    font-family: Oxanium, Manrope, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-transform: none;
    color: #f8fafc;
}
#aoi-modal .aoi-item-name i {
    position: absolute;
    left: 14px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    border-radius: 10px;
    background: rgba(46, 142, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
    color: #60a5fa;
    font-size: 13px;
}
#aoi-modal .aoi-item-modules { gap: 5px; }
#aoi-modal .aoi-module-tag {
    padding: 3px 9px 4px;
    border-radius: 999px;
    background: rgba(46, 142, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.28);
    color: #bfdbfe;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-transform: none;
}
/* None yet: a quiet box, its pin in a chip over the words. */
#aoi-modal .aoi-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 26px;
    border-radius: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
    background: rgba(2, 10, 24, 0.3);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
    color: rgba(203, 213, 225, 0.72);
}
#aoi-modal .aoi-empty::before {
    content: "\f5a0" / "";
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(46, 142, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
    color: #60a5fa;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 13px;
}

/* ── A phone: the panels nearly the screen's width, tighter in ────────────────────────────────────────── */
@media (max-width: 640px) {
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .modal-content { max-width: calc(100vw - 20px); padding: 16px 16px 0; }
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions { margin: 18px -16px 0; padding: 12px 16px 14px; }
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-modal-actions button { height: 44px; }
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .bc-btn-group__btn { width: 36px; height: 36px; }
    #aoi-method-modal .aoi-fmt-seg button { height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .modal-content,
    #aoi-method-modal .aoi-method-view--chooser,
    #aoi-method-modal .aoi-method-view--coords,
    #aoi-edit-modal .aoi-name-loading,
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) .aoi-form-input.error { animation: none; }
    #aoi-edit-modal #btn-aoi-delete.aoi-delete-confirm::after { animation: none; }   /* the fuse: a still red line */
    :is(#aoi-modal, #aoi-method-modal, #aoi-edit-modal, #aoi-share-modal) :is(button, .aoi-form-input, .aoi-form-select, .aoi-coord-row,
        .aoi-module-section, .toggle-switch, .aoi-share-contact, .aoi-share-contact::before, input[type="checkbox"], .aoi-item),
    #aoi-method-modal .aoi-method-option::before,
    #aoi-method-modal .aoi-method-option .text > i,
    #aoi-method-modal .aoi-method-option .text::after,
    #aoi-edit-modal #btn-aoi-delete .adc-icon-default,
    #aoi-edit-modal #btn-aoi-delete .adc-confirm-label { transition: none; }
}
