:root {
  /* Layout */
  --fc-header-height: 64px;
  --fc-header-slot: 64px;
  --fc-header-inline: 16px;
  --fc-touch-target: 44px;

  /* Icons */
  --fc-icon-size: 18px;
  --fc-icon-size-small: 16px;
  --fc-icon-stroke: 1.5;

  /* Interaction motion. Business/content animation owns its own timing. */
  --fc-motion-press-scale: .96;
  --fc-motion-instant: .001ms;
  --fc-motion-fast: 150ms;
  --fc-motion-state: 180ms;
  --fc-motion-medium: 220ms;
  --fc-motion-slow: 460ms;
  --fc-motion-press-duration: var(--fc-motion-fast);
  --fc-motion-overlay-duration: var(--fc-motion-state);
  --fc-motion-panel-duration: var(--fc-motion-medium);
  --fc-motion-dialog-offset: 8px;
  --fc-state-ease: cubic-bezier(.2, 0, 0, 1);
  --fc-motion-ease: var(--fc-state-ease);
  --fc-motion-ease-out: cubic-bezier(.22, 1, .36, 1);

  /* Shared interface layers */
  --fc-z-header: 500;
  --fc-z-tab-bar: 9000;
  --fc-z-dialog: 10000;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

fc-shell-header,
fc-shell-tab-bar {
  display: none;
}

/* Structural hooks: pages keep their own surface, color and typography. */
.fc-app-header {
  --fc-header-line-color: rgba(36, 33, 29, .09);
  --fc-header-shadow-color: rgba(36, 33, 29, .08);
  --fc-header-surface: rgba(241, 238, 231, .9);
  min-height: var(--fc-header-height);
  transition-property: background-color, border-color, box-shadow, -webkit-backdrop-filter, backdrop-filter;
  transition-duration: var(--fc-motion-state);
  transition-timing-function: var(--fc-motion-ease);
}

.fc-app-header--centered {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: var(--fc-header-slot) minmax(0, 1fr) var(--fc-header-slot);
  align-items: center;
  height: var(--fc-header-height);
  padding-inline: var(--fc-header-inline);
}

.fc-app-header.fc-app-header--centered {
  border-bottom: 1px solid transparent;
}

.fc-app-header.fc-app-header--centered[data-fc-header-state="scrolled"] {
  border-bottom-color: var(--fc-header-line-color);
  box-shadow: 0 14px 28px -26px var(--fc-header-shadow-color);
}

.fc-app-header.fc-app-header--immersive {
  border-bottom: 1px solid transparent;
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.fc-app-header.fc-app-header--immersive[data-fc-header-state="scrolled"] {
  border-bottom-color: var(--fc-header-line-color);
  background-color: var(--fc-header-surface);
  box-shadow: 0 14px 28px -24px var(--fc-header-shadow-color);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}

.fc-app-header__leading {
  grid-column: 1;
  justify-self: start;
}

.fc-app-header__title {
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  text-wrap: balance;
}

.fc-app-header__title:is(a, button) {
  min-height: var(--fc-touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition-property: transform;
  transition-duration: var(--fc-motion-fast);
  transition-timing-function: var(--fc-motion-ease);
}

.fc-app-header__title:is(a, button):active {
  transform: scale(var(--fc-motion-press-scale));
}

.fc-app-header__title:is(a, button):focus-visible {
  outline: 2px solid var(--fc-header-title-focus, rgba(36, 33, 29, .42));
  outline-offset: 2px;
}

.fc-app-header__trailing {
  grid-column: 3;
  justify-self: end;
}

.fc-app-header__label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .14em;
  white-space: nowrap;
}

.fc-app-header__action,
.fc-icon-button {
  min-width: var(--fc-touch-target);
  min-height: var(--fc-touch-target);
}

.fc-icon-button {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--fc-motion-state) var(--fc-motion-ease),
    background-color var(--fc-motion-state) var(--fc-motion-ease),
    border-color var(--fc-motion-state) var(--fc-motion-ease),
    box-shadow var(--fc-motion-state) var(--fc-motion-ease),
    opacity var(--fc-motion-state) var(--fc-motion-ease),
    transform var(--fc-motion-fast) var(--fc-motion-ease);
}

.fc-icon-button:focus-visible {
  outline: 2px solid var(--fc-icon-button-focus, rgba(161, 35, 35, .54));
  outline-offset: var(--fc-icon-button-focus-offset, 2px);
}

.fc-icon-button:active:not(:disabled, [aria-disabled="true"]) {
  transform: scale(var(--fc-motion-press-scale));
}

.fc-icon-button:is(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: var(--fc-icon-button-disabled-opacity, .52);
}

/* Shared home-return control. Contextual back controls may keep a text label. */
.fc-app-header .fc-header-back {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--fc-touch-target);
  height: var(--fc-touch-target);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 50%;
  background: rgba(247, 245, 237, .34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .56),
    0 8px 20px rgba(64, 47, 29, .065);
  color: inherit;
  text-decoration: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
}

.fc-app-header .fc-header-back:is(:hover, :focus-visible) {
  background-color: rgba(247, 245, 237, .68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7),
    0 10px 22px rgba(64, 47, 29, .085);
}

.fc-app-header .fc-header-back {
  --fc-icon-button-focus: rgba(36, 33, 29, .42);
}

.fc-app-header .fc-header-back .fc-icon {
  width: var(--fc-icon-size);
  height: var(--fc-icon-size);
}

.fc-tab-bar__item {
  min-width: var(--fc-touch-target);
  min-height: var(--fc-touch-target);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.fc-pressable {
  transition-property: color, background-color, border-color, opacity, transform;
  transition-duration: var(--fc-motion-fast);
  transition-timing-function: var(--fc-motion-ease);
}

.fc-pressable:active {
  transform: scale(var(--fc-motion-press-scale));
}

@media (max-width: 900px) {
  :root {
    --fc-header-height: 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --fc-motion-fast: var(--fc-motion-instant);
    --fc-motion-state: var(--fc-motion-instant);
    --fc-motion-medium: var(--fc-motion-instant);
    --fc-motion-slow: var(--fc-motion-instant);
  }

  .fc-pressable {
    transition-duration: var(--fc-motion-instant) !important;
  }

  .fc-icon-button {
    transition-duration: var(--fc-motion-instant) !important;
  }

  .fc-app-header {
    transition-duration: var(--fc-motion-instant) !important;
  }

  .fc-app-header .fc-header-back {
    transition-duration: var(--fc-motion-instant) !important;
  }
}
