:root {
  --purr-ink: #262924;
  --purr-muted: #5d6155;
  --purr-surface: #f9f7ef;
  --purr-paper: #eee9dc;
  --purr-tint: #e8e9dd;
  --purr-line: #d9d7c9;
  --purr-accent: #404d3f;
  --purr-pressed: #313d31;
  --purr-shadow: rgba(42, 40, 30, .12);
  --purr-texture: url("/static/img/purr-brushed-light.webp");
}

body.purr-shell {
  --purr-column: 740px;
  --tab-h: 66px;
  --purr-icon-ink: #514138;
  --purr-icon-cream: #f5e9cf;
  --purr-icon-peach: #e6a88e;
  --purr-icon-gold: #efce8d;
  --purr-icon-sage: #b9cdb2;
  --purr-icon-lilac: #c7b6ce;
  --purr-icon-glint: #fff5df;
  --purr-current-tab: #efe4d4;
  --purr-control-press: rgba(111, 87, 65, .12);
  --ink: var(--purr-ink);
  --ink-2: var(--purr-muted);
  --ink-3: var(--purr-muted);
  --brand: var(--purr-accent);
  --brand-ink: var(--purr-accent);
  --brand-press: var(--purr-pressed);
  --brand-tint: var(--purr-surface);
  --brand-soft: var(--purr-tint);
  --paper: var(--purr-paper);
  --paper-2: var(--purr-tint);
  --card: var(--purr-surface);
  --card-2: var(--purr-tint);
  --line: var(--purr-line);
  --line-soft: var(--purr-line);
  color: var(--purr-ink);
}

body.purr-shell,
html[data-theme] body.purr-shell {
  background: linear-gradient(115deg, rgba(250, 247, 238, .49), rgba(235, 231, 221, .16)),
    var(--purr-paper) var(--purr-texture) center top / cover no-repeat !important;
}

html body.purr-shell > .app {
  max-width: var(--purr-column);
  background: transparent !important;
}

body.purr-shell > .app > .topbar {
  position: sticky;
  top: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.purr-shell > .app > .topbar::before {
  position: absolute;
  inset: 0 0 -9px;
  z-index: -1;
  pointer-events: none;
  content: "";
  backdrop-filter: blur(9px);
  mask-image: linear-gradient(black 72%, transparent);
}

.purr-shell .purr-chrome-icon { color: var(--purr-icon-ink); }
.purr-shell .purr-icon-cream { fill: var(--purr-icon-cream); }
.purr-shell .purr-icon-peach { fill: var(--purr-icon-peach); }
.purr-shell .purr-icon-gold { fill: var(--purr-icon-gold); }
.purr-shell .purr-icon-sage { fill: var(--purr-icon-sage); }
.purr-shell .purr-icon-lilac { fill: var(--purr-icon-lilac); }
.purr-shell .purr-icon-highlight { stroke: var(--purr-icon-glint); }

body.purr-shell .c5-bar > .c5-rbtn {
  border: 0;
  border-radius: 14px;
  background: transparent;
}
body.purr-shell .c5-bar > .c5-rbtn:active { background: var(--purr-control-press); }
.purr-shell .c5-bar .purr-chrome-icon { width: 27px; height: 27px; }
.purr-shell .c5-bar .c5-fav.on .purr-icon-cream { fill: var(--purr-icon-gold); }

.purr-shell > .app > .topbar .pet-chip { display: none; }
.purr-shell > .app > .topbar .top-right { gap: 3px; }

body.purr-shell > .app > .topbar :is(.menu-btn, .bell, .top-plus) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  color: var(--purr-icon-ink);
  touch-action: manipulation;
}

body.purr-shell > .app > .topbar .top-plus {
  padding: 0 8px 0 6px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

body.purr-shell > .app > .topbar :is(.menu-btn, .bell, .top-plus) svg {
  width: 28px;
  height: 28px;
  flex: none;
  filter: drop-shadow(0 1px 1px rgba(84, 63, 46, .15));
}

body.purr-shell > .app > .topbar .top-plus svg { width: 24px; height: 24px; }
body.purr-shell > .app > .topbar :is(.menu-btn, .bell, .top-plus):active { background: var(--purr-control-press); }

html body.purr-shell > .app > .tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 34;
  width: 100%;
  max-width: var(--purr-column);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 7px max(12px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  transform: none;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--purr-line);
  border-radius: 0;
  background: color-mix(in srgb, var(--purr-surface) 96%, transparent) !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 -9px 30px -22px var(--purr-shadow);
}

html body.purr-shell > .app > .tabbar a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  padding: 3px 0;
  border-radius: 14px;
  color: var(--purr-muted);
  line-height: 1.15;
  font-size: 11px;
  font-weight: 550;
}

html body.purr-shell > .app > .tabbar a.on {
  background: var(--purr-current-tab);
  color: var(--purr-icon-ink);
  font-weight: 740;
}

html body.purr-shell > .app > .tabbar a .tb-ic {
  display: grid;
  place-items: center;
  width: 28px;
  height: 27px;
  border-radius: 0;
  background: transparent !important;
}

html body.purr-shell > .app > .tabbar a .purr-chrome-icon,
html[data-theme] body.purr-shell > .app > .tabbar a.on .purr-chrome-icon {
  box-sizing: border-box;
  width: 27px;
  height: 27px;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 1px 1px rgba(84, 63, 46, .14));
}

.purr-shell > .app > :is(.topbar, .tabbar) :is(a, button):focus-visible {
  outline: 2px solid var(--purr-accent);
  outline-offset: 2px;
}

body.purr-shell > .app > .main {
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px);
}

html body.purr-shell.purr-page-home > .app > .main {
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px) !important;
}

body.purr-shell.purr-page-chat > .app > .main {
  padding-bottom: calc(var(--tab-h) + var(--composer-h) + env(safe-area-inset-bottom) + 30px);
}

body.purr-page-chat .composer {
  bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom));
  max-width: calc(var(--purr-column) - 32px);
}

html body.purr-shell.pet-enrolling > .app > :is(.topbar, .tabbar) { display: none; }
body.purr-shell.pet-enrolling > .app > .main {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

@media (hover: hover) and (pointer: fine) {
  html body.purr-shell > .app > .tabbar a:not(.on):hover,
  body.purr-shell > .app > .topbar :is(.menu-btn, .bell, .top-plus):hover {
    background: var(--purr-control-press);
  }
}

.purr-guest-card {
  max-width: 480px;
  margin: clamp(34px, 10svh, 85px) auto;
  padding: 25px;
  border: 1px solid var(--purr-line);
  border-radius: 20px;
  background: var(--purr-surface);
  box-shadow: 0 12px 24px -21px var(--purr-shadow);
}

.purr-guest-card h1 { margin-top: 12px; }
.purr-guest-card p { margin: 6px 0 19px; color: var(--purr-muted); font-size: 14px; }
.purr-guest-card .btn-primary { display: inline-flex; min-height: 44px; align-items: center; }
.purr-guest-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: var(--purr-tint);
  color: var(--purr-accent);
}
.purr-guest-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; }
