/* Course shell: /app/continue, /app/course/7day, /app/profile (Phase 0).
   Loaded after app.css — overrides the locked full-height layout so these
   pages scroll like normal documents. */

html,
body {
  height: auto;
  min-height: 100%;
  overflow: auto;
}

body {
  background: var(--bb-page);
  color: var(--bb-ink);
  font-family: var(--bb-font);
}

.shell {
  max-width: 520px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* Top bar: brand + profile icon */
.shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.shell-brand {
  font-family: var(--bb-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bb-muted);
}
.shell-logo-link {
  display: inline-block;
  text-decoration: none;
}
.shell-logo {
  display: block;
  height: 30px;
  width: auto;
  object-fit: contain;
}
.shell-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--bb-line);
  background: var(--bb-surface);
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
}
.shell-profile img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Hero */
.shell-hero {
  margin-bottom: 24px;
}
.shell-title {
  font-family: var(--bb-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.shell-belt {
  font-family: var(--bb-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bb-muted);
  margin: 0;
}
.shell-progress {
  margin: 16px 0 4px;
  font-size: 0.92rem;
  color: var(--bb-body);
  font-weight: 600;
}
.shell-bar {
  height: 8px;
  border-radius: 6px;
  background: var(--bb-line);
  overflow: hidden;
  margin: 10px 0 0;
}
.shell-bar > span {
  display: block;
  height: 100%;
  background: var(--bb-blue);
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* Primary CTA */
.shell-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 22px 0 30px;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  background: var(--bb-blue);
  color: #fff;
  font-family: var(--bb-font);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 68, 226, 0.28);
}
.shell-cta:hover {
  background: var(--bb-blue-hover);
}

/* Secondary action (e.g. "У меня уже есть доступ") */
.shell-cta--ghost {
  background: transparent;
  color: var(--bb-blue);
  box-shadow: none;
  border: 1.5px solid var(--bb-blue);
  margin-top: 0;
}
.shell-cta--ghost:hover {
  background: var(--bb-blue-soft);
}

/* Secondary logout action on the profile (reuses the landing secondary look) */
.shell-logout {
  width: 100%;
  box-sizing: border-box;
  margin-top: 24px;
}

/* Login form */
.shell-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}
.shell-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1.5px solid var(--bb-line, #d7deea);
  border-radius: 14px;
  font-family: var(--bb-font);
  font-size: 1rem;
  background: #fff;
  color: var(--bb-ink);
}
.shell-input:focus {
  outline: none;
  border-color: var(--bb-blue);
}
.shell-form .shell-cta {
  margin: 6px 0 0;
}

/* Document pages (terms / privacy) */
.shell-prose {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}
.shell-prose h2 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bb-ink, #0a1430);
}
.shell-prose p,
.shell-prose li {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--bb-body, #41496a);
}
.shell-prose ul {
  margin: 0 0 10px;
  padding-left: 20px;
}
.shell-prose a {
  color: var(--bb-blue, #0044e2);
}

/* Section heading */
.shell-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bb-muted);
  margin: 0 0 12px;
}

/* Day list */
.shell-days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shell-day {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bb-surface);
  border: 1px solid var(--bb-card-border);
  text-decoration: none;
  color: inherit;
}
a.shell-day:hover {
  border-color: var(--bb-card-ring);
}
.shell-day.is-locked {
  opacity: 0.55;
  cursor: default;
}
.shell-day__num {
  flex-shrink: 0;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bb-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  background: var(--bb-blue-soft);
  color: var(--bb-blue);
}
.shell-day.is-locked .shell-day__num {
  background: var(--bb-line);
  color: var(--bb-muted);
}
.shell-day__body {
  flex: 1;
  min-width: 0;
}
.shell-day__name {
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0 0 2px;
}
.shell-day__status {
  font-size: 0.8rem;
  color: var(--bb-muted);
  margin: 0;
}
.shell-day__status.is-done {
  color: #15803d;
}
.shell-day__status.is-active {
  color: var(--bb-blue);
  font-weight: 600;
}
.shell-day__mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--bb-muted);
}
.shell-day__mark.is-done {
  color: #15803d;
}

/* Centered states (continue / profile) */
.shell-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

/* Shared chrome: top logo bar + unified footer (injected by site-chrome.js). */
body.has-site-chrome {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
body.has-site-chrome > main {
  flex: 1 1 auto;
  min-height: 0;
}
.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 18px 12px;
  box-sizing: border-box;
}
.site-topbar-link {
  display: inline-block;
  text-decoration: none;
}
.site-topbar-link img {
  display: block;
  height: 42px;
  width: auto;
}
.site-footer {
  margin-top: auto;
  padding: 18px 20px max(18px, env(safe-area-inset-bottom));
  text-align: center;
}
.site-footer-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 0 0 6px;
}
.site-footer-nav a {
  color: var(--bb-blue, #0044e2);
  font-size: 13px;
  text-decoration: none;
}
.site-footer-nav a:hover {
  text-decoration: underline;
}
.site-footer-dot {
  color: var(--bb-muted, #8a93a6);
}
.site-footer-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--bb-muted, #8a93a6);
}

/* App-zone CTAs reuse the landing button visuals (hero primary/secondary) but
   go full-width on mobile, mirroring the course template ("Начать тест"). */
.shell-center .land-cta-row {
  width: 100%;
  max-width: 420px;
  margin: 0;
}
.shell-center .land-cta-shell,
.shell-center .land-btn {
  width: 100%;
}
.shell-muted {
  color: var(--bb-muted);
  font-size: 0.95rem;
  margin: 0;
}
.shell-hero--profile {
  margin-bottom: 14px;
}
.shell-profile-lead {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--bb-body);
  line-height: 1.45;
}

/* Read-only field (e.g. Stripe email) */
.shell-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  margin-bottom: 26px;
  border-radius: 14px;
  background: var(--bb-surface);
  border: 1px solid var(--bb-card-border);
}
.shell-field__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-muted);
}
.shell-field__value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bb-ink);
  word-break: break-all;
}
.shell-field__hint {
  font-size: 0.78rem;
  color: var(--bb-muted);
}

/* Compact action pill (course row in profile) */
.shell-pill {
  flex-shrink: 0;
  align-self: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bb-blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.shell-pill:hover {
  background: var(--bb-blue-hover);
}
.shell-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--bb-line);
  border-top-color: var(--bb-blue);
  animation: shell-spin 0.8s linear infinite;
}
@keyframes shell-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Profile menu */
.shell-menu {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shell-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--bb-surface);
  border: 1px solid var(--bb-card-border);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}
a.shell-menu-item:hover {
  border-color: var(--bb-card-ring);
}
.shell-menu-item[aria-disabled='true'] {
  opacity: 0.55;
}
.shell-menu-item small {
  font-weight: 400;
  font-size: 0.74rem;
  color: var(--bb-muted);
}
.shell-back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.85rem;
  color: var(--bb-muted);
  text-decoration: none;
}
.shell-back:hover {
  color: var(--bb-blue);
}

/* Cookie consent — compact side banner (reuses land-note / shell-pill tokens) */
.cookie-consent{
  position:fixed;left:max(14px,env(safe-area-inset-left));
  bottom:max(14px,env(safe-area-inset-bottom));z-index:10000;
  width:min(272px,calc(100vw - 28px));margin:0;padding:12px 14px;
  text-align:left;border-radius:14px;background:var(--bb-surface);
  border:1px solid var(--bb-line);
  box-shadow:0 4px 24px rgba(0,0,0,.08);
}
.cookie-consent__text{
  margin:0 0 10px;font-size:12px;line-height:1.45;text-align:left;color:var(--bb-muted);
}
.cookie-consent__text a{
  color:var(--bb-blue);text-decoration:none;font-weight:600;
}
.cookie-consent__text a:hover{text-decoration:underline}
.cookie-consent__options{display:flex;flex-direction:column;gap:10px;margin:0 0 12px}
.cookie-consent__options[hidden]{display:none}
.cookie-consent__opt{
  display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;
}
.cookie-consent__opt-main{display:flex;flex-direction:column;gap:1px}
.cookie-consent__opt-name{font-size:12px;font-weight:700;color:var(--bb-body)}
.cookie-consent__opt-desc{font-size:11px;line-height:1.35;color:var(--bb-muted)}
.cookie-consent__opt input{
  flex-shrink:0;width:16px;height:16px;accent-color:var(--bb-blue);cursor:pointer;margin:0;
}
.cookie-consent__opt input:disabled{cursor:default;opacity:.55}
.cookie-consent__actions{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  justify-content:space-between;
}
.cookie-consent__accept{
  flex-shrink:0;padding:7px 12px;border-radius:999px;border:none;cursor:pointer;
  background:var(--bb-blue);color:#fff;font-size:12px;font-weight:700;
  font-family:var(--bb-font);line-height:1.2;
}
.cookie-consent__accept:hover{background:var(--bb-blue-hover)}
.cookie-consent__decline,.cookie-consent__settings{
  appearance:none;border:none;background:transparent;padding:0;
  font:inherit;font-size:12px;font-weight:600;color:var(--bb-muted);
  cursor:pointer;text-decoration:underline;text-underline-offset:2px;
}
.cookie-consent__decline:hover,.cookie-consent__settings:hover{color:var(--bb-body)}
