/* AppTopBar geometry and controls reused from features/shell/app-shell.module.css. */
.grandma-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: none;
  box-sizing: border-box;
  width: 100%;
  padding: env(safe-area-inset-top, 0px) 4px 0;
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  color: var(--text);
}
.grandma-bar-inner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(44px, auto);
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  max-width: 42rem;
  min-height: 52px;
  margin: 0 auto;
  padding: 4px 8px 4px 4px;
}
.grandma-bar-title {
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grandma-bar-trailing {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 44px;
  height: 44px;
}
.grandma-header-control {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.grandma-header-control:hover {
  background: var(--fill);
}
.grandma-header-control:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.grandma-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  box-sizing: border-box;
  width: min(320px, 86vw);
  max-width: none;
  height: 100svh;
  max-height: 100svh;
  margin: 0;
  padding: calc(4px + env(safe-area-inset-top, 0px)) 12px 16px;
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  color: var(--text);
  box-shadow:
    12px 0 40px rgb(0 0 0 / 0.08),
    -48px 0 0 0 var(--surface);
}
.grandma-drawer::backdrop {
  background: rgb(21 21 21 / 0.28);
}
.grandma-drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
}
.grandma-drawer-heading h2 {
  margin: 0 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}
.grandma-navigation {
  display: block;
  margin: 4px 0 0;
}
.grandma-navigation ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.grandma-navigation a,
.grandma-navigation button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
}
.grandma-navigation a:hover,
.grandma-navigation button:hover {
  background: var(--fill);
}
.grandma-navigation a[aria-current="page"] {
  background: var(--surface-inverse);
  color: var(--canvas);
}
.grandma-navigation :is(a, button):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
body:has(.grandma-drawer[open]) {
  overflow: hidden;
}
/* Same slot, clip, figure, gaze and waddle as components/hrumi-bar-mascot.module.css. */
.header-hrumi-slot {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
}
.header-hrumi-clip {
  position: absolute;
  inset: 0 0 -4px;
  clip-path: inset(-80px -24px 0 -400px);
}
.header-hrumi-walker {
  display: block;
  width: 44px;
  height: 44px;
  transform: translateX(var(--walk-x, 0px));
  transition: transform var(--walk-ms, 1200ms) cubic-bezier(0.42, 0, 0.58, 1);
}
.header-hrumi-walker[data-walking="out"] {
  --hrumi-lx: -0.9;
  --hrumi-ly: 0.15;
}
.header-hrumi-walker[data-walking="back"] {
  --hrumi-lx: 0.9;
  --hrumi-ly: 0.15;
}
.header-hrumi-control {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translateY(0);
}
.header-hrumi-control:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}
.header-hrumi-figure {
  display: block;
  width: 40px;
  height: 40px;
  transform-origin: 50% 90%;
  transition: transform 140ms var(--ease);
}
.header-hrumi-control:active .header-hrumi-figure {
  transform: scale(0.9, 0.86);
}
.header-hrumi-vector {
  display: block;
  width: 100%;
  height: 100%;
}
.header-hrumi-walker[data-walking="out"] .header-hrumi-figure,
.header-hrumi-walker[data-walking="back"] .header-hrumi-figure {
  animation: header-hrumi-waddle 600ms ease-in-out infinite alternate;
}
@keyframes header-hrumi-waddle {
  from {
    transform: translateY(0) rotate(-5deg);
  }
  to {
    transform: translateY(-2px) rotate(5deg);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .grandma-drawer[open] {
    animation: header-drawer-in 380ms var(--header-spring);
  }
  .grandma-drawer[open]::backdrop {
    animation: header-backdrop-in 200ms ease-out;
  }
}
@keyframes header-drawer-in {
  from {
    transform: translateX(-100%);
  }
}
@keyframes header-backdrop-in {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .header-hrumi-walker,
  .header-hrumi-control,
  .header-hrumi-figure {
    transition: none;
  }
  .header-hrumi-walker[data-walking] .header-hrumi-figure {
    animation: none;
  }
}
.hrumi-svg-root {
  display: block;
  overflow: visible;
}
.hrumi-svg-figure {
  transform-box: fill-box;
  transform-origin: 50% 85%;
}
.hrumi-svg-root[data-phase="idle"] .hrumi-svg-figure {
  animation: header-hrumi-breathe 5s ease-in-out infinite;
}
.hrumi-svg-root[data-phase="thinking"] .hrumi-svg-figure {
  animation: header-hrumi-sway 3.4s ease-in-out infinite;
}
/* Angry: one short header-hrumi-huff as the face appears, then the usual breathing. No fill mode, so leaving the mood never snaps. */
.hrumi-svg-root[data-phase="idle"][data-mood="angry"] .hrumi-svg-figure {
  animation:
    header-hrumi-huff 0.46s ease-in-out,
    header-hrumi-breathe 5s ease-in-out 0.46s infinite;
}
.hrumi-svg-body {
  transform-box: fill-box;
  transform-origin: 50% 96%;
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.hrumi-svg-white {
  fill: #fffef9;
}
/* Pupils shift inside the clipped eye whites; the range is in the 440-unit drawing space. */
.hrumi-svg-pupils {
  transform: translate(calc(var(--hrumi-lx, 0) * 17px), calc(var(--hrumi-ly, 0) * 12px));
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hrumi-svg-dark {
  fill: #14140f;
}
.hrumi-svg-stroke {
  fill: none;
  stroke: #14140f;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hrumi-svg-tongue {
  fill: #ff5b5b;
}
.hrumi-svg-lid {
  transform: translateY(0);
  transition: transform 0.13s ease-out;
}
.hrumi-svg-root[data-blink="true"] .hrumi-svg-lid {
  transform: translateY(var(--lid, 80px));
}
.hrumi-svg-mood {
  opacity: 0;
  transition: opacity 0.16s linear;
}
.hrumi-svg-mood[data-active="true"] {
  opacity: 1;
}
@keyframes header-hrumi-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.005);
  }
}
@keyframes header-hrumi-sway {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  35% {
    transform: translateY(1px) rotate(-1.2deg);
  }
  70% {
    transform: translateY(-1px) rotate(0.9deg);
  }
}
@keyframes header-hrumi-huff {
  0%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  15% {
    transform: translate(-8px, 2px) rotate(-1.6deg);
  }
  32% {
    transform: translate(8px, 2px) rotate(1.6deg);
  }
  50% {
    transform: translate(-6px, 1px) rotate(-1deg);
  }
  68% {
    transform: translate(5px, 0) rotate(0.8deg);
  }
  84% {
    transform: translate(-2px, 0) rotate(-0.3deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hrumi-svg-root[data-phase="idle"] .figure,
  .hrumi-svg-root[data-phase="idle"][data-mood="angry"] .figure,
  .hrumi-svg-root[data-phase="thinking"] .hrumi-svg-figure {
    animation: none;
  }
  .body,
  .pupils,
  .lid,
  .hrumi-svg-mood {
    transition: none;
  }
}

.grandma-drawer {
  --header-spring: linear(
    0,
    0.14 4%,
    0.298 8%,
    0.452 12%,
    0.591 16%,
    0.707 20%,
    0.821 25%,
    0.902 30%,
    0.955 35%,
    0.988 40%,
    1.008 46%,
    1.016 52%,
    1.016 58%,
    1.013 65%,
    1.009 72%,
    1.005 80%,
    1.002 90%,
    1
  );
}
