/* Staff site, 8 of 13: the installed app's affordances, the modal, and the receipt and address helpers. */

/* Installed-app affordances */
.sidebar-foot .install-btn { padding-left: 0; text-align: left; }
/* The back control exists only when there is no browser back to lean on: in the app bar on
   phones (hidden with the bar above 800 px), above the page on wider screens. */
.standalone-back { display: none; }
.content-back {
    align-items: center; gap: .25rem; font: inherit; background: transparent; border: 0; color: var(--primary);
    min-height: 44px; padding: 0 .5rem 0 0; margin: -.5rem 0 .5rem; cursor: pointer;
}
@media (display-mode: standalone) {
    /* Once it is on the home screen the install button has done its job, row and all. */
    .install-btn, .more-list li:has(> .install-btn) { display: none; }
    .standalone-back { display: inline-flex; }
}
@media (display-mode: standalone) and (max-width: 800px) {
    .content-back { display: none; }
}
/* Opened from the phone app (the fo.phone-app cookie): only its window, an installed app's, swaps Today for Home
   and offers the way back from the login page. A browser tab sharing that cookie stays the plain website. */
.tab.in-phone-app, .btn.phone-app-back { display: none; }
@media (display-mode: standalone) {
    .tab.in-phone-app { display: flex; }
    .tab.not-in-phone-app { display: none; }
    .btn.phone-app-back { display: flex; }
}

/* Modal (native <dialog>) */
.modal {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
    padding: 1.25rem 1.5rem; width: min(520px, calc(100vw - 2rem)); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(12, 24, 32, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin: 0 0 .5rem; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-close { font: inherit; font-size: 1.4rem; line-height: 1; background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0 .25rem; }
.modal-close:hover { color: var(--text); }
.install-steps { border-top: 1px solid var(--line-soft); padding: .6rem 0; }
.install-steps summary { cursor: pointer; font-weight: 600; padding: .2rem 0; }
.install-steps ol { margin: .5rem 0 .25rem; padding-left: 1.4rem; }
.install-steps li { margin: .3rem 0; }

/* The receipt scanner round an expense form's file input (ArcTerra.Scan: receipt-scan-element.js) */
receipt-scan { display: block; }
.receipt-scan-preview { margin: .5rem 0 0; }

/* Receipt suggestions round the expense form (js/receipt-suggest.js; the hint is ReceiptHint) */
receipt-suggest { display: block; }
input.suggested { background: var(--warn-wash); border-color: var(--warn); }
.receipt-hint { margin: -.25rem 0 .75rem; font-size: .9rem; color: var(--warn-ink); }
.receipt-hint[hidden] { display: none; }
.btn-link {
    background: none; border: 0; padding: 0; margin-left: .35rem; min-height: 44px; width: auto;
    color: var(--primary); font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer;
}

/* Address suggestions (address-autocomplete.js) */
address-autocomplete { display: block; }
.suggest-anchor { position: relative; }
.suggest-list {
    position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
    margin: .2rem 0 0; padding: .25rem 0; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    font-weight: normal;
}
.suggest-list li[role="option"] { padding: .45rem .75rem; cursor: pointer; color: var(--ink); }
.suggest-list li[role="option"]:hover, .suggest-list li[aria-selected="true"] { background: var(--well); }
.suggest-credit { padding: .35rem .75rem 0; border-top: 1px solid var(--line-soft); margin-top: .25rem; font-size: var(--fs-fine); color: var(--ink-3); }
.suggest-credit a { color: inherit; }
