/* Thmanyah Sans: the app's only typeface. Served from the app itself, so it works offline. */
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-sans-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-sans-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-sans-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Pharma Trainer. Palette, type and components follow the reference study-app design:
   Onest, orange accent, cream background, pastel cards, floating round bottom bar. */
:root {
  --orange: #f95e08;
  --orange-2: #fe8118;
  --orange-soft: #fff1e7;
  --ink: #1c1b19;
  --ink-2: #4f4b45;
  --muted: #8b857d;
  --bg: #fcfaf6;
  --surface: #ffffff;
  --line: #efe9e1;
  --peach: #fbe8da;
  --cream: #f9eedf;
  --lime: #ecedc7;
  --lavender: #ded1e8;
  --mint: #d2e4e2;
  --sage: #d9e7cb;
  --sky: #cfe6f4;
  --yellow: #fe8118;
  --orange-deep: #c2410c;
  /* text and icons on soft orange */
  --orange-tint: #ffe9dc;
  /* soft orange fills */
  --orange-line: #ffcdb0;
  /* borders on soft orange */
  --ok: #2f9e5b;
  --ok-soft: #e3f4e8;
  --bad: #e5484d;
  --bad-soft: #fde8e8;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --radius: var(--r-lg);
  --radius-sm: var(--r-md);
  --shadow: 0 10px 30px rgba(60, 40, 20, .07);
  --shadow-lg: 0 24px 60px rgba(60, 40, 20, .14);
  --grad: linear-gradient(90deg, var(--orange), var(--orange-2));
  --font: 'Thmanyah', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

p {
  margin: 0;
}

em {
  font-style: normal;
  color: var(--orange);
}

img,
svg {
  flex-shrink: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(249, 94, 8, .45);
  outline-offset: 2px;
}

[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}

.boot,
.boot-error {
  margin: 36vh auto 0;
  text-align: center;
  color: var(--muted);
  max-width: 420px;
  padding: 20px;
}

.boot-mascot {
  display: block;
  margin: 0 auto 14px;
  filter: drop-shadow(0 4px 14px rgba(249, 94, 8, .12));
  animation: bootFloat 2.2s ease-in-out infinite alternate;
}

@keyframes bootFloat {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-6px);
  }
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

.pad {
  padding: 16px;
}

/* Tones */
.tone-sage {
  background: var(--sage);
}

.tone-mint {
  background: var(--mint);
}

.tone-lime {
  background: var(--lime);
}

.tone-lavender {
  background: var(--lavender);
}

.tone-peach {
  background: var(--peach);
}

.tone-sky {
  background: var(--sky);
}

/* The white scribble drawn across the reference header cards. */
.swoosh {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.swoosh::before {
  content: '';
  position: absolute;
  inset: -10px -20px auto auto;
  width: 280px;
  height: 170px;
  z-index: -1;
  opacity: .7;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 130'%3E%3Cpath d='M18 104C52 30 78 18 92 52s4 72 34 58 30-82 58-86 22 40 22 40' fill='none' stroke='white' stroke-width='20' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

[dir="rtl"] .swoosh::before {
  inset: -10px auto auto -20px;
  transform: scaleX(-1);
}

/* Buttons and controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(249, 94, 8, .28);
}

.btn-primary:hover {
  box-shadow: 0 14px 28px rgba(249, 94, 8, .36);
}

.btn-soft {
  background: var(--orange-soft);
  color: var(--orange);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.btn-cream {
  background: var(--cream);
  color: var(--ink-2);
}

.btn-white {
  background: #fff;
  color: var(--ink);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  min-height: 54px;
  padding: 0 24px;
  font-size: 16px;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.grow {
  flex: 1;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: background .15s ease, color .15s ease;
}

.icon-btn.sm {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
}

.icon-btn.on {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.icon-btn.on svg path {
  fill: currentColor;
}

.icon-btn:disabled {
  opacity: .6;
  cursor: default;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: 0;
}

.chip-white {
  background: #fff;
}

.chip-peach {
  background: var(--peach);
  color: var(--ink-2);
}

.chip-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-tab {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s ease;
}

.chip-tab.active,
.chip-tab:has(input:checked) {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(249, 94, 8, .25);
}

.chip-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-tab:has(input:focus-visible) {
  outline: 3px solid rgba(249, 94, 8, .45);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.pill-btn.hot {
  background: var(--grad);
  color: #fff;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.warn {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.tag.hot {
  background: var(--orange-soft);
  color: var(--orange);
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(28, 27, 25, .08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  transition: width .5s ease;
}

.bar-thin {
  height: 6px;
}

.bar-on-tone {
  background: rgba(255, 255, 255, .7);
}

.ring {
  position: relative;
  flex-shrink: 0;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(28, 27, 25, .08);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: var(--orange);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s ease;
}

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  direction: ltr;
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.art {
  display: block;
  width: 100%;
  height: auto;
}

.mascot {
  width: auto;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  color: var(--ink-2);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
}

.logo-mark {
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(249, 94, 8, .3);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* Toasts */
.toasts {
  position: fixed;
  inset: auto 0 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
  transition: opacity .3s ease, transform .3s ease;
}

.toast.ok {
  background: var(--ok);
}

.toast.out {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 90;
}

/* App layout: phone first, floating bottom bar. */
.layout {
  min-height: 100vh;
}

.sidebar {
  display: none;
}

.main {
  min-width: 0;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 130px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 46px;
}

.topbar-start,
.topbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
}

.stat-pills {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  direction: ltr;
  text-decoration: none;
  box-shadow: none;
}

.stat-pill:hover {
  opacity: 0.85;
}

.stat-pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-left: 1px;
}

.stat-pill-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: transparent !important;
  border: none !important;
}

.stat-pill-ico.flame {
  background: transparent !important;
  color: #ef4444;
  /* Clean flame red, not orange */
}

.stat-pill-ico.bolt {
  background: transparent !important;
  color: #eab308;
  /* Clean energy yellow */
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 2px 12px;
  gap: 12px;
}

.section-title {
  font-size: 19px;
  font-weight: 700;
}

.see-all {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.bottom-nav {
  position: fixed;
  inset: auto 0 calc(14px + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: min(420px, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  z-index: 50;
}

.nav-btn {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
  transition: color .15s ease, background .15s ease;
}

.nav-btn.active {
  color: var(--orange);
  background: var(--orange-soft);
}

.nav-btn.active svg {
  fill: rgba(249, 94, 8, .15);
}

.nav-center {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-top: -26px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 26px rgba(249, 94, 8, .45);
  transition: transform .15s ease;
}

.nav-center:hover {
  transform: translateY(-2px) rotate(-6deg);
}

/* Home */
.home-grid {
  display: grid;
  gap: 4px;
}

.home-aside {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  align-content: start;
}

.buddy-card {
  background: var(--peach);
  border-radius: var(--radius);
  padding: 16px;
}

.buddy-card.static {
  box-shadow: none;
}

.buddy-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding-inline-end: 96px;
  position: relative;
}

.buddy-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.buddy-text small {
  color: var(--ink-2);
  font-size: 13px;
}

.buddy-text b {
  font-size: 21px;
  font-weight: 700;
}

.buddy-bot {
  position: absolute;
  inset-inline-end: -6px;
  top: -14px;
  animation: float 4s ease-in-out infinite;
}

.ask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
}

.round-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink-2);
  flex-shrink: 0;
}

.ask-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 0 16px;
  outline: none;
  color: var(--ink);
  display: flex;
  align-items: center;
}

span.ask-input {
  color: var(--muted);
}

.ask-input::placeholder {
  color: var(--muted);
}

.send-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--grad);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(249, 94, 8, .3);
}

.goal-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.goal-card .ring-label {
  font-size: 13px;
}

.goal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.goal-body b {
  font-size: 16px;
}

.goal-body small {
  color: var(--muted);
}

.goal-streak {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--orange-soft);
  min-width: 50px;
}

.goal-streak b {
  font-size: 15px;
  line-height: 1.15;
}

.goal-streak small {
  font-size: 10px;
  color: var(--ink-2);
  text-align: center;
  white-space: nowrap;
}

.flame {
  color: var(--orange);
  display: inline-grid;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  padding: 16px 20px 20px;
  border-radius: var(--r-lg);
  background: var(--lime);
  min-height: 280px;
  overflow: hidden;
  transition: transform .2s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
}

.hero-art {
  max-width: 320px;
  margin: 0 auto;
  width: 88%;
}

.hero-card h2 {
  font-size: 24px;
  font-weight: 700;
  max-width: 75%;
}

.hero-go {
  position: absolute;
  inset-inline-end: 20px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(249, 94, 8, .35);
}

.suggest-list {
  display: grid;
  gap: 12px;
}

.suggest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}

.suggest:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.suggest-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.suggest-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.suggest-body small {
  color: var(--muted);
  font-size: 13px;
}

.suggest-arrow {
  color: var(--muted);
}

.subject-grid {
  display: grid;
  gap: 12px;
}

.subject-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  isolation: isolate;
}

.subject-card:not(.static):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.subject-card::after {
  content: '';
  position: absolute;
  inset: auto -10px -16px auto;
  width: 110px;
  height: 110px;
  z-index: -1;
  opacity: .35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='3'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E") no-repeat center / contain;
}

[dir="rtl"] .subject-card::after {
  inset: auto auto -16px -10px;
}

.subject-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.subject-card h3 {
  font-size: 17px;
  font-weight: 700;
}

.subject-desc {
  color: var(--ink-2);
  font-size: 13px;
}

.subject-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.subject-foot .pill-btn {
  margin-inline-start: auto;
}

.level-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.level-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-card-top div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.level-card-top small {
  color: var(--muted);
}

.level-xp {
  font-weight: 700;
  color: var(--orange);
  direction: ltr;
}

.level-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--yellow);
  color: var(--orange-deep);
  flex-shrink: 0;
}

.side-card {
  padding: 16px 16px;
  display: grid;
  gap: 12px;
}

.side-card .section-head {
  margin: 0;
}

.side-card .section-title {
  font-size: 16px;
}

.badge-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.badge-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.badge-mini small {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.25;
}

.badge-mini .badge-ico {
  width: 46px;
  height: 46px;
}

.board-mini {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.board-mini li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px;
  border-radius: var(--r-sm);
}

.board-mini li b {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-mini li.me {
  background: var(--orange-soft);
}

.rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.rank.r1 {
  background: var(--yellow);
}

.rank.r2 {
  background: #e3e7ee;
}

.rank.r3 {
  background: var(--orange-line);
}

.board-xp {
  font-weight: 700;
  font-size: 13px;
  color: var(--orange);
  direction: ltr;
  white-space: nowrap;
}

/* Subjects */
.subjects-hero {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--peach);
  display: grid;
  gap: 16px;
}

.subjects-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subjects-hero h1,
.subjects-hero h3 {
  font-size: 22px;
  font-weight: 700;
}

.subjects-hero-bot {
  flex-shrink: 0;
  animation: float 4s ease-in-out infinite;
}

.activity-list {
  padding: 8px;
}

.activity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
}

.activity+.activity {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.activity-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--ink-2);
  flex-shrink: 0;
}

.activity-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.activity-body small {
  color: var(--muted);
  font-size: 12px;
}

/* Search */
.ask-card {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--peach);
}

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

.ask-card h1 {
  font-size: 24px;
  font-weight: 700;
}

.ask-card p {
  color: var(--ink-2);
  font-size: 14px;
}

.ask-bot {
  flex-shrink: 0;
  margin: -10px 0 -18px;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 8px;
  scrollbar-width: none;
}

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

.results {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.try-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.try-chips .chip {
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 8px 12px;
  direction: ltr;
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 16px;
  border-radius: var(--r-lg);
  display: grid;
  gap: 12px;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-head h3 {
  font-size: 19px;
  margin-top: 8px;
}

.brand-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.brand-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .7);
  font-size: 13px;
}

.brand-rows li b {
  font-size: 15px;
}

.brand-rows li span {
  color: var(--ink-2);
}

.result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

/* Library */
.lib-head {
  padding: 20px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.lib-head::before {
  filter: invert(1);
  opacity: .05;
}

.lib-head h1,
.lib-head h3 {
  font-size: 26px;
  font-weight: 800;
}

.lib-head p {
  color: var(--ink-2);
  margin-top: 2px;
}

.lib-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.lib-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
}

.lib-stat b {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.lib-stat span {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 500;
}

.seg-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 16px 0;
  border-radius: 999px;
  background: var(--cream);
}

.seg {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
}

.seg.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(249, 94, 8, .25);
}

.review-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.review-banner span {
  flex: 1;
}

.lib-grid {
  display: grid;
  gap: 12px;
}

.lib-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px 16px;
  border-radius: var(--r-lg);
}

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

.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.status.fixed {
  color: var(--ok);
}

.status.pending {
  color: var(--orange-deep);
}

.lib-q {
  font-size: 16px;
  font-weight: 600;
}

.lib-a {
  font-size: 14px;
  color: var(--ink-2);
}

.lib-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lib-card-foot small {
  color: var(--ink-2);
  font-size: 12px;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 13px;
}

.rating svg {
  color: var(--orange-2);
  fill: var(--orange-2);
}

.lib-title {
  font-size: 18px;
}

.lib-brands {
  font-size: 13px;
  color: var(--ink-2);
}

.icon-actions {
  display: flex;
  gap: 8px;
}

.icon-actions .icon-btn {
  border: 0;
}

.prog-top {
  display: grid;
  gap: 12px;
}

.prog-overall {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.prog-overall>div:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mini-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.mini-tiles span {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.mini-tiles b {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.2;
}

.heat-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.heat {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 4px;
  direction: ltr;
}

.heat span {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: #f1ece5;
}

.heat .h1 {
  background: var(--orange-tint);
}

.heat .h2 {
  background: var(--orange-line);
}

.heat .h3 {
  background: var(--orange-2);
}

.heat .h4 {
  background: var(--orange);
}

.prog-list {
  padding: 8px;
}

.prog-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
}

.prog-row:hover {
  background: var(--bg);
}

.prog-dot {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  font-weight: 800;
  flex-shrink: 0;
}

.prog-body {
  flex: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.prog-body small {
  color: var(--muted);
  font-size: 12px;
}

.prog-pct {
  font-weight: 700;
  min-width: 44px;
  text-align: end;
  direction: ltr;
}

.how-card {
  margin-top: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.how-card b {
  display: flex;
  align-items: center;
  gap: 8px;
}

.how-card ul {
  margin: 0;
  padding-inline-start: 20px;
  color: var(--ink-2);
  font-size: 14px;
  display: grid;
  gap: 4px;
}

.how-card .btn {
  justify-self: start;
}

/* Profile */
.profile-grid {
  display: grid;
  gap: 16px;
}

.profile-card {
  padding: 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.profile-card::before {
  filter: invert(1);
  opacity: .05;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-id {
  flex: 1;
  min-width: 0;
}

.profile-id h1 {
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-id small {
  color: var(--muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
}

.profile-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.ptile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.ptile b {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 12px 0;
  border-radius: var(--r-md);
  font-size: 26px;
  font-weight: 800;
  direction: ltr;
}

.ptile span {
  font-size: 14px;
  color: var(--ink-2);
}

.level-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--orange-tint) 0%, var(--orange-tint) 35%, var(--orange-2) 70%, var(--orange-2) 100%);
  box-shadow: 0 12px 30px rgba(249, 94, 8, .18);
}

.level-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.level-banner-text small {
  color: var(--ink-2);
  font-size: 13px;
}

.level-banner .level-badge {
  background: var(--yellow);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
}

.levelup {
  animation: pop .5s ease;
}

.settings-list {
  display: grid;
  gap: 12px;
  align-content: start;
}

.setting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  text-align: start;
  width: 100%;
}

button.setting:hover,
a.setting:hover {
  box-shadow: var(--shadow);
}

.setting-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--bg);
  flex-shrink: 0;
}

.setting-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.setting-body small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-arrow {
  color: var(--muted);
}

.setting.danger .setting-ico {
  background: var(--bad-soft);
  color: var(--bad);
}

.setting.danger b {
  color: var(--bad);
}

.mini-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 0;
  background: #ddd6cc;
  flex-shrink: 0;
  transition: background .2s ease;
}

.switch span {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  transition: inset-inline-start .2s ease;
}

.switch.on {
  background: var(--orange);
}

.switch.on span {
  inset-inline-start: 25px;
}

.btn-signout {
  background: #fff;
  border: 1px solid var(--line);
  min-height: 54px;
  margin-top: 8px;
}

/* Badges and leaderboard */
.badges-hero,
.board-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--lavender);
}

.board-hero {
  background: var(--mint);
  justify-content: space-between;
}

.badges-hero h1,
.board-hero h1 {
  font-size: 22px;
  font-weight: 700;
}

.badges-hero p,
.board-hero p {
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 4px;
}

.badges-art {
  width: 140px;
  flex-shrink: 0;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.badge small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.badge .bar {
  width: 100%;
  margin-top: 4px;
}

.badge-count {
  font-weight: 600;
  color: var(--ink-2) !important;
}

.badge-ico {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f1ece5;
  color: #b9b1a6;
}

.badge.earned .badge-ico,
.badge-mini.earned .badge-ico {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(249, 94, 8, .3);
}

.badge.earned {
  border-color: var(--orange-line);
}

.badge.pop {
  animation: pop .6s ease;
}

.level-ladder {
  padding: 8px;
}

.ladder-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  color: var(--muted);
}

.ladder-step b {
  flex: 1;
  font-weight: 600;
}

.ladder-xp {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-inline-end: 6px;
}

.ladder-n {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1ece5;
  font-weight: 700;
}

.ladder-step.past {
  color: var(--ink);
}

.ladder-step.past .ladder-n {
  background: var(--sage);
}

.ladder-step.now {
  color: var(--ink);
  background: var(--orange-soft);
}

.ladder-step.now .ladder-n {
  background: var(--grad);
  color: #fff;
}

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 12px;
  margin: 20px 0 12px;
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 0;
}

.podium-col b {
  font-size: 14px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-col small {
  color: var(--orange);
  font-weight: 700;
  direction: ltr;
}

.podium-step {
  width: 100%;
  margin-top: 8px;
  border-radius: var(--r-md) var(--r-md) var(--r-sm) var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-2);
}

.podium-col.p1 .podium-step {
  height: 96px;
  background: var(--yellow);
}

.podium-col.p2 .podium-step {
  height: 70px;
  background: #e3e7ee;
}

.podium-col.p3 .podium-step {
  height: 54px;
  background: var(--orange-line);
}

.podium-col.me b {
  color: var(--orange);
}

.board-list {
  padding: 8px;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
}

.board-row.me {
  background: var(--orange-soft);
}

.board-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board-body small {
  color: var(--muted);
  font-size: 12px;
}

/* Training session */
.play {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.play-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(252, 250, 246, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.play-bar {
  flex: 1;
  min-width: 0;
}

.segments {
  display: flex;
  gap: 4px;
  direction: inherit;
}

.segments span {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #ece5dc;
  transition: background .3s ease;
}

.segments span.now {
  background: var(--orange-line);
}

.segments span.ok {
  background: var(--ok);
}

.segments span.bad {
  background: var(--bad);
}

.timer {
  height: 12px;
  border-radius: 999px;
  background: #ece5dc;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: var(--grad);
  border-radius: inherit;
  transition: width .2s linear;
}

.timer-fill.low {
  background: var(--bad);
  animation: blink .6s ease infinite alternate;
}

.play-pills {
  display: flex;
  gap: 8px;
}

.combo-pill,
.xp-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  direction: ltr;
}

.combo-pill {
  color: var(--muted);
}

.combo-pill.hot {
  color: #fff;
  background: linear-gradient(90deg, var(--orange), var(--orange));
  border-color: transparent;
  animation: pulse 1s ease infinite;
}

.xp-pill {
  color: var(--orange);
}

.float-text {
  position: absolute;
  inset-inline-start: 50%;
  top: -4px;
  font-weight: 800;
  font-size: 15px;
  pointer-events: none;
  animation: float-up .9s ease forwards;
}

.float-text.ok {
  color: var(--ok);
}

.float-text.dim {
  color: var(--muted);
}

.play-body {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.play-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.play-meta .chip {
  border: 1px solid var(--line);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.question-card {
  position: relative;
  padding: 20px 20px 24px;
  border-radius: var(--r-lg);
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  overflow: hidden;
}

.q-bot {
  position: absolute;
  top: 4px;
  inset-inline-end: 10px;
}

.q-bot.bounce {
  animation: bounce .6s ease;
}

.q-bot.shake {
  animation: shake .45s ease;
}

.q-type {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-inline-end: 90px;
}

.q-text {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
}

.q-name {
  color: var(--orange);
  font-weight: 800;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: #fff;
  text-align: start;
  font-size: 16px;
  font-weight: 600;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, opacity .2s ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--orange-line);
  transform: translateY(-1px);
}

.choice:active:not(:disabled) {
  transform: scale(.98);
}

.choice:disabled {
  cursor: default;
}

.choice-key {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--bg);
  font-weight: 700;
  flex-shrink: 0;
  color: var(--ink-2);
}

.choice-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.choice.is-correct {
  border-color: var(--ok);
  background: var(--ok-soft);
  animation: pop .35s ease;
}

.choice.is-correct .choice-key {
  background: var(--ok);
  color: #fff;
}

.choice.is-correct .choice-mark {
  color: var(--ok);
}

.choice.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  animation: shake .4s ease;
}

.choice.is-wrong .choice-key {
  background: var(--bad);
  color: #fff;
}

.choice.is-wrong .choice-mark {
  color: var(--bad);
}

.choice.is-dim {
  opacity: .45;
}

.kbd-hint {
  display: none;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  .kbd-hint {
    display: block;
  }
}

.sheet {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  transform: translateY(110%);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
  pointer-events: none;
}

.sheet.show {
  transform: none;
  pointer-events: auto;
}

.sheet-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: #fff;
  box-shadow: 0 -16px 40px rgba(60, 40, 20, .14);
  display: grid;
  gap: 12px;
  border-top: 5px solid var(--ok);
}

.sheet.bad .sheet-inner {
  border-top-color: var(--bad);
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
}

.sheet-head b {
  flex: 1;
}

.sheet-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  flex-shrink: 0;
}

.sheet.bad .sheet-ico {
  background: var(--bad);
}

.xp-gain {
  font-weight: 800;
  color: var(--orange);
  direction: ltr;
}

.sheet-correct {
  font-size: 15px;
  color: var(--ink-2);
}

.sheet-correct b {
  color: var(--ok);
}

.drug-fact {
  display: grid;
  gap: 2px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 14px;
  color: var(--ink-2);
}

.drug-fact>span[dir="ltr"] {
  text-align: start;
}

.drug-fact b {
  color: var(--ink);
}

.report-form {
  display: grid;
  gap: 8px;
}

.report-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 12px;
  resize: vertical;
  background: var(--bg);
}

.report-form .btn {
  justify-self: start;
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-burst {
  position: fixed;
  top: 38%;
  inset-inline: 0;
  margin: 0 auto;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--orange));
  color: #fff;
  font-size: 22px;
  box-shadow: 0 18px 40px rgba(249, 94, 8, .4);
  z-index: 40;
  pointer-events: none;
  animation: burst 1.3s ease forwards;
}

/* Results */
.result-hero {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r-lg);
  text-align: center;
}

.result-art {
  width: 170px;
}

.result-art .mascot {
  margin: 0 auto;
}

.result-text {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.result-text h1 {
  font-size: 28px;
  font-weight: 800;
}

.result-text p {
  color: var(--ink-2);
}

.result-ring {
  background: rgba(255, 255, 255, .7);
  border-radius: 50%;
  padding: 8px;
}

.result-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.rtile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.rtile b {
  font-size: 22px;
  direction: ltr;
}

.rtile small {
  color: var(--muted);
  font-size: 12px;
}

.rtile-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
}

.rtile-ico.bolt {
  background: var(--orange-soft);
  color: var(--orange);
}

.rtile-ico.flame {
  background: var(--orange-soft);
  color: var(--orange);
}

.rtile-ico.target {
  background: var(--ok-soft);
  color: var(--ok);
}

.xp-break {
  margin-top: 12px;
  padding: 8px 16px;
}

.xp-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
}

.xp-row+.xp-row {
  border-top: 1px dashed var(--line);
}

.xp-row b {
  color: var(--orange);
  direction: ltr;
}

.wrong-list {
  padding: 8px 16px;
}

.wrong-row {
  padding: 12px 0;
  display: grid;
  gap: 4px;
}

.wrong-row+.wrong-row {
  border-top: 1px solid var(--line);
}

.wrong-row p {
  font-weight: 600;
}

.wrong-row small {
  color: var(--ink-2);
}

.wrong-row small b {
  color: var(--ok);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.result-actions .btn {
  flex: 1 1 180px;
}

/* Landing */
.landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.land-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 0 12px;
  background: rgba(252, 250, 246, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.land-links {
  display: none;
  gap: 8px;
}

.land-links button {
  border: 0;
  background: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
  color: var(--ink-2);
}

.land-links button:hover {
  background: #fff;
}

.land-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {

  .land-actions .land-btn-install,
  .land-actions .land-btn-login,
  .land-actions .land-btn-logout {
    display: none !important;
  }
}

.land-hero {
  display: grid;
  gap: 32px;
  padding: 24px 0 40px;
  align-items: center;
}

.land-hero-text {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 600;
  font-size: 13px;
}

.land-hero h1 {
  font-size: clamp(32px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.lead {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 560px;
}

.land-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.land-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.land-stats div {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
}

.land-stats b {
  font-size: 24px;
  font-weight: 800;
}

.land-stats span {
  font-size: 13px;
  color: var(--muted);
}

.land-devices {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
  flex-wrap: wrap;
}

.land-hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 32px 0;
  min-height: 560px;
}

.hero-blob {
  position: absolute;
  inset: 6% 4%;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--orange-tint), var(--orange-2) 60%, var(--orange-2));
}

.hero-blob::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: linear-gradient(rgba(255, 255, 255, .25) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .25) 1px, transparent 1px);
  background-size: 28px 28px;
}

.device {
  position: relative;
  width: 270px;
  height: 550px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: #1d1d1f;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px #3a3a3c;
  rotate: -6deg;
  animation: float 6s ease-in-out infinite;
}

.device-notch {
  position: absolute;
  top: 20px;
  inset-inline: 0;
  margin: 0 auto;
  width: 90px;
  height: 26px;
  border-radius: 999px;
  background: #000;
  z-index: 2;
}

.device-screen {
  position: relative;
  height: 100%;
  border-radius: var(--r-lg);
  background: var(--bg);
  overflow: hidden;
  padding: 52px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid var(--line);
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 3px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  direction: ltr;
}

.mini-pill i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  background: var(--yellow);
}

.mini-buddy {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--peach);
  position: relative;
}

.mini-buddy-text {
  display: flex;
  flex-direction: column;
  padding-inline-end: 50px;
}

.mini-buddy-text small {
  font-size: 9px;
  color: var(--ink-2);
}

.mini-buddy-text b {
  font-size: 13px;
}

.mini-buddy-bot {
  position: absolute;
  top: -8px;
  inset-inline-end: 2px;
}

.mini-ask {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  color: var(--muted);
}

.mini-ask i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
}

.mini-label {
  font-weight: 700;
  font-size: 12px;
}

.mini-hero {
  position: relative;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--lime);
  display: grid;
  gap: 4px;
  flex: 1;
  align-content: start;
}

.mini-hero b {
  font-size: 13px;
  padding-inline-end: 34px;
}

.mini-go {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
}

.mini-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mini-nav i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
}

.mini-nav i.c {
  width: 32px;
  height: 32px;
  margin-top: -12px;
  background: var(--grad);
  color: #fff;
}

.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 14px;
  animation: float 5s ease-in-out infinite;
}

.chip-xp {
  top: 12%;
  inset-inline-start: 6%;
  color: var(--orange);
}

.chip-streak {
  top: 46%;
  inset-inline-end: 4%;
  color: var(--orange-deep);
  animation-delay: -1.5s;
}

.chip-ok {
  bottom: 12%;
  inset-inline-start: 10%;
  color: var(--ok);
  animation-delay: -3s;
}

.float-mascot {
  position: absolute;
  bottom: 4%;
  inset-inline-end: 8%;
  animation: float 4.5s ease-in-out infinite;
  animation-delay: -2s;
}

.land-features {
  display: grid;
  gap: 20px;
}

.feature {
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: #f6f3ee;
  align-items: center;
}

.feature-text {
  display: grid;
  gap: 12px;
}

.feature-text h2 {
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 800;
}

.feature-text p {
  color: var(--ink-2);
  font-size: 16px;
  max-width: 480px;
}

.show-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow);
}

.show-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.show-row .art {
  width: 150px;
}

.show-row b {
  font-size: 20px;
}

.show-card .lib-head {
  box-shadow: none;
}

.show-card .profile-tiles {
  margin-top: 0;
}

.show-card .level-banner {
  margin-top: 0;
}

.land-fun {
  padding: 60px 0 20px;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.land-fun h2,
.land-source h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
}

.fun-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  text-align: start;
}

.fun-card {
  padding: 20px;
  border-radius: var(--r-lg);
  display: grid;
  gap: 8px;
  transition: transform .2s ease;
}

.fun-card:hover {
  transform: translateY(-4px) rotate(-.5deg);
}

.fun-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--orange);
}

.fun-card h3 {
  font-size: 18px;
}

.fun-card p {
  color: var(--ink-2);
  font-size: 14px;
}

.land-source {
  display: grid;
  gap: 20px;
  align-items: center;
  margin: 40px 0;
  padding: 32px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.source-bot {
  justify-self: center;
}

.source-text {
  display: grid;
  gap: 16px;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--ink-2);
}

.check-list svg {
  color: var(--ok);
  margin-top: 2px;
}

.land-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--grad);
  color: #fff;
  box-shadow: 0 24px 50px rgba(249, 94, 8, .3);
}

.land-band h2 {
  font-size: 28px;
  font-weight: 800;
}

.land-band p {
  opacity: .9;
}

.land-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 32px 4px 12px;
  color: var(--muted);
  font-size: 13px;
}

/* Onboarding and sign-in */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

.ob-card {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.ob-visual {
  position: relative;
  flex: 1;
  min-height: 340px;
  display: grid;
  place-items: center;
  padding: 70px 20px 32px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}

.ob-top {
  position: absolute;
  top: 14px;
  inset-inline: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ob-art {
  position: relative;
  width: min(340px, 86%);
}

.ob-mascot {
  position: absolute;
  bottom: -10px;
  inset-inline-end: -16px;
  animation: float 4s ease-in-out infinite;
}

.ob-body {
  display: grid;
  gap: 12px;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
}

.dots {
  display: flex;
  gap: 8px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e6ddd2;
  transition: width .2s ease;
}

.dots span.on {
  width: 26px;
  background: var(--orange);
}

.ob-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
}

.ob-text {
  color: var(--ink-2);
}

.slide-btn {
  --fill: 0;
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 8px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
  box-shadow: 0 12px 26px rgba(249, 94, 8, .3);
  overflow: hidden;
}

.slide-knob {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  transition: transform .25s ease;
}

.slide-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  opacity: calc(1 - var(--fill));
}

.slide-arrows {
  position: absolute;
  inset-inline-end: 20px;
  display: flex;
  opacity: .55;
  animation: nudge 1.4s ease infinite;
}

.slide-arrows svg+svg {
  margin-inline-start: -8px;
}

.slide-btn.done .slide-knob {
  background: #fff;
  color: var(--orange);
}

.auth-switch {
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
}

.auth-switch a {
  color: var(--orange);
  font-weight: 700;
}

.auth-wrap {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
}

.auth-art {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 16px)) 16px calc(32px + env(safe-area-inset-bottom, 16px));
  display: grid;
  gap: 16px;
  align-content: start;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--peach);
}

.auth-hero small {
  color: var(--ink-2);
}

.auth-hero h1 {
  font-size: 26px;
  font-weight: 800;
}

.auth-hero-bot {
  margin: -16px 0 -22px;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 14px;
  padding: 0 4px;
}

.field-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--muted);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field-box:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(249, 94, 8, .12);
  color: var(--orange);
}

.field-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  height: 100%;
  color: var(--ink);
}

[dir="rtl"] .field-box input[dir="ltr"] {
  text-align: right;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 10px;
}

.select-field {
  position: relative;
  min-width: 0;
}

.select-btn {
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}

.select-value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-caret {
  flex-shrink: 0;
  color: var(--muted);
}

.field-row .field-box {
  gap: 6px;
  padding: 0 12px;
}

.select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  inset-inline: 0;
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.select-menu[hidden] {
  display: none;
}

.select-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  text-align: start;
  cursor: pointer;
}

.select-opt:active,
.select-opt.on {
  background: var(--orange-soft);
  color: var(--orange);
}

.eye-btn {
  border: 0;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 4px;
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.choice-group .chip-tab {
  position: relative;
}

.form-error {
  min-height: 20px;
  color: var(--bad);
  font-weight: 500;
  font-size: 14px;
}

.fine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Animations */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes pop {
  0% {
    transform: scale(.94);
  }

  60% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  35% {
    transform: translateY(-14px) rotate(-4deg);
  }

  65% {
    transform: translateY(0) rotate(2deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes blink {
  to {
    opacity: .55;
  }
}

@keyframes float-up {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -26px);
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: scale(.6);
  }

  20% {
    opacity: 1;
    transform: scale(1.08);
  }

  70% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-30px) scale(.96);
  }
}

@keyframes nudge {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(5px);
  }
}

[dir="rtl"] .slide-arrows {
  animation-name: nudge-rtl;
}

@keyframes nudge-rtl {

  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Phones only */
@media (max-width: 480px) {
  .hide-phone {
    display: none;
  }

  .stat-pill small {
    display: none;
  }

  .q-text {
    font-size: 19px;
  }

  .result-text h1 {
    font-size: 24px;
  }

  .land-hero-visual {
    min-height: 500px;
  }

  .device {
    width: 240px;
    height: 490px;
  }
}

/* Tablets (iPad) and up */
@media (min-width: 720px) {
  body {
    font-size: 16px;
  }

  .page {
    max-width: 860px;
    padding: 20px 32px 140px;
  }

  .subject-grid,
  .lib-grid,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .suggest-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .prog-top {
    grid-template-columns: 1.3fr 1fr;
  }

  .home-aside {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-aside .level-card {
    grid-column: 1 / -1;
  }

  .result-hero {
    grid-template-columns: 170px 1fr auto;
    text-align: start;
    justify-items: start;
    align-items: center;
  }

  .result-text {
    justify-items: start;
  }

  .hero-card {
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    min-height: 240px;
  }

  .hero-card h2 {
    max-width: none;
    font-size: 28px;
    grid-row: 1;
    padding-inline-end: 40px;
  }

  .hero-art {
    grid-column: 2;
    width: 100%;
  }

  .question-card {
    min-height: 210px;
    padding: 32px 32px 32px;
  }

  .q-text {
    font-size: 26px;
  }

  .choices {
    grid-template-columns: repeat(2, 1fr);
  }

  .choice {
    min-height: 76px;
  }

  .fun-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .land-source {
    grid-template-columns: auto 1fr;
    padding: 40px;
  }

  .ob-card {
    min-height: auto;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-lg);
    margin: 24px;
  }

  .ob-visual {
    border-radius: 0;
    min-height: 600px;
  }

  .ob-body {
    align-content: center;
    padding: 40px;
  }

  .ob-title {
    font-size: 34px;
  }

  .auth-page {
    padding: 24px;
  }
}

/* Landing two-column layout */
@media (min-width: 960px) {
  .landing {
    padding: 0 32px 32px;
  }

  .land-links {
    display: flex;
  }

  .land-hero {
    grid-template-columns: 1.05fr 1fr;
    padding: 40px 0 70px;
  }

  .feature {
    grid-template-columns: 1fr 1fr;
    padding: 40px;
    gap: 40px;
  }

  .feature.reverse .feature-text {
    order: 2;
  }

  .fun-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .land-band {
    padding: 40px 48px;
  }

  .auth-wrap {
    grid-template-columns: 1fr 1fr;
    max-width: 1100px;
    min-height: auto;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-lg);
  }

  .auth-art {
    display: grid;
    align-content: space-between;
    gap: 16px;
    padding: 32px;
    background: linear-gradient(160deg, var(--orange-2), var(--orange) 70%);
    color: #fff;
    position: relative;
    overflow: hidden;
  }

  .auth-art .logo-mark {
    background: #fff;
    color: var(--orange);
  }

  .auth-art-bot {
    justify-self: center;
    animation: float 4s ease-in-out infinite;
  }

  .auth-art h2 {
    font-size: 30px;
    font-weight: 800;
  }

  .auth-art ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
  }

  .auth-art li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
  }

  .auth-card {
    padding: 32px 40px;
    max-width: none;
  }
}

/* Laptops: sidebar instead of the bottom bar */
@media (min-width: 1100px) {
  .layout {
    display: grid;
    grid-template-columns: 270px 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 16px;
    background: #fff;
    border-inline-end: 1px solid var(--line);
  }

  .sidebar-logo {
    padding: 4px 8px;
  }

  .sidebar-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    border-radius: 999px;
    background: var(--grad);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(249, 94, 8, .3);
    transition: transform .15s ease;
  }

  .sidebar-cta:hover {
    transform: translateY(-2px);
  }

  .sidebar-nav {
    display: grid;
    gap: 4px;
  }

  .side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: var(--r-md);
    font-weight: 500;
    color: var(--ink-2);
    transition: background .15s ease;
  }

  .side-link:hover {
    background: var(--bg);
  }

  .side-link.active {
    background: var(--orange-soft);
    color: var(--orange);
    font-weight: 700;
  }

  .side-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--bg);
  }

  .side-user-body {
    flex: 1;
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .side-user-body b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-user-body small {
    color: var(--muted);
    font-size: 12px;
  }

  .bottom-nav,
  .hide-desktop {
    display: none;
  }

  .page {
    max-width: 1180px;
    padding: 24px 40px 60px;
  }

  .toasts {
    bottom: 30px;
  }

  .home-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
  }

  .home-aside {
    position: sticky;
    top: 26px;
    grid-template-columns: 1fr;
    margin-top: 62px;
  }

  .subject-grid,
  .lib-grid,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .badge-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .play-body {
    padding-bottom: 240px;
  }
}

@media (min-width: 1400px) {

  .subject-grid,
  .lib-grid,
  .result-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .home-main .subject-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Pictures (SVG) */
.vis {
  display: block;
}

.vt {
  font-size: 10px;
  fill: #7a736a;
  font-family: var(--font);
}

.vt-strong {
  fill: var(--ink);
  font-weight: 700;
}

.q-visual {
  display: grid;
  place-items: center;
  padding: 8px 0;
  margin-inline-end: 90px;
  align-self: flex-start;
}

.q-visual .ix {
  margin-inline-end: -90px;
}

.choice-art {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.choices.two {
  grid-template-columns: repeat(2, 1fr);
}

.preg-badge {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--fg);
  font-weight: 800;
  border: 2px solid var(--fg);
}

.preg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preg-row b {
  min-width: 38px;
  font-size: 13px;
  color: var(--ink-2);
}

.freq {
  display: grid;
  gap: 8px;
  margin: 4px 0 12px;
}

.freq-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: #ece7df;
}

.freq-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--ink-2);
}

.freq-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 5px;
}

.hl-chart,
.dose-clock {
  margin: 12px 0;
}

.hl-chart svg,
.dose-clock svg {
  direction: ltr;
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
}

.hl-chart figcaption,
.dose-clock figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.ix {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .7);
}

.ix-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
  max-width: 46%;
}

.ix-node b {
  overflow-wrap: anywhere;
}

.ix-mid {
  display: grid;
  place-items: center;
  min-width: 44px;
  color: var(--orange);
  text-align: center;
}

.ix-mid.lowers {
  color: #3b6fd0;
}

.ix-mid small {
  font-size: 11px;
  font-weight: 700;
}

.ix-unknown {
  font-size: 28px;
  font-weight: 800;
  color: var(--muted);
}

.ix-item {
  display: grid;
  gap: 8px;
  padding: 12px 0;
}

.ix-item+.ix-item {
  border-top: 1px solid var(--line);
}

.ix-item p {
  font-size: 14px;
  color: var(--ink-2);
}

/* Matching board */
.match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.match-col {
  display: grid;
  gap: 6px;
  align-content: start;
}

.match-item {
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: center;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.match-item:hover:not(:disabled) {
  border-color: var(--orange-line);
}

.match-item.picked {
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: scale(1.02);
}

.match-item.solved {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  opacity: .85;
}

.match-item.wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  animation: shake .4s ease;
}

.match-hint {
  font-size: 12px;
  margin-bottom: 6px;
}

/* Answer explanation */
.sheet-inner {
  max-height: 82vh;
  overflow-y: auto;
}

.explain:empty {
  display: none;
}

.explain {
  display: grid;
  gap: 8px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.expl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.expl-row p,
.expl-text {
  font-size: 14px;
  color: var(--ink-2);
}

.expl-text b {
  color: var(--ink);
}

/* Drug card */
.dhead {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
}

.dhead-art {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .75);
  flex-shrink: 0;
}

.dhead-body {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
}

.dhead h1 {
  font-size: 26px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dhead p {
  color: var(--ink-2);
  font-size: 14px;
}

.dfacts {
  display: grid;
  gap: 12px;
  padding: 16px 16px;
  margin-top: 12px;
}

.dfact {
  display: grid;
  gap: 8px;
}

.dfact small {
  color: var(--muted);
  font-weight: 600;
}

.dfact p {
  font-size: 14px;
  color: var(--ink-2);
}

.study-btn {
  margin: 12px 0 8px;
}

.dsec {
  margin-top: 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.dsec summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.dsec summary::-webkit-details-marker {
  display: none;
}

.dsec summary b {
  flex: 1;
}

.dsec-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--orange-soft);
  color: var(--orange);
}

.dsec-arrow {
  color: var(--muted);
  transition: transform .2s ease;
  transform: rotate(90deg);
}

.dsec[open] .dsec-arrow {
  transform: rotate(-90deg);
}

.dsec-body {
  padding: 4px 16px 16px;
  display: grid;
  gap: 12px;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-cloud .chip {
  background: var(--bg);
  border: 1px solid var(--line);
}

.mini-h {
  font-size: 14px;
  margin-top: 8px;
  color: var(--ink-2);
}

.ind {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.ind p {
  font-size: 14px;
  color: var(--ink-2);
}

.kv {
  display: grid;
  gap: 2px;
}

.kv p {
  font-size: 14px;
  color: var(--ink-2);
}

.organ-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.organ-card p {
  font-size: 14px;
  color: var(--ink-2);
}

.tier {
  display: grid;
  gap: 8px;
}

.tier b {
  font-size: 13px;
  color: var(--ink-2);
}

.tier-common .chip-cloud .chip {
  background: var(--orange-soft);
  border-color: var(--orange-line);
}

.plain-list {
  margin: 0;
  padding-inline-start: 20px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.brand-lines {
  display: grid;
  gap: 8px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.brand-line>div {
  flex: 1;
  min-width: 0;
  display: grid;
}

.brand-line small {
  color: var(--muted);
}

.dnote {
  margin-top: 16px;
  font-size: 12px;
}

.result-actions-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-foot .pill-btn {
  background: #fff;
}

.result-foot .pill-btn.hot {
  background: var(--grad);
}

.chip svg.vis {
  margin-inline-end: 2px;
}

@media (min-width: 720px) {
  .match-item {
    min-height: 44px;
    font-size: 13.5px;
  }

  .dsec-body {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1100px) {
  .dcard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
  }
}

/* Lessons */
.lesson-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.lesson-head-art {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  background: none;
}

.lesson-head h1 {
  font-size: 22px;
  font-weight: 800;
}

.lesson-head p {
  color: var(--ink-2);
  font-size: 14px;
}

.stage-path {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.stage-n {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  font-weight: 800;
  flex-shrink: 0;
}

.stage-body {
  flex: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.stage-body b {
  font-size: 16px;
}

.stage-body small {
  color: var(--ink-2);
  font-size: 13px;
}

.stage-meta {
  color: var(--muted) !important;
}

.stage-passed .stage-n {
  background: var(--ok);
  color: #fff;
}

.stage-open .stage-n {
  background: var(--grad);
  color: #fff;
}

.stage-locked {
  opacity: .6;
}

.stage-lock {
  color: var(--muted);
}

.contrast {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.contrast-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: baseline;
  font-size: 14px;
}

.contrast-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.contrast-label {
  font-weight: 700;
  color: var(--ink-2);
  font-size: 13px;
}

.lesson-head {
  width: 100%;
  box-sizing: border-box;
}

.lesson-head>div:last-child {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.lesson-head-art svg {
  max-width: 100%;
  height: auto;
}

/* Subjects that are outside the plan, the plan card, and the admin panel */
.subject-card.is-locked {
  opacity: .7;
}

.pick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--peach);
  color: var(--ink);
}

.pick-card>span {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pick-card small {
  color: var(--ink-2);
  font-size: 13px;
}

.upgrade-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px 20px;
  margin-top: 12px;
}

.upgrade-card h2 {
  font-size: 20px;
  font-weight: 800;
}

.upgrade-card p {
  color: var(--ink-2);
  max-width: 420px;
}

.btn-danger {
  background: var(--bad-soft);
  color: var(--bad);
}

/* One column that never grows past the screen: a wide row (such as the filter chips) scrolls instead of pushing the cards out. */
.admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.admin-stats .stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  text-align: center;
}

.admin-stats .stat b {
  font-size: 24px;
  font-weight: 800;
  direction: ltr;
}

.admin-stats .stat span {
  color: var(--muted);
  font-size: 13px;
}

.admin-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.admin-row.is-off {
  opacity: .65;
}

.admin-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.admin-body b {
  overflow-wrap: anywhere;
}

.admin-body small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions .btn {
  min-height: 34px;
}

@media (min-width: 720px) {
  .admin-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}



/* ---- Native phone feel ---- */
html,
body {
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

input,
textarea,
select {
  font-size: 16px;
}

.page {
  animation: page-in .28s cubic-bezier(.2, .8, .2, 1);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.bottom-nav {
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.page {
  padding-bottom: calc(130px + env(safe-area-inset-bottom));
}

.icon-btn,
.nav-btn,
.btn,
.chip-tab,
.choice,
.suggest,
.subject-card,
.stage,
.start-hero {
  touch-action: manipulation;
}

.btn:active,
.subject-card:active,
.suggest:active,
.start-hero:active,
.choice:active {
  transform: scale(.98);
}

/* ---- Start card ("ابدأ التدريب") ---- */
.start-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 176px;
  padding: 20px 20px 20px 16px;
  border-radius: var(--r-lg);
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(135deg, var(--orange-soft) 0%, var(--orange-tint) 55%, var(--orange-2) 100%);
  box-shadow: 0 18px 40px rgba(249, 94, 8, .18);
}

.start-hero::after {
  content: '';
  position: absolute;
  inset-inline-end: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  pointer-events: none;
}

.start-text {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  gap: 8px;
  min-width: 0;
  justify-items: start;
}

.start-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  font-size: 12px;
  font-weight: 700;
  color: var(--orange);
}

.start-text h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.start-text p {
  font-size: 15px;
  color: var(--ink-2);
}

.start-cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.start-bot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 118px;
  animation: float 4s ease-in-out infinite;
}

.start-bot svg {
  width: 100%;
  height: auto;
}

/* ---- Side menu (phones) ---- */
.drawer-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.drawer-wrap:not([hidden]) {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 25, .35);
  opacity: 0;
  transition: opacity .28s ease;
}

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: min(84vw, 330px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: calc(22px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  box-shadow: 0 0 40px rgba(28, 27, 25, .18);
  transform: translateX(var(--off, 105%));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

:root[dir="ltr"] .drawer {
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  --off: -105%;
}

:root[dir="rtl"] .drawer,
:root:not([dir]) .drawer {
  --off: 105%;
}

.drawer-wrap.open .drawer {
  transform: translateX(0);
}

.drawer-wrap.open .drawer-backdrop {
  opacity: 1;
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
}

.drawer-user>div {
  display: grid;
  min-width: 0;
}

.drawer-user b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-user small {
  color: var(--muted);
  font-size: 12px;
}

.drawer-nav {
  display: grid;
  gap: 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 12px;
  border-radius: var(--r-md);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  background: none;
  border: 0;
  width: 100%;
  text-align: start;
}

.drawer-link span {
  flex: 1;
}

.drawer-link:active {
  background: #fff;
}

.drawer-link.active {
  background: var(--orange-soft);
  color: var(--orange);
}

.drawer-arrow {
  color: var(--muted);
}

.drawer-out {
  margin-top: auto;
  color: var(--bad);
}

/* ---- Confirm sheet (replaces the browser dialog) ---- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.sheet-wrap.open {
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 27, 25, .4);
  opacity: 0;
  transition: opacity .25s ease;
}

.confirm-sheet {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  margin: 0 auto;
  width: min(480px, 100%);
  display: grid;
  gap: 12px;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: #fff;
  box-shadow: 0 -16px 40px rgba(28, 27, 25, .16);
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

.sheet-wrap.open .confirm-sheet {
  transform: none;
}

.sheet-wrap.open .sheet-backdrop {
  opacity: 1;
}

.confirm-sheet .grab {
  justify-self: center;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #e2dbd1;
  margin-bottom: 8px;
}

.confirm-sheet h3 {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.confirm-sheet p {
  text-align: center;
  color: var(--ink-2);
  font-size: 15px;
  margin-bottom: 8px;
}

.btn-danger-solid {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(229, 72, 77, .25);
}

/* ---- Admin area ---- */
.admin-layout .page {
  padding-top: calc(14px + env(safe-area-inset-top));
}

.admin-search {
  margin-top: 4px;
}

.admin-plan {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.admin-plan h3 {
  font-size: 17px;
  font-weight: 800;
}

.admin-plan p {
  color: var(--ink-2);
  font-size: 14px;
}

.topbar-spacer {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}


/* ---- Admin dashboard ---- */
.vt {
  font-size: 10px;
  fill: #7a736a;
  font-family: var(--font);
}

.chart {
  width: 100%;
  height: auto;
  display: block;
}

.admin-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.panel-head h3 {
  font-size: 16px;
  font-weight: 800;
}

.split {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: #ece7df;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 5px;
}

.subj-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 12px;
}

.subj-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subj-acc {
  font-size: 13px;
  font-weight: 800;
  direction: ltr;
  min-width: 40px;
  text-align: end;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: var(--r-md);
  background: none;
  border: 0;
  text-align: start;
  color: var(--ink);
}

.recent-row:active {
  background: var(--bg);
}

.recent-body {
  flex: 1;
  display: grid;
  min-width: 0;
}

.recent-body small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row {
  display: grid;
  gap: 12px;
  padding: 12px;
  width: 100%;
  text-align: start;
  color: var(--ink);
  cursor: pointer;
}

.admin-row .admin-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-row .admin-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.admin-open {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--orange);
  font-weight: 700;
  font-size: 13px;
}

.admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0;
}

/* The user cards stay inside the screen: the list and each card may shrink, and long names, emails and numbers wrap. */
.admin-list,
.admin-row,
.admin-row>* {
  min-width: 0;
  max-width: 100%;
}

.admin-row {
  box-sizing: border-box;
}

.admin-row .admin-body b,
.admin-row .admin-body small {
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-contact {
  display: grid;
  gap: 1px;
}

[dir="rtl"] .admin-contact small {
  text-align: right;
}

.admin-users-bar .admin-search {
  min-width: 0;
}

.sheet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sheet-stats div {
  display: grid;
  gap: 2px;
  padding: 12px 4px;
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: center;
}

.sheet-stats b {
  font-size: 17px;
  font-weight: 800;
  direction: ltr;
}

.sheet-stats span {
  font-size: 11px;
  color: var(--muted);
}

.sheet-subjects {
  display: grid;
  gap: 8px;
}

.sheet-meta {
  font-size: 13px;
  text-align: center;
}

.action-sheet .action-list {
  display: grid;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  width: 100%;
  text-align: start;
}

.action-item span {
  flex: 1;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-users-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-users-bar .admin-search {
  flex: 1;
  margin: 0;
}

.admin-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-weight: 700;
  white-space: nowrap;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

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



/* ---- App behaviour: one scroll container, no scroll bars, no zoom, no selection ---- */
html,
body {
  height: 100%;
  overflow: hidden;
  touch-action: pan-x pan-y;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
}

#app {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

img,
svg,
a,
button {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ---- One header and one gutter on every screen ---- */
.page {
  --gutter: 16px;
  padding-top: 0;
}

@media (min-width: 720px) {
  .page {
    --gutter: 28px;
  }
}

@media (min-width: 1100px) {
  .page {
    --gutter: 40px;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 calc(var(--gutter) * -1) 12px;
  padding: 8px var(--gutter);
  padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(252, 250, 246, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* ---- More colour on the start card ---- */
.start-hero {
  background: linear-gradient(135deg, var(--orange-tint) 0%, var(--orange-2) 100%);
  box-shadow: 0 18px 36px rgba(249, 94, 8, .24);
}

.start-hero::after {
  background: rgba(255, 255, 255, .28);
}

.start-cta {
  background: var(--ink);
  color: #fff;
}

/* ---- Study cards, interaction checker, reminder ---- */
.study-link {
  margin-bottom: 12px;
}

.study-stage {
  margin: 16px 0;
}

.flip {
  perspective: 1200px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  min-height: 300px;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  transform-style: preserve-3d;
}

.flip.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  border-radius: var(--r-lg);
  text-align: center;
  border: 1px solid var(--line);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-front small,
.flip-back small {
  color: var(--ink-2);
  font-weight: 700;
  font-size: 13px;
}

.flip-front b {
  font-size: 28px;
  font-weight: 800;
}

.flip-front span {
  color: var(--ink-2);
  font-size: 14px;
  margin-top: -4px;
}

.flip-front em {
  margin-top: 12px;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

.flip-back {
  transform: rotateY(180deg);
  background: #fff;
}

.flip-generic {
  font-size: 28px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.flip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.study-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.study-actions[hidden] {
  display: none;
}

.checker {
  display: grid;
  gap: 16px;
  padding: 16px;
  margin-top: 12px;
}

.picker {
  display: grid;
  gap: 8px;
}

.picker small {
  font-weight: 700;
  color: var(--ink-2);
  font-size: 13px;
}

.picker-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-md);
  background: var(--orange-soft);
}

.suggest-box {
  display: grid;
  gap: 4px;
}

.suggest-item {
  text-align: start;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  color: var(--ink);
}

.suggest-item:active {
  background: var(--bg);
}

.checker-result {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.checker-none {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--ok-soft);
  color: var(--ink);
}

.checker-none p {
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 4px;
}

.remind-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 12px;
  border-radius: var(--r-md);
  background: var(--orange-soft);
  color: var(--ink);
}

.remind-card>span {
  flex: 1;
  display: grid;
}

.remind-card small {
  color: var(--ink-2);
  font-size: 13px;
}

.remind-card svg:first-child {
  color: var(--orange);
}

/* ---- Phone home and profile ---- */
.greet {
  font-size: 22px;
  font-weight: 800;
  margin: 4px 2px 12px;
}

.goal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.goal-row .goal-body {
  flex: 1;
  display: grid;
  min-width: 0;
}

.goal-row .goal-body b {
  font-size: 15px;
}

.goal-row .goal-body small {
  color: var(--muted);
  font-size: 12px;
}

.goal-row .goal-streak {
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--orange-soft);
  min-width: 50px;
}

.goal-row .goal-streak b {
  font-size: 15px;
}

.goal-row .goal-streak small {
  font-size: 10px;
  color: var(--ink-2);
  white-space: nowrap;
}

.subject-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.subject-tile {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 14px;
  border-radius: var(--r-lg);
  color: var(--ink);
  align-content: space-between;
}

.subject-tile .tile-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.subject-tile .tile-meta {
  font-size: 12px;
  color: var(--ink-2);
}

.subject-tile.is-locked {
  opacity: .6;
}

.subject-tile .tile-lock {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  color: var(--ink-2);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 0;
}

.profile-head .profile-id {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: start;
}

.profile-head h1 {
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.profile-head small {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 12px;
}

.profile-stats div {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 14px 6px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.profile-stats b {
  font-size: 22px;
  font-weight: 800;
  direction: ltr;
}

.profile-stats span {
  font-size: 12px;
  color: var(--ink-2);
}

.group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 20px 4px 8px;
}

.settings-list .setting {
  min-height: 56px;
  padding: 10px 14px;
  border-radius: var(--r-md);
}

.settings-list .setting>.mini-select {
  flex-shrink: 0;
  max-width: 46%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 14px;
}

.settings-list .setting-body small {
  white-space: normal;
}

.btn-signout {
  margin-top: 20px;
}

/* ---- Choice sheet and picker buttons ---- */
.pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  max-width: 100%;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.pick-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.choice-sheet {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-sheet h3 {
  flex-shrink: 0;
}

.choice-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  max-height: 56vh;
  padding: 2px;
}

.choice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
  text-align: start;
  width: 100%;
}

.choice-item:active {
  background: var(--bg);
}

.choice-item[disabled] {
  opacity: .55;
}

.choice-item.selected {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.choice-item.selected svg {
  color: var(--orange);
}

.choice-text {
  display: grid;
  min-width: 0;
}

.choice-text b {
  font-size: 16px;
  font-weight: 700;
}

.choice-text small {
  color: var(--muted);
  font-size: 12px;
}

/* ---- Landing: real screenshots ---- */
.landing {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.land-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.land-hero {
  padding: 28px 0 24px;
  display: grid;
  gap: 14px;
}

.land-hero h1 {
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.2;
}

.land-hero .lead {
  color: var(--ink-2);
  font-size: 17px;
  max-width: 560px;
}

.land-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shot {
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 28px rgba(60, 40, 20, .08);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.land-shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0 32px;
}

.land-point {
  display: grid;
  gap: 20px;
  align-items: center;
  margin: 36px 0;
}

.land-point-text h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}

.land-point-text p {
  color: var(--ink-2);
  font-size: 16px;
  max-width: 520px;
}

.land-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  margin: 40px 0 24px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
}

.land-band h2 {
  font-size: 22px;
  font-weight: 800;
}

.land-band p {
  opacity: .8;
}

.land-band .btn-white {
  color: var(--ink);
}

.land-foot {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 0 0;
}

@media (max-width: 719px) {
  .land-shots {
    grid-template-columns: 1fr 1fr;
  }

  .land-shots .shot:last-child {
    display: none;
  }
}

@media (min-width: 720px) {
  .land-point {
    grid-template-columns: 1fr 260px;
  }

  .land-point:nth-of-type(even) {
    grid-template-columns: 260px 1fr;
  }

  .land-point:nth-of-type(even) .land-point-text {
    order: 2;
  }
}

/* ---- Full screen on phones, a compact layout, and the home header ---- */
.app-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 2px;
}

.app-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
}

.app-head-title {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  --gutter: 14px;
  padding-top: 8px;
}

@media (max-width: 1099px) {
  .bottom-nav {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    border-radius: 22px 22px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(60, 40, 20, .06);
    background: rgba(255, 255, 255, .97);
  }

  .nav-btn {
    width: 46px;
    height: 46px;
  }

  .nav-center {
    width: 58px;
    height: 58px;
    margin-top: -22px;
  }

  .page {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

/* Tighter cards: less padding, smaller gaps between sections. */
.start-hero {
  min-height: 136px;
  padding: 16px 16px 16px 14px;
  border-radius: var(--r-lg);
}

.start-bot {
  width: 92px;
}

.start-text h2 {
  font-size: 22px;
}

.start-cta {
  margin-top: 4px;
  padding: 9px 14px;
  font-size: 13px;
}

.goal-row {
  margin-top: 10px;
  padding: 10px 12px;
}

.suggest {
  padding: 9px 12px;
  border-radius: var(--r-md);
  gap: 10px;
}

.suggest-ico {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
}

.suggest-list {
  gap: 8px;
}

.section-head {
  margin: 16px 2px 8px;
}

.subject-tiles {
  gap: 8px;
}

.subject-tile {
  min-height: 84px;
  padding: 11px;
  border-radius: var(--r-md);
}

.subject-tile .tile-name {
  font-size: 14px;
}

.profile-head {
  gap: 12px;
}

.profile-stats {
  margin: 12px 0 8px;
  gap: 8px;
}

.profile-stats div {
  padding: 9px 4px;
  border-radius: var(--r-md);
}

.profile-stats b {
  font-size: 19px;
}

.level-banner {
  margin-top: 8px;
  padding: 10px;
  border-radius: var(--r-md);
}

.group-title {
  margin: 14px 4px 6px;
}

.settings-list {
  gap: 6px;
}

.settings-list .setting {
  min-height: 50px;
  padding: 8px 12px;
  gap: 10px;
  border-radius: var(--r-md);
}

.settings-list .setting-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
}

.settings-list .setting-body b {
  font-size: 15px;
}

.settings-list .setting-body small {
  font-size: 12px;
  line-height: 1.35;
}

.pick-btn {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-signout {
  margin-top: 14px;
  min-height: 48px;
}

.choice-item {
  min-height: 52px;
  padding: 8px 14px;
}

/* ---- Capsule navigation, content kept above it, and a quieter header ---- */
@media (max-width: 1099px) {
  .bottom-nav {
    inset: auto 0 calc(12px + env(safe-area-inset-bottom));
    margin: 0 auto;
    width: min(420px, calc(100% - 28px));
    max-width: 420px;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, .92);
  }

  .nav-btn {
    width: 50px;
    height: 50px;
  }

  .nav-center {
    width: 64px;
    height: 64px;
    margin-top: -26px;
  }

  .page {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }
}

.app-head {
  gap: 8px;
  padding: 4px 0 0;
}

.app-head-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.app-head-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.app-head .icon-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: 0;
  box-shadow: none;
}

.start-kicker {
  display: none;
}

/* ---- Room for the nav bar at the end of every screen ---- */
.page::after {
  content: '';
  display: block;
  height: calc(100px + env(safe-area-inset-bottom));
}

/* ---- Profile header ---- */
.profile-hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 16px 16px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.profile-hero h1 {
  font-size: 20px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-hero small {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-hero .chip {
  margin-top: 4px;
}

.avatar-ring {
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(#f95e08, var(--orange-2), #f95e08);
}

.avatar-ring .avatar {
  border: 3px solid #fff;
}

/* ---- One spacing system and smaller text ---- */
body {
  font-size: 14px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page>* {
  margin: 0 !important;
}

.page>.topbar {
  margin: 0 calc(var(--gutter) * -1) !important;
}

.suggest-list,
.subject-tiles,
.settings-list,
.admin-list,
.lib-grid,
.result-grid,
.subject-grid,
.stage-path,
.badge-grid,
.subject-list {
  gap: 10px;
}

.topbar {
  gap: 10px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
}

.section-title {
  font-size: 17px;
}

.section-head {
  margin: 0;
}

.setting-body b,
.suggest-body b {
  font-size: 14px;
}

.subject-tile .tile-name {
  font-size: 13px;
}

.profile-hero h1 {
  font-size: 18px;
}

.start-text h2 {
  font-size: 20px;
}

.q-text {
  font-size: 20px;
}

.choice {
  font-size: 15px;
}

.app-head-title {
  font-size: 14px;
}

.goal-row .goal-body b {
  font-size: 14px;
}

/* ---- Horizontal chip rows run edge to edge, with no hard cut at the gutter ---- */
.filter-row,
.chip-row,
.subject-chips {
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter);
  scroll-padding: 0 var(--gutter);
}

/* ---- Centre button: white, with Capsy\x27s head ---- */
.nav-center {
  background: #ffffff;
  border: 2px solid var(--orange);
  box-shadow: 0 10px 22px rgba(249, 94, 8, .28);
}

.nav-center .capsy-face {
  display: block;
}

/* ---- Subject tiles: the lock stays visible, long names wrap ---- */
.subject-tile .tile-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.subject-tile .tile-lock {
  position: static;
  order: -1;
  justify-self: start;
  color: var(--ink-2);
}

/* ---- Header: solid, with no line, so content does not show through ---- */
.topbar {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: 0;
}

/* ---- Filter chips: soft pills, no borders ---- */
.filter-row {
  gap: 8px;
}

.filter-row .chip-tab {
  border: 0;
  background: #efe9e1;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  min-height: 36px;
  padding: 0 14px;
  box-shadow: none;
}

.filter-row .chip-tab.active {
  background: var(--orange);
  color: #fff;
  box-shadow: none;
}

/* ---- Landing: the live app in a phone frame, with tabs to switch screens ---- */
.land-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 32px 0;
}

.land-points .card {
  padding: 18px;
  display: grid;
  gap: 6px;
}

.land-points h2 {
  font-size: 17px;
  font-weight: 800;
}

.land-points p {
  color: var(--ink-2);
  font-size: 14px;
}

/* The live app keeps a real phone size (390 x 800) and is scaled to fit, inside a phone frame. */

/* ---- Every screen scrolls as one full page: the header moves with the content, nothing is cut at the top ---- */
html {
  background: var(--bg);
}

.topbar {
  position: relative;
  top: auto;
}

.topbar-start {
  flex: 1;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Filter row on the search screen runs from screen edge to screen edge ---- */
.page>.filter-row {
  margin: 0 calc(var(--gutter) * -1) !important;
  padding: 2px var(--gutter);
  scroll-padding: 0 var(--gutter);
}

/* ---- Home start card: flat, no glow spilling onto the cards below ---- */
.start-hero {
  box-shadow: none;
}

/* ---- Answer sheet: a floating card clear of the screen edges, long names wrap ---- */
.sheet {
  inset: auto 10px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(calc(100% + 40px));
}

.sheet.show {
  transform: none;
}

.sheet-inner,
.sheet.bad .sheet-inner {
  max-width: 620px;
  max-height: 72vh;
  padding: 12px;
  gap: 10px;
  border: 0;
  border-radius: 26px;
  box-shadow: 0 14px 44px rgba(28, 27, 25, .2);
}

.sheet-head {
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--ok-soft);
  font-size: 16px;
  gap: 10px;
}

.sheet.bad .sheet-head {
  background: var(--bad-soft);
}

.sheet-head b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sheet-ico {
  width: 34px;
  height: 34px;
}

.xp-gain {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.sheet-correct {
  padding: 0 4px;
  font-size: 14px;
}

.sheet-inner>*,
.drug-fact>*,
.contrast-row>*,
.expl-row>*,
.expl-text,
.sheet-correct b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sheet-actions .btn-primary {
  box-shadow: none;
}

/* ---- Calmer screens: no watermark letters, plain rows, clear drug names ---- */
.swoosh::before,
.lib-head::before {
  display: none;
}

.q-type {
  margin-inline-end: 90px;
  max-width: calc(100% - 90px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-text {
  font-size: 19px;
  line-height: 1.6;
  margin-inline-end: 90px;
}

.lib-title {
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.lib-brands {
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.lib-kind {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.flip-back b {
  font-size: 20px;
  font-weight: 800;
}

.flip-back span {
  font-size: 14px;
  color: var(--ink-2);
}

.organ-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.organ-row b {
  display: block;
  margin-bottom: 2px;
}

.organ-row p {
  font-size: 14px;
  color: var(--ink-2);
}

.organ-row .tag {
  flex-shrink: 0;
}

.tag.bad {
  background: var(--bad-soft);
  color: var(--bad);
}

/* ---- Clinical tools: a clear strength table, a collapsed English summary ---- */
.iv-table {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.iv-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: 14px;
}

.iv-row b {
  font-weight: 800;
  white-space: nowrap;
}

.iv-row small {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.preg-more {
  margin-top: 10px;
}

.preg-more summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.preg-more p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---- IV dilution: compatible and incompatible solutions, each in its own colour ---- */
.iv-group {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
}

.iv-group b {
  font-weight: 800;
}

.iv-group.ok {
  background: var(--ok-soft);
}

.iv-group.ok b {
  color: var(--ok);
}

.iv-group.bad {
  background: var(--bad-soft);
}

.iv-group.bad b {
  color: var(--bad);
}

.iv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.iv-chips .chip {
  font-size: 12px;
}

/* ---- Clinical lists: cards stay inside the screen and long text wraps ---- */
.iv-list,
.preg-list {
  grid-template-columns: minmax(0, 1fr);
}

.iv-list>*,
.preg-list>* {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.iv-row b,
.iv-row small {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---- Home: one subject, three stages, one button ---- */
.path-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-lg);
}

.path-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.path-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: none;
}

.path-title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.path-title small {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.path-title h2 {
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.path-steps {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.path-step {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .55);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--ink-2);
}

.path-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(28, 27, 25, .1);
  font-size: 12px;
  font-weight: 800;
}

.path-step.is-done .path-dot {
  background: var(--ok);
  color: #fff;
}

.path-step.is-now {
  background: #fff;
  color: var(--ink);
}

.path-step.is-now .path-dot {
  background: var(--orange);
  color: #fff;
}

.path-done {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.path-link {
  justify-self: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.pick-card {
  width: 100%;
  text-align: start;
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tool-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 2px;
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 390px) {
  .tool-row {
    gap: 4px;
  }

  .tool-tile {
    padding: 8px 1px;
    font-size: 10px;
  }

  .tool-tile span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
}

/* ---- Pregnancy: the allowed list and the card game ---- */
.preg-rule {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--peach);
}

.preg-rule h1 {
  font-size: 20px;
  font-weight: 800;
}

.preg-rule p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}

.preg-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  padding: 28px 16px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
}

.preg-card h2 {
  font-size: 24px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.preg-card small {
  color: var(--ink-2);
}

.preg-card.is-right {
  background: var(--ok-soft);
  border-color: var(--ok);
}

.preg-card.is-wrong {
  background: var(--bad-soft);
  border-color: var(--bad);
}

.preg-answer {
  margin-top: 8px;
  font-size: 15px;
}

.preg-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---- Pickers in the same style as the rest of the app ---- */
.pick-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
  text-align: start;
}

.pick-field b {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.choice-search {
  width: 100%;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: #efe9e1;
  font-size: 16px;
  outline: none;
}

.choice-item[hidden] {
  display: none;
}

/* ---- IV dilution: a closed row per drug, four steps inside ---- */
.iv-item {
  padding: 0;
  overflow: hidden;
}

.iv-item>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.iv-item>summary::-webkit-details-marker {
  display: none;
}

.iv-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.iv-name b {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.iv-name small,
.iv-name .ar-title {
  color: var(--ink-2);
  font-size: 13px;
}

.iv-item[open]>summary .dsec-arrow {
  transform: rotate(90deg);
}

.iv-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.iv-step {
  display: grid;
  gap: 6px;
}

.iv-step h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.iv-n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
}

.iv-line {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.iv-line.is-head {
  background: transparent;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.iv-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
}

/* ---- Learn first: classes, drugs, uses, brands ---- */
.learn-list {
  display: grid;
  gap: 10px;
}

.learn-class {
  padding: 0;
  overflow: hidden;
}

.learn-class>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.learn-class>summary::-webkit-details-marker {
  display: none;
}

.learn-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.learn-drug {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
}

.learn-drug b {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.learn-drug span {
  font-size: 13px;
  color: var(--ink-2);
}

.learn-drug small {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.learn-count {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
}

.learn-notes {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--ok-soft);
}

.learn-notes h4 {
  font-size: 14px;
  font-weight: 800;
}

.learn-notes p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
}

.learn-notes b {
  color: var(--ink);
}

/* ---- Subject card: lighter and calmer ---- */
.path-card {
  gap: 14px;
  padding: 16px;
  box-shadow: none;
}

.path-ico {
  width: 44px;
  height: 44px;
  background: none;
}

.path-title small {
  font-weight: 500;
}

.path-title h2 {
  font-size: 16px;
  font-weight: 600;
}

.path-card .pick-btn {
  font-weight: 500;
  font-size: 12px;
  background: rgba(255, 255, 255, .6);
}

.path-steps {
  gap: 4px;
}

.path-step {
  background: transparent;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 500;
  gap: 6px;
}

.path-step.is-now {
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.path-dot {
  width: 22px;
  height: 22px;
  font-weight: 600;
}

.path-card .btn {
  min-height: 46px;
  font-weight: 600;
  box-shadow: none;
}

.path-link {
  font-weight: 500;
  font-size: 12px;
}

.path-done {
  font-size: 13px;
}

/* ---- Drug card: one column, plain rows, a clear order ---- */
.dcard-head {
  display: grid;
  gap: 4px;
  padding: 4px 2px 0;
}

.dcard-class {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.dcard-head h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dcard-head p {
  font-size: 14px;
  color: var(--ink-2);
}

.dcard-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
}

.dfact {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.dfact small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.dfact p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.dcats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dcat {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  color: var(--ink-2);
}

.dcat b {
  font-weight: 800;
  color: var(--ink);
  margin-inline-start: 4px;
}

.dcard-cta {
  justify-content: center;
}

.dcard-list {
  display: grid;
  gap: 8px;
}

.dsec {
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.dsec>summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
}

.dsec>summary::-webkit-details-marker {
  display: none;
}

.dsec>summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-inline-end: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg);
  transition: transform .2s;
  flex-shrink: 0;
  margin-inline-start: 6px;
}

.dsec[open]>summary::after {
  transform: rotate(45deg);
}

.dcount {
  margin-inline-start: auto;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.dsec-body {
  display: grid;
  gap: 0;
  padding: 0 16px 14px;
  border-top: 1px solid var(--line);
}

.drow {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.drow:last-child {
  border-bottom: 0;
}

.drow>b {
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.drow p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.dhint {
  font-size: 12px;
  color: var(--muted);
}

.dtag {
  justify-self: start;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.dtag.tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.dtag.tag-warn {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.dtag.tag-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.dsub {
  margin: 12px 0 2px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
}

.dlist {
  display: grid;
  gap: 6px;
  padding-inline-start: 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.dlist li {
  overflow-wrap: anywhere;
}

.dnone {
  font-size: 13px;
  color: var(--muted);
}

.dbrand {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dbrand:last-child {
  border-bottom: 0;
}

.dbrand b {
  font-size: 15px;
  font-weight: 800;
}

.dbrand small {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tier-common .dsec-body,
.tier-common {
  color: var(--ink);
}

.dsec .drow .dlist {
  font-size: 13px;
}

.dsec .drow b {
  font-size: 13px;
}

/* ---- BNF 81 Clinical Panel & Regimens ---- */
.bnf-panel {
  display: grid;
  gap: 12px;
  padding: 12px 0 4px;
}

.bnf-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: start;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.08);
  border: 1px solid rgba(30, 58, 138, 0.2);
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}

.bnf-panel-badge small {
  opacity: 0.75;
  font-weight: 600;
  margin-inline-start: 4px;
}

.bnf-regimens {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.bnf-reg-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.bnf-reg-pop {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
}

.bnf-route {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.bnf-reg-ind {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.bnf-reg-dose {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---- Calculator strength choices: compact, not oversized ---- */
.field-label .chip-tabs {
  gap: 6px;
}

.field-label .chip-tabs .chip-tab {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Phone: the first screens use smaller, lighter headings and a shorter picture, so more content fits on screen. */
@media (max-width: 719px) {
  .ob-visual {
    flex: 0 0 auto;
    height: 36vh;
    min-height: 240px;
    max-height: 320px;
  }

  .ob-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
  }

  .ob-text {
    font-size: 15px;
    line-height: 1.6;
  }

  .land-hero {
    padding: 16px 0 24px;
  }

  .land-hero h1 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
  }

  .land-hero .lead {
    font-size: 15px;
  }

  .land-hero-visual {
    min-height: 0;
    padding: 16px 0;
  }
}

/* ==========================================================================
   Responsive Auth Pages (Signup, Login, Onboarding)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  width: 100%;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-art {
  display: none !important;
}

@media (min-width: 860px) {
  .auth-wrap {
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 28px;
  }

  .auth-art {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px 24px;
    background: var(--peach);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
  }

  .auth-art h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 16px 0 10px;
    color: var(--ink);
  }

  .auth-art ul {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 10px;
    text-align: start;
  }

  .auth-art li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-2);
  }

  .auth-art li svg {
    color: var(--ok);
  }
}

.auth-card {
  background: #ffffff;
  border-radius: var(--r-lg);
  padding: 18px 16px;
  box-shadow: 0 8px 30px rgba(60, 40, 20, .06);
  border: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

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

/* The back and language icons sit in the middle of their round buttons (a link does not centre its icon by itself). */
.auth-top .icon-btn {
  display: grid;
  place-items: center;
  padding: 0;
}

/* On phones the sign-up form fits one screen: a compact header card with a small robot, and the card in the middle of the screen. */
@media (max-width: 719px) {
  .auth-wrap {
    justify-content: center;
  }

  .auth-card {
    gap: 12px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .auth-card .auth-hero {
    padding: 10px 14px;
  }

  .auth-card .auth-hero-bot {
    margin: -8px 0 -12px;
  }

  .auth-card .auth-hero-bot svg {
    width: 58px;
    height: auto;
  }

  .auth-card .form {
    gap: 8px;
  }

  .auth-card .field {
    gap: 4px;
  }

  .auth-card .field-label {
    font-size: 13px;
  }

  .auth-card .field-box {
    height: 46px;
  }

  .auth-card .field-box input,
  .auth-card .select-btn,
  .auth-card .select-opt {
    font-size: 14px;
  }

  .auth-card .btn-lg {
    height: 48px;
    min-height: 48px;
    font-size: 15px;
  }

  .auth-card .auth-switch {
    font-size: 13px;
  }
}

/* The install bar would cover the end of the sign-up and log-in forms, so it waits until after sign-in. */
body:has(.auth-page) .install-bar {
  display: none;
}

body.has-install-bar:has(.auth-page) #app {
  padding-bottom: 0;
}

.auth-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--orange-soft);
  border-radius: var(--r-md);
  margin-bottom: 2px;
  border: none;
}

.auth-hero small {
  color: var(--orange);
  font-weight: 700;
  font-size: 11.5px;
  display: block;
}

.auth-hero h1 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 1px;
}

.auth-hero-bot {
  flex-shrink: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0 12px;
  min-height: 42px;
  transition: all .15s ease;
}

.field-box:focus-within {
  border-color: var(--orange);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(249, 94, 8, .12);
}

.field-box svg {
  color: var(--muted);
  flex-shrink: 0;
  margin-inline-end: 8px;
  width: 18px;
  height: 18px;
}

.field-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  width: 100%;
}

.eye-btn {
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
}

.carrier-badge {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
  transition: all .2s ease;
}

.carrier-badge.show {
  display: inline-flex;
}

.carrier-badge.carrier-zain {
  background: rgba(0, 135, 68, 0.1);
  color: #008744;
  border: 1px solid rgba(0, 135, 68, 0.25);
}

.carrier-badge.carrier-asiacell {
  background: rgba(227, 6, 19, 0.08);
  color: #d32f2f;
  border: 1px solid rgba(227, 6, 19, 0.25);
}

.carrier-badge.carrier-korek {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.carrier-badge svg {
  color: #008744;
  width: 12px;
  height: 12px;
}

.choice-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chip-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-tab {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.chip-tab input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.chip-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--cream);
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all .15s ease;
}

.chip-tab input[type="radio"]:checked+span {
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--orange);
}

.form-error {
  color: var(--bad);
  font-size: 12px;
  font-weight: 600;
  min-height: 16px;
  margin: 0;
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 44px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--r-md);
  border: none;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 3px 0 0;
}

.auth-switch a {
  color: var(--orange);
  font-weight: 700;
  text-decoration: underline;
}

.fine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  margin: 2px 0 0;
}

/* Onboarding */
.ob-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .ob-card {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    min-height: 100dvh;
    min-height: 100vh;
  }
}

.ob-visual {
  position: relative;
  padding: calc(18px + env(safe-area-inset-top, 16px)) 20px 20px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 0 0 28px 28px;
}

.ob-top {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 12px));
  right: 16px;
  left: auto;
  z-index: 10;
  display: flex;
  align-items: center;
}

.ob-top .icon-btn {
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ob-art {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.ob-body {
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 16px));
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex: 1;
  justify-content: space-between;
}

.ob-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  text-align: center;
  margin: 0;
}

.ob-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
  text-align: center;
  max-width: 320px;
  margin: 0 auto;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  transition: all .2s;
}

.dots span.on {
  width: 24px;
  background: var(--orange);
}

.slide-btn {
  position: relative;
  min-height: 50px;
  background: var(--orange-soft);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  border: 1.5px solid var(--line);
}

.slide-knob {
  position: absolute;
  inset-inline-start: 5px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--orange);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(249, 94, 8, .3);
}

.slide-label {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}

.slide-arrows {
  display: flex;
  color: var(--orange);
  margin-inline-start: 8px;
}

/* ==========================================================================
   Smart PWA Install Prompt (iOS & Android)
   ========================================================================== */
/* Hidden fully below and out of sight until it is shown, so no edge of the sheet can peek into the page. */
.install-prompt-modal {
  position: fixed;
  inset-inline: 12px;
  bottom: 12px;
  margin-inline: auto;
  max-width: 440px;
  z-index: 99999;
  transform: translateY(calc(100% + 40px));
  opacity: 0;
  visibility: hidden;
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .25s ease, visibility .35s;
  pointer-events: none;
}

.install-prompt-modal.active {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.install-sheet {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: 0 16px 40px rgba(60, 40, 20, 0.16);
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--cream);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease;
}

.install-close:hover {
  background: var(--peach);
}

.install-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline-end: 24px;
}

.install-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(249, 94, 8, 0.2);
  flex-shrink: 0;
}

.install-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.install-tag {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  line-height: 1.4;
}

.ios-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--cream);
  padding: 12px 14px;
  border-radius: var(--r-md);
}

.ios-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.ios-num {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-text {
  flex: 1;
  line-height: 1.4;
}

.ios-ico-share {
  color: #007aff;
  display: flex;
  align-items: center;
  background: #fff;
  padding: 4px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.ios-ico-plus {
  color: var(--ink);
  display: flex;
  align-items: center;
  background: #fff;
  padding: 4px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.ios-pointer {
  text-align: center;
  margin-top: -6px;
}

.ios-arrow-bounce {
  display: inline-block;
  font-size: 20px;
  color: #007aff;
  animation: bounceDown 1.4s infinite ease-in-out;
}

@keyframes bounceDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}



/* Phone: the top bar of the landing page wraps instead of running off the screen; the sign-in and sign-up headings are smaller and lighter. */
@media (max-width: 719px) {
  .land-nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .land-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .auth-hero h1 {
    font-size: 16px;
    font-weight: 700;
  }

  .auth-hero small {
    font-size: 11px;
  }
}

/* Install bar: one small row at the bottom of the welcome, onboarding, log-in and sign-up screens. */
.install-bar {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  margin-inline: auto;
  max-width: 440px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(60, 40, 20, .14);
}

.install-bar-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
}

.install-bar-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.install-bar-text b {
  font-size: 14px;
  font-weight: 700;
}

.install-bar-text small {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}

.install-bar .btn {
  flex-shrink: 0;
}

.install-bar-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #f3eee8;
  color: var(--ink-2);
}

body.has-install-bar #app {
  padding-bottom: 84px;
}

/* ---- Landing page: two columns on large screens (text and numbers beside the live app), colour tiles for the features ---- */
.lp {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 32px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.lp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.lp-brand .art.mascot {
  display: block;
  overflow: visible;
  flex-shrink: 0;
}

.lp-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-hero {
  display: grid;
  gap: 28px;
  padding: 12px 0 36px;
}

.lp-hero-text {
  display: grid;
  gap: 16px;
  align-content: center;
  justify-items: start;
}

.lp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 700;
  font-size: 13px;
}

.lp-hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.lp-lead {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 540px;
}

.lp-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lp-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
}

.lp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.lp-stats div {
  display: grid;
  min-width: 96px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lp-stats b {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
}

.lp-stats span {
  font-size: 12px;
  color: var(--muted);
}

.lp-features {
  padding: 24px 0;
}

.lp-section-title {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 800;
}

.lp-feature-grid {
  display: grid;
  gap: 12px;
}

.lp-feature {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 107, 43, 0.95) 0%, rgba(255, 87, 34, 0.88) 50%, rgba(244, 81, 30, 0.94) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-top: 1.5px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 32px rgba(255, 87, 34, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.lp-feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(255, 87, 34, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.lp-feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
}

.lp-feature h3 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.lp-feature p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.lp-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 8px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #fff;
}

.lp-band h2 {
  font-size: 22px;
  font-weight: 800;
}

.lp-band p {
  opacity: .75;
}

.lp-band .btn-white {
  color: var(--ink);
}

.lp-foot {
  padding: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.lp-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1.5px solid var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

@media (max-width: 480px) {
  .lp-hide-phone {
    display: none;
  }
}

@media (min-width: 1000px) {
  .lp {
    padding: 0 32px 40px;
  }

  .lp-hero {
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: 48px;
    padding: 24px 0 56px;
  }

  .lp-hero h1 {
    font-size: 52px;
  }

  .lp-lead {
    font-size: 18px;
  }

  .lp-section-title {
    margin-bottom: 24px;
    font-size: 30px;
    text-align: center;
  }

  .lp-feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lp-feature {
    padding: 24px;
  }

  .lp-band {
    padding: 32px 40px;
  }
}

/* On large screens the landing page has its own install link, so the bottom bar is for phones only. */
@media (min-width: 900px) {
  .install-bar {
    display: none;
  }

  body.has-install-bar #app {
    padding-bottom: 0;
  }
}

/* The app's logo (the Capsy robot) in the landing header, and the robot itself beside the live app on large screens. */
.lp-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.lp-hero-art {
  display: none;
}

@media (min-width: 1000px) {
  .lp-hero-art {
    display: grid;
    place-items: center;
    filter: drop-shadow(0 18px 24px rgba(60, 40, 20, .18));
    animation: float 4s ease-in-out infinite;
  }
}

/* ---- Training map: a dashed path with one stop per feature, each with its real screen; the mascot walks down it ---- */
.lp-map-sec {
  padding: 24px 0 8px;
}

.lp-map-lead {
  margin: -8px 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.lp-map {
  position: relative;
}

.lp-stops {
  position: relative;
  display: grid;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-stops::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  inset-inline-start: 21px;
  border-inline-start: 3px dashed rgba(249, 94, 8, .35);
}

.lp-stop {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 14px;
  row-gap: 14px;
  align-items: start;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}

.lp-stop.on {
  opacity: 1;
  transform: none;
}

.lp-stop-node {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--orange-soft);
  color: var(--orange);
  box-shadow: 0 0 0 6px var(--bg);
}

.lp-stop-text {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 6px;
}

.lp-stop-text small {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange);
}

.lp-stop-text h3 {
  font-size: 19px;
  font-weight: 800;
}

.lp-stop-text p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* One phone frame for every stop: the same width, height and screen ratio, with a notch. */
.lp-stop-shot {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  justify-self: start;
  box-sizing: border-box;
  width: min(250px, 100%);
  padding: 10px;
  border-radius: 46px;
  background: #1c1b19;
  box-shadow: inset 0 0 0 2px #3a3733, 0 20px 44px rgba(60, 40, 20, .2);
}

/* The screenshot is fitted inside the screen, never cropped: a narrower screenshot shows the page colour around it. */
.lp-stop-screen {
  position: relative;
  aspect-ratio: 390 / 800;
  overflow: hidden;
  border-radius: 36px;
  background: var(--bg);
}

.lp-stop-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

.lp-walker {
  position: absolute;
  top: 0;
  inset-inline-start: -6px;
  width: 56px;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}

@media (min-width: 860px) {
  .lp-stops::before {
    inset-inline-start: calc(50% - 1.5px);
  }

  .lp-stop {
    grid-template-columns: 1fr 56px 1fr;
    row-gap: 0;
  }

  .lp-stop-node {
    grid-column: 2;
    grid-row: 1;
    width: 56px;
    height: 56px;
  }

  .lp-stop-text {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    max-width: 380px;
    text-align: end;
  }

  .lp-stop-shot {
    grid-column: 3;
    grid-row: 1;
    justify-self: start;
  }

  .lp-stop.reverse .lp-stop-text {
    grid-column: 3;
    justify-self: start;
    text-align: start;
  }

  .lp-stop.reverse .lp-stop-shot {
    grid-column: 1;
    justify-self: end;
  }

  .lp-walker {
    inset-inline-start: calc(50% - 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-stop {
    transition: none;
  }
}

/* ---- Tools list: one card, one row per tool, each row with its own colour and icon ---- */
.tool-list {
  padding: 6px;
  display: grid;
  margin: 12px 0;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  color: var(--ink);
  text-decoration: none;
}

.tool-item+.tool-item {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.tool-item:active {
  background: var(--bg);
}

.tool-ico {
  background: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
  color: var(--ink);
}

.tool-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tool-text b {
  font-size: 16px;
  font-weight: 700;
}

.tool-text small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.tool-chev {
  color: var(--muted);
  flex-shrink: 0;
}

/* ---- Skincare: the same parts as the rest of the app ---- */
.skin-tabs {
  margin-bottom: 10px;
}

.skin-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.skin-search {
  margin: 0;
}

.skin-clear {
  flex-shrink: 0;
}

.skin-count {
  font-size: 13px;
  margin: 0;
}

.skin-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.skin-item {
  display: grid;
  gap: 10px;
  text-align: start;
  padding: 14px;
  width: 100%;
  color: var(--ink);
  font: inherit;
  border: 0;
  cursor: pointer;
}

.skin-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.skin-item-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.skin-item-title b {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.skin-item-title small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.skin-item .tag {
  flex-shrink: 0;
}

.skin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.skin-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}

.skin-compat,
.skin-quiz {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.skin-compat h2,
.skin-quiz h2 {
  font-size: 18px;
  margin: 0;
}

.skin-compat p,
.skin-quiz p {
  margin: 0;
}

.skin-pick {
  display: grid;
  gap: 4px;
  justify-items: stretch;
  min-width: 0;
}

.skin-pick .field-select {
  min-width: 0;
  width: 100%;
}

.skin-vs {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.skin-result {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  min-width: 0;
}

.skin-result p {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.skin-result.tone-ok {
  background: var(--ok-soft);
}

.skin-result.tone-bad {
  background: var(--bad-soft);
}

.skin-result.tone-warn {
  background: var(--cream);
}

.skin-quiz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.skin-case {
  font-size: 15px;
  line-height: 1.75;
}

.skin-options {
  display: grid;
  gap: 8px;
}

.skin-option {
  text-align: start;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.skin-option:disabled {
  cursor: default;
}

.skin-option.is-right {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
  font-weight: 700;
}

.skin-option.is-wrong {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: var(--bad);
}

.skin-sheet {
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.skin-sheet h2 {
  font-size: 20px;
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.skin-detail {
  display: grid;
  gap: 14px;
  margin: 10px 0;
}

.skin-detail h3 {
  font-size: 14px;
  margin: 0 0 4px;
  color: var(--muted);
}

.skin-detail p,
.skin-detail li {
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.skin-detail ul {
  margin: 0;
  padding-inline-start: 20px;
}

.skin-flag {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bad-soft);
}

.skin-flag h3,
.skin-flag p {
  color: var(--bad);
}

.skin-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.skin-facts div {
  display: grid;
  gap: 2px;
  padding: 10px 6px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px solid var(--line);
  min-width: 0;
}

.skin-facts small {
  font-size: 11px;
  color: var(--muted);
}

.skin-facts b {
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* Skincare interaction checker: each ingredient is one full-width row that opens the list */
.skin-pickrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: start;
}

.skin-pickrow>span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.skin-pickrow small {
  color: var(--muted);
  font-size: 12px;
}

.skin-pickrow b {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.skin-vs {
  justify-self: center;
}

.skin-item-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}

.skin-modal-head {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.skin-modal-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skin-modal-sub {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.skin-preg-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin-bottom: 10px;
  border: 1px solid var(--line);
}

.skin-preg-banner.tag-ok {
  background: var(--ok-soft);
  border-color: rgba(30, 142, 62, 0.25);
  color: var(--ok);
}

.skin-preg-banner.tag-warn {
  background: var(--cream);
  border-color: rgba(227, 116, 0, 0.25);
  color: #a85900;
}

.skin-preg-banner.tag-bad {
  background: var(--bad-soft);
  border-color: rgba(217, 48, 37, 0.25);
  color: var(--bad);
}

.skin-preg-banner small {
  font-size: 13px;
  line-height: 1.5;
}

.skin-tip-section {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(26, 115, 232, 0.06);
  border: 1px solid rgba(26, 115, 232, 0.2);
}

.skin-tip-section h3 {
  color: #1a73e8;
  font-weight: 700;
}

.skin-routine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .skin-routine-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.skin-routine-card {
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
}

.skin-routine-card.routine-am {
  background: rgba(249, 171, 0, 0.08);
  border-color: rgba(249, 171, 0, 0.3);
}

.skin-routine-card.routine-pm {
  background: rgba(103, 58, 183, 0.08);
  border-color: rgba(103, 58, 183, 0.25);
}

.skin-routine-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--ink);
}

.skin-routine-card.routine-am .skin-routine-title {
  color: #b06000;
}

.skin-routine-card.routine-pm .skin-routine-title {
  color: #512da8;
}

.skin-avoid-box {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bad-soft);
  border: 1px solid rgba(217, 48, 37, 0.2);
}

.skin-avoid-box h3 {
  color: var(--bad);
}

.skin-expl-box {
  display: grid;
  gap: 10px;
}

.skin-expl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.skin-expl-card {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.skin-expl-tag {
  display: inline-block;
  align-self: start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.skin-pearl-card {
  background: rgba(11, 87, 208, 0.05);
  border-color: rgba(11, 87, 208, 0.25);
}

.chip-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid rgba(30, 142, 62, 0.3);
}

.chip-bad {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid rgba(217, 48, 37, 0.3);
}

/* Interaction findings: a coloured edge shows how serious each one is */
.ix-item {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 14px 16px;
  border-radius: var(--r-md);
}

.ix-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
}

.ix-item-pair {
  font-size: 14.5px;
  color: var(--ink);
}

.ix-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ix-advice-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.45;
  width: 100%;
  box-sizing: border-box;
}

.ix-advice-card b {
  color: var(--orange, #f95e08);
  flex-shrink: 0;
}

.ix-advice-card span {
  color: var(--ink-2);
}

.ix-item.ix-sev-3 {
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: #fdf5f5;
}

.ix-item.ix-sev-2 {
  border: 1px solid rgba(217, 119, 6, 0.2);
  background: #fffcf5;
}

.ix-item.ix-sev-1 {
  border: 1px solid rgba(46, 125, 50, 0.18);
  background: #f4fbf5;
}

[data-theme="dark"] .ix-item.ix-sev-3 { background: rgba(220, 38, 38, 0.12); border-color: rgba(255, 59, 48, 0.25); }
[data-theme="dark"] .ix-item.ix-sev-2 { background: rgba(217, 119, 6, 0.12); border-color: rgba(255, 149, 0, 0.25); }
[data-theme="dark"] .ix-item.ix-sev-1 { background: rgba(46, 125, 50, 0.12); border-color: rgba(52, 199, 89, 0.25); }

/* ---- Barcode Scanner & Iraqi Alternatives Styles ---- */
.search-scanner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-soft, #fff5eb);
  color: var(--orange, #f95e08);
  border: 1px solid var(--orange, #f95e08);
  border-radius: var(--r-full, 9999px);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.search-scanner-btn:hover {
  background: var(--orange, #f95e08);
  color: #fff;
  transform: translateY(-1px);
}

.search-scanner-btn svg {
  flex-shrink: 0;
}

.scanner-page {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.scanner-header h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  margin: 0 0 6px;
}

.scanner-header p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.scanner-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--card, #fff);
  border-radius: var(--r-lg, 18px);
  border: 1px solid var(--line, #ede7df);
}

.scanner-viewport-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 340px;
  background: #0d0f14;
  border-radius: var(--r-md, 14px);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.scanner-reader {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

.scanner-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.scanner-starting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(circle at center, #1e293b, #0d0f14);
  color: #e2e8f0;
  z-index: 1;
}

.scanner-starting-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseScanner 1.5s ease-in-out infinite;
}

.scanner-starting-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.scanner-starting-text {
  font-size: 13.5px;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
}

@keyframes pulseScanner {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
}

.scanner-guide {
  position: absolute;
  inset: 15% 10%;
  pointer-events: none;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s;
}

.scanner-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #f95e08;
}

.scanner-corner.tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 8px;
}

.scanner-corner.tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 8px;
}

.scanner-corner.bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 8px;
}

.scanner-corner.br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 8px;
}

.scanner-laser {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f95e08, #ff9e42, #f95e08, transparent);
  box-shadow: 0 0 8px #f95e08, 0 0 16px #ff7a1a;
  animation: scanLaser 2s ease-in-out infinite alternate;
}

@keyframes scanLaser {
  0% {
    top: 8%;
    opacity: 0.9;
  }

  100% {
    top: 92%;
    opacity: 0.9;
  }
}

.scanner-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.scanner-controls button.active {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}

.scanner-hint {
  text-align: center;
  font-size: 13px;
  margin: 0;
}

.scanner-manual-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.scanner-manual-form input {
  flex: 1;
}

.scanner-demo-chips {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #ede7df);
}

.demo-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-chip {
  background: var(--bg, #fcfaf6);
  border: 1px solid var(--line, #ede7df);
  border-radius: var(--r-full, 9999px);
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-2, #555);
  transition: all 0.15s ease;
}

.pill-chip:hover {
  background: var(--orange-soft, #fff5eb);
  color: var(--orange, #f95e08);
  border-color: var(--orange, #f95e08);
}

/* Result Card - Clean Native Medical UI */
.scanner-results-container {
  margin-top: 14px;
}

.scanner-result-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  scroll-margin-top: 72px;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

.scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scanned-main-info {
  display: grid;
  gap: 4px;
}

.scanned-trade {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.scanned-company {
  font-size: 13px;
  color: var(--muted);
}

.scanned-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.spec-chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.scanned-scientific-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.sci-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sci-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  overflow-wrap: anywhere;
}

.scanned-clinical-tips {
  background: #fcfbf9;
  border: 1px solid rgba(249, 94, 8, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

[data-theme="dark"] .scanned-clinical-tips {
  background: rgba(249, 94, 8, 0.08);
  border-color: rgba(249, 94, 8, 0.22);
}

.scanned-clinical-tips h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.scanned-clinical-tips p {
  margin: 0;
  color: var(--ink-2);
}

.tip-advice {
  color: var(--ink);
}

.tip-warn {
  color: var(--bad);
  font-weight: 600;
}

.scanned-actions-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 16px;
  width: 100%;
}

.scanned-actions-row .btn {
  width: 100%;
  min-height: 48px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-md);
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  text-decoration: none;
  box-sizing: border-box;
}

.scanned-actions-row .btn-primary {
  background: var(--orange, #f95e08);
  color: #fff;
  border: none;
  box-shadow: none !important;
}

.scanned-actions-row .btn-primary:active {
  opacity: 0.9;
}

.scanned-actions-row .btn-soft {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none !important;
}

.scanned-actions-row .btn-soft:active {
  background: #ede7df;
}

.scanned-not-in-system {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.alternatives-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.alt-section-title h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.alt-count-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink);
}

.alt-grid {
  display: grid;
  gap: 10px;
}

.alt-card {
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

.alt-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.alt-brand-tag {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.alt-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.scanner-no-result {
  text-align: center;
  padding: 32px 20px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.scanner-no-result .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bad-soft, #fef2f2);
  color: var(--bad, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-no-result h3 {
  margin: 0;
  font-size: 18px;
}

.scanner-no-result p {
  margin: 0;
  font-size: 14px;
  max-width: 400px;
}

/* Clean interaction checker styling */
.ix-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ix-item-pair {
  font-size: 13px;
  color: var(--ink-2);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.ix-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 8px;
}

.ix-advice-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4fbf5;
  border: 1px solid rgba(46, 125, 50, 0.16);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

[data-theme="dark"] .ix-advice-card {
  background: rgba(46, 125, 50, 0.1);
  border-color: rgba(52, 199, 89, 0.22);
}

/* Compact Pregnancy & Lactation directory cards */
.preg-header-row {
  margin-bottom: 8px;
}

.preg-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* FDA category badges */
.fda-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.fda-badge.fda-A {
  background: #edf7ee;
  color: #1b5e20;
}

.fda-badge.fda-B {
  background: #e6f4f2;
  color: #00695c;
}

.fda-badge.fda-C {
  background: #fff8e6;
  color: #b45309;
}

.fda-badge.fda-D {
  background: #fdf0eb;
  color: #c2410c;
}

.fda-badge.fda-X {
  background: #fde8e8;
  color: #b91c1c;
}

/* ==========================================================================
   Capcy Lifetime Full Access Row - Compact Single Setting Row
   ========================================================================== */
.capcy-lifetime-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 56px;
  padding: 10px 14px !important;
  border-radius: var(--r-md, 20px) !important;
  background: #ffffff !important;
  border: 1px solid var(--line, #efe9e1) !important;
  box-shadow: none !important;
  text-decoration: none !important;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.clc-ico {
  width: 40px !important;
  height: 40px !important;
  border-radius: var(--r-sm, 12px) !important;
  background: var(--orange-soft, #fff1e7) !important;
  color: var(--orange, #f95e08) !important;
  display: grid !important;
  place-items: center !important;
  flex-shrink: 0 !important;
}

.clc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.clc-heading {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ink, #1c1b19) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
}

.clc-sub {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--muted, #8b857d) !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.clc-btn {
  background: var(--orange, #f95e08) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

.capcy-lifetime-card:hover .clc-btn,
.capcy-lifetime-card:active .clc-btn {
  background: var(--orange-deep, #c2410c) !important;
}

/* ==========================================================================
   Capsule Search Bar & Camera Modal
   ========================================================================== */
.capsule-search-container {
  position: relative;
  margin-bottom: 14px;
  z-index: 50;
}

.capsule-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 14px;
  background: #ffffff;
  border: 1.5px solid var(--line, #e2e8f0);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
}

.capsule-search-bar:focus-within {
  border-color: #f95e08;
  box-shadow: 0 0 0 3px rgba(249, 94, 8, 0.12);
}

.capsule-search-icon {
  color: var(--muted, #94a3b8);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.capsule-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink, #0f172a);
  font-family: inherit;
  min-width: 0;
}

.capsule-cam-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f95e08;
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none !important;
  transition: background 0.15s;
}

.capsule-cam-btn:hover,
.capsule-cam-btn:active {
  background: #e05305;
}

.cam-btn-text {
  white-space: nowrap;
}

/* Dropdown Autocomplete for 20,001 Drugs */
.capsule-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--r-md, 14px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.capsule-suggestions-dropdown.hidden {
  display: none !important;
}

.sug-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #f1f5f9);
  cursor: pointer;
  transition: background 0.12s;
  gap: 8px;
}

.sug-item:last-child {
  border-bottom: none;
}

.sug-item:hover,
.sug-item:active {
  background: var(--bg, #f8fafc);
}

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

.sug-trade {
  font-size: 14px;
  color: var(--ink, #0f172a);
}

.sug-sci {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.sug-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.sug-company {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  font-weight: 600;
}

.sug-dose {
  font-size: 11px;
  color: #f95e08;
  font-weight: 700;
}

/* Camera Modal / Sheet */
.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.camera-modal.hidden {
  display: none !important;
}

.camera-modal-content {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--r-lg, 18px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.camera-modal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

/* Quiz readability: the whole question shows, words are not cut, and the interaction diagram reads clearly on a phone. */
.question-card { overflow: visible; justify-content: flex-start; min-height: 0; }
.q-text { font-size: 19px; line-height: 1.5; }
.choice-text { overflow-wrap: break-word; word-break: normal; }
.ix { flex-direction: column; gap: 8px; padding: 14px; }
.ix-node { width: 100%; max-width: 100%; justify-content: center; font-size: 15px; }
.ix-node b { font-size: 16px; overflow-wrap: break-word; }
.ix-mid { display: flex; align-items: center; gap: 6px; }
.ix-mid small { font-size: 13px; }
@media (max-width: 719px) {
  .q-text { font-size: 18px; }
  .choice { font-size: 15px; min-height: 52px; }
}

/* Pregnancy list: long names, classes and the category badge wrap inside the card in both languages. */
.preg-card-header { flex-wrap: wrap; }
.preg-name-col { flex: 1 1 140px; min-width: 0; }
.preg-drug-name { overflow-wrap: anywhere; }
.preg-system-tag { display: block; overflow-wrap: anywhere; line-height: 1.4; }
.fda-badge { white-space: normal; max-width: 100%; line-height: 1.3; border-radius: 14px; padding: 4px 10px; text-align: start; }

/* Pregnancy: category filter chips, a letter badge on each card, and the lactation note behind a tap. Nothing runs past the card. */
.preg-filters { padding: 4px 2px 8px; }
.preg-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.preg-chip small { font-size: 11px; font-weight: 700; opacity: .7; }
.preg-chip-A.active { background: #15803d; color: #fff; }
.preg-chip-B.active { background: #0f766e; color: #fff; }
.preg-chip-C.active { background: #b45309; color: #fff; }
.preg-chip-D.active { background: #c2410c; color: #fff; }
.preg-chip-X.active { background: #b91c1c; color: #fff; }
.preg-card, .preg-card * { min-width: 0; }
.preg-chip { padding: 0 11px; gap: 4px; font-size: 14px; }

/* Leaderboard rows: rank, avatar, a name that is cut with "..." when long, and an XP number that never wraps or pushes the row. */
.board-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.board-row .board-body { min-width: 0; }
.board-row .board-body b, .board-row .board-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-xp { white-space: nowrap; font-variant-numeric: tabular-nums; }
.board-mini li b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-col { min-width: 0; }
.podium-col b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-col small { max-width: 100%; white-space: nowrap; font-size: clamp(10px, 3vw, 13px); }
.board-me { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.board-me b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Search: the list keeps its height while typing so the page does not jump, and the field gets the room the leading icon used */
.results { min-height: 70vh; align-content: start; }
#search-form > .round-btn { display: none; }

/* Quiz and duel questions: smaller text in regular weight (no bold); the drug name stands out by colour */
.q-text,
.duel-question-prompt { font-size: 17px !important; font-weight: 500 !important; line-height: 1.5; }
.q-name { font-weight: 600; }
@media (max-width: 719px) {
  .q-text,
  .duel-question-prompt { font-size: 16px !important; }
}

/* Child doses: nothing runs past the card or the screen edge in either language */
.tool-card { max-width: 100%; box-sizing: border-box; min-width: 0; }
.tool-card .tool-head h2,
.tool-card .tool-head small,
.tool-card .field-label span,
.tool-card .dose-cautions span { overflow-wrap: anywhere; min-width: 0; }
.tool-card .pick-field { max-width: 100%; box-sizing: border-box; min-width: 0; }
.tool-card .stepper-box { max-width: 100%; }
.tool-card .stepper-box .field-input { flex: 1 1 0; min-width: 0; width: 0; }
.tool-card .stepper-box .btn { flex-shrink: 0; }
.tool-card .quick-weights,
.tool-card .chip-tabs { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.tool-card .chip-tab { max-width: 100%; white-space: normal; text-align: start; }
.tool-card .result-box { max-width: 100%; box-sizing: border-box; }
.dose-mg small { display: block; font-size: 12px; color: var(--muted, #6b6b6b); }

/* System Hub (Drugs & Classes + Training Stages) and Quick Drug Preview Sheet */
.layout { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
@media (min-width: 1100px) {
  .layout { grid-template-columns: 270px minmax(0, 1fr); }
}
.main { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.page { width: 100%; min-width: 0; box-sizing: border-box; }
.page > .filter-row,
.page > .learn-class-chips {
  margin: 0 !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  touch-action: pan-x pan-y;
}
.filter-row .chip-tab,
.learn-class-chips .chip-tab {
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.sys-hub-tabs { margin-bottom: 12px; width: 100%; max-width: 100%; box-sizing: border-box; }
.sys-hub-tabs .seg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; min-width: 0; }
.learn-search-box { margin-bottom: 10px; background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 14px; padding: 0 12px; min-height: 44px; display: flex; align-items: center; gap: 8px; width: 100%; max-width: 100%; box-sizing: border-box; }
.learn-search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; min-width: 0; }
.learn-class-chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 4px 2px 10px; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; }
.learn-class-chips:active { cursor: grabbing; }
.learn-class-chips::-webkit-scrollbar { display: none; }
.learn-class-chips .chip-tab { flex: 0 0 auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.learn-class-chips .chip-tab .lcc-label,
.learn-class-chips .chip-tab span { background: transparent !important; padding: 0 !important; border: none !important; border-radius: 0 !important; color: inherit !important; font-size: inherit !important; font-weight: inherit !important; box-shadow: none !important; }
.learn-class-chips .chip-tab small { background: rgba(0,0,0,0.08); padding: 1px 7px; border-radius: 999px; font-size: 11px; color: inherit; }
.learn-class-chips .chip-tab.active small { background: rgba(255,255,255,0.22); color: #fff; }

.learn-class-summary { margin-bottom: 12px; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 16px; padding: 12px 14px; }
.learn-class-summary summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.learn-class-summary summary::-webkit-details-marker { display: none; }
.lcs-head { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #0f172a; }
.lcs-sub { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #64748b; font-weight: 600; }
.learn-class-summary .learn-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; }

.learn-section-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 2px 10px; }
.learn-section-bar b { font-size: 15px; color: #0f172a; }
.learn-results-meta { margin: 4px 2px 10px; font-size: 13px; }

.learn-drugs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.learn-drug-card { width: 100%; text-align: start; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid #e2e8f0; background: #fff; cursor: pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.learn-drug-card:active { transform: scale(0.99); border-color: #cbd5e1; }
.ldc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; width: 100%; }
.ldc-title-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ldc-generic { font-size: 16px; font-weight: 800; color: #0f172a; line-height: 1.25; }
.ldc-class { font-size: 11.5px; color: #64748b; font-weight: 600; }
.ldc-arrow { color: #94a3b8; flex-shrink: 0; margin-top: 2px; }
.ldc-use { margin: 0; font-size: 13.5px; color: #334155; line-height: 1.45; }
.ldc-brands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ldc-brand-pill { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; border: 1px solid #e2e8f0; color: #1e293b; padding: 3px 9px; border-radius: 8px; font-size: 12px; }
.ldc-brand-pill b { font-weight: 700; }
.ldc-brand-pill small { color: #64748b; font-size: 11px; }
.ldc-brand-more { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 8px; background: #fff7ed; color: #ea580c; font-size: 11.5px; font-weight: 700; }

.learn-drug-sheet { max-height: 84vh; display: flex; flex-direction: column; gap: 12px; text-align: start; }
.lds-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lds-title { margin: 4px 0 0; font-size: 20px; font-weight: 800; color: #0f172a; }
.lds-scroll { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; max-height: 56vh; }
.lds-notes { display: flex; flex-direction: column; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; font-size: 13.5px; line-height: 1.5; color: #1e293b; }
.lds-note-row b { color: #0f172a; }
.lds-note-row.is-advice { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 8px 10px; border-radius: 10px; color: #14532d; }
.lds-note-row.is-warn { background: #fef2f2; border: 1px solid #fecaca; padding: 8px 10px; border-radius: 10px; color: #7f1d1d; }
.lds-sec-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #475569; }
.lds-brands-list { display: flex; flex-direction: column; gap: 6px; }
.lds-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 13px; }
.lds-brand-main { display: flex; flex-direction: column; min-width: 0; }
.lds-brand-main b { color: #0f172a; font-weight: 700; }
.lds-brand-main small { color: #64748b; font-size: 11.5px; }
.lds-brand-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lds-strength { font-size: 12px; font-weight: 600; color: #475569; }
.lds-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

/* Compact Home Tools Grid & Emergency Drugs / Sera Tool */
.tool-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-compact-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 54px;
  background: #ffffff;
  border: 1px solid var(--line, #efe9e1);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink, #1c1b19);
  transition: transform .12s ease, border-color .12s ease;
  min-width: 0;
}

.tool-compact-tile:active {
  transform: scale(0.98);
}

.tool-compact-tile.is-featured {
  grid-column: 1 / -1;
  background: #fffafa;
  border-color: #fecdd3;
}

.tool-compact-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg, #fcfaf6);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.tool-compact-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tool-compact-text b {
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.3;
  color: var(--ink, #1c1b19);
  overflow-wrap: anywhere;
}

.tool-compact-text small {
  font-size: 11.5px !important;
  color: var(--muted, #8b857d);
  line-height: 1.3;
}

.emg-count-line {
  font-size: 12.5px;
  margin: 2px 2px 8px;
}

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

.emg-item {
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line, #efe9e1);
  overflow: hidden;
}

.emg-item > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.emg-item > summary::-webkit-details-marker {
  display: none;
}

.emg-summary-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.emg-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: var(--ink, #1c1b19);
  margin: 0;
  line-height: 1.3;
}

.emg-indication {
  font-size: 12px !important;
  color: var(--muted, #64748b);
  line-height: 1.35;
  margin: 0;
  font-weight: 500;
}

.emg-body {
  padding: 0 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line, #f1ede7);
  padding-top: 10px;
}

.emg-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.emg-form-chip {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  color: var(--ink-2, #475569);
  padding: 3px 8px;
  border-radius: 7px;
  max-width: 100%;
}

.emg-sec {
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emg-sec-lbl {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.emg-sec p {
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0;
}

.emg-dose-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.emg-admin-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.emg-flag-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

.emg-drug-link {
  font-size: 12px;
  font-weight: 700;
}

/* Capcy Orange Upgrade Bar & 2-Step Features Sheet */
.capcy-upgrade-bar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 10px;
  border-radius: 15px;
  border: none;
  background: var(--grad, linear-gradient(135deg, #f95e08 0%, #ea580c 100%));
  color: #ffffff;
  cursor: pointer;
  text-align: start;
  box-shadow: 0 6px 16px rgba(249, 94, 8, 0.22);
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.capcy-upgrade-bar:active {
  transform: scale(0.99);
}

.cub-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cub-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.cub-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cub-sub {
  font-size: 11.5px !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cub-cta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--orange-deep, #c2410c);
  font-size: 11.5px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.upgrade-sheet {
  text-align: start;
  max-width: 440px;
  box-sizing: border-box;
  overflow: hidden;
}

.ugs-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 10px;
}

.ugs-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--orange-soft, #fff1e7);
  color: var(--orange-deep, #c2410c);
  font-size: 11px;
  font-weight: 700;
}

.ugs-title {
  font-size: 16.5px !important;
  font-weight: 800 !important;
  color: var(--ink, #1c1b19);
  margin: 0;
  line-height: 1.3;
}

.ugs-note {
  font-size: 12px !important;
  color: var(--muted, #64748b);
  margin: 0;
  line-height: 1.35;
}

.ugs-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.ugs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  min-width: 0;
}

.ugs-item-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--orange-soft, #fff1e7);
  color: var(--orange, #f95e08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ugs-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 0;
}

.ugs-item-text b {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--ink, #1c1b19);
  line-height: 1.25;
  overflow-wrap: break-word;
}

.ugs-item-text small {
  font-size: 11.5px !important;
  color: var(--muted, #64748b);
  line-height: 1.3;
  overflow-wrap: break-word;
}

.ugs-ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px !important;
}

/* Badges & Levels: compact typography that never overflows card borders */
.badge {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 13px 10px;
}

.badge b {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: break-word;
}

.badge small {
  font-size: 11.5px !important;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: break-word;
}

.badge-mini {
  min-width: 0;
  overflow: hidden;
}

.badge-mini small {
  font-size: 11px !important;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ladder-step {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px 12px;
}

.ladder-step b {
  font-size: 13.5px !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-banner {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.level-banner-text {
  min-width: 0;
  overflow: hidden;
}

.level-banner-text b,
.level-banner-text small,
.side-user-body b,
.side-user-body small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-banner-text b {
  font-size: 13.5px !important;
}

/* Conditions: BNF treatment summaries */
.cond-search { margin: 4px 0 12px; }
.cond-chips { padding: 2px 2px 10px; }
.cond-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cond-chip svg { flex-shrink: 0; }
.cond-count { margin: 0 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cond-list { display: grid; gap: 10px; }
.cond-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 10px 26px -16px rgba(0, 0, 0, .22); transition: transform .15s ease; }
.cond-card:active { transform: scale(.985); }
.cond-ico { display: grid; place-items: center; flex-shrink: 0; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .72); }
.cond-body { display: grid; flex: 1; gap: 2px; min-width: 0; }
.cond-body b { font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cond-body small { font-size: 12.5px; color: var(--ink-2); }
.cond-go { flex-shrink: 0; opacity: .55; color: var(--ink-2); }
[dir="rtl"] .cond-go svg { transform: scaleX(-1); }
.cond-none { padding: 28px 0; text-align: center; }
.cond-hero-card { display: grid; gap: 12px; margin-bottom: 12px; padding: 22px 20px 18px; border-radius: 26px; }
.cond-hero-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(255, 255, 255, .75); }
.cond-hero-card h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cond-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.cond-jump { position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; padding: 4px 2px 10px; overflow-x: auto; scrollbar-width: none; background: linear-gradient(#fcfaf6 78%, rgba(252, 250, 246, 0)); }
.cond-jump::-webkit-scrollbar { display: none; }
.cond-jump .chip-tab { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cond-sections { display: grid; gap: 12px; }
.cond-sec { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; scroll-margin-top: 64px; }
.cond-sec h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: .01em; color: var(--orange); }
.cond-text p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.cond-text p:last-child { margin-bottom: 0; }
.cond-bullet { position: relative; padding-inline-start: 18px; }
.cond-bullet::before { content: ''; position: absolute; inset-inline-start: 2px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.cond-drugs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cond-drugs-lbl { display: inline-flex; align-items: center; gap: 5px; margin-inline-end: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cond-drugs .chip { text-decoration: none; }
.cond-source { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 6px; font-size: 12px; color: var(--ink-2); }
.cond-chips .chip-tab span,
.cond-jump .chip-tab span { padding: 0; border: none; border-radius: 0; background: transparent; }
.cond-chip, .cond-jump .chip-tab { padding-block: 8px; }

.cond-title-main { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.cond-title-sub { display: block; font-size: 12.5px; color: var(--ink-2); }
.cond-hero-title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.cond-hero-sub { margin: -6px 0 0; font-size: 14px; font-weight: 600; opacity: .85; }

.cond-mode-bar {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 16px;
  background: #f0ebe4;
  border-radius: 999px;
}
.cond-mode-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s ease;
}
.cond-mode-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.cond-brief-wrap {
  display: grid;
  gap: 12px;
}
.cond-brief-card {
  padding: 16px 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}
.cond-brief-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}
.cond-brief-card.cond-brief-goal h3 { color: var(--orange); }
.cond-brief-card.cond-brief-drugs h3 { color: #0284c7; }
.cond-brief-card.cond-brief-nondrug h3 { color: #16a34a; }
.cond-brief-card.cond-brief-warn h3 { color: #dc2626; }
.cond-brief-card.cond-brief-attached h3 { color: #7c3aed; }

.cond-brief-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.cond-brief-list {
  margin: 0;
  padding-inline-start: 20px;
  display: grid;
  gap: 8px;
}
.cond-brief-list li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
.cond-drugs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.cond-drugs-pills .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

/* Brand quiz: hub, question sheet and the admin builder */
.bh-brands { display: flex; gap: 14px; padding: 4px 2px 12px; overflow-x: auto; scrollbar-width: none; }
.bh-brands::-webkit-scrollbar { display: none; }
.bh-brand { display: grid; flex-shrink: 0; justify-items: center; gap: 6px; padding: 2px 4px; border: 0; background: none; cursor: pointer; }
.bh-logo { display: grid; place-items: center; width: 56px; height: 56px; padding: 8px; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 50%; background: #fff; transition: all .15s ease; }
.bh-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bh-brand.is-on .bh-logo { border: 2.5px solid var(--orange); box-shadow: 0 0 0 4px rgba(249, 94, 8, .14); }
.bh-name { max-width: 72px; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bh-brand.is-on .bh-name { font-weight: 800; color: var(--orange); }
.bh-products { display: grid; gap: 14px; }
.bh-product { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 12px 30px -20px rgba(0, 0, 0, .25); }
.bh-thumb { display: grid; place-items: center; height: 190px; padding: 14px; box-sizing: border-box; border-radius: 18px; background: linear-gradient(180deg, #f4f8fb, #eaf2f8); }
.bh-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bh-info { display: grid; gap: 4px; min-width: 0; }
.bh-info h3 { margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.bh-info small { font-size: 13px; line-height: 1.4; }
.bh-empty { padding: 20px; }

.bq-sheet { max-height: 92vh; padding: 18px 18px 22px; overflow-y: auto; text-align: start; }
.bq-close { position: absolute; top: 12px; inset-inline-end: 12px; }
.bq-dots { display: flex; justify-content: center; gap: 6px; margin: 6px 40px 16px; }
.bq-dots i { flex: 1; max-width: 44px; height: 5px; border-radius: 99px; background: var(--line); }
.bq-dots i.is-done { background: var(--orange); opacity: .55; }
.bq-dots i.is-now { background: var(--orange); }
.bq-q { margin: 0 0 14px; font-size: 17px; font-weight: 500; line-height: 1.55; }
.bq-opts { display: grid; gap: 8px; }
.bq-opt { padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); font-size: 15px; line-height: 1.4; text-align: start; overflow-wrap: anywhere; }
.bq-opt.is-right { border-color: #2e9e5b; background: #e6f5ec; color: #1b6b3c; font-weight: 700; }
.bq-opt.is-wrong { border-color: #d9534f; background: #fdeceb; color: #a3231f; }
.bq-opt.is-dim { opacity: .5; }
.bq-after { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.bq-why { flex: 1; min-width: 0; }
.bq-why summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); list-style: none; cursor: pointer; }
.bq-why summary::-webkit-details-marker { display: none; }
.bq-why p { margin: 8px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--orange-soft, #fff1e7); font-size: 13.5px; line-height: 1.55; }
.bq-done { display: grid; justify-items: center; gap: 10px; padding: 14px 0 4px; text-align: center; }
.bq-done-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(34, 197, 94, .12); color: #16a34a; }
.bq-done h3 { margin: 0; font-size: 18px; }
.bq-score { margin: 0; font-size: 22px; font-weight: 800; color: var(--orange); }
.bq-done .btn { margin-top: 6px; }

.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 12px; }
.bc-head h2 { margin: 0; font-size: 20px; }
.bc-list { display: grid; gap: 14px; }
.bc-card { display: grid; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.bc-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bc-logo { display: grid; place-items: center; flex-shrink: 0; width: 58px; height: 46px; padding: 6px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 800; }
.bc-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bc-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.bc-text b, .bc-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-prod { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px; border-radius: 16px; background: #f7f5f0; }
.bc-thumb { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; padding: 3px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.bc-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bc-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.bc-stats .chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bc-prod .bc-text b { overflow: visible; white-space: normal; line-height: 1.3; overflow-wrap: anywhere; }
.bc-icons { display: flex; flex-shrink: 0; gap: 6px; }
.bc-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bc-new { margin-top: 14px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.bc-new > summary { display: flex; align-items: center; gap: 8px; padding: 16px; font-weight: 800; list-style: none; cursor: pointer; }
.bc-new > summary::-webkit-details-marker { display: none; }
.bc-form { display: grid; gap: 14px; padding: 0 16px 16px; }
.bc-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .bc-grid { grid-template-columns: 1fr 1fr; } }
.bc-upload { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; background: #f7f5f0; }
.bc-preview { display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 64px; padding: 4px; box-sizing: border-box; overflow: hidden; border: 1.5px dashed var(--line); border-radius: 14px; background: #fff; font-size: 10px; text-align: center; }
.bc-preview.is-round { border-radius: 50%; }
.bc-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bc-upload-side { display: grid; gap: 6px; min-width: 0; }
.bc-questions { display: grid; gap: 8px; }
.bc-q { border: 1px solid var(--line); border-radius: 16px; background: #faf9f6; }
.bc-q > summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
.bc-q-body { display: grid; gap: 10px; padding: 0 14px 14px; }
.bc-opts { display: grid; gap: 8px; }
.bc-opt { display: flex; align-items: center; gap: 8px; }
.bc-opt-mark { display: flex; align-items: center; gap: 4px; min-width: 44px; cursor: pointer; }
.bc-opt .field-input { flex: 1; min-width: 0; }
.bq-q, .bq-opt, .bq-why p { text-align: start; }
.bc-logo img { max-height: 32px; }
.bh-thumb img { max-height: 160px; }

/* Brand quiz: the explanation as an insight card */
.bq-why-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.bq-why-btn.is-on { border-color: var(--orange); background: var(--orange-soft, #fff1e7); color: var(--orange); }
.bq-insight { position: relative; display: flex; gap: 12px; margin-top: 14px; padding: 16px 16px 16px 20px; border: 1px solid #fde0c8; border-radius: 22px; background: linear-gradient(180deg, #fffaf4, #fff1e6); overflow: hidden; animation: bqIn .22s ease; }
.bq-insight[hidden] { display: none; }
.bq-insight::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--orange); }
.bq-insight-ico { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--orange); box-shadow: 0 4px 12px -6px rgba(249, 94, 8, .5); }
.bq-insight-body { min-width: 0; text-align: start; }
.bq-insight-body b { display: block; font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.bq-insight-body p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
@keyframes bqIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bq-sheet .bq-q, .bq-sheet .bq-opt, .bq-sheet .bq-insight-body { text-align: start; }
.bq-insight-body b { font-weight: 600; font-size: 14.5px; }

/* Consult: how to deal with a patient */
.cs-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; padding: 18px; border-radius: 28px; background: linear-gradient(135deg, #f95e08, #fe8118); color: #fff; text-decoration: none; box-shadow: 0 20px 38px -20px rgba(249, 94, 8, .75); }
.cs-hero-ico { display: grid; place-items: center; flex-shrink: 0; width: 58px; height: 58px; border-radius: 20px; background: rgba(255, 255, 255, .22); }
.cs-hero-text { display: grid; flex: 1; gap: 10px; min-width: 0; }
.cs-hero-text b { font-size: 19px; font-weight: 800; line-height: 1.25; }
.cs-steps-mini { display: flex; gap: 6px; }
.cs-steps-mini i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .24); }
.cs-hero .cs-go { color: #fff; opacity: .9; }
[dir="rtl"] .cs-go svg { transform: scaleX(-1); }
.cs-search { margin: 0 0 12px; }
.cs-chips { padding: 2px 2px 10px; }
.cs-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cs-chips .chip-tab span { padding: 0; border: none; border-radius: 0; background: transparent; }
.cs-count { margin: 0 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cs-list { display: grid; gap: 10px; }
.cs-none { padding: 28px 0; text-align: center; }
.cs-card { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border-radius: 22px; color: var(--ink); text-decoration: none; box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 10px 26px -16px rgba(0, 0, 0, .22); transition: transform .15s ease; }
.cs-card:active { transform: scale(.985); }
.cs-ico { display: grid; place-items: center; flex-shrink: 0; width: 50px; height: 50px; border-radius: 16px; background: rgba(255, 255, 255, .74); }
.cs-body { display: grid; flex: 1; gap: 6px; min-width: 0; }
.cs-body b { font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.cs-meta { display: flex; gap: 6px; }
.cs-meta i { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .72); font-size: 12px; font-style: normal; font-weight: 700; color: var(--ink-2); }
.cs-meta i.is-red { color: #b4281f; }
.cs-go { flex-shrink: 0; opacity: .5; }

.cs-case-hero { display: grid; gap: 10px; justify-items: start; margin-bottom: 12px; padding: 20px; border-radius: 28px; }
.cs-case-ico { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 22px; background: rgba(255, 255, 255, .76); }
.cs-case-hero h1 { margin: 0; font-size: 27px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cs-tabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; padding: 6px 2px 12px; overflow-x: auto; scrollbar-width: none; background: linear-gradient(#fcfaf6 80%, rgba(252, 250, 246, 0)); }
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-tab { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; padding: 10px 15px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.cs-tab em { padding: 1px 7px; border-radius: 99px; background: rgba(0, 0, 0, .07); font-size: 11.5px; font-style: normal; }
.cs-tab.is-on { border-color: var(--orange); background: var(--orange); color: #fff; box-shadow: 0 10px 20px -12px rgba(249, 94, 8, .8); }
.cs-tab.is-on em { background: rgba(255, 255, 255, .26); }
.cs-pane { display: grid; gap: 10px; animation: csIn .2s ease; }
@keyframes csIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cs-recall { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cs-recall.is-on { border-color: var(--orange); background: var(--orange-soft, #fff1e7); color: var(--orange); }

.cs-q { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.cs-q > header { display: flex; align-items: center; gap: 11px; }
.cs-q > header b { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.cs-badge { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--orange-soft, #fff1e7); color: var(--orange); font-size: 15px; font-weight: 800; }
.cs-text p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; text-align: start; }
.cs-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cs-clamp.is-open { display: block; }
.cs-more { margin-top: 4px; padding: 4px 0; border: 0; background: none; color: var(--orange); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cs-sub { display: grid; gap: 4px; margin-top: 10px; padding: 11px 13px; border-radius: 15px; background: #faf8f4; }
.cs-sub > b { font-size: 13.5px; }
.cs-sub .cs-text p { font-size: 13.5px; line-height: 1.6; }

.cs-veil { position: relative; }
.cs-veil .cs-hint { display: none; }
.cs-veil.is-veiled { cursor: pointer; }
.cs-veil.is-veiled > :not(.cs-hint) { filter: blur(7px); pointer-events: none; user-select: none; }
.cs-veil.is-veiled .cs-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--orange); }

.cs-flags-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 0; font-size: 15px; font-weight: 800; color: #b4281f; }
.cs-flags-head span { display: inline-flex; align-items: center; gap: 8px; }
.cs-flags { display: grid; gap: 8px; }
.cs-flag { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid #f4cdca; border-radius: 18px; background: #fdeeed; color: #7e1a15; }
.cs-flag-ico { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #d9534f; }
.cs-flag p { margin: 0; font-size: 14.5px; line-height: 1.55; text-align: start; overflow-wrap: anywhere; }
.cs-time { display: flex; gap: 12px; padding: 16px; border-radius: 22px; background: #eef5ff; border: 1px solid #d6e5fb; }
.cs-time-ico { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 14px; background: #fff; color: #2a6fd6; }
.cs-time b { display: block; margin-bottom: 4px; font-size: 14.5px; }
.cs-acc { border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.cs-acc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; list-style: none; cursor: pointer; }
.cs-acc summary::-webkit-details-marker { display: none; }
.cs-acc summary b { font-size: 15.5px; line-height: 1.35; overflow-wrap: anywhere; }
.cs-acc summary span { flex-shrink: 0; transition: transform .2s ease; color: var(--ink-2); }
.cs-acc[open] summary span { transform: rotate(180deg); }
.cs-acc > p { margin: 0; padding: 0 16px 16px; font-size: 14.5px; line-height: 1.7; text-align: start; overflow-wrap: anywhere; }

.cs-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.cs-step { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 26px; background: #fff; }
.cs-step > header { display: flex; align-items: center; gap: 12px; }
.cs-step h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 800; }
.cs-num { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; box-shadow: 0 8px 16px -8px rgba(249, 94, 8, .8); }
.cs-wham { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-wham-tile { display: grid; align-content: start; gap: 6px; padding: 14px; border-radius: 20px; background: var(--orange-soft, #fff1e7); }
.cs-wham-tile:nth-child(n+3) { grid-column: 1 / -1; }
.cs-wham-k { font-size: 30px; font-weight: 800; line-height: 1; color: var(--orange); }
.cs-wham-tile b { font-size: 14px; line-height: 1.4; }
.cs-wham-tile p, .cs-wham-tile li { margin: 0; font-size: 13px; line-height: 1.55; text-align: start; }
.cs-wham-tile ul { display: grid; gap: 6px; margin: 0; padding-inline-start: 18px; }
.cs-outs { display: grid; gap: 8px; }
.cs-out { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 18px; background: #eef7f0; }
.cs-out > span { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #2e9e5b; }
.cs-out:last-child { background: #fdeeed; }
.cs-out:last-child > span { color: #d9534f; }
.cs-out p { margin: 0; font-size: 14.5px; line-height: 1.5; text-align: start; }
.cs-risk { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid #f4cdca; border-radius: 20px; background: #fdeeed; color: #7e1a15; }
.cs-risk b { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; }
.cs-risk p { position: relative; margin: 0; padding-inline-start: 14px; font-size: 14px; line-height: 1.5; text-align: start; }
.cs-risk p::before { content: ''; position: absolute; inset-inline-start: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: #d9534f; }
.cs-groups-title { margin: 22px 4px 10px; font-size: 16px; font-weight: 800; }
.cs-groups { display: grid; gap: 10px; }

/* Consult: easier reading (short points, larger type) and a calm hero without the orange glow */
.cs-hero { box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 6px 16px -10px rgba(0, 0, 0, .28); }
.cs-lines { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cs-lines li { position: relative; padding-inline-start: 22px; font-size: 16.5px; line-height: 1.7; text-align: start; color: var(--ink); overflow-wrap: anywhere; }
.cs-lines li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.cs-lines.is-single li { padding-inline-start: 0; }
.cs-lines.is-single li::before { display: none; }
.cs-q > header b { font-size: 17.5px; }
.cs-badge { width: 36px; height: 36px; font-size: 16px; }
.cs-sub .cs-lines li { font-size: 15.5px; }
.cs-flag p { font-size: 16px; line-height: 1.6; }
.cs-acc summary b { font-size: 17px; }
.cs-acc > .cs-lines { padding: 0 16px 16px; }
.cs-more { font-size: 15px; }
.cs-out p { font-size: 16px; }
.cs-risk p { font-size: 15.5px; }
.cs-wham-tile b { font-size: 15px; }
.cs-wham-tile p, .cs-wham-tile li { font-size: 14.5px; }
.cs-time b { font-size: 15.5px; }
.cs-time .cs-lines li { font-size: 15.5px; }

/* Skincare: readable sheets and quiz (short points, start-aligned, larger type) */
.skin-sheet { text-align: start; }
.skin-sheet .skin-modal-head { text-align: start; }
.skin-sheet h2 { font-size: 24px; line-height: 1.25; text-align: start; }
.skin-sheet .skin-modal-sub { font-size: 15px; text-align: start; }
.skin-sheet .skin-detail { display: grid; gap: 22px; }
.skin-sheet .skin-detail section { display: grid; gap: 10px; }
.skin-sheet .skin-detail h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .01em; text-align: start; color: var(--ink); }
.skin-sheet .skin-detail h3::before { content: ''; width: 4px; height: 16px; border-radius: 3px; background: var(--orange); }
.skin-sheet .pts li, .skin-quiz .pts li { font-size: 16.5px; line-height: 1.7; }
.skin-sheet .skin-detail p { font-size: 16px; line-height: 1.7; text-align: start; }
.skin-sheet .skin-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.skin-sheet .skin-chips .chip { font-size: 14.5px; padding: 8px 13px; }
.skin-sheet .skin-avoid-box ul { display: grid; gap: 8px; margin: 0; padding-inline-start: 20px; }
.skin-sheet .skin-avoid-box li { font-size: 16px; line-height: 1.6; text-align: start; }
.skin-sheet .skin-preg-banner { display: grid; gap: 8px; text-align: start; }
.skin-sheet .skin-preg-banner small { font-size: 15px; line-height: 1.6; }
.skin-sheet .skin-facts div { text-align: center; }

.skin-sheet .skin-routine-grid { display: grid; gap: 10px; }
.skin-sheet .skin-routine-card { padding: 14px 16px; text-align: start; }
.skin-sheet .skin-routine-title { margin-bottom: 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.pts-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pts-steps li { display: flex; align-items: flex-start; gap: 12px; }
.pts-steps li span { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; background: rgba(0, 0, 0, .08); font-size: 13px; font-weight: 800; }
.pts-steps li p { margin: 0; font-size: 16px; line-height: 1.6; text-align: start; overflow-wrap: anywhere; }

.skin-quiz { text-align: start; }
.skin-quiz h2 { font-size: 22px; text-align: start; }
.skin-quiz .skin-case { font-size: 16.5px; line-height: 1.75; text-align: start; }
.skin-quiz .skin-option { padding: 14px 16px; font-size: 16px; line-height: 1.5; text-align: start; }
.skin-quiz .skin-expl-card { display: grid; gap: 8px; padding: 14px 16px; text-align: start; }
.skin-quiz .skin-expl-tag { justify-self: start; }
.skin-quiz .skin-expl-head b { font-size: 16px; }
.skin-quiz .skin-quiz-nav { flex-wrap: wrap; }

.skin-list .skin-item { text-align: start; }
.skin-item-title b { font-size: 17px; line-height: 1.3; }
.skin-item-sub { display: block; margin-top: 4px; font-size: 14.5px; line-height: 1.5; }
.skin-sheet .pts, .skin-quiz .pts { margin: 0; padding: 0; }
.skin-sheet .skin-avoid-box ul { margin: 0; padding: 0; list-style: none; }
.skin-sheet .skin-avoid-box li { position: relative; padding-inline-start: 20px; }
.skin-sheet .skin-avoid-box li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: #d9534f; }
.bidi-nw { white-space: nowrap; }

/* Brand quiz: the pinned footer keeps Why and Next in view; the explanation is its own card */
.bq-foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px -18px -22px; padding: 14px 18px 22px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 26%); }
.bq-why-card { display: grid; gap: 14px; margin-top: 4px; }
.bq-verdict { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 9px 15px; border-radius: 99px; font-size: 14px; font-weight: 700; }
.bq-verdict.is-right { background: #e6f5ec; color: #1b6b3c; }
.bq-verdict.is-wrong { background: #fdeceb; color: #a3231f; }
.bq-answer { margin: 0; padding: 14px 16px; border: 1.5px solid #2e9e5b; border-radius: 18px; background: #f2faf5; color: #1b6b3c; font-size: 16px; font-weight: 600; line-height: 1.45; text-align: start; }
.bq-why-card .bq-insight { margin-top: 0; }
.bq-insight-body b { font-size: 16px; }
.bq-insight-body p { font-size: 15px; }
.bq-sheet .bq-answer { text-align: start; }

/* Content Protection: prevent drag-select and bulk copying of clinical cases, pearls, and quiz options */
.cs-case, .cs-guidance-card, .cs-pearl-box, .cs-section,
.bq-why-card, .bq-card, .bq-opts, .bq-q, .bq-opt {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.bq-opt.is-verifying {
  opacity: 0.7;
  pointer-events: none;
}

/* Brand hub: a compact two-column grid and a details sheet */
.bh-search { margin: 0 0 8px; }
.bh-count { margin: 0 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.bh-tile { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); text-align: start; cursor: pointer; transition: transform .15s ease; }
.bh-tile:active { transform: scale(.98); }
.bh-tile-img { display: grid; place-items: center; height: 96px; border-radius: 14px; background: linear-gradient(180deg, #f4f8fb, #eaf2f8); overflow: hidden; }
.bh-tile-img img { max-width: 100%; max-height: 84px; object-fit: contain; }
.bh-tile b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.bh-sheet { display: grid; gap: 10px; padding-top: 6px; text-align: start; }
.bh-sheet-img { display: grid; place-items: center; height: 170px; border-radius: 20px; background: linear-gradient(180deg, #f4f8fb, #eaf2f8); overflow: hidden; }
.bh-sheet-img img { max-width: 100%; max-height: 150px; object-fit: contain; }
.bh-sheet h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.bh-sheet p { margin: 0; font-size: 15px; line-height: 1.6; }
.bh-sheet .btn { margin-top: 6px; }
.bq-sheet .bh-sheet, .bq-sheet .bh-sheet * { text-align: start; }
.bh-tile-img { height: 84px; }
.bh-tile-img img { max-height: 74px; }

/* Brand hub: smaller, lighter product names */
.bh-tile { gap: 6px; padding: 9px 9px 11px; }
.bh-tile b { font-size: 13px; font-weight: 600; line-height: 1.35; }
.bh-tile-img { height: 76px; }
.bh-tile-img img { max-height: 66px; }
.bh-sheet h3 { font-size: 17px; font-weight: 600; }
.bh-sheet p { font-size: 14.5px; }
.bh-empty-state, .bh-no-quiz { display: flex; align-items: center; justify-content: center; padding: 24px 12px; min-height: 110px; width: 100%; box-sizing: border-box; }

/* Admin brand builder: each field is a label above a full-width input, and nothing runs past the card */
.bc-form .field-box { display: grid; gap: 6px; align-items: start; padding: 10px 14px 12px; border-radius: 18px; min-width: 0; }
.bc-form .field-box > small { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.bc-form .field-input { width: 100%; min-width: 0; box-sizing: border-box; font-size: 16px; }
.bc-form textarea.field-input { min-height: 74px; resize: vertical; }
.bc-form { min-width: 0; }
.bc-q-body .field-box { background: #fff; }
.bc-form .field-box { height: auto; min-height: 0; overflow: visible; background: #fff; border: 1.5px solid var(--line); }
.bc-form .field-box > input, .bc-form .field-box > textarea { height: auto; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 12px; background: #faf8f4; }
.bc-form .field-box:focus-within { border-color: var(--orange); }
.bc-form .field-box:focus-within > small { color: var(--orange); }
.bc-new { overflow: hidden; }
.bc-form > *, .bc-form .bc-grid > * { max-width: 100%; box-sizing: border-box; min-width: 0; }

/* Product pictures sit on plain white: no tint, no border, and an off-white picture background blends in */
.bh-tile-img, .bh-sheet-img, .bh-thumb { background: #fff; border: 0; box-shadow: none; }
.bh-tile-img img, .bh-sheet-img img, .bh-thumb img { mix-blend-mode: multiply; }
.bc-thumb, .bc-preview { background: #fff; }
.bc-thumb img, .bc-preview img { mix-blend-mode: multiply; }

/* Admin brand card: three icon buttons (preview, add product, delete) instead of text buttons */
.bc-actions { justify-content: flex-end; gap: 8px; }
.bc-actions [data-add-prod] { color: var(--orange); }
.bc-prod .bc-icons .icon-btn { width: 40px; height: 40px; }
.bc-actions .icon-btn { width: 42px; height: 42px; }

/* Brands as levels: companies, a company's profile, one product */
.bp-list, .bp-prods { display: grid; gap: 10px; }
.bp-brand, .bp-prod { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; color: var(--ink); text-decoration: none; transition: transform .15s ease; }
.bp-brand:active, .bp-prod:active { transform: scale(.985); }
.bp-logo { display: grid; place-items: center; flex-shrink: 0; width: 56px; height: 56px; padding: 8px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.bp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-body { display: grid; flex: 1; gap: 3px; min-width: 0; }
.bp-body b { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.bp-body small { font-size: 13px; line-height: 1.4; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-count { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 99px; background: var(--orange-soft, #fff1e7); color: var(--orange); font-size: 13px; font-weight: 800; }
.bp-go { flex-shrink: 0; opacity: .45; }
[dir="rtl"] .bp-go svg { transform: scaleX(-1); }

.bp-hero { display: grid; justify-items: center; gap: 8px; margin: 4px 0 18px; padding: 22px 16px 18px; border: 1px solid var(--line); border-radius: 28px; background: #fff; text-align: center; }
.bp-hero-logo { display: grid; place-items: center; width: 88px; height: 88px; padding: 12px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 26px; background: #fff; }
.bp-hero-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-hero h1 { margin: 4px 0 0; font-size: 22px; font-weight: 700; line-height: 1.25; }
.bp-hero p { margin: 0; font-size: 14px; }
.bp-thumb { display: grid; place-items: center; flex-shrink: 0; width: 58px; height: 58px; padding: 4px; box-sizing: border-box; border-radius: 16px; background: #fff; overflow: hidden; }
.bp-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.bp-prod .bp-body b { font-size: 15px; font-weight: 600; }

.bp-product { display: grid; gap: 12px; padding: 8px 4px 18px; }
.bp-brand-chip { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 13px; font-weight: 700; }
.bp-chip-logo { display: grid; place-items: center; width: 24px; height: 24px; }
.bp-chip-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-product-img { display: grid; place-items: center; min-height: 220px; padding: 18px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 28px; background: #fff; }
.bp-product-img img { max-width: 100%; max-height: 220px; object-fit: contain; mix-blend-mode: multiply; }
.bp-product h1 { margin: 4px 0 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.bp-actives { margin: 0; font-size: 14px; color: var(--ink-2); }
.bp-indication { margin: 0; font-size: 15.5px; line-height: 1.65; }
.bp-product .btn { margin-top: 6px; }

/* Admin brands as levels: company cards, a company page, forms as pages */
.bc-company { display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 22px; background: #fff; color: var(--ink); text-align: start; cursor: pointer; transition: transform .15s ease; }
.bc-company:active { transform: scale(.985); }
.bc-head h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bc-head { gap: 10px; }
.bc-plus { color: var(--orange); }
.bc-page-icons { display: flex; flex-shrink: 0; gap: 8px; }
.bc-hero { display: grid; justify-items: center; gap: 8px; margin: 0 0 14px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 26px; background: #fff; text-align: center; }
.bc-hero-logo { display: grid; place-items: center; width: 84px; height: 84px; padding: 10px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 24px; background: #fff; font-size: 22px; font-weight: 800; }
.bc-hero-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bc-hero p { margin: 0; font-size: 14px; }
.bc-subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px 10px; font-size: 15px; }
.bc-form-page { padding: 0; }

/* Update banner: a new version is ready; the person taps it to load it */
#update-banner { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 12px; right: 12px; z-index: 9000; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 18px; background: #1e293b; color: #fff; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45); transform: translateY(-140%); transition: transform .3s ease; }
#update-banner.show { transform: translateY(0); }
#update-banner .update-text { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 700; }
#update-banner .update-btn { flex-shrink: 0; padding: 8px 14px; border: 0; border-radius: 99px; background: var(--orange, #f95e08); color: #fff; font-size: 13px; font-weight: 800; cursor: pointer; }

/* Pull to refresh on the home screen */
#pull-indicator { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; z-index: 8900; margin-left: -90px; width: 180px; padding: 8px 12px; border-radius: 99px; background: #fff; color: var(--ink); text-align: center; font-size: 13px; font-weight: 700; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(-40px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
#pull-indicator.show { opacity: 1; }

/* Barcode camera: a full app screen. A rounded viewfinder centred on the screen, a white frame in the middle, no glow. */
.camera-modal {
  background: var(--bg, #fcfaf6);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.camera-modal-content {
  max-width: 560px;
  height: 100%;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  gap: 14px;
  box-sizing: border-box;
}

.camera-modal-head {
  min-height: 48px;
}

.camera-modal-title {
  font-size: 17px;
  font-weight: 800;
}

.scanner-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.scanner-viewport-wrap {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  border-radius: 26px;
  background: #111;
  box-shadow: none;
}

/* The frame is centred on both axes, and the area around it is dimmed (no glow). */
.scanner-guide {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76%;
  height: 38%;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

.scanner-corner {
  width: 28px;
  height: 28px;
  border-width: 4px;
  border-color: #ffffff;
}

.scanner-corner.tl { border-top-left-radius: 14px; }
.scanner-corner.tr { border-top-right-radius: 14px; }
.scanner-corner.bl { border-bottom-left-radius: 14px; }
.scanner-corner.br { border-bottom-right-radius: 14px; }

.scanner-laser {
  left: 12px;
  right: 12px;
  height: 2px;
  background: #f95e08;
  box-shadow: none;
  animation: scanLaserPlain 1.6s linear infinite alternate;
}

@keyframes scanLaserPlain {
  0% { top: 10%; }
  100% { top: 90%; }
}

.scanner-starting {
  background: #111;
}

.scanner-starting-icon {
  animation: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.scanner-starting-spinner {
  border-top-color: #ffffff;
}

.scanner-starting-text {
  color: #d4d4d8;
}

.scanner-hint {
  align-self: center;
  padding: 10px 16px;
  border-radius: 99px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, #0f172a);
  margin: 0;
}
/* The viewfinder fills the free height of the camera screen (it overrides the small phone strip in mobile.css). */
.camera-modal .scanner-viewport-wrap { height: auto !important; max-height: none !important; aspect-ratio: auto !important; flex: 1 1 auto; min-height: 240px; }

/* The camera shows the whole picture: nothing around the barcode is cut off. */
.camera-modal #barcode-reader video { object-fit: contain !important; }
.camera-modal-head { justify-content: flex-end; min-height: 44px; }
/* The frame is placed by one rule only: in a right-to-left page the old left/right pair put it off-centre and cut it. */
.camera-modal .scanner-viewport-wrap { direction: ltr; }
.camera-modal .scanner-guide { inset: 31% 12% !important; left: 12% !important; right: 12% !important; top: 31% !important; bottom: 31% !important; width: auto !important; height: auto !important; transform: none !important; }

/* Long generic names (combinations) wrap inside the card and shrink a little, so the card never breaks the screen. */
.result-head > div { min-width: 0; flex: 1 1 auto; }
.result-head h3 { font-size: clamp(15px, 4.6vw, 19px); line-height: 1.35; overflow-wrap: anywhere; word-break: break-word; }
.brand-rows li { min-width: 0; }
.brand-rows li b, .brand-rows li span { overflow-wrap: anywhere; max-width: 100%; }
