/* Shared by every theme page: reset, the shell bar, layouts and states. Themes restyle the shell
   with the --shell-* properties and own everything inside .tt-card. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
img, svg { display: block; max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.tt-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

:root {
  --shell-bg: transparent;
  --shell-fg: currentColor;
  --shell-muted: color-mix(in srgb, currentColor 65%, transparent);
  --shell-accent: currentColor;
  --shell-font: system-ui, sans-serif;
  --shell-size: 0.8125rem;
  --shell-border: color-mix(in srgb, currentColor 30%, transparent);
  --shell-control-bg: transparent;
  --shell-radius: 4px;
  --shell-focus: currentColor;
  --shell-pad: 0.5rem 1rem;
}

/* The shell: one quiet link. */
.tt-shell {
  position: relative; z-index: 10;
  display: flex; align-items: center;
  padding: var(--shell-pad);
  background: var(--shell-bg); color: var(--shell-fg);
  font-family: var(--shell-font); font-size: var(--shell-size); line-height: 1.2;
}
.tt-shell a { color: inherit; text-decoration: none; }
.tt-shell__home { padding: 0.375rem 0; }
.tt-shell__home:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.tt-shell :focus-visible, .tt-more :focus-visible, .tt-status :focus-visible {
  outline: 2px solid var(--shell-focus); outline-offset: 2px;
}
.tt-card:focus-visible { outline: 2px solid var(--shell-focus); outline-offset: 4px; }
/* A card reached with Space or Page Down (core/ui/snap.js) is focused for screen readers, without a ring. */
.tt-card[data-stepped]:focus-visible, .tt-card[data-stepped]:focus-visible * { outline: none !important; }

/* A whole card that opens its detail sheet (core/ui/detail.js): one real button laid over it. */
.tt-open { position: absolute; inset: 0; z-index: 1; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.tt-detail { overscroll-behavior: contain; }
.tt-detail:focus { outline: none; }

/* Snapping (core/ui/snap.js, desktop only): each card settles in the middle, one per gesture. */
html.tt-snap { scroll-snap-type: y mandatory; }
html.tt-snap .tt-header, html.tt-snap .tt-list > .tt-card, html.tt-snap .tt-more { scroll-snap-align: center; scroll-snap-stop: always; }
@media (prefers-reduced-motion: no-preference) { html.tt-snap { scroll-behavior: smooth; } }

.tt-main { display: block; }
.tt-list.tt-layout-column { display: flex; flex-direction: column; align-items: center; }
.tt-list.tt-layout-grid { display: grid; }
.tt-more { display: flex; justify-content: center; padding: 2rem 1rem 4rem; }
.tt-more__button, .tt-retry {
  min-height: 2.75rem; padding: 0 1.25rem; cursor: pointer;
  border: 1px solid var(--shell-border); border-radius: var(--shell-radius);
  background: var(--shell-control-bg); color: var(--shell-fg); font-family: var(--shell-font);
}
.tt-state { margin: 3rem auto; max-width: 32rem; padding: 0 1rem; text-align: center; font-family: var(--shell-font); }
.tt-card-error { padding: 1rem; font-family: var(--shell-font); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
