/* Shared presentation for the administration and employee interfaces. */
:where(.ep, #app, .sheet) :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 2px solid #476b20;
  outline-offset: 2px;
}

:is(.ep-btn, .ep-iconbtn, .ep-avatarbtn, .ep-dockbtn, .btn, .iconbtn, .tabbar a):active:not(:disabled) {
  transform: translateY(1px);
}

.company-picker > summary {
  display: inline-flex;
  align-items: center;
  gap: .5em;
}

.company-picker > summary::-webkit-details-marker { display: none; }
.company-picker > summary .company-chevron {
  flex: none;
  transition: transform 160ms ease-out;
}
.company-picker[open] > summary .company-chevron { transform: rotate(180deg); }
.company-picker[open] .company-options,
.ep-accmenu:not([hidden]),
dialog.ep-modal[open] .ep-modal-in {
  animation: feedback-enter 170ms ease-out;
}

@keyframes feedback-enter {
  from { opacity: 0; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}

@media (pointer: coarse), (max-width: 767px) {
  .group-header .company-options input,
  .company-picker > summary,
  .company-choices > button,
  .company-options > button,
  .ep-topicon, .ep-avatarbtn, .ep-modal-in .ep-iconbtn,
  .sheet header .iconbtn, #bellBtn { min-block-size: 44px; }
  .ep-topicon, .ep-avatarbtn, .ep-modal-in .ep-iconbtn,
  .sheet header .iconbtn, #bellBtn { min-inline-size: 44px; }
  .sheet { max-height: 92dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .company-picker > summary .company-chevron,
  .company-picker[open] .company-options,
  .ep-accmenu:not([hidden]),
  dialog.ep-modal[open] .ep-modal-in { animation: none; transition: none; }

  :is(.ep-btn, .ep-iconbtn, .ep-avatarbtn, .ep-dockbtn, .btn, .iconbtn, .tabbar a):active {
    transform: none;
  }
}

/* Feedback follows the real lifetime of the operation. */
button[aria-busy="true"] { cursor: wait; }
button[aria-busy="true"]::before,
.ui-loading::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  inline-size: 1em;
  block-size: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: feedback-spin 720ms linear infinite;
}
@keyframes feedback-spin { to { transform: rotate(360deg); } }

.ep-boot > .ui-loading,
.loading > .ui-loading,
.ep-empty.ui-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7em;
}
.ui-loading::before { color: #476b20; }

.ep-toast:not([hidden]),
body > .toast {
  display: flex;
  align-items: center;
  gap: .65em;
  inline-size: max-content;
  max-inline-size: min(420px, calc(100vw - 32px));
  overflow-wrap: anywhere;
  animation: feedback-enter 170ms ease-out;
}
.ep-toast > svg, .toast > svg { flex: none; width: 18px; height: 18px; }
.toast:not(.bad) { border-inline-start: 3px solid #c7ef4b; }

:is(.login, .sheet) .err:not(:empty),
.ep-form-error:not([hidden]) {
  padding: 9px 12px;
  border-radius: 6px;
  border-inline-start: 3px solid currentColor;
  background: #fff3f2;
  color: #8e2121;
  overflow-wrap: anywhere;
}
.login .err[data-tone="ok"]:not(:empty) {
  background: #edf5e5;
  color: #33591d;
}

@media (max-width: 767px) {
  .ep-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  body > .toast { inline-size: auto; max-inline-size: none; }
}

@media (prefers-reduced-motion: reduce) {
  button[aria-busy="true"]::before, .ui-loading::before,
  .ep-toast:not([hidden]), body > .toast { animation: none; }
}

.company-choices button[aria-pressed="true"] { font-weight: 600; }
.company-options, .company-choices, .sheet .body { overscroll-behavior: contain; }

:is(.ep-topicon, #bellBtn, .mbell) > .dot { box-shadow: 0 0 0 2px #fff; }
:is(.ep-topicon, #bellBtn, .mbell)[aria-current="page"] { outline: 2px solid #476b20; }
:is(.ep-topicon, #bellBtn, .mbell)[aria-current="page"]:focus-visible { outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .chart .line { stroke-dashoffset: 0; }
  .ep-dockbtn:active .ic, .mquick button:active span { transform: none; }
}

.sheet .drop:focus-within { outline: 2px solid #476b20; outline-offset: 2px; }
