* { box-sizing: border-box; }

/* Guarantees an element with the `hidden` attribute stays hidden even if a
   component gives it its own `display` (e.g. `display:flex`) — without
   this, an equal-specificity author rule can beat the UA's [hidden] rule. */
[hidden] { display: none !important; }

/* Hides text visually while keeping it in the accessibility tree — used to
   give screen readers a label for a value that's otherwise only labeled
   visually (e.g. the mobile-only ::before labels on the pack table in
   components.css). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  /* Extra bottom padding clears the fixed .result-hotbar (see
     components.css) so it never covers the footer at the end of a scroll,
     whether or not the bar happens to be showing. */
  padding: 24px 24px 104px;
  transition: background .15s ease, color .15s ease;
}

.wrap { max-width: 880px; margin: 0 auto; }

/* ===== Header ===== */

header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

header .crystal {
  width: 56px; height: 56px;
  object-fit: contain;
  flex: none;
}

h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
}

.theme-toggle {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-pill-border);
  background: var(--color-pill-bg);
  color: var(--color-pill-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.theme-toggle:hover { background: var(--color-pill-hover); }

.subtitle {
  color: var(--color-text-muted);
  font-size: 13.5px;
  margin: 0 0 22px 68px;
}

/* ===== Tabs ===== */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* No `border` here on purpose — these buttons are auto-width, so a border
   that changes width between states (e.g. 1px inactive / 0px active) shrinks
   or grows the box and visibly reflows its neighbor in the flex row. Instead
   the "border" is an inset box-shadow, which paints without ever touching
   box size, so toggling it on/off between states can't shift anything. */
.tab-btn {
  background: var(--color-pill-bg);
  border: none;
  box-shadow: inset 0 0 0 1px var(--color-pill-border);
  color: var(--color-pill-text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
}
.tab-btn:hover { background: var(--color-pill-hover); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--color-active-grad-start), var(--color-active-grad-end));
  color: #fff;
  box-shadow: 0 2px 8px var(--color-active-shadow);
}

/* Panels are switched with the `hidden` attribute — see the global
   [hidden] rule above. */

/* ===== Footer ===== */

footer {
  font-size: 11.5px;
  color: var(--color-text-whisper);
  text-align: center;
  margin-top: 18px;
  line-height: 1.6;
}
