/* Header account drop-down (#394). Base layout only: the theme carries the look (.ilc-acct-panel, .ilc-acct*). */
.ilc-acct-panel { position: fixed; z-index: 99999; background: #fff; border: 1px solid #e2e8ef; border-radius: 8px; box-shadow: 0 8px 24px rgba(13, 36, 76, .14); padding: 16px; box-sizing: border-box; font-size: 14px; }
.ilc-acct-panel[hidden] { display: none; }
.ilc-acct__title, .ilc-acct__name { margin: 0 0 10px; font-weight: 600; }
.ilc-acct__field { margin: 0 0 10px; }
.ilc-acct__field label { display: block; margin: 0 0 4px; font-size: 13px; }
.ilc-acct-panel .ilc-acct__field input { width: 100%; box-sizing: border-box; font-size: 16px; } /* at least 16px, or iOS zooms the page on focus (#394, iPad 768) */
.ilc-acct__remember { margin: 0 0 10px; font-size: 13px; }
.ilc-acct__submit, .ilc-acct__logout { display: block; width: 100%; box-sizing: border-box; text-align: center; }
.ilc-acct__logout[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.ilc-acct__error { margin: 0 0 10px; color: #b42318; }
.ilc-acct__links, .ilc-acct__note { margin: 10px 0 0; font-size: 13px; }
.ilc-acct__list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ilc-acct__out { margin: 0; }
/* Touch screens: every control at least 44 px tall (Roddy's phone rule). */
@media (pointer: coarse) {
	.ilc-acct__field input { min-height: 44px; }
	.ilc-acct__submit, .ilc-acct__logout { display: flex; align-items: center; justify-content: center; min-height: 44px; }
	.ilc-acct__list a, .ilc-acct__links a, .ilc-acct__terms a { display: inline-flex; align-items: center; min-height: 44px; }
	.ilc-acct__remember label { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; }
	.ilc-acct__list { gap: 0; }
}

/* #507: Log in / Sign up tabs. */
.ilc-acct__tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid #e2e8ef; }
.ilc-acct__tab { flex: 1; min-height: 40px; padding: 8px 10px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; font-weight: 600; color: #5b6472; cursor: pointer; }
.ilc-acct__tab[aria-selected="true"] { color: #0d244c; border-bottom-color: currentColor; }
.ilc-acct__pane[hidden] { display: none; }
.ilc-acct__lead { margin: 0 0 12px; }
/* #536: the account-on-terms line sits apart and small under Sign up (a request, not the instant login). */
.ilc-acct__terms { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #e2e8ef; font-size: 13px; }

/* #507: on a touch screen the header panel is a full-width drop-down sheet under the link. */
.ilc-acct-panel.ilc-acct-panel--sheet { left: 8px; right: 8px; width: auto; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0; }
/* #590: its grab bar on the bottom edge (always in view, held to the bottom while the content scrolls): push it up to close. */
.ilc-acct-panel__grab { display: none; }
.ilc-acct-panel--sheet .ilc-acct-panel__grab { display: block; position: sticky; bottom: 0; height: 28px; margin: 8px -16px 0; background: inherit; touch-action: none; }
/* The phone drop-down never has bottom padding: its grab bar is the bottom edge. The block theme gives the panel
   `padding: 20px !important`, which lifted the bar 20px and let it cover Log in with the keyboard up (Roddy's phone,
   19 Nov). Out-ranks it here so the fix does not wait on the theme (#788 tidies the theme side). */
body .ilc-acct-panel.ilc-acct-panel--sheet { padding-bottom: 0 !important; }
/* The account drop-down (--flow, Roddy 19 Nov: "the swipe bar is in a frozen position" over Log in): a column of two
   parts. The content scrolls in its own area; the grab bar is the next part BELOW it, in the normal flow, so nothing
   passes under it and it takes no tap meant for Log in. The panel's height (max-height, set from the visible part of
   the screen while typing by swipe-panel.js keyboard()) is shared out by flex: the content area gives way, the bar
   never does. The My Lab drop-down keeps the sticky bar above (no form in it). */
.ilc-acct-panel.ilc-acct-panel--sheet.ilc-acct-panel--flow:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); }
.ilc-acct-panel--sheet.ilc-acct-panel--flow .ilc-acct-panel__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: -3px -4px 0; padding: 3px 4px 0; }
.ilc-acct-panel--sheet.ilc-acct-panel--flow .ilc-acct-panel__grab { position: relative; bottom: auto; flex: none; margin: 4px 0 0; }
.ilc-acct-panel--sheet .ilc-acct-panel__grab::before { content: ""; position: absolute; left: 50%; top: 12px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #cdd5df; }
/* Typing on a short screen (Roddy, 19 Nov): the tabs and the title fold away until typing stops, so the field being
   typed in and Log in both fit above the keyboard (swipe-panel.js keyboard(), o.tight). The grab bar stays. */
.ilc-acct-panel--sheet.ilc-kb-tight .ilc-acct__tabs, .ilc-acct-panel--sheet.ilc-kb-tight .ilc-acct__title { display: none; }

/* #507: the "Log in for your price" modal: centred on a desktop, a sheet from the bottom on a phone. */
.ilc-acct-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.ilc-acct-modal[hidden] { display: none; }
.ilc-acct-modal__backdrop { position: absolute; inset: 0; background: rgba(13, 36, 76, .45); }
/* #590: a fixed header (the grab bar, X and tabs) over a body that scrolls, so on a short screen with the keyboard up
   the X and the grab bar never scroll out of reach. */
.ilc-acct-modal__dialog { position: relative; display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; background: #fff; border-radius: 10px; box-shadow: 0 16px 40px rgba(13, 36, 76, .22); padding: 20px; box-sizing: border-box; font-size: 14px; }
.ilc-acct-modal__close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; line-height: 1; color: #5b6472; cursor: pointer; }
.ilc-acct-modal__head { flex: none; }
/* #590 follow-up: on a short phone with the keyboard up, when the field and Log in do not both fit, the tabs fold away until
   typing stops (the grab bar and X stay; ILCSwipe.keyboard adds the class). */
.ilc-acct-modal__dialog.ilc-kb-tight .ilc-acct-modal__head { display: none; }
.ilc-acct-modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ilc-acct-modal__grab { display: none; }
.ilc-acct-modal .ilc-acct__tabs { margin-right: 40px; }
.ilc-acct-modal .ilc-acct__field input { width: 100%; box-sizing: border-box; font-size: 16px; } /* 16px: no iOS zoom */
html.ilc-acct-locked, html.ilc-acct-locked body { overflow: hidden; }
@media (max-width: 767px) {
	.ilc-acct-modal { align-items: flex-end; }
	.ilc-acct-modal__dialog { width: 100%; max-height: 90vh; border-radius: 14px 14px 0 0; padding-top: 22px; }
	/* The grab bar: a full-width strip across the sheet's top edge (what a finger can grab), drawn as the usual 40x4
	   bar. While typing, a drag that starts here (or the X) is the only way the sheet closes (#590). */
	.ilc-acct-modal__grab { display: block; position: absolute; top: 0; left: 0; right: 0; height: 22px; z-index: 1; touch-action: none; }
	.ilc-acct-modal__grab::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #cdd5df; }
}
@media (pointer: coarse) {
	.ilc-acct__tab { min-height: 44px; }
	.ilc-acct-modal .ilc-acct__field input { min-height: 44px; }
	.ilc-acct-modal .ilc-acct__submit { display: flex; align-items: center; justify-content: center; min-height: 44px; }
	.ilc-acct-modal .ilc-acct__links a, .ilc-acct-modal .ilc-acct__remember label { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; }
}
/* Fly-out motion (Roddy, 14 Nov: every fly-out the same): transform and opacity only, the backdrop fading in with the
   panel, one duration and curve (the same values as assets/swipe-panel.js, quick view and the theme's drawers); a sheet
   from the bottom on a phone. While open the page is locked without moving: the scrollbar's space is kept. */
.ilc-acct-modal { --ilc-fly-dur: 250ms; --ilc-fly-ease: cubic-bezier(0, 0, .2, 1); }
/* Opened in two steps: first shown held out of sight (.is-pre) so the page's style work happens before anything moves,
   then released on the next frame to slide in (header-account.js). Their own layers, so no frame is spent painting them. */
.ilc-acct-modal.is-pre .ilc-acct-modal__dialog,
.ilc-acct-modal.is-pre .ilc-acct-modal__backdrop { visibility: hidden; }
.ilc-acct-modal__dialog { will-change: transform; }
.ilc-acct-modal__backdrop { will-change: opacity; }
html.ilc-keep-gutter { scrollbar-gutter: stable; } /* only when the page has a scrollbar (ILCSwipe.lockPage) */
@media (prefers-reduced-motion: no-preference) {
	.ilc-acct-modal:not([hidden]):not(.is-pre) .ilc-acct-modal__dialog { animation: ilc-acct-in var(--ilc-fly-dur) var(--ilc-fly-ease); }
	.ilc-acct-modal:not([hidden]):not(.is-pre) .ilc-acct-modal__backdrop { animation: ilc-acct-fade var(--ilc-fly-dur) var(--ilc-fly-ease); }
	@media (max-width: 767px) {
		.ilc-acct-modal:not([hidden]):not(.is-pre) .ilc-acct-modal__dialog { animation-name: ilc-acct-up; }
	}
	@keyframes ilc-acct-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
	@keyframes ilc-acct-up { from { transform: translateY(100%); } to { transform: none; } }
	@keyframes ilc-acct-fade { from { opacity: 0; } to { opacity: 1; } }
}
