/* BowlMath site chrome + shared components. Mobile first. Needs tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font: 400 var(--fs-base)/1.5 var(--font); }
body.menu-locked { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-md); }

/* logo mark (same SVG + rules as the calculator) */
.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: #e95624;
  box-shadow: 0 10px 22px rgba(233, 86, 36, 0.3);
}

.mark svg {
  width: 42px;
  height: 42px;
  overflow: visible;
}

.logo-badge-bg {
  fill: #e95624;
}

.logo-badge-ring {
  fill: #fff8ef;
}

.logo-badge-core {
  fill: #151515;
}

.logo-ear-left,
.logo-cap,
.logo-left-patch {
  fill: #111;
}

.logo-ear-right,
.logo-face {
  fill: #fff8ef;
}

.logo-muzzle {
  fill: #ffe6d8;
}

.logo-ear-left,
.logo-ear-right {
  stroke: #111;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.logo-face,
.logo-cap,
.logo-left-patch {
  stroke: #111;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.logo-eye {
  fill: #171b1b;
}

.logo-eye-shine {
  fill: #fff;
}

.logo-nose {
  fill: #f07f79;
}

.logo-mouth {
  stroke: #1f2525;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-width: 1.6;
}

.logo-whiskers {
  fill: none;
  stroke: #fff8ef;
  stroke-linecap: round;
  stroke-width: 1.25;
  opacity: 0.94;
}


.brand .mark { width: 32px; height: 32px; flex: none; box-shadow: none; }
.brand .mark svg { width: 32px; height: 32px; }

/* header: one 56px row on mobile */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; gap: var(--s2); height: var(--header-h); max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; margin-right: auto; color: var(--ink); font-size: var(--fs-md); font-weight: 900; text-decoration: none; }
.site-nav { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); cursor: pointer; }
.header-cta { min-height: 44px; padding: 0 var(--s4); font-size: .9375rem; }
.cta-long { display: none; }
.header-cta.is-hidden { visibility: hidden; }
@media (min-width: 900px) {
  .site-nav { display: flex; gap: var(--s1); margin-right: var(--s3); }
  .site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-pill); color: var(--primary); font-weight: 800; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
  .site-nav a:hover { background: var(--primary-tint); }
  .site-nav a[aria-current="page"] { background: var(--primary-tint); }
  .brand { margin-right: auto; }
  .menu-open { display: none; }
  .cta-short { display: none; } .cta-long { display: inline; }
}

/* menu sheet */
.sheet { position: fixed; inset: 0; z-index: 100; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gutter) var(--s6); background: var(--surface-2); }
.sheet[hidden] { display: none; }
.sheet:not([hidden]) { animation: sheet-in .16s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sheet:not([hidden]) { animation: none; } }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: var(--header-h); margin: 0 calc(-1 * var(--gutter)); padding: 0 max(var(--gutter), calc((100vw - 560px) / 2)); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sheet-title { margin: 0; color: var(--ink); font-size: var(--fs-md); font-weight: 900; }
.sheet-nav { display: grid; gap: var(--s2); max-width: 560px; margin: 0 auto; padding-top: var(--s2); }
.sheet-label { margin: var(--s4) 0 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sheet-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.sheet-list[hidden] { display: none; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; padding: 0 var(--s4); border-bottom: 1px solid var(--line); color: var(--ink); font-size: var(--fs-md); font-weight: 800; text-decoration: none; }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row[aria-current="page"] { background: var(--primary-tint); }
.sheet-row span { color: var(--muted); font-size: 1.25rem; }
.sheet-row-sm { min-height: 48px; font-size: var(--fs-base); font-weight: 700; }
.sheet-nav .btn-block { margin-top: var(--s1); }
.sheet-sec { display: grid; }
.sheet-group { display: flex; align-items: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.sheet-group-t { flex: 1; }
.sheet-count { min-width: 24px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--primary-tint); color: var(--primary); font-size: var(--fs-xs); font-weight: 800; text-align: center; }
.sheet-group .chev { color: var(--muted); transition: transform .15s; }
.sheet-group[aria-expanded="true"] { border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; }
.sheet-group[aria-expanded="true"] .chev { transform: rotate(180deg); }
.sheet-sub { border-top-color: var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.sheet-legal { display: flex; flex-wrap: wrap; gap: 0 var(--s4); margin: var(--s4) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); }
.sheet-legal a, .footer-legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5); border: 1px solid transparent; border-radius: var(--r-pill); font: inherit; font-weight: 800; text-decoration: none; text-align: center; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--line); }
.btn-block { display: flex; width: 100%; min-height: 52px; font-size: var(--fs-md); }

/* footer: full-width rule, content in the same 1200px container as the header */
.site-footer { margin-top: var(--s7); padding: var(--s6) max(var(--gutter), calc((100% - var(--max)) / 2)) var(--s5); border-top: 1px solid var(--line); }
.f-brand { display: none; }
.f-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "tools tools" "brands guides"; gap: var(--s5) var(--s4); }
.f-sec:nth-child(1) { grid-area: tools; } .f-sec:nth-child(2) { grid-area: brands; } .f-sec:nth-child(3) { grid-area: guides; }
.footer-cols ul { display: grid; margin: 0; padding: 0; list-style: none; }
.footer-label { margin: 0 0 var(--s1); color: var(--muted); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.f-sec a { display: flex; align-items: center; min-height: 44px; color: var(--ink); font-size: 16px; font-weight: 400; line-height: 1.25; text-decoration: none; }
.f-sec a:hover { color: var(--primary); text-decoration: underline; }
.f-sec a[aria-current="page"] { font-weight: 700; }
.f-more { display: none; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.footer-legal span { margin-right: auto; white-space: nowrap; }
@media (max-width: 767px) { .footer-legal span { order: 1; flex-basis: 100%; padding: var(--s1) 0 0; } }
@media (min-width: 768px) { .f-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "tools brands guides"; gap: var(--s6); } .f-more { display: list-item; } .f-sec a { min-height: 36px; } }
@media (min-width: 1024px) {
  .footer-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: var(--s6); }
  .f-brand { display: grid; align-content: start; gap: var(--s3); }
  .f-brand p { margin: 0; max-width: 28ch; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
}

/* breadcrumbs */
.crumbs ol { display: flex; align-items: center; gap: var(--s1); margin: 0 0 var(--s2); padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--muted); overflow: hidden; }
.crumbs li { min-width: 0; white-space: nowrap; }
.crumbs li:not(:last-child) { flex-shrink: 0; }
.crumbs li:not(:first-child):not(:last-child) { overflow: hidden; text-overflow: ellipsis; }
.crumbs li:last-child { overflow: hidden; text-overflow: ellipsis; }
.crumbs li + li::before { content: "/"; margin-right: var(--s1); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); font-weight: 700; text-decoration: none; }

/* shared content components */
.card { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.rows { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.rows > a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 700; text-decoration: none; }
.rows > a:last-child { border-bottom: 0; }
.rows > a small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.rows > a::after { content: "›"; color: var(--muted); font-size: 1.25rem; }
.chips { display: flex; gap: var(--s2); overflow-x: auto; margin: var(--s3) calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) var(--s1); scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: .9375rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary-tint); border-color: var(--teal); }
.input, .field input, .field select { width: 100%; min-width: 0; min-height: 48px; padding: 0 var(--s3); border: 1px solid #cfdedd; border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.field { display: grid; gap: var(--s1); min-width: 0; margin-bottom: var(--s3); }
.field > span { font-size: var(--fs-sm); font-weight: 700; }
.field input[type="range"] { min-height: 44px; padding: 0; border: 0; background: transparent; accent-color: var(--primary); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); }
.tag { display: inline-block; padding: 2px var(--s2); border-radius: var(--r-sm); background: var(--primary-tint); color: var(--primary); font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; }
.note { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--note); font-size: var(--fs-sm); }
.result { display: block; padding: var(--s4); border-radius: var(--r-md); background: var(--primary-tint); font-weight: 800; }
.result small { display: block; margin-top: var(--s1); color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.disclaimer-block { margin-top: var(--s6); color: var(--muted); font-size: var(--fs-sm); }
.disclaimer-block p { margin: 0 0 var(--s3); }
