:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-fast: 180ms;
}

.view.active { animation: none; }
button { position: relative; isolation: isolate; overflow: hidden; transition: background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast), translate var(--motion-fast) var(--motion-ease); }
button:not(:disabled):active { translate: 0 1px; }
.button-ripple { position: absolute; pointer-events: none; border-radius: 50%; background: currentColor; z-index: 1; }
.nav-item { transition: background 240ms, color 240ms, box-shadow 240ms; }
.nav-item svg, .quick-link svg, .record-actions svg { transition: transform 220ms var(--motion-ease); }
.nav-item:hover svg, .nav-item:focus-visible svg { transform: translateX(2px); }
.quick-link { transition: background 180ms; }
.quick-link:hover svg:last-child { transform: translate(2px, -2px); }
.record-actions button:hover svg { transform: rotate(-8deg); }
.brand-mark { transition: filter 240ms; }
.brand:hover .brand-mark { filter: drop-shadow(0 0 6px #ffffff30); }

.metrics article { isolation: isolate; position: relative; overflow: hidden; transition: translate 220ms var(--motion-ease), box-shadow 220ms, border-color 220ms; }
.metrics article::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, #ffffff90 48%, transparent 61%); transform: translateX(-120%); }
.metric-icon { transition: transform 240ms var(--motion-ease); }
.search-field { transition: filter 180ms; }
.search-field:focus-within { filter: drop-shadow(0 2px 5px #004f7614); }
input, select, textarea { transition: border-color 180ms, box-shadow 180ms; }
tbody tr { transition: background 160ms, box-shadow 160ms; }
.event-link .event-arrow { transition: translate 180ms var(--motion-ease); }
.event-link:hover .event-arrow { translate: 3px 0; }
.record-card { transition: border-color 200ms, box-shadow 200ms; }
.calendar-day { transition: background 160ms, border-color 160ms, box-shadow 160ms; }
.calendar-accordion summary::before { transition: transform 220ms var(--motion-ease); }
.calendar-accordion[open] summary::before { transform: rotate(180deg); }
.calendar-accordion-body { animation: accordion-reveal 220ms var(--motion-ease); }
@keyframes accordion-reveal { from { opacity: .3; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  .calendar-accordion { interpolate-size: allow-keywords; }
  .calendar-accordion::details-content { block-size: 0; overflow: clip; transition: block-size 240ms var(--motion-ease), content-visibility 240ms; transition-behavior: allow-discrete; }
  .calendar-accordion[open]::details-content { block-size: auto; }
}

dialog { opacity: 0; transform: translateY(14px) scale(.98); transition: opacity 180ms ease-out, transform 220ms var(--motion-ease), display 220ms, overlay 220ms; transition-behavior: allow-discrete; }
dialog[open] { opacity: 1; transform: translateY(0) scale(1); }
dialog::backdrop { opacity: 0; transition: opacity 200ms, display 220ms, overlay 220ms; transition-behavior: allow-discrete; }
dialog[open]::backdrop { opacity: 1; }
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(14px) scale(.98); }
  dialog[open]::backdrop { opacity: 0; }
}
@supports not (transition-behavior: allow-discrete) {
  dialog[open] { animation: dialog-reveal 220ms var(--motion-ease); }
}
@keyframes dialog-reveal { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (hover: hover) and (pointer: fine) {
  .metrics article:hover { translate: 0 -3px; box-shadow: 0 10px 24px #002c4930; }
  .metrics article:hover::after { transition: transform 650ms ease-out; transform: translateX(120%); }
  .metrics article:hover .metric-icon { transform: rotate(-7deg) scale(1.08); }
  .record-card:hover { box-shadow: 0 4px 14px #004f7612; }
  .calendar-day:hover { box-shadow: inset 0 0 0 1px #7ca8c0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:not(:disabled):active, .metrics article:hover { translate: none; }
  .metrics article::after, .button-ripple { display: none; }
  .nav-item:hover svg, .nav-item:focus-visible svg, .quick-link:hover svg:last-child, .record-actions button:hover svg, .metrics article:hover .metric-icon { transform: none; }
  .event-link:hover .event-arrow { translate: none; }
  .brand:hover .brand-mark { filter: none; }
  dialog, dialog[open] { transform: none; }
}
