/* DESIGN ROLL
   tree rings · utility bar plus cookie main (not LCR split) · charcoal and sprout green
   · matte with subtle grain · organic rounded · rounded friendly sans (Nunito)
   · sliding highlight blob · shrink on scroll · bottom tab bar
   Signature: pith grows a new annual ring on hover; active chip sap-fills;
   cart badge pulses a growth-ring (not a planted seed).
   Family XYLEM_COOKIE — not semaphore arms, LCR dock, leaf midrib, span bridge,
   hanging flags, field-guide mast, radial sector dial, or glass pill. */

.xr-root {
  --xr-charcoal: var(--xy-charcoal);
  --xr-charcoal-deep: var(--xy-charcoal-deep);
  --xr-sprout: var(--xy-sprout);
  --xr-lime: var(--xy-lime);
  --xr-pith: var(--xy-pith);
  --xr-bark: var(--xy-bark);
  --xr-mute: var(--xy-mute-on-dark);
  --xr-font: var(--xy-font);
  --xr-ease: var(--xy-ease);
  --xr-dock: 64px;
  position: relative;
  z-index: 80;
  font-family: var(--xr-font);
}

.xr-util {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding: 4px clamp(12px, 3vw, 28px);
  background: var(--xr-charcoal-deep);
  color: var(--xr-mute);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.xr-announce {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--xr-lime);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xr-util-link {
  color: var(--xr-pith);
  text-decoration: none;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.xr-util-link:hover { color: var(--xr-lime); }

.xr-stage {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(200, 240, 74, 0.08), transparent 46%),
    var(--xr-charcoal);
  color: var(--xr-pith);
  padding: 8px clamp(12px, 3vw, 28px) 10px;
  box-shadow: 0 10px 28px rgba(18, 24, 16, 0.18);
}
.xr-stage::before {
  content: "";
  position: absolute;
  inset: 28px 0 auto 0;
  height: 1px;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='80' height='40' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.xr-cookie {
  position: relative;
  width: min(960px, 100%);
  min-height: 108px;
  margin: 0 auto;
  border-radius: 50% / 46%;
  background:
    radial-gradient(circle at 46% 50%, #2a382c 0 22%, transparent 23%),
    repeating-radial-gradient(circle at 46% 50%, transparent 0 10px, rgba(200, 240, 74, 0.06) 10px 12px),
    #243028;
  box-shadow:
    inset 0 0 0 2px rgba(200, 240, 74, 0.16),
    0 8px 0 rgba(18, 24, 16, 0.28);
}

.xr-orbit {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(200, 240, 74, 0.16);
  pointer-events: none;
}
.xr-orbit--2 { inset: 22px; opacity: 0.7; }
.xr-orbit--3 { inset: 34px; opacity: 0.45; }

.xr-pith {
  position: absolute;
  left: 16%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: min(42%, 220px);
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  color: var(--xr-charcoal);
  background: var(--xr-lime);
  text-decoration: none;
}
.xr-pith:hover .xr-mark-ring {
  transform: scale(1.28);
  stroke-width: 2;
}
.xr-mark { display: block; color: var(--xr-charcoal); }
.xr-mark-ring {
  transform-origin: 18px 18px;
  transition: transform 0.22s var(--xr-ease);
}
.xr-pith-text { display: flex; flex-direction: column; line-height: 1.05; }
.xr-pith-text small {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
}
.xr-pith-text strong {
  font-size: clamp(0.92rem, 0.86rem + 0.25vw, 1.05rem);
  font-weight: 800;
  white-space: nowrap;
}

.xr-chips {
  position: absolute;
  inset: 8px 16% 8px 40%;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
  gap: 6px 8px;
  z-index: 2;
}
.xr-chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--xr-pith);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(234, 246, 228, 0.06);
}
.xr-chip:nth-child(1) { transform: translate(-10px, -16px); }
.xr-chip:nth-child(2) { transform: translate(8px, -4px); }
.xr-chip:nth-child(3) { transform: translate(18px, 8px); }
.xr-chip:nth-child(4) { transform: translate(-2px, 16px); }
.xr-chip:nth-child(5) { transform: translate(-18px, 4px); }
.xr-chip.is-on,
.xr-chip:hover {
  color: var(--xr-charcoal);
  background: var(--xr-lime);
}
.xr-blob {
  position: absolute;
  width: 0;
  height: 0;
  border-radius: 999px;
  background: var(--xr-sprout);
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
  transition: left 0.22s var(--xr-ease), top 0.22s var(--xr-ease), width 0.22s var(--xr-ease), height 0.22s var(--xr-ease), opacity 0.22s;
}

.xr-knot {
  position: absolute;
  right: 4%;
  bottom: 10%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 10px;
  border-radius: 999px 18px 999px 18px;
  background: var(--xr-sprout);
  color: #f3fff4;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow: 0 0 0 3px rgba(200, 240, 74, 0.25);
}
.xr-knot:hover,
.xr-knot.is-on { background: #247A34; }
.xr-knot-label { display: none; }
@media (min-width: 720px) {
  .xr-knot-label { display: inline; }
}

.xr-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--xr-lime);
  color: var(--xr-charcoal);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.xr-badge.is-pulse {
  animation: xr-ring 0.28s var(--xr-ease);
}
@keyframes xr-ring {
  0% { box-shadow: 0 0 0 0 rgba(200, 240, 74, 0.7); transform: scale(1); }
  70% { box-shadow: 0 0 0 8px rgba(200, 240, 74, 0); transform: scale(1.12); }
  100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}

.xr-rail {
  width: min(960px, 100%);
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.xr-search {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 46px;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(200, 240, 74, 0.35);
}
.xr-search-ico { color: var(--xr-sprout); padding: 0 0 0 12px; display: grid; }
.xr-search input {
  flex: 1;
  min-height: 44px;
  border: 0;
  padding: 0 10px;
  font: inherit;
  color: var(--xr-charcoal);
  background: transparent;
}
.xr-search-go {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: var(--xr-sprout);
  color: #f3fff4;
  font-weight: 800;
  cursor: pointer;
}
.xr-rows-btn,
.xr-account,
.xr-icon-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--xr-lime);
  color: var(--xr-charcoal);
  font-family: inherit;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}
.xr-account.is-on { outline: 2px solid var(--xr-lime); outline-offset: 2px; }

.xr-scrim {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 16, 0.46);
  z-index: 90;
}
.xr-rows,
.xr-sheet {
  position: fixed;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: end center;
}
.xr-rows[hidden],
.xr-sheet[hidden],
.xr-scrim[hidden] { display: none; }
.xr-rows-panel,
.xr-sheet-panel {
  width: min(560px, 100%);
  max-height: min(78vh, 640px);
  overflow: auto;
  background: var(--xr-pith);
  color: var(--xr-charcoal);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px 24px;
}
@media (max-width: 960px) {
  .xr-rows-panel,
  .xr-sheet-panel {
    max-height: min(78vh, calc(100vh - 24px));
    padding-bottom: 24px;
  }
}
.xr-rows-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.xr-rows-head p {
  margin: 0;
  font-weight: 800;
}
.xr-rows ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.xr-rows a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--xr-charcoal);
  text-decoration: none;
  font-weight: 800;
}
.xr-rows a:hover { background: var(--xr-lime); }
.xr-search--sheet { margin-top: 8px; }

.xr-dock { display: none; }

.xr-root.is-shrink .xr-util { display: none; }
.xr-root.is-shrink .xr-stage { padding-top: 6px; }

.xr-root a:focus-visible,
.xr-root button:focus-visible,
.xr-root input:focus-visible {
  outline: 3px solid var(--xr-lime);
  outline-offset: 2px;
}

@media (min-width: 961px) {
  /* Grid cookie — no absolute overlap; chips wrap in the center band */
  .xr-cookie {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "pith chips knot";
    align-items: center;
    gap: 10px 14px;
    width: min(960px, 100%);
    min-height: 0;
    padding: 12px 16px 14px;
    border-radius: 999px;
  }

  .xr-orbit,
  .xr-orbit--2,
  .xr-orbit--3,
  .xr-blob { display: none; }

  .xr-pith {
    position: static;
    transform: none;
    grid-area: pith;
    max-width: none;
    flex-shrink: 0;
  }

  .xr-chips {
    position: static;
    inset: auto;
    grid-area: chips;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    gap: 6px;
    min-width: 0;
  }

  .xr-chip:nth-child(n) { transform: none; }
  .xr-chip {
    font-size: 0.78rem;
    min-height: 34px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .xr-knot {
    position: static;
    grid-area: knot;
    align-self: center;
    flex-shrink: 0;
    min-height: 40px;
    font-size: 0.76rem;
  }

  .xr-root.is-shrink .xr-cookie {
    padding: 8px 12px;
    gap: 8px 10px;
  }
  .xr-root.is-shrink .xr-chip {
    min-height: 30px;
    font-size: 0.72rem;
    padding: 0 8px;
  }
  .xr-root.is-shrink .xr-pith {
    min-height: 38px;
    padding: 4px 8px 4px 4px;
  }
  .xr-root.is-shrink .xr-pith .xr-mark {
    width: 28px;
    height: 28px;
  }
  .xr-root.is-shrink .xr-knot {
    min-height: 36px;
    padding: 0 10px;
  }
}

@media (max-width: 960px) {
  .xr-stage { padding-bottom: 8px; }

  /* Compact pith tools row — brand stays visible; ring chips move to dock/sheets */
  .xr-cookie {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin: 0 0 8px;
    padding: 6px 8px 6px 6px;
    border-radius: 999px;
    background:
      radial-gradient(circle at 12% 50%, rgba(200, 240, 74, 0.12), transparent 38%),
      linear-gradient(135deg, #243028, #1a221c);
    box-shadow:
      inset 0 0 0 2px rgba(200, 240, 74, 0.18),
      0 4px 0 rgba(18, 24, 16, 0.22);
  }
  .xr-orbit,
  .xr-orbit--2,
  .xr-orbit--3,
  .xr-chips,
  .xr-blob { display: none !important; }

  .xr-pith {
    position: static;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
  .xr-pith .xr-mark { width: 32px; height: 32px; }

  .xr-knot {
    position: static;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 10px;
    box-shadow: none;
  }
  .xr-knot-label { display: none; }

  .xr-rail {
    width: 100%;
    gap: 6px;
  }
  .xr-search { display: none; }
  .xr-rows-btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    padding-inline: 10px;
    font-size: 0.78rem;
  }
  .xr-account { flex: 0 0 auto; }

  .xr-dock {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: relative;
    z-index: 1;
    min-height: var(--xr-dock);
    margin-top: 6px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--xr-charcoal);
    border-radius: var(--xy-radius-sm);
    box-shadow: 0 4px 16px rgba(18, 24, 16, 0.16);
  }
  .xr-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    color: var(--xr-mute);
    text-decoration: none;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
  }
  .xr-tab.is-on { color: var(--xr-lime); }
  .xr-badge--dock {
    position: absolute;
    top: 4px;
    right: 18%;
  }

  .xr-root.is-shrink .xr-cookie { min-height: 46px; margin-bottom: 6px; }
}

@media (max-width: 420px) {
  .xr-announce { font-size: 0.66rem; }
  .xr-rows-btn {
    font-size: 0;
    gap: 0;
    padding-inline: 0;
    min-width: 44px;
  }
  .xr-rows-btn svg { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .xr-chip,
  .xr-blob,
  .xr-mark-ring,
  .xr-badge { transition: none; animation: none; }
}
