.app-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: calc(72px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 0 0;
  background: var(--accent);
  color: #fff;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-strong) 44%, transparent);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

.app-header-inner {
  width: min(calc(100% - 28px), var(--content-inner-max-width));
  height: 72px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
}
.app-header h1 {
  margin: 0;
  text-align: center;
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}
.header-side {
  width: 48px;
  display: grid;
  place-items: center;
}
.header-logo {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 12px;
  display: block;
  background: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-strong) 28%, transparent);
}
.app-header .icon-btn {
  border-radius: var(--radius-pill);
  color: #fff;
  background: color-mix(in srgb, #fff 15%, transparent);
  border: 1px solid color-mix(in srgb, #fff 28%, transparent);
}
.app-header .icon-btn:active {
  background: color-mix(in srgb, #fff 28%, transparent);
}
.dock {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: calc(8px - env(safe-area-inset-bottom));
  width: min(var(--content-max-width), 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(var(--dock-count, 4), 1fr);
  gap: 7px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 11px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: none;
  overflow: visible;
  contain: layout style;
  isolation: isolate;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.dock::before {
  content: "";
  position: absolute;
  inset: 8px 16px calc(11px + env(safe-area-inset-bottom));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 21px;
  background: var(--dock);
  box-shadow: var(--shadow);
  pointer-events: none;
}
.dock-indicator {
  position: absolute;
  z-index: 0;
  top: 15px;
  bottom: calc(17px + env(safe-area-inset-bottom));
  left: 21px;
  width: calc((100% - 42px - (7px * (var(--dock-count, 4) - 1))) / var(--dock-count, 4));
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(15, 23, 42, .13);
  transform: translateX(calc(var(--dock-index, 0) * (100% + 7px)));
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.dock button {
  min-height: 52px;
  border: 0;
  background: transparent;
  border-radius: 15px;
  padding: 5px 4px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  position: relative;
  z-index: 1;
  transition: color 160ms ease, transform 120ms ease;
}
.dock button:active { transform: scale(.98); }
.dock button.active {
  background: transparent;
  color: var(--accent);
}
.dock button svg { width: 22px; height: 22px; }
.dock-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  line-height: 0;
}
.dock-icon svg {
  display: block;
  transform-origin: center;
}
/* Optical compensation: equal perceived mass, not merely equal SVG boxes. */
.dock-icon-inspection svg { width: 22.5px; height: 22.5px; }
.dock-icon-interior svg { width: 21.5px; height: 21.5px; }
.dock-icon-exterior svg { width: 22px; height: 22px; }
.dock-icon-proposal svg { width: 21.5px; height: 21.5px; }
.dock small {
  font-size: 0.68rem;
  line-height: 1.05;
}
.fab {
  position: fixed;
  z-index: 55;
  right: max(20px, calc((100vw - var(--content-inner-max-width)) / 2 + 8px));
  bottom: calc(var(--dock-height) + var(--fab-dock-gap));
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 19px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 38%, transparent);
}
.fab svg {
  width: 28px;
  height: 28px;
}
@media (max-width: 760px) {
  .fab {
    right: 20px;
  }
}

.header-add-btn,
.header-edit-btn {
  color: #fff;
}
.header-action-spacer {
  width: 44px;
  height: 44px;
}
.fab-projects {
  bottom: calc(var(--dock-height) + var(--fab-dock-gap));
}
