/*
 * Shelf shop – layout of this app only. Colours, fonts, radii and shadows come from /kit.
 */

/* Signed-in state (set before paint by /js/boot.js). */
[data-auth="in"] [data-when="out"],
[data-auth="out"] [data-when="in"],
:root:not([data-auth]) [data-when="in"] {
  display: none !important;
}

/* No sticky top bar in the shop: sticky rails and summaries hold to the window's top edge. */
:root {
  --header-h: 0rem;
}

/* ── Storefront header: the shop's own paper, under the QA Steps strip ── */
.store-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.store-head__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 4.75rem;
  padding: var(--space-2) var(--gutter);
}
.wordmark {
  display: grid;
  flex-shrink: 0;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover {
  color: var(--ink);
}
.wordmark__name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.wordmark__tag {
  margin-top: 0.2rem;
  color: var(--ink-3);
  font-size: var(--text-xs);
}
.store-head .nav__link {
  min-height: 2.75rem;
  padding: 0 var(--space-2);
  color: var(--ink-2);
  font-size: var(--text-md);
  border-top: 0;
  border-bottom: 2px solid transparent;
}
.store-head .nav__link:hover {
  color: var(--ink);
}
.store-head .nav__link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.store-nav {
  height: auto;
  gap: var(--space-2);
}
@media (max-width: 1279px) {
  .store-nav__cat {
    display: none;
  }
}
.store-search {
  position: relative;
  flex: 1 1 18rem;
  max-width: 30rem;
  margin-left: auto;
}
.store-search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.store-search input {
  width: 100%;
  height: var(--control-h);
  padding: 0 1rem 0 2.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--raised);
  color: var(--ink);
  font-size: var(--text-base);
}
.store-search input::placeholder {
  color: var(--ink-3);
}
.store-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.store-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.store-search + .store-head__actions {
  margin-left: 0;
}
.currency-select {
  height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--edge);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.currency-select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.currency-select option {
  background: var(--raised);
  color: var(--ink);
}
.cart-pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.cart-pill:hover,
.cart-pill[aria-current="page"] {
  background: var(--ink-2);
  color: var(--surface);
}
.cart-pill__n {
  font-variant-numeric: tabular-nums;
}
.cart-pill__n:not(:empty)::before {
  content: " · ";
  white-space: pre;
}
@media (max-width: 959px) {
  .store-head__inner {
    min-height: 3.75rem;
  }
  .wordmark__name {
    font-size: var(--text-2xl);
  }
}
.tabbar .count {
  margin-left: 0.15rem;
}
.tabbar .nav__link {
  position: relative;
}
.tabbar .count {
  position: absolute;
  top: 0.3rem;
  left: calc(50% + 0.45rem);
}

/* Page head: kit/components.css (.page-head). */

/* ── Product tiles (pictogram on a platform tint) ─ */
.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-xl);
  background: var(--tint-amber);
  color: var(--tint-amber-ink);
  overflow: hidden;
}
.tile svg {
  width: 42%;
  height: auto;
  aspect-ratio: 1;
}
/* A drawn product picture is cut out of its paper (scripts/content/product-cutout.mjs in the platform)
   and sits whole on the tile's paper, with a margin all round. */
.tile.tile--img[data-tint] {
  position: relative;
  background: var(--product-paper);
}
/* The tile's height comes from its aspect ratio, so the picture is laid over it rather than sized by it. */
.tile--img img {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: contain;
}
.tile[data-tint="forge"] { background: var(--tint-forge); color: var(--tint-forge-ink); }
.tile[data-tint="grove"] { background: var(--tint-grove); color: var(--tint-grove-ink); }
.tile[data-tint="tide"] { background: var(--tint-tide); color: var(--tint-tide-ink); }
.tile[data-tint="dusk"] { background: var(--tint-dusk); color: var(--tint-dusk-ink); }
.tile[data-tint="amber"] { background: var(--tint-amber); color: var(--tint-amber-ink); }
.tile[data-tint="rose"] { background: var(--tint-rose); color: var(--tint-rose-ink); }
.tile--sm {
  width: 3.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}
.tile--sm svg {
  width: 62%;
}
.tile--lg {
  aspect-ratio: 1 / 1;
  max-height: min(44rem, calc(100dvh - 9rem));
  border-radius: var(--radius-2xl);
}
.tile--lg svg {
  width: 38%;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.rating svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--rating);
}

/* ── Catalog ───────────────────────────────────── */
.filters {
  display: grid;
  gap: var(--space-5);
}
.filters .card__body {
  display: grid;
  gap: var(--space-5);
}
.filter-group {
  display: grid;
  gap: var(--space-2);
}
.price-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  min-height: var(--control-h);
}
.toolbar .select {
  width: auto;
  min-width: 12rem;
}
.result-count {
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.mobile-filters {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.catalog-head__n {
  color: var(--ink-2);
}
.catalog-head .cat-chips {
  align-self: center;
}
@media (max-width: 639px) {
  .catalog-head {
    margin-bottom: var(--space-4);
  }
}
/* Six categories (All + five) → a 3 × 2 grid on phones: every chip visible, no scrolling. */
.cat-chips {
  --chips-cols: 3;
}
.mobile-filters details {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--raised);
}
.mobile-filters summary {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}
.mobile-filters details > div {
  display: grid;
  gap: var(--space-4);
  padding: 0 var(--space-4) var(--space-4);
}

.product-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  transition: box-shadow var(--dur) var(--ease);
}
.product-card:hover {
  box-shadow: var(--shadow-card), 0 6px 18px color-mix(in srgb, var(--top) 10%, var(--surface));
}
.product-card .tile {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-xl);
}
.product-card .tile svg {
  width: 34%;
}
.product-card__flag {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
}
.product-card__body {
  display: grid;
  grid-template-rows: auto 2.6em auto 1fr;
  gap: var(--space-1);
  padding: 0 var(--space-1) var(--space-1);
  min-width: 0;
}
.product-card__name {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.3;
}
.product-card__name a {
  color: var(--ink);
  text-decoration: none;
}
.product-card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.product-card__buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  align-self: end;
  padding-top: var(--space-2);
}
.product-card__buy .btn {
  position: relative;
  z-index: 1;
}
.btn--pill {
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.btn--pill:focus-visible {
  box-shadow: inset 0 0 0 1.5px var(--ink), var(--focus-ring);
}
.price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-md);
}
.price--lg {
  font-size: var(--text-2xl);
}
.skeleton-card {
  height: 22rem;
  border-radius: var(--radius-card);
}

/* ── Product page ─────────────────────────────── */
.product-hero {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 960px) {
  .product-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: var(--space-10);
    align-items: start;
  }
  .product-hero > .tile {
    position: sticky;
    top: calc(var(--header-h) + var(--space-4));
  }
}
.buy-box {
  display: grid;
  gap: var(--space-4);
}
@media (min-width: 960px) {
  .buy-box {
    padding-top: var(--space-2);
  }
}
.buy-box__kicker {
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
}
.buy-box__title {
  font-size: var(--text-2xl);
  font-weight: 400;
}
@media (min-width: 960px) {
  .buy-box__title {
    font-size: 2.75rem;
  }
}
.buy-box__lead {
  font-size: var(--text-md);
  color: var(--ink-2);
}
.buy-box__qty {
  display: grid;
  gap: var(--space-2);
}
.buy-box__qty .label {
  color: var(--ink);
  font-size: var(--text-sm);
  letter-spacing: 0;
  text-transform: none;
}
.btn--buy {
  --btn-h: 3.25rem;
  padding: 0 var(--space-8);
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
}
.buy-box__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.specs {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  font-size: var(--text-sm);
}
.specs dt {
  color: var(--ink-3);
}
.specs dd {
  margin: 0;
}
.stepper {
  display: inline-grid;
  grid-template-columns: var(--control-h) 3rem var(--control-h);
  align-items: stretch;
  height: var(--control-h);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--raised);
  overflow: hidden;
}
.stepper--sm {
  grid-template-columns: var(--control-h-sm) 2.5rem var(--control-h-sm);
  height: var(--control-h-sm);
}
.stepper button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stepper button:hover {
  background: var(--sunken);
  color: var(--ink);
}
.stepper button svg {
  width: 1rem;
  height: 1rem;
}
.stepper input {
  width: 100%;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.perks {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.perks li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.perks svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}
.section-title {
  margin: var(--space-10) 0 var(--space-4);
}

/* ── Cart, checkout, order ────────────────────── */
.lines {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}
.line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3) var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: var(--raised);
}
.line .tile--sm {
  width: 5.25rem;
  border-radius: var(--radius-lg);
}
.line__name {
  font-size: var(--text-md);
}
.line__total {
  font-family: var(--font-mono);
}
.line__name {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.line__name:hover {
  color: var(--accent);
}
.line__meta {
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.line__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  grid-column: 2 / -1;
  justify-content: space-between;
}
.line__total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 6.5rem;
}
@media (min-width: 720px) {
  .line {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  }
  .line__controls {
    grid-column: auto;
    display: contents;
  }
}
.summary {
  display: grid;
  gap: var(--space-2);
  margin-inline: 0;
  margin-bottom: 0;
  font-size: var(--text-sm);
}
.summary div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}
.summary dt {
  color: var(--ink-2);
}
.summary dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.summary .total {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-md);
  font-weight: 700;
}
.summary .total dt {
  color: var(--ink);
}
.meter {
  height: 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--sunken);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: inherit;
}
.mini-lines {
  display: grid;
  gap: var(--space-3);
  margin-inline: 0;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}
.mini-lines li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  font-size: var(--text-sm);
}
.mini-lines .tile--sm {
  width: 2.75rem;
}
.form-grid {
  display: grid;
  gap: var(--space-2) var(--space-4);
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.form-grid > * {
  grid-column: span 6;
}
@media (min-width: 560px) {
  .form-grid .span-3 { grid-column: span 3; }
  .form-grid .span-2 { grid-column: span 2; }
  .form-grid .span-4 { grid-column: span 4; }
}
.test-cards {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.test-cards td {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.test-cards tr:last-child td {
  border-bottom: 0;
}
.test-cards .mono {
  white-space: nowrap;
}
.test-cards td:last-child {
  text-align: right;
}
.address {
  font-style: normal;
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ── Orders: every order its own row card ─────── */
.orders-list .table {
  border-collapse: separate;
  border-spacing: 0 var(--space-2);
  font-size: var(--text-base);
}
.orders-list .table th {
  border-bottom: 0;
  padding: 0 var(--space-5);
  color: var(--ink-2);
  font-size: var(--text-sm);
  letter-spacing: 0;
  text-transform: none;
}
.orders-list .table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 0;
  background: var(--raised);
  border-block: 1px solid var(--line);
}
.orders-list .table td:first-child {
  border-left: 1px solid var(--line);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.orders-list .table td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}
.orders-list .table tbody tr:hover td {
  background: var(--raised);
  border-color: var(--edge);
}
.orders-list td.num,
.orders-list .order-link {
  font-family: var(--font-mono);
}
@container (max-width: 40rem) {
  .orders-list .table--stack {
    border-spacing: 0;
  }
  .orders-list .table--stack tr {
    margin-bottom: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--raised);
  }
  .orders-list .table--stack td,
  .orders-list .table--stack td:first-child,
  .orders-list .table--stack td:last-child {
    padding: var(--space-1) 0;
    border: 0;
    border-radius: 0;
    background: none;
  }
}
.orders-table .order-link {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chips--status {
  --chips-cols: 2;
}
@media (min-width: 640px) {
  .chips--status {
    --chips-cols: 4;
  }
}

/* ── Account ──────────────────────────────────── */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.fact {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--sunken);
}
.fact__n {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

/* ── Sign-in pages ────────────────────────────── */
.auth-card .card__body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
}
.auth-card h1 {
  font-size: var(--text-2xl);
}
.auth-side {
  display: grid;
  gap: var(--space-3);
}
.auth-wrap {
  display: grid;
  gap: var(--space-8);
  align-items: start;
  padding-top: clamp(var(--space-4), 6vh, var(--space-12));
}
@media (min-width: 960px) {
  .auth-wrap {
    grid-template-columns: minmax(0, 26rem) minmax(0, 24rem);
    justify-content: center;
    gap: var(--space-12);
  }
}

/* ── About ────────────────────────────────────── */
.about-grid {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
.endpoint-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.not-found {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  padding-block: var(--space-12);
}
.not-found__code {
  font-family: var(--font-display);
  font-size: 4.5rem;
  line-height: 1;
  color: var(--accent);
}

/* ── Checkout: small phones keep expiry and CVC on one row ── */
@media (max-width: 375px) {
  .checkout-forms .form-grid {
    grid-template-columns: repeat(6, 4.5rem);
  }
  .checkout-forms .form-grid .span-2 {
    grid-column: span 2;
  }
}
/* ── Checkout: delivery and payment side by side on wide screens (1200 px and up) ── */
.checkout-forms {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  /* never wider than the column: the test-card numbers used to widen the page on 360 px phones */
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
@media (min-width: 1200px) {
  .checkout-forms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .checkout-forms > .alert {
    grid-column: 1 / -1;
  }
}

/* ── Crumbs above a full-width block need air ── */
.page > .crumbs {
  margin-bottom: var(--space-4);
}

/* ── Tablets: one line per product name, so the cards keep one height ── */
@media (min-width: 720px) and (max-width: 959px) {
  .product-card__name {
    display: block;
    font-size: var(--text-lg);
    white-space: nowrap;
    overflow: visible;
  }
  .product-card__body {
    min-width: max-content;
  }
}
/* ── Phones (559 px and narrower) ── */
@media (max-width: 559px) {
  .product-card__buy {
    flex-direction: column;
    align-items: stretch;
  }
  .product-card {
    padding: var(--space-2);
  }
}

/* ── Coupon (cart summary) ─────────────────────── */
.summary__coupon dd {
  color: var(--ok);
}
.summary__coupon .btn--link {
  margin-left: var(--space-2);
}
.coupon {
  display: grid;
  gap: var(--space-1);
}
.coupon__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}
.coupon .input {
  font-family: var(--font-mono);
  font-size: var(--text-md);
}
.coupon__ok {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--ok);
  font-size: var(--text-sm);
  font-weight: 600;
}
.coupon__ok svg {
  width: 1rem;
  height: 1rem;
}
.summary dd {
  font-family: var(--font-mono);
}
[data-summary] .card__title,
.aside .card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}
[data-summary] .btn--primary {
  --btn-h: 3.25rem;
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
}

/* Cart lines on phones: a smaller picture, controls on their own row, the stepper never squeezed. */
@media (max-width: 719px) {
  .line .tile--sm {
    width: 3.75rem;
  }
  .line__controls {
    flex-wrap: wrap;
  }
  .line__controls .stepper {
    flex-shrink: 0;
  }
}

/* With the missions panel open the header is narrower: categories go first, nothing wraps. */
.store-signin {
  white-space: nowrap;
}
@media (max-width: 1679px) {
  .shell:has(> .missions:not([hidden])) .store-nav__cat {
    display: none;
  }
}

/* Product picture on wide screens: the whole column wide, its height capped by the window. */
@media (min-width: 960px) {
  .product-hero > .tile--lg {
    aspect-ratio: auto;
    height: min(44rem, calc(100dvh - 9rem));
  }
}

/* ── Ask Shelf (SHELF_ASK on): a launcher at the bottom right and a chat panel above it ── */
.ask {
  position: fixed;
  right: var(--gutter);
  bottom: var(--space-5);
  z-index: var(--z-header);
  display: grid;
  justify-items: end;
}
.ask__open {
  box-shadow: var(--shadow-pop);
}
.ask__panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: min(26rem, calc(100vw - 2 * var(--gutter)));
  height: min(38rem, calc(100dvh - 2 * var(--space-5)));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.ask__panel[hidden] {
  display: none;
}
.ask__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.ask__head .row {
  gap: var(--space-1);
}
.ask__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
}
.ask__disclosure {
  margin: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--sunken);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.ask__log {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-4);
  overflow: auto;
  list-style: none;
}
.ask__msg {
  max-width: 88%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
}
.ask__msg--you {
  justify-self: end;
  background: color-mix(in srgb, var(--accent) 14%, var(--raised));
}
.ask__msg--bot {
  justify-self: start;
  border: 1px solid var(--line);
  background: var(--surface);
}
.ask__msg--sys {
  justify-self: center;
  max-width: 100%;
  background: var(--warn-soft);
  font-size: var(--text-sm);
}
.ask__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ask__meta {
  margin: var(--space-1) 0 0;
  color: var(--ink-3);
  font-size: var(--text-xs);
}
.ask__empty {
  color: var(--ink-3);
}
.ask__form {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-top: 1px solid var(--line);
}
.ask__form .input {
  flex: 1 1 auto;
  min-width: 0;
}
.ask__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
}
.ask__help {
  font-size: var(--text-sm);
}
/* below 960 px the tab bar (3.25rem) sits at the bottom: the launcher and the panel stay above it */
@media (max-width: 959px) {
  .ask {
    bottom: calc(3.25rem + env(safe-area-inset-bottom) + var(--space-3));
  }
  .ask__panel {
    height: min(38rem, calc(100dvh - 3.25rem - env(safe-area-inset-bottom) - 2 * var(--space-3)));
  }
}
@media (max-width: 559px) {
  .ask {
    right: var(--space-3);
  }
  .ask__panel {
    width: calc(100vw - 2 * var(--space-3));
  }
  .ask__head .btn--sm {
    padding-inline: var(--space-2);
  }
}

/* Help pages: the list of pages in the rail, the page as prose */
.help-nav {
  display: grid;
  gap: var(--space-1);
}
.help-nav__link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--ink-2);
  text-decoration: none;
}
.help-nav__link:hover {
  background: var(--sunken);
  color: var(--ink);
}
.help-nav__link[aria-current="page"] {
  background: var(--sunken);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.help-page section + section {
  margin-top: var(--space-6);
}
.help-list {
  display: grid;
  gap: var(--space-3);
  padding-left: var(--space-5);
}
