/* The wrapper of a component that does not render one element (<phem-c>) does not change the layout. */
phem-c{display:contents}
/* The fallback of a <Suspense>: a box, so a lazy boundary can come into view. */
phem-suspense{display:block}
/* The default message of a failed event. */
.phem-error{position:fixed;inset:auto 1rem 1rem;z-index:2147483647;max-width:32rem;margin:auto;padding:.75rem 1rem;border-radius:.375rem;background:#b91c1c;color:#fff;font:inherit;cursor:pointer}
/* A phem:loading or phem:progress element shows only while its handler runs, also with a `display` of its own. */
[data-phem-loading][hidden],[data-phem-progress][hidden]{display:none!important}
/* The phem-toast controller: a stack of toasts at the bottom right. :where() lets the app change it. A part with a class attribute gets no default look: the class styles it, also when it is a utility class in a cascade layer (Tailwind). */
:where([data-controller~="phem-toast"]:not([class])){position:fixed;inset:auto 1rem 1rem auto;z-index:2147483646;display:flex;flex-direction:column-reverse;gap:.5rem;max-width:min(24rem,calc(100vw - 2rem))}
:where([data-phem-toast]:not([class])){display:flex;align-items:start;gap:.75rem;padding:.75rem 1rem;border-radius:.375rem;background:#1f2937;color:#fff;font:inherit;box-shadow:0 4px 12px rgb(0 0 0/.15)}
:where([data-phem-toast]:not([class])[data-type="error"]){background:#b91c1c}
:where([data-phem-toast]:not([class])[data-type="warning"]){background:#b45309}
:where([data-phem-toast]:not([class])[data-type="success"]){background:#15803d}
:where([data-phem-toast]:not([class])[data-limited]){display:none}
/* A swipe of a toast: the toast follows the pointer. */
:where([data-phem-toast]:not([class])[data-swiping],[data-phem-toast]:not([class])[data-swipe-direction]){transform:translate(var(--toast-swipe-movement-x,0px),var(--toast-swipe-movement-y,0px))}
:where([data-phem-toast-content]:not([class])){flex:1;display:flex;flex-direction:column;gap:.125rem}
:where([data-phem-toast-description]:not([class])){flex:1}
:where([data-phem-toast-close]:not([class])){padding:0 .25rem;border:0;background:none;color:inherit;font:inherit;line-height:1;cursor:pointer}
/* The phem-sortable controller: a touch on a handle drags, and does not scroll. An item with no handle keeps the scroll: a hold starts its drag. No text selection and no touch callout during a drag. */
[data-controller~="phem-sortable"] [data-phem-sortable-target~="handle"]{touch-action:none}
[data-phem-sorting],[data-phem-sorting] *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* The drop marker of phem-sortable: a line in the gap of the drop place, on the list with data-drop. The controller sets its center and its length (--sortable-drop-x, -y, -width, -height on the root). The app changes --sortable-drop-color and --sortable-drop-thickness, or the whole rule: :where() lets it. */
:where([data-controller~="phem-sortable"][data-drop])::after{content:"";position:fixed;z-index:2147483646;left:var(--sortable-drop-x);top:var(--sortable-drop-y);width:max(var(--sortable-drop-width),var(--sortable-drop-thickness,2px));height:max(var(--sortable-drop-height),var(--sortable-drop-thickness,2px));translate:-50% -50%;border-radius:1px;background:var(--sortable-drop-color,#2563eb);pointer-events:none}
@media (forced-colors:active){:where([data-controller~="phem-sortable"][data-drop])::after{background:Highlight}}
/* A modal phem-dialog: a scroll on the dialog or on its backdrop does not scroll the page. The backdrop needs an overflow to be a scroll container. */
:where(dialog[data-phem-dialog-target]:modal){overscroll-behavior:contain}
:where(dialog[data-phem-dialog-target])::backdrop{overflow:hidden;overscroll-behavior:contain}
/* The dialog of a modal route (phem:modal): a box in the center of the screen, with a close button at the top right. A scroll on the dialog or on its backdrop does not scroll the page. :where() lets the app change it. */
:where(dialog[data-phem-modal-route]){box-sizing:border-box;width:min(48rem,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);padding:2.5rem 1.5rem 1.5rem;border:0;border-radius:.5rem;background:Canvas;color:CanvasText;box-shadow:0 10px 40px rgb(0 0 0/.25);overscroll-behavior:contain}
:where(dialog[data-phem-modal-route])::backdrop{overflow:hidden;overscroll-behavior:contain;background:rgb(0 0 0/.5)}
:where([data-phem-modal-close]){position:absolute;top:.5rem;right:.75rem;padding:0 .25rem;border:0;background:none;color:inherit;font:inherit;font-size:1.5rem;line-height:1;cursor:pointer}
/* The swipe of a drawer (phem-dialog with a swipe direction): no text selection. */
[data-phem-dialog-target~="popup"][data-swiping]{-webkit-user-select:none;user-select:none}
/* The scrub area of a phem-number-field: a touch scrubs and does not scroll, and no text selection. */
[data-phem-number-field-target~="scrubArea"]{touch-action:none;-webkit-user-select:none;user-select:none}
