/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *, :before, :after, ::backdrop {
      --tw-rotate-x: initial;
      --tw-rotate-y: initial;
      --tw-rotate-z: initial;
      --tw-skew-x: initial;
      --tw-skew-y: initial;
      --tw-border-style: solid;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-outline-style: solid;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-backdrop-blur: initial;
      --tw-backdrop-brightness: initial;
      --tw-backdrop-contrast: initial;
      --tw-backdrop-grayscale: initial;
      --tw-backdrop-hue-rotate: initial;
      --tw-backdrop-invert: initial;
      --tw-backdrop-opacity: initial;
      --tw-backdrop-saturate: initial;
      --tw-backdrop-sepia: initial;
    }
  }
}

@layer theme {
  :root, :host {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
      "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
      "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --default-transition-duration: .15s;
    --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}

@layer base {
  *, :after, :before, ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html, :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub {
    bottom: -.25em;
  }

  sup {
    top: -.5em;
  }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring:where(:not(iframe)) {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }

    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit {
    display: inline-flex;
  }

  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }

  ::-webkit-datetime-edit {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-year-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-month-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-day-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-hour-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-minute-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-second-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-millisecond-field {
    padding-block: 0;
  }

  ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }

  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button {
    height: auto;
  }

  ::-webkit-outer-spin-button {
    height: auto;
  }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
}

@layer components;

@layer utilities {
  .block {
    display: block;
  }

  .flex {
    display: flex;
  }

  .grid {
    display: grid;
  }

  .hidden {
    display: none;
  }

  .inline {
    display: inline;
  }

  .inline-flex {
    display: inline-flex;
  }

  .table {
    display: table;
  }

  .flex-shrink {
    flex-shrink: 1;
  }

  .border-collapse {
    border-collapse: collapse;
  }

  .transform {
    transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
  }

  .flex-wrap {
    flex-wrap: wrap;
  }

  .rounded {
    border-radius: .25rem;
  }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .ring {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .outline {
    outline-style: var(--tw-outline-style);
    outline-width: 1px;
  }

  .filter {
    filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
  }

  .backdrop-filter {
    -webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
    backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
  }

  .transition {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --bg-canvas: #f3f6fb;
  --bg-glow-1: #0969da1c;
  --bg-glow-2: #8250df17;
  --bg-glow-3: #1a7f3712;
  --shell-bg: #f3f6fbd9;
  --bar-bg: #fffffff0;
  --card-bg: #ffffffeb;
  --card-inner: #f1f5f9f5;
  --glass-border: #cbd5e1eb;
  --specular-rim: #fffffffa;
  --sheen-grad: linear-gradient(145deg, #ffffffc7 0%, #ffffff1a 55%, #ffffff59 100%);
  --card-shadow: 0 8px 20px -6px #0f172a14,
        0 2px 6px -1px #0969da0a,
        inset 0 1px 0 var(--specular-rim);
  --dock-shadow: 0 10px 28px -6px #0f172a24,
        inset 0 1px 0 var(--specular-rim);
  --text-primary: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --accent-blue: #0969da;
  --accent-blue-soft: #0969da1f;
  --accent-purple: #8250df;
  --accent-purple-soft: #8250df1f;
  --accent-green: #1a7f37;
  --accent-green-soft: #1a7f371f;
  --accent-amber: #9a6700;
  --accent-amber-soft: #9a670021;
  --accent-red: #cf222e;
  --accent-red-soft: #cf222e1f;
  --pill-active-bg: #0f172a;
  --pill-active-text: #fff;
}

html[data-theme="dark"] {
  --bg-canvas: #0d1117;
  --bg-glow-1: #58a6ff1f;
  --bg-glow-2: #bc8cff17;
  --bg-glow-3: #3fb95012;
  --shell-bg: #0d1117e6;
  --bar-bg: #161b22f2;
  --card-bg: #161b22eb;
  --card-inner: #0d1117eb;
  --glass-border: #30363d;
  --specular-rim: #ffffff24;
  --sheen-grad: linear-gradient(145deg, #ffffff12 0%, #fff0 55%, #ffffff08 100%);
  --card-shadow: 0 8px 24px #010409a6,
        inset 0 1px 0 var(--specular-rim);
  --dock-shadow: 0 12px 30px #010409d1,
        inset 0 1px 0 #ffffff24;
  --text-primary: #f0f6fc;
  --text-muted: #8b949e;
  --text-faint: #6e7681;
  --accent-blue: #58a6ff;
  --accent-blue-soft: #58a6ff26;
  --accent-purple: #bc8cff;
  --accent-purple-soft: #bc8cff26;
  --accent-green: #3fb950;
  --accent-green-soft: #3fb95026;
  --accent-amber: #d29922;
  --accent-amber-soft: #d2992229;
  --accent-red: #f85149;
  --accent-red-soft: #f8514929;
  --pill-active-bg: #f0f6fc;
  --pill-active-text: #0d1117;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  transition: background-color .25s, color .2s;
  overflow: hidden;
}

body {
  justify-content: center;
  align-items: center;
  display: flex;
}

.hidden {
  display: none !important;
}

.tabular-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ambient-bg {
  pointer-events: none;
  z-index: 0;
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.aura {
  filter: blur(72px);
  border-radius: 50%;
  position: absolute;
}

.aura-1 {
  background: var(--bg-glow-1);
  width: 300px;
  height: 300px;
  top: -80px;
  left: -60px;
}

.aura-2 {
  background: var(--bg-glow-2);
  width: 320px;
  height: 320px;
  top: 34%;
  right: -90px;
}

.aura-3 {
  background: var(--bg-glow-3);
  width: 290px;
  height: 290px;
  bottom: -80px;
  left: 18%;
}

.app-shell {
  z-index: 1;
  background: var(--shell-bg);
  -webkit-backdrop-filter: blur(18px);
  flex-direction: column;
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

.glass-card {
  background-color: var(--card-bg);
  background-image: var(--sheen-grad);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), border-color .2s, background-color .2s;
  position: relative;
}

.glass-card:active {
  transform: scale(.968);
}

.app-header {
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--glass-border);
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  height: 54px;
  box-shadow: var(--dock-shadow);
  z-index: 20;
  border-radius: 0 0 20px 20px;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  display: flex;
}

.brand-wrap {
  align-items: center;
  gap: 9px;
  min-width: 0;
  display: flex;
}

.brand-logo {
  border: 1px solid var(--glass-border);
  width: 34px;
  height: 34px;
  box-shadow: 0 3px 10px #00000029, inset 0 1px 0 var(--specular-rim);
  background: linear-gradient(145deg, #ffffff24, #ffffff0a);
  border-radius: 11px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  display: flex;
}

.brand-name {
  letter-spacing: -.02em;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-tag {
  color: var(--text-muted);
  margin: 1px 0 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
}

.header-right {
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  display: flex;
}

.mastered-badge {
  height: 34px;
  color: var(--accent-amber);
  cursor: pointer;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
}

.circle-btn {
  width: 34px;
  height: 34px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  padding: 0;
  display: flex;
}

.main-viewport {
  scrollbar-width: none;
  flex: 1;
  padding: 12px 13px 82px;
  overflow: hidden auto;
}

.main-viewport::-webkit-scrollbar {
  display: none;
}

.stack-sm {
  flex-direction: column;
  gap: 10px;
  display: flex;
}

.bottom-dock-wrap {
  padding: 0 14px calc(10px + env(safe-area-inset-bottom, 0px)) 14px;
  pointer-events: none;
  z-index: 25;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.bottom-dock {
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  height: 54px;
  box-shadow: var(--dock-shadow);
  pointer-events: auto;
  border-radius: 27px;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  display: grid;
}

.desktop-nav {
  display: none;
}

.nav-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 22px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  transition: all .2s;
  display: flex;
}

.nav-btn.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-weight: 800;
}

.seg-bar {
  scrollbar-width: none;
  border-radius: 18px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  display: flex;
  overflow-x: auto;
}

.seg-bar::-webkit-scrollbar {
  display: none;
}

.seg-btn {
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: none;
  border-radius: 14px;
  flex: 1 0 auto;
  padding: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  transition: all .2s;
}

.seg-btn.active-blue {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 3px 10px #0969da4d;
}

.seg-btn.active-purple {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 3px 10px #8250df4d;
}

.seg-btn.active-amber {
  background: var(--accent-amber);
  color: #fff;
  box-shadow: 0 3px 10px #9a67004d;
}

.seg-btn.active-red {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 3px 10px #cf222e4d;
}

.seg-btn.active-green {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 3px 10px #1a7f374d;
}

.search-box {
  align-items: center;
  width: 100%;
  display: flex;
  position: relative;
}

.search-icon {
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  position: absolute;
  left: 13px;
}

.search-input {
  width: 100%;
  height: 40px;
  color: var(--text-primary);
  border-radius: 15px;
  outline: none;
  padding: 0 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.clear-btn {
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  position: absolute;
  right: 10px;
}

.pill-row {
  scrollbar-width: none;
  align-items: center;
  gap: 6px;
  padding: 1px;
  display: flex;
  overflow-x: auto;
}

.pill-row::-webkit-scrollbar {
  display: none;
}

.range-pill {
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  flex-shrink: 0;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.range-pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  border-color: #0000;
  font-weight: 800;
}

.num-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  display: grid;
}

.num-card {
  text-align: center;
  cursor: pointer;
  border-radius: 22px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 92px;
  padding: 11px 6px;
  display: flex;
  position: relative;
}

.num-star {
  color: var(--accent-amber);
  font-size: 11px;
  line-height: 1;
  position: absolute;
  top: 7px;
  left: 9px;
}

.num-qbadge {
  border: 1px solid var(--glass-border);
  background: var(--card-inner);
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  padding: 0;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  position: absolute;
  top: 6px;
  right: 7px;
}

.num-exp {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
}

.num-exp.cube {
  color: var(--accent-purple);
}

.num-line {
  background: var(--glass-border);
  border-radius: 99px;
  width: 24px;
  height: 1.5px;
  margin: 6px 0;
}

.num-val {
  font-family: var(--font-mono);
  letter-spacing: -.02em;
  color: var(--text-primary);
  font-size: clamp(.96rem, 4.1vw, 1.18rem);
  font-weight: 900;
  line-height: 1.1;
}

.num-val.seven-digits {
  font-size: clamp(.84rem, 3.6vw, 1.04rem);
}

.fp-dir-bar {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.fp-dir-pills {
  border-radius: 15px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  display: inline-flex;
}

.fp-dir-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 11px;
  padding: 6px 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  transition: all .2s;
}

.fp-dir-btn.active {
  background: var(--accent-amber);
  color: #fff;
  box-shadow: 0 2px 8px #9a670047;
}

.fp-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  display: grid;
}

.fp-card {
  text-align: center;
  cursor: pointer;
  border-radius: 22px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 112px;
  padding: 12px 6px 10px;
  display: flex;
  position: relative;
}

.fp-top-val {
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-mono);
  color: var(--accent-amber);
  font-size: 16.5px;
  font-weight: 900;
  line-height: 1.15;
}

.fp-bot-val {
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-mono);
  color: var(--text-primary);
  font-size: 15.5px;
  font-weight: 900;
  line-height: 1.15;
}

.fp-mixed-sub {
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-sans);
  color: var(--text-muted);
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
}

.ps-card {
  border-radius: 24px;
  flex-direction: column;
  gap: 10px;
  padding: 14px 13px;
  display: flex;
}

.ps-card:active {
  transform: none;
}

.ps-head {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.ps-title {
  letter-spacing: -.01em;
  color: var(--text-primary);
  margin: 0;
  font-size: 15.5px;
  font-weight: 900;
}

.ps-sub {
  color: var(--text-muted);
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 700;
}

.ps-toggle-pills {
  border-radius: 13px;
  align-items: center;
  gap: 3px;
  padding: 3px;
  display: inline-flex;
}

.ps-toggle-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 5px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  transition: all .2s;
}

.ps-toggle-btn.active {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 2px 8px #cf222e47;
}

.ps-toggle-btn.active-blue {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px #0969da47;
}

.ps-stats-row {
  text-align: center;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  display: grid;
}

.ps-stat-chip {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  padding: 7px 6px;
}

.ps-stat-chip strong {
  font-family: var(--font-mono);
  color: var(--accent-red);
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.1;
  display: block;
}

.ps-stat-chip span {
  color: var(--text-muted);
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  display: block;
}

.prime-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  display: grid;
}

.prime-cell {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  border-radius: 15px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  transition: transform .14s, border-color .2s, background-color .2s;
  display: flex;
  position: relative;
}

.prime-cell:active {
  transform: scale(.95);
}

.prime-cell:hover {
  border-color: var(--accent-red);
}

.prime-rank {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 8.5px;
  font-weight: 800;
  position: absolute;
  top: 4px;
  left: 6px;
}

.prime-num {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 16.5px;
  font-weight: 900;
  line-height: 1.1;
}

.prime-cell.match-hi {
  background: var(--accent-red-soft);
  border-color: var(--accent-red);
}

.prime-cell.match-hi .prime-num {
  color: var(--accent-red);
}

.prime-grid-100 {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  display: grid;
}

.p100-cell {
  aspect-ratio: 1;
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  min-height: 30px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  cursor: pointer;
  border-radius: 9px;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  display: flex;
}

.p100-cell.is-prime {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  border-color: #f8514973;
  font-weight: 900;
}

.p100-cell.match-hi {
  background: var(--accent-red);
  color: #fff;
  border-color: #0000;
}

.series-table-scroll {
  border: 1px solid var(--glass-border);
  background: var(--card-inner);
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  width: 100%;
  overflow-x: auto;
}

.series-matrix {
  border-collapse: collapse;
  width: 100%;
  min-width: 680px;
  font-family: var(--font-mono);
  text-align: center;
}

.series-matrix th {
  background: var(--bar-bg);
  color: var(--accent-blue);
  border-bottom: 1.5px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  cursor: pointer;
  white-space: nowrap;
  padding: 9px 6px;
  font-size: 11.5px;
  font-weight: 900;
  transition: background-color .18s, color .18s;
  position: sticky;
  top: 0;
}

.series-matrix th:first-child {
  z-index: 4;
  color: var(--accent-amber);
  position: sticky;
  left: 0;
}

.series-matrix th.col-hi {
  background: var(--accent-blue);
  color: #fff;
}

.series-matrix td {
  color: var(--text-primary);
  border-bottom: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 6px;
  font-size: 12.5px;
  font-weight: 800;
  transition: background-color .15s, color .15s;
}

.series-matrix td:first-child {
  z-index: 3;
  background: var(--bar-bg);
  color: var(--accent-amber);
  font-weight: 900;
  position: sticky;
  left: 0;
}

.series-matrix tr:last-child td {
  border-bottom: none;
}

.series-matrix tr.row-hi td {
  background: var(--accent-amber-soft);
}

.series-matrix tr.row-hi td:first-child {
  background: var(--accent-amber);
  color: #fff;
}

.series-matrix td.col-hi {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.series-matrix td.cell-match {
  font-weight: 900;
  background: var(--accent-green) !important;
  color: #fff !important;
}

.series-matrix td:hover {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
}

.ejoty-card {
  border-radius: 20px;
  padding: 11px 12px;
}

.ejoty-top {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  display: flex;
}

.ejoty-title {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 800;
}

.ejoty-pill {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
}

.ejoty-grid {
  text-align: center;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  display: grid;
}

.ejoty-cell {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px 2px;
}

.ejoty-cell strong {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  display: block;
}

.ejoty-cell span {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-size: 10.5px;
  font-weight: 800;
}

.alpha-head-row {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
}

.alpha-list {
  flex-direction: column;
  gap: 8px;
  display: flex;
}

.alpha-row {
  cursor: pointer;
  border-radius: 20px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  display: grid;
}

.alpha-side {
  align-items: center;
  gap: 8px;
  min-width: 0;
  display: flex;
}

.alpha-side.right {
  text-align: right;
  justify-content: flex-end;
}

.alpha-tile {
  background: var(--accent-blue-soft);
  width: 36px;
  height: 36px;
  color: var(--accent-blue);
  font-family: var(--font-mono);
  border-radius: 12px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 900;
  display: flex;
}

.alpha-tile.opp {
  background: var(--accent-red-soft);
  color: var(--accent-red);
}

.alpha-meta {
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  display: flex;
}

.alpha-pos {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.alpha-rev {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.alpha-bridge {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  text-align: center;
  border-radius: 12px;
  max-width: 124px;
  padding: 5px 8px;
}

.alpha-bridge-pair {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  display: block;
}

.alpha-bridge-word {
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  display: block;
  overflow: hidden;
}

.tbl-toolbar {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.tbl-mode-pill {
  border-radius: 14px;
  flex-shrink: 0;
  align-items: center;
  gap: 3px;
  padding: 4px;
  display: inline-flex;
}

.tbl-mode-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 5px 9px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  transition: all .2s;
}

.tbl-mode-btn.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px #0969da47;
}

.tbl-num-strip {
  scrollbar-width: none;
  align-items: center;
  gap: 6px;
  padding: 2px 1px;
  display: flex;
  overflow-x: auto;
}

.tbl-num-strip::-webkit-scrollbar {
  display: none;
}

.tbl-num-chip {
  min-width: 38px;
  height: 34px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 12px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  padding: 0 9px;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
}

.tbl-num-chip.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: #0000;
  box-shadow: 0 3px 10px #0969da4d;
}

.tbl-featured-card {
  border-radius: 26px;
  flex-direction: column;
  gap: 11px;
  padding: 15px 14px;
  display: flex;
}

.tbl-featured-head {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.tbl-title-wrap {
  flex-direction: column;
  gap: 2px;
  display: flex;
}

.tbl-title {
  letter-spacing: -.02em;
  color: var(--text-primary);
  margin: 0;
  font-size: 19px;
  font-weight: 900;
}

.tbl-subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 11px;
  font-weight: 700;
}

.tbl-step-btns {
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.tbl-step-btn {
  height: 34px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 12px;
  align-items: center;
  gap: 4px;
  padding: 0 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
}

.tbl-rows-wrap {
  flex-direction: column;
  gap: 5px;
  display: flex;
}

.tbl-row {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  font-family: var(--font-mono);
  cursor: pointer;
  border-radius: 14px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 9px 13px;
  transition: transform .14s, border-color .2s, background-color .2s;
  display: grid;
}

.tbl-row:nth-child(2n) {
  background: none;
}

.tbl-row:active {
  transform: scale(.985);
}

.tbl-row.highlighted {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
}

.tbl-lhs {
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 800;
}

.tbl-eq {
  color: var(--text-faint);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.tbl-rhs {
  text-align: right;
  color: var(--accent-blue);
  font-size: 16px;
  font-weight: 900;
}

.tbl-row.highlighted .tbl-rhs {
  color: var(--accent-green);
}

.tbl-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  display: grid;
}

.tbl-mini-card {
  text-align: center;
  cursor: pointer;
  border-radius: 18px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  display: flex;
}

.tbl-mini-card.selected {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.tbl-mini-num {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}

.tbl-mini-sub {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

#view-formulas {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.fm-filter-bar {
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.fm-filter-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  display: inline-flex;
}

.fm-lang-pills {
  border-radius: 999px;
  align-items: center;
  gap: 2px;
  padding: 3px;
  display: inline-flex;
}

.fm-lang-btn {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  transition: all .2s;
}

.fm-lang-btn.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px #0969da47;
}

.fm-badge-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  display: flex;
}

.speed-trick-badge {
  letter-spacing: .03em;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid #d2992252;
  border-radius: 999px;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  font-size: 9.5px;
  font-weight: 900;
  display: inline-flex;
}

.fm-count-lbl {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.fm-star-filter {
  color: var(--accent-amber);
  cursor: pointer;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
}

.fm-star-filter.active {
  background: var(--accent-amber-soft);
  border-color: #d2992273;
}

.fm-list {
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  display: flex;
}

.fm-card {
  border-radius: 24px;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 14px 13px;
  display: flex;
  overflow: hidden;
}

.fm-card:active {
  transform: none;
}

.fm-card-head {
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  display: flex;
}

.fm-title-block {
  flex-direction: column;
  flex: 1;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  display: flex;
}

.fm-title {
  letter-spacing: -.01em;
  width: 100%;
  color: var(--text-primary);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.3;
}

.fm-star-btn {
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: var(--text-faint);
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  padding: 0;
  display: flex;
}

.fm-star-btn.starred {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: #d2992273;
}

.fm-formula-box {
  box-sizing: border-box;
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-sans);
  color: var(--accent-blue);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  border-radius: 15px;
  padding: 11px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.85;
}

.fm-trick-box {
  box-sizing: border-box;
  background: var(--accent-green-soft);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: var(--text-primary);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid #3fb95047;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
}

.fm-trick-lbl {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent-green);
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 900;
  display: block;
}

.fm-example-box {
  box-sizing: border-box;
  background: var(--card-inner);
  border: 1px dashed var(--glass-border);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-sans);
  color: var(--text-muted);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.75;
}

.fm-example-box strong {
  color: var(--text-primary);
  font-weight: 800;
}

.frac {
  vertical-align: middle;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 2px 3px;
  font-size: .86em;
  font-weight: 800;
  line-height: 1.12;
  display: inline-flex;
}

.frac > .num {
  white-space: normal;
  border-bottom: 1.5px solid;
  padding: 0 4px 2px;
  display: block;
}

.frac > .den {
  white-space: normal;
  padding: 2px 4px 0;
  display: block;
}

.pill-tag {
  letter-spacing: .04em;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  white-space: normal;
  border-radius: 999px;
  max-width: 100%;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  display: inline-block;
}

.pill-tag.green {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.pill-tag.purple {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
}

.pill-tag.amber {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
}

.pill-tag.red {
  background: var(--accent-red-soft);
  color: var(--accent-red);
}

.fc-count {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.act-btn {
  cursor: pointer;
  min-height: 54px;
  color: var(--text-primary);
  border-radius: 18px;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
}

.act-btn.primary {
  background: var(--accent-blue);
  color: #fff;
  border-color: #0000;
  box-shadow: 0 4px 14px #0969da4d;
}

.act-btn.amber {
  color: var(--accent-amber);
}

.act-btn.amber.starred {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: #d2992273;
}

.stats-strip {
  text-align: center;
  border-radius: 20px;
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 8px;
  display: grid;
}

.stat-cell + .stat-cell {
  border-left: 1px solid var(--glass-border);
}

.stat-lbl {
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 800;
}

.stat-num {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}

.stat-sub {
  color: var(--text-faint);
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
}

.quiz-rule-banner {
  color: var(--text-muted);
  border-radius: 14px;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
}

.review-trigger-btn {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  cursor: pointer;
  border: 1px solid #f8514959;
  border-radius: 999px;
  flex-shrink: 0;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 800;
}

.quiz-bar {
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  display: flex;
}

.q-cat-btn {
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 12px;
  flex-shrink: 0;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

.q-cat-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: #0000;
  font-weight: 800;
}

.q-cat-btn.practice-active {
  background: var(--accent-red);
  color: #fff;
  border-color: #0000;
  font-weight: 800;
}

.mode-btn {
  color: var(--accent-purple);
  cursor: pointer;
  border-radius: 12px;
  flex-shrink: 0;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
}

.quiz-card {
  text-align: center;
  border-radius: 28px;
  flex-direction: column;
  justify-content: space-between;
  min-height: 222px;
  padding: 18px 16px;
  display: flex;
}

.quiz-card.right {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px var(--accent-green-soft), var(--card-shadow);
}

.quiz-card.wrong {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px var(--accent-red-soft), var(--card-shadow);
}

.quiz-card-top {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.quiz-q-center {
  margin: auto 0;
  padding: 10px 0;
}

.quiz-q {
  font-family: var(--font-mono);
  letter-spacing: -.03em;
  margin: 0;
  font-size: 40px;
  font-weight: 900;
  line-height: 1.15;
}

.quiz-fb {
  min-height: 18px;
  color: var(--text-muted);
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.quiz-trick-box {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  font-family: var(--font-mono);
  color: var(--text-primary);
  border-radius: 15px;
  padding: 9px 11px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.mcq-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  display: grid;
}

.mcq-opt {
  font-family: var(--font-mono);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 18px;
  padding: 15px 10px;
  font-size: 18px;
  font-weight: 800;
}

.mcq-opt.correct {
  background: var(--accent-green) !important;
  color: #fff !important;
  border-color: #0000 !important;
}

.mcq-opt.wrong {
  background: var(--accent-red) !important;
  color: #fff !important;
  border-color: #0000 !important;
}

.pad-display {
  border-radius: 18px;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  display: flex;
}

.pad-val {
  font-family: var(--font-mono);
  letter-spacing: .04em;
  font-size: 24px;
  font-weight: 900;
}

.pad-clr {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  cursor: pointer;
  border: none;
  border-radius: 11px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
}

.pad-num-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  display: grid;
}

.pad-alpha-grid {
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  display: grid;
}

.pad-key {
  font-family: var(--font-mono);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 4px;
  font-size: 16px;
  font-weight: 800;
}

.pad-key.alpha {
  padding: 10px 2px;
  font-size: 13px;
}

.pad-key.go {
  background: var(--accent-blue);
  color: #fff;
  border-color: #0000;
}

.mistake-head-card {
  border-radius: 22px;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  display: flex;
}

.mistake-actions {
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  display: grid;
}

.mistake-list {
  flex-direction: column;
  gap: 9px;
  display: flex;
}

.mistake-item {
  border-radius: 20px;
  flex-direction: column;
  gap: 7px;
  padding: 12px 13px;
  display: flex;
}

.mistake-top {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.mistake-q {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 900;
}

.mistake-ans-row {
  font-family: var(--font-mono);
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
}

.ans-pill-wrong {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  border-radius: 999px;
  padding: 3px 9px;
}

.ans-pill-right {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-radius: 999px;
  padding: 3px 9px;
}

.toast-pill {
  z-index: 60;
  background: var(--bar-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--dock-shadow);
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12px;
  font-weight: 800;
  transition: all .22s;
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
}

.toast-pill.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sheet-backdrop {
  z-index: 70;
  -webkit-backdrop-filter: blur(8px);
  background: #0104098f;
  justify-content: center;
  align-items: flex-end;
  display: flex;
  position: fixed;
  inset: 0;
}

.sheet-card {
  background: var(--bar-bg);
  border-top: 1px solid var(--glass-border);
  border-radius: 28px 28px 0 0;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  max-height: 76vh;
  padding: 18px;
  display: flex;
}

.chip-wrap {
  flex-wrap: wrap;
  gap: 7px;
  display: flex;
  overflow-y: auto;
}

.chip {
  font-family: var(--font-mono);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-radius: 10px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
}

.sheet-foot {
  gap: 8px;
  display: flex;
}

.btn-danger {
  background: var(--accent-red-soft);
  color: var(--accent-red);
  cursor: pointer;
  border: none;
  border-radius: 14px;
  flex: 1;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
}

.btn-solid {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  cursor: pointer;
  border: none;
  border-radius: 14px;
  flex: 1;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
}

.center-backdrop {
  z-index: 80;
  -webkit-backdrop-filter: blur(11px);
  background: #010409a3;
  justify-content: center;
  align-items: center;
  padding: 16px;
  display: flex;
  position: fixed;
  inset: 0;
}

.trick-modal {
  background-color: var(--bar-bg);
  background-image: var(--sheen-grad);
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 396px;
  box-shadow: 0 24px 60px #00000085, inset 0 1px 0 var(--specular-rim);
  border-radius: 30px;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  animation: .22s cubic-bezier(.22, 1, .36, 1) popScale;
  display: flex;
}

@keyframes popScale {
  from {
    opacity: 0;
    transform: scale(.92) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-top {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  display: flex;
}

.modal-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.hero-box {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  text-align: center;
  border-radius: 22px;
  padding: 14px 12px;
}

.hero-expr {
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-mono);
  color: var(--accent-blue);
  font-size: 18px;
  font-weight: 800;
}

.hero-expr.purple {
  color: var(--accent-purple);
}

.hero-expr.amber {
  color: var(--accent-amber);
}

.hero-expr.red {
  color: var(--accent-red);
}

.hero-res {
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-mono);
  letter-spacing: -.02em;
  color: var(--text-primary);
  margin: 4px 0;
  font-size: 30px;
  font-weight: 900;
}

.rule-pill {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-radius: 999px;
  margin-top: 2px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-block;
}

.steps-list {
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  display: flex;
  overflow-y: auto;
}

.step-item {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 9px 11px;
}

.step-lbl {
  color: var(--text-muted);
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 800;
}

.step-math {
  font-family: "Cambria Math", "Times New Roman", Georgia, var(--font-mono);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}

.tip-box {
  background: var(--accent-amber-soft);
  color: var(--text-primary);
  border: 1px solid #d2992259;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.45;
}

.popup-nav-row {
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 8px;
  display: grid;
}

.quiz-layout-grid, .quiz-main-col, .quiz-side-col, .tables-workspace, .tables-left-col, .tables-right-col, .primes-series-workspace {
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  display: flex;
}

@media (min-width: 768px) {
  .app-header {
    border-radius: 0 0 22px 22px;
    width: calc(100% - 40px);
    max-width: 1320px;
    height: 64px;
    margin: 0 auto;
    padding: 0 22px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-tag {
    font-size: 11px;
  }

  .circle-btn {
    width: 36px;
    height: 36px;
  }

  .desktop-nav {
    background: var(--card-inner);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    align-items: center;
    gap: 6px;
    padding: 4px;
    display: inline-flex;
  }

  .desktop-nav-btn {
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    border-radius: 999px;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    transition: all .2s;
    display: inline-flex;
  }

  .desktop-nav-btn:hover {
    color: var(--text-primary);
    background: #80808014;
  }

  .desktop-nav-btn.active {
    background: var(--accent-blue);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 3px 12px #0969da47;
  }

  .bottom-dock-wrap {
    display: none;
  }

  .main-viewport {
    padding: 20px 24px 36px;
  }

  .main-viewport > section {
    gap: 16px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
  }

  .learn-top-controls {
    grid-template-columns: 440px 1fr 210px;
    align-items: center;
    gap: 12px;
    display: grid;
  }

  .learn-top-controls .search-box {
    justify-self: end;
    min-width: 170px;
    max-width: 210px;
  }

  .learn-top-controls #range-pills {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .learn-top-controls.frac-toolbar-mode, .learn-top-controls.primes-toolbar-mode {
    grid-template-columns: 440px 1fr;
    align-items: center;
    gap: 12px;
    display: grid;
  }

  .learn-top-controls.frac-toolbar-mode .search-box, .learn-top-controls.primes-toolbar-mode .search-box {
    justify-self: end;
    width: 100%;
    min-width: 0;
    max-width: 340px;
  }

  .learn-top-controls.alpha-toolbar-mode {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
  }

  .learn-top-controls.alpha-toolbar-mode .search-box {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #learn-alpha-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

  .num-grid, .fp-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .tbl-featured-card {
    padding: 20px 22px;
  }

  .tbl-rows-wrap {
    grid-template-rows: repeat(5, auto);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    gap: 8px 12px;
    display: grid;
  }

  .tbl-rows-wrap.tbl-rows-20 {
    grid-template-rows: repeat(10, auto);
  }

  .tbl-row:nth-child(2n) {
    background: var(--card-inner);
  }

  .tbl-row:hover {
    border-color: var(--accent-blue);
  }

  .formulas-top-controls {
    grid-template-columns: 360px 1fr;
    align-items: center;
    gap: 14px;
    display: grid;
  }

  .fm-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px;
    display: grid;
  }

  .fm-card {
    justify-content: space-between;
    padding: 18px;
  }

  .fm-card:hover {
    border-color: var(--accent-blue);
  }

  .main-viewport > section#view-quiz {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 980px;
    min-height: auto;
    margin: 0 auto;
    padding-top: 0;
    display: flex;
  }

  .quiz-layout-grid {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
  }

  .quiz-side-col, .quiz-main-col {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: static;
  }

  .quiz-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .quiz-card {
    width: 100%;
    min-height: 265px;
    padding: 24px;
  }

  .quiz-q {
    font-size: 48px;
  }

  .mcq-grid {
    gap: 12px;
    width: 100%;
  }

  .mcq-opt {
    padding: 18px 14px;
    font-size: 20px;
  }

  .mcq-opt:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
  }

  .trick-modal {
    max-width: 460px;
    padding: 24px;
  }
}

@media (min-width: 960px) {
  .num-grid, .fp-grid {
    grid-template-columns: repeat(auto-fill, minmax(max(132px, 10% - 12.6px), 1fr));
    gap: 14px;
  }
}

@media (min-width: 1120px) {
  .fm-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tables-workspace {
    grid-template-columns: 380px 1fr;
    align-items: start;
    gap: 16px;
    display: grid;
  }

  .primes-series-workspace {
    grid-template-columns: 390px 1fr;
    align-items: start;
    gap: 16px;
    display: grid;
  }
}

html, body {
  overscroll-behavior: none;
  touch-action: manipulation;
}

#root {
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  display: flex;
}

.app-header {
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(54px + env(safe-area-inset-top, 0px));
}

.bottom-dock-wrap {
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.main-viewport {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .main-viewport {
    padding-bottom: 32px;
  }
}

.pwa-install-btn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid #58a6ff73;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  font-size: 11.5px;
  font-weight: 800;
  transition: transform .16s cubic-bezier(.34, 1.56, .64, 1), filter .18s;
  display: inline-flex;
  box-shadow: 0 4px 14px #58a6ff47, inset 0 1px #ffffff47;
}

.pwa-install-btn:hover {
  filter: brightness(1.08);
}

.pwa-install-btn:active {
  transform: scale(.95);
}

@media (max-width: 390px) {
  .pwa-install-btn span {
    display: none;
  }

  .pwa-install-btn {
    justify-content: center;
    width: 34px;
    padding: 0;
  }
}

.pwa-guide-steps {
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 16px;
  display: flex;
}

.pwa-guide-step {
  background: var(--card-inner);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: 14px;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  display: flex;
}

.pwa-step-num {
  background: var(--accent-blue-soft);
  width: 22px;
  height: 22px;
  color: var(--accent-blue);
  border-radius: 999px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
}

.pwa-offline-pill {
  left: 50%;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  color: #0d1117;
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  background: #d29922f0;
  border-radius: 999px;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  position: fixed;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px #00000059;
}

@media (min-width: 768px) {
  .pwa-offline-pill {
    bottom: 20px;
    left: 20px;
    transform: none;
  }
}

.pwa-offline-dot {
  background: #0d1117;
  border-radius: 50%;
  width: 7px;
  height: 7px;
  animation: 1.4s ease-in-out infinite pwaPulse;
}

@keyframes pwaPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .45;
    transform: scale(.8);
  }
}

.pwa-update-banner {
  right: 14px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 96;
  background: var(--bar-bg);
  border: 1px solid var(--accent-blue);
  box-shadow: var(--dock-shadow);
  color: var(--text-primary);
  border-radius: 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  position: fixed;
}

@media (min-width: 768px) {
  .pwa-update-banner {
    bottom: 20px;
    right: 20px;
  }
}

.pwa-update-btn {
  background: var(--accent-blue);
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 800;
}

.tab-view-enter {
  animation: .16s ease-out bmFadeIn;
}

@keyframes bmFadeIn {
  from {
    opacity: .65;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@property --tw-rotate-x {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-y {
  syntax: "*";
  inherits: false
}

@property --tw-rotate-z {
  syntax: "*";
  inherits: false
}

@property --tw-skew-x {
  syntax: "*";
  inherits: false
}

@property --tw-skew-y {
  syntax: "*";
  inherits: false
}

@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false
}

@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-ring-inset {
  syntax: "*";
  inherits: false
}

@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}

@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

@property --tw-outline-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}

@property --tw-blur {
  syntax: "*";
  inherits: false
}

@property --tw-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-invert {
  syntax: "*";
  inherits: false
}

@property --tw-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-sepia {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-color {
  syntax: "*";
  inherits: false
}

@property --tw-drop-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

@property --tw-drop-shadow-size {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-blur {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-brightness {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-contrast {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-grayscale {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-hue-rotate {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-invert {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-opacity {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-saturate {
  syntax: "*";
  inherits: false
}

@property --tw-backdrop-sepia {
  syntax: "*";
  inherits: false
}
