/* === LILAC APP CHROME =====================================================
   Sidebar shell, Study Chat bar and shared soft components for the "Lilac"
   look: tinted ground, near-white rounded surfaces used only for distinct
   objects, Nunito throughout. Tokens live in calm_paper.css (:root).
   ========================================================================== */

/* ---- Shell ---------------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 36px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  align-items: start;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-mobilebar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-mobilebar__menu {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--cp-card);
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.app-mobilebar__menu svg { width: 20px; height: 20px; }
.app-mobilebar__end { display: flex; align-items: center; gap: 8px; }
.app-mobilebar__signin { font-weight: 700; color: var(--ink-soft); }

/* Focus pages (players) hide the sidebar on desktop; the drawer still opens. */
.app-shell--focus { grid-template-columns: minmax(0, 1fr); }
.app-shell--focus > .app-mobilebar { display: flex; }

/* ---- Logo ----------------------------------------------------------------- */
.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.app-logo__mark {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent);
  display: grid;
  place-items: center;
}

.app-logo__mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2.5px solid var(--accent-ink);
}

/* ---- Sidebar -------------------------------------------------------------- */
.app-sidebar {
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.app-shell--focus > .app-sidebar { display: none; }

.app-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 6px;
}

.app-sidebar__close {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
}

.app-sidebar__close svg { width: 18px; height: 18px; margin: auto; }

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-sidebar__group { display: flex; flex-direction: column; gap: 1px; }

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  color: var(--ink-mute);
  transition: background-color .15s, color .15s;
}

.app-sidebar__link .dashboard-icon,
.app-sidebar__link > svg {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--accent);
}

a.app-sidebar__link:hover { background: color-mix(in srgb, var(--cp-card) 70%, transparent); color: var(--ink); }

.app-sidebar__link.is-active {
  background: var(--cp-card);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.app-sidebar__link--sub {
  padding: 7px 12px 7px 43px;
  font-weight: 600;
  font-size: 14.5px;
}

.app-sidebar__link--label { cursor: default; }
.app-sidebar__link.is-disabled { opacity: .55; cursor: not-allowed; }

.app-sidebar__count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
}

.app-sidebar__heading {
  margin: 16px 12px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint);
}

.app-sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.app-sidebar__auth { display: grid; gap: 8px; padding: 0 4px; }

/* Track switcher */
.app-track { display: grid; gap: 4px; padding: 0 4px; }
.app-track__label { font-size: 12.5px; font-weight: 700; color: var(--ink-faint); padding-left: 4px; }
.app-track__select {
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: var(--paper-2);
  padding: 9px 12px;
  font: 700 14px/1.2 var(--font-ui);
  color: var(--ink);
  cursor: pointer;
}

/* Account menu */
.app-account { position: relative; }
.app-account__summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.app-account__summary::-webkit-details-marker { display: none; }
.app-account__summary:hover,
.app-account[open] .app-account__summary { background: color-mix(in srgb, var(--cp-card) 70%, transparent); }

.app-account__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: inline-grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.app-account__meta { display: grid; min-width: 0; }
.app-account__email { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-account__plan { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); }

.app-account__menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  padding: 6px;
  background: var(--cp-card);
  border-radius: 14px;
  box-shadow: 0 12px 32px -12px rgba(60, 30, 70, .28), 0 0 0 1px var(--line);
}

.app-account__item,
.app-account__form button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: 600 14px/1.2 var(--font-ui);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}
.app-account__item:hover { background: var(--paper); color: var(--ink); }
.app-account__item--danger { color: var(--bad); }
.app-account__lang select { border: 0; background: transparent; font: inherit; color: var(--ink); max-width: 8rem; }

/* ---- Buttons -------------------------------------------------------------- */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 15px/1.2 var(--font-ui);
  cursor: pointer;
  transition: filter .15s, background-color .15s;
  text-decoration: none;
}
.app-btn:hover { filter: brightness(1.06); color: var(--accent-ink); }
.app-btn--soft { background: var(--accent-soft); color: var(--accent); }
.app-btn--soft:hover { color: var(--accent); }
.app-btn--small { padding: 8px 14px; font-size: 14px; }
.cp-page a.app-btn { color: var(--accent-ink); }
.cp-page a.app-btn--soft { color: var(--accent); }

.app-surface {
  background: var(--cp-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.app-label { font-size: 14px; font-weight: 700; color: var(--ink-faint); margin: 0 0 10px; }

/* ---- Study Chat bar ------------------------------------------------------- */
.chat-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 6px 6px 18px;
  background: var(--cp-card);
  border: 1.5px solid transparent;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: border-color .15s, box-shadow .15s;
}

.chat-bar:focus-within {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft);
}

.chat-bar__icon { width: 20px; height: 20px; flex: none; color: var(--accent); }

.chat-bar__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 600 16px/1.3 var(--font-ui);
  color: var(--ink);
  padding: 8px 0;
}
.chat-bar__input::placeholder { color: var(--ink-faint); font-weight: 600; }
.chat-bar__input:focus { box-shadow: none; outline: 0; }

.chat-bar__hint {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--ink-faint);
  font: 700 12px/1 var(--font-ui);
}
.chat-bar:focus-within .chat-bar__hint { display: none; }

.chat-bar__send {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.chat-bar__send svg { width: 18px; height: 18px; }
.chat-bar__send:hover { filter: brightness(1.08); }

/* ---- Mobile / drawer ------------------------------------------------------ */
@media (max-width: 1023.98px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .app-shell > .app-mobilebar { display: flex; }
  .app-shell > .app-sidebar { display: none; }
  .chat-bar__hint { display: none; }
}

.app-shell > .app-sidebar.is-drawer-open {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: min(19rem, 86vw);
  max-height: none;
  height: 100dvh;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-radius: 0 22px 22px 0;
  box-shadow: 0 24px 60px rgba(40, 20, 50, .3);
  animation: dashboard-drawer-in 180ms ease-out;
}
.app-sidebar.is-drawer-open .app-sidebar__close { display: inline-grid; }

/* Native web sheets render without app chrome. */
.native-app .app-sidebar,
.native-app .app-mobilebar,
.native-app .chat-bar { display: none !important; }
.native-app .app-shell { display: block; }

.app-shell .dashboard-backdrop.is-active {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(42, 34, 48, .38);
  cursor: pointer;
  animation: dashboard-backdrop-in 180ms ease-out;
}

/* ---- Today / dashboard ---------------------------------------------------- */
.app-greeting h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.app-greeting p { margin: 4px 0 0; font-weight: 600; color: var(--ink-mute); }

.app-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-weight: 600;
}
.app-notice p { flex: 1; min-width: 14rem; margin: 0; line-height: 1.45; }
.app-notice b, .app-notice strong { color: var(--accent); }

/* Practice tiles: one accent, soft surfaces, no gradients or tilts. */
.cp-page .cp-mode {
  --mode-accent: var(--accent);
  border: 0;
  border-radius: var(--radius);
  background: var(--cp-card);
  box-shadow: var(--shadow-soft);
  min-height: 124px;
}
.cp-page .cp-mode:hover,
.cp-page .cp-mode-wrap:hover > .cp-mode {
  transform: none;
  box-shadow: 0 1px 2px rgba(60, 30, 70, .06), 0 14px 32px -14px rgba(60, 30, 70, .22);
  border-color: transparent;
}
.cp-page .cp-mode-wrap:hover { transform: translateY(-2px); }
.cp-page .cp-mode .ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}
.cp-page .cp-mode:hover .ic,
.cp-page .cp-mode-wrap:hover > .cp-mode .ic { transform: none; }
.cp-page .cp-mode .ttl { font-weight: 800; font-size: 17px; }
.cp-page .cp-practice--lead .cp-modes > *,
.cp-page .cp-practice--lead .cp-modes > * > .cp-mode,
.cp-page .cp-practice--clinical .cp-modes > *,
.cp-page .cp-practice--clinical .cp-modes > * > .cp-mode { --mode-accent: var(--accent); }
.cp-page .cp-mode--feature { background: var(--cp-card); }
.cp-page .cp-mode__quick {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  font-weight: 700;
  box-shadow: none !important;
}

.cp-page .cp-continue .cp-mode { min-height: 0; }
.cp-page .cp-continue .cp-mode .ttl { font-weight: 700; }

.cp-page .cp-kicker,
.cp-page .cp-label-row .right {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}

/* ---- Marketing pages (landing, pricing) ----------------------------------- */
.site {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 48px;
  font-family: var(--font-ui);
  color: var(--ink);
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding: 20px 0 12px;
}
.site-nav__links { display: flex; align-items: center; gap: 22px; font-weight: 700; color: var(--ink-mute); }
.site-nav__links > a:hover, .site-nav__links > a[aria-current="page"] { color: var(--ink); }
.site-nav__actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.site-nav__signin { font-weight: 700; color: var(--ink-mute); }
.site-nav__signin:hover { color: var(--ink); }

.site-chat { max-width: 760px; margin: 18px auto 0; }
.site-chat__note { margin: 10px 0 0; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-faint); }

.site-lede { margin: 18px 0 0; max-width: 32em; font-size: 19px; line-height: 1.55; color: var(--ink-mute); }
.site-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.site-link { color: var(--accent); font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; }
.cp-page a.site-link { color: var(--accent); }

.site-hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0 72px;
}
.site-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.site-hero h1 span { color: var(--accent); }
.site-stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.site-marksheet { margin: 0; padding: 22px 24px; }
.site-marksheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.site-marksheet header b { font-size: 17px; font-weight: 800; }
.site-marksheet__score {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.site-marksheet ul { list-style: none; margin: 0; padding: 0; }
.site-marksheet li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: 15px; font-weight: 600; }
.site-marksheet__note {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mute);
}

.site-tick {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
}
.site-tick svg { width: 13px; height: 13px; }
.site-tick.is-met { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.site-tick.is-missed { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }

.site-section {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--rule);
}
.site-section h2,
.price-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}

.site-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.site-feature__badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.site-feature__badge svg { width: 20px; height: 20px; }
.site-feature h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--ink); }
.site-feature p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-mute); }

.site-tracks {
  list-style: none;
  margin: 0;
  padding: 6px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
}
.site-tracks li { border-bottom: 1px solid var(--line); }
.site-tracks a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-weight: 700; color: var(--ink); }
.site-tracks a:hover span:first-child { color: var(--accent); }
.site-tracks__exam { font-size: 14px; font-weight: 600; color: var(--ink-faint); text-align: right; }
.site-price { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 22px; font-size: 18px; }
.site-price p { margin: 0; }
.site-price b { color: var(--ink); font-weight: 800; }

.site-quote { padding: 56px 0 24px; border-top: 1px solid var(--rule); }
.site-quote blockquote { margin: 0; max-width: 30em; font-size: 24px; font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; color: var(--ink); }
.site-quote p { margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-faint); }

.site-partners { padding: 40px 0; text-align: center; }
.site-partners__logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 32px; opacity: .55; }
.site-partners__logos img { height: 34px; width: auto; filter: grayscale(1); }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faint);
}
.site-foot a:hover { color: var(--ink); }
.site-foot__social { margin-left: auto; display: flex; gap: 18px; }

/* Pricing */
.price-head { padding: 48px 0 28px; max-width: 36em; }
.price-head h1 { font-size: clamp(34px, 5vw, 50px); }
.price-offer { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: start; }
.price-card { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.price-card h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.price-card--pro { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-soft); }
.price-card__amount { margin: 10px 0 0; font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.price-card__term { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-faint); }
.price-card__owned { margin: 8px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.price-list { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; gap: 10px; }
.price-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: var(--ink-soft); }
.price-list .site-tick { width: 20px; height: 20px; }

.price-options { display: grid; gap: 8px; width: 100%; margin-top: 16px; }
.price-option {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--paper);
}
.price-option__label { display: grid; }
.price-option__label b { font-weight: 800; color: var(--ink); }
.price-option__label span { font-size: 13px; font-weight: 600; color: var(--ink-mute); }
.price-option__price { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price-option__price s { margin-right: 6px; font-size: 14px; font-weight: 600; color: var(--ink-faint); }
.price-option__form { margin: 0; }

.price-faq { margin-top: 48px; max-width: 46em; display: grid; gap: 8px; }
.price-faq details { padding: 0 20px; border-radius: var(--radius-sm); background: var(--cp-card); box-shadow: var(--shadow-soft); }
.price-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; font-weight: 800; cursor: pointer; }
.price-faq summary::-webkit-details-marker { display: none; }
.price-faq summary::after { content: "+"; color: var(--ink-faint); }
.price-faq details[open] summary::after { content: "–"; }
.price-faq p { margin: 0; padding: 0 0 16px; color: var(--ink-mute); font-weight: 600; }

.price-coupon { margin: 36px 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.price-coupon__form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.price-coupon__form label { font-size: 14px; font-weight: 700; color: var(--ink-faint); }
.price-coupon__form input[type="text"] {
  border: 0;
  border-radius: 999px;
  background: var(--cp-card);
  box-shadow: var(--shadow-soft);
  padding: 9px 14px;
  font: 700 14px var(--font-ui);
  text-transform: uppercase;
  color: var(--ink);
}
.price-coupon__msg { width: 100%; margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-mute); }
.price-coupon__msg.is-error { color: var(--bad); }
.price-coupon__msg.is-ok { color: var(--good); }

@media (max-width: 900px) {
  .site-hero, .site-section, .price-offer { grid-template-columns: minmax(0, 1fr); }
  .site-hero { gap: 36px; padding: 40px 0 48px; }
  .site-section { gap: 24px; padding: 40px 0; }
  .site-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .site-nav__links { order: 3; width: 100%; }
  .site-features, .site-tracks { grid-template-columns: minmax(0, 1fr); }
  .price-option { grid-template-columns: 1fr auto; }
  .price-option__form { grid-column: 1 / -1; }
  .price-option__form .app-btn { width: 100%; }
  .site-foot__social { margin-left: 0; }
}

.site-nav .cp-nav__dropdown-trigger {
  font: inherit;
  font-weight: 700;
  color: var(--ink-mute);
}
