:root {
  color-scheme: dark;
  --brand-black: #0F0F0F;
  --brand-surface: #202020;
  --brand-green: #5DD62C;
  --brand-green-deep: #337418;
  --brand-white: #F8F8F8;
  --bg: var(--brand-black);
  --surface: var(--brand-surface);
  --surface-2: rgba(32, 32, 32, .96);
  --surface-3: rgba(248, 248, 248, .055);
  --line: rgba(248, 248, 248, .10);
  --line-soft: rgba(248, 248, 248, .06);
  --line-strong: rgba(93, 214, 44, .30);
  --text: var(--brand-white);
  --muted: rgba(248, 248, 248, .56);
  --muted-2: rgba(248, 248, 248, .68);
  --lime: var(--brand-green);
  --lime-soft: var(--brand-green);
  --lime-dark: var(--brand-green-deep);
  --accent-soft: rgba(93, 214, 44, .10);
  --accent-surface: rgba(51, 116, 24, .36);
  --on-accent: var(--brand-black);
  --danger: #ff7777;
  --safe-top-inset: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px), var(--app-safe-area-inset-top, 0px), var(--app-content-safe-area-inset-top, 0px));
  --safe-top-floor: 10px;
  --safe-top-clearance: 0px;
  --safe-top: calc(max(var(--safe-top-inset), var(--safe-top-floor)) + var(--safe-top-clearance));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px), var(--app-safe-area-inset-bottom, 0px), var(--app-content-safe-area-inset-bottom, 0px), 8px);
  --gutter-left: max(env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px), var(--app-safe-area-inset-left, 0px), var(--app-content-safe-area-inset-left, 0px), 18px);
  --gutter-right: max(env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px), var(--app-safe-area-inset-right, 0px), var(--app-content-safe-area-inset-right, 0px), 18px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root.telegram-fullscreen,
:root.fullscreen-pending {
  --safe-top-floor: 56px;
  --safe-top-clearance: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% -5%, rgba(93, 214, 44, .08), transparent 30%),
    var(--brand-black);
}

button, textarea, input, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(72px);
  opacity: .12;
}
.ambient-one { width: 180px; height: 180px; background: var(--lime); top: -120px; left: -60px; }
.ambient-two { width: 140px; height: 140px; background: var(--brand-green-deep); right: -100px; top: 36%; }

.app-shell {
  width: min(100%, 540px);
  height: min(var(--tg-viewport-stable-height, 100dvh), var(--app-visible-height, 100dvh));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  position: relative;
  isolation: isolate;
  background: rgba(15, 15, 15, .94);
}

.topbar { grid-row: 1; }
.context-card { grid-row: 2; }
.chat { grid-row: 3; }
.composer-wrap { grid-row: 4; }
.bottom-nav { grid-row: 5; }
.app-shell.fatal-state .context-card,
.app-shell.fatal-state .composer-wrap,
.app-shell.fatal-state .session-divider { display: none; }
.app-shell.fatal-state #menuButton { visibility: hidden; }
.app-shell.fatal-state .bottom-nav { display: none; }
.app-shell.fatal-state .chat {
  display: grid;
  align-items: center;
  padding-top: 12px;
  padding-bottom: calc(12px + var(--safe-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  padding: var(--safe-top) var(--gutter-right) 10px var(--gutter-left);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(15, 15, 15, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248,248,248,.035);
  color: var(--muted-2);
  display: grid;
  place-items: center;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}
.icon-button:active { transform: scale(.96); border-color: var(--line-strong); background: var(--accent-soft); }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button circle { fill: currentColor; stroke: none; }

.mentor-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  position: relative;
  isolation: isolate;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--lime);
  font-weight: 750;
  font-size: 13px;
  border: 1px solid rgba(93,214,44,.42);
  background: radial-gradient(circle at 50% 40%, rgba(93,214,44,.18), rgba(32,32,32,.74) 66%);
  box-shadow: inset 0 0 12px rgba(93,214,44,.07);
}
.avatar::before { content: ""; position: absolute; z-index: -1; inset: -15px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(93,214,44,.20) 0, rgba(93,214,44,.08) 38%, transparent 72%); filter: blur(5px); }
.avatar span { position: relative; z-index: 1; filter: drop-shadow(0 0 7px rgba(93,214,44,.45)); }
.identity-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.identity-copy strong { font-size: 16px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-copy > span { position: relative; display: block; min-width: 0; padding-left: 12px; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-copy i { position: absolute; left: 1px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(93,214,44,.07), 0 0 6px rgba(93,214,44,.48); transform: translateY(-50%); }

.context-card {
  width: calc(100% - var(--gutter-left) - var(--gutter-right));
  margin: 12px var(--gutter-right) 2px var(--gutter-left);
  padding: 12px 13px;
  border-radius: 15px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(110deg, rgba(51,116,24,.24), rgba(32,32,32,.96));
  box-shadow: inset 0 0 26px rgba(93,214,44,.025);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}
.context-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.context-card strong { color: var(--brand-green); font-size: 12px; letter-spacing: .01em; line-height: 1.25; }
.context-copy > span { color: var(--muted); font-size: 11px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context-card.expanded { align-items: flex-start; }
.context-card.expanded .context-copy > span { white-space: normal; overflow: visible; line-height: 1.45; }
.context-side { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.context-chevron { width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.context-card.expanded .context-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.plan-pill { flex: 0 0 auto; border: 1px solid rgba(93,214,44,.30); color: var(--brand-white); background: rgba(51,116,24,.32); border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; letter-spacing: .035em; line-height: 1; text-transform: uppercase; white-space: nowrap; }

.chat {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  padding: 0 var(--gutter-right) 64px var(--gutter-left);
  scrollbar-width: none;
}
.chat::-webkit-scrollbar { display: none; }
.session-divider { display: flex; align-items: center; gap: 12px; margin: 17px 0 16px; color: var(--muted); font-size: 11px; letter-spacing: .055em; text-transform: uppercase; }
.session-divider::before, .session-divider::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line)); }
.session-divider::after { transform: rotate(180deg); }

.messages { display: flex; flex-direction: column; gap: 15px; }
.message-row { display: flex; align-items: flex-end; gap: 9px; animation: message-in .26s ease both; }
.message-row.user { justify-content: flex-end; }
.message-row.mentor { padding-right: 8%; }
.message-avatar { width: 27px; height: 27px; border: 1px solid rgba(93,214,44,.35); border-radius: 50%; display: grid; place-items: center; color: var(--lime); font-size: 8px; font-weight: 800; box-shadow: 0 0 13px rgba(93,214,44,.1); flex: 0 0 27px; }
.message-bubble {
  max-width: min(88%, 430px);
  padding: 13px 15px;
  border-radius: 20px 20px 20px 7px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--brand-surface);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-row.user .message-bubble { border-radius: 20px 20px 7px 20px; background: var(--brand-green-deep); border-color: rgba(93,214,44,.24); }
.message-bubble strong, .message-bubble b { color: var(--text); font-weight: 700; }
.message-bubble em, .message-bubble i { color: var(--muted-2); }
.message-bubble code, .message-bubble pre { color: var(--text); background: rgba(248,248,248,.06); border-radius: 7px; }
.message-bubble code { padding: 2px 5px; }
.message-bubble p { margin: 0 0 .72em; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble pre { max-width: 100%; margin: 9px 0 0; padding: 10px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bubble ul,
.message-bubble ol { margin: 9px 0 0; padding-left: 20px; }
.message-bubble li + li { margin-top: 4px; }
.message-bubble.streaming::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -.16em; background: var(--lime); animation: blink .8s infinite; }
.message-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 6px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.message-tool { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: var(--muted-2); background: rgba(248,248,248,.035); font-size: 11px; }
.message-tool-copy { grid-column: 1 / -1; }
.message-tool-rating { min-width: 0; }
.message-tool:active, .message-tool.selected { color: var(--brand-green); border-color: var(--line-strong); background: var(--accent-soft); }
.message-tool:disabled { opacity: .58; }
.message-feedback-status { grid-column: 1 / -1; min-height: 0; color: var(--muted); font-size: 11px; text-align: center; }

.action-card {
  margin-top: 13px;
  border: 1px solid rgba(93,214,44,.22);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(51,116,24,.48), rgba(32,32,32,.96));
}
.action-eyebrow { color: var(--brand-green); text-transform: uppercase; letter-spacing: .11em; font-size: 11px; font-weight: 800; }
.action-title { margin-top: 7px; font-size: 15px; font-weight: 800; }
.action-meta { margin-top: 5px; color: var(--muted-2); font-size: 12px; line-height: 1.35; }
.handoff-button {
  width: 100%;
  margin-top: 11px;
  border: 0;
  border-radius: 11px;
  min-height: 44px;
  padding: 12px 14px;
  color: var(--on-accent);
  background: var(--brand-green);
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 6px 22px rgba(93,214,44,.12);
}
.handoff-button:disabled { opacity: .55; }
.handoff-button.is-loading:disabled,
.handoff-button.is-success:disabled { opacity: 1; filter: none; }
.handoff-button.is-loading::after,
.sheet-action.is-loading::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .75s linear infinite; }
.handoff-note { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; }

.quick-area { position: relative; margin-top: 18px; }
.quick-area::after { content: ""; position: absolute; z-index: 2; right: 0; bottom: 0; width: 30px; height: 46px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(15,15,15,.98)); }
.quick-caption { text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .025em; margin-bottom: 10px; }
.quick-list { display: flex; gap: 7px; overflow-x: auto; padding: 1px 30px 4px 1px; scroll-padding-inline: 1px 30px; scrollbar-width: none; }
.quick-list::-webkit-scrollbar { display: none; }
.quick-chip { flex: 0 0 auto; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; color: var(--text); background: var(--brand-surface); font-size: 12px; white-space: nowrap; }
.quick-chip:active { border-color: rgba(93,214,44,.32); color: var(--lime); }
.quick-chip:disabled { opacity: .45; }

.composer-wrap { border-top: 1px solid var(--line-soft); background: rgba(15,15,15,.94); padding: 7px var(--gutter-right) 10px var(--gutter-left); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.session-status { min-height: 20px; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: center; display: flex; align-items: center; justify-content: center; }
.session-status strong { color: var(--brand-green); }
.composer { min-height: 51px; border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: flex-end; gap: 8px; padding: 6px; background: var(--brand-surface); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(93,214,44,.33); box-shadow: 0 0 0 3px rgba(93,214,44,.035); }
.composer textarea { resize: none; max-height: 112px; min-height: 44px; overflow-y: hidden; flex: 1; border: 0; outline: 0; padding: 11px 8px 8px; color: var(--text); background: transparent; line-height: 1.35; font-size: 16px; }
.composer textarea::placeholder { color: var(--muted); opacity: 1; }
.send-button { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; border: 1px solid var(--brand-green); background: var(--brand-green); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 0 20px rgba(93,214,44,.18); }
.send-button:disabled { background: rgba(248,248,248,.055); color: rgba(248,248,248,.30); border-color: var(--line-soft); box-shadow: none; }
.send-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.bottom-nav { min-height: calc(69px + var(--safe-bottom)); padding: 8px var(--gutter-right) var(--safe-bottom) var(--gutter-left); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); background: var(--brand-black); position: relative; }
.nav-item { position: relative; min-width: 0; min-height: 48px; border: 0; border-radius: 12px; padding: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; transition: color .16s ease, background-color .16s ease; }
.nav-item::before { content: ""; position: absolute; top: -9px; left: 50%; width: 38px; height: 2px; border-radius: 99px; background: var(--lime); box-shadow: 0 0 12px var(--lime); opacity: 0; transform: translateX(-50%) scaleX(.4); transition: opacity .18s ease, transform .18s ease; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-item > span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.active { color: var(--lime); }
.nav-item.active::before { opacity: 1; transform: translateX(-50%) scaleX(1); }
.nav-item.locked { color: rgba(248,248,248,.38); }
.nav-lock { position: absolute; z-index: 1; top: -1px; right: calc(50% - 23px); width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 50%; background: var(--brand-surface); display: grid; place-items: center; color: var(--muted); }
.nav-lock svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }

.mentor-dashboard { margin: 14px 0 18px; }
.dashboard-skeleton { height: 218px; border-radius: 21px; }
.mentor-dashboard > div:last-child { display: grid; gap: 11px; }
.dashboard-hero,
.dashboard-next-step,
.mentor-observation,
.unfinished-card {
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 15px;
  background: var(--brand-surface);
}
.dashboard-hero {
  border-color: rgba(93,214,44,.2);
  background:
    radial-gradient(circle at 88% 12%, rgba(93,214,44,.11), transparent 34%),
    var(--brand-surface);
}
.section-eyebrow { color: var(--brand-green); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.dashboard-hero h1,
.view-header h1 { margin: 6px 0 0; font-size: clamp(21px, 6vw, 28px); line-height: 1.12; letter-spacing: -.035em; }
.goal-chip { display: inline-flex; max-width: 100%; margin-top: 12px; border: 1px solid rgba(93,214,44,.2); border-radius: 999px; padding: 7px 10px; color: var(--text); background: var(--accent-soft); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.priority-line { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); display: grid; gap: 4px; }
.priority-line > span { color: var(--muted); font-size: 11px; }
.priority-content { position: relative; min-height: 24px; overflow: hidden; border-radius: 9px; display: flex; align-items: center; }
.priority-value { font-size: 14px; line-height: 1.42; }
.priority-line.is-locked .priority-value { filter: blur(5px); opacity: .3; user-select: none; pointer-events: none; }
.priority-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 2px 7px; color: var(--text); background: rgba(32,32,32,.54); font-size: 11px; font-weight: 750; -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.priority-lock svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: var(--brand-green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.priority-lock span { color: var(--text); font-size: 11px; }
.dashboard-next-step { border-color: rgba(93,214,44,.18); }
.dashboard-next-step h2 { margin: 7px 0 5px; font-size: 17px; line-height: 1.28; letter-spacing: -.02em; }
.dashboard-next-step > p { margin: 0; color: var(--muted-2); font-size: 12px; line-height: 1.48; }
.dashboard-why { margin-top: 11px !important; padding-top: 11px; border-top: 1px solid var(--line-soft); color: var(--muted-2) !important; }
.dashboard-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dashboard-actions .section-action:first-child { grid-column: 1 / -1; }
.dashboard-actions .weekly-report-action { grid-column: 1 / -1; width: 100%; }
.section-action {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(248,248,248,.035);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}
.section-action.primary { border: 0; color: var(--on-accent); background: var(--brand-green); box-shadow: 0 7px 24px rgba(93,214,44,.10); }
.section-action:disabled { opacity: .48; box-shadow: none; }
.section-action.is-loading::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .75s linear infinite; }
.mentor-observation { margin: 0; color: var(--muted-2); font-size: 12px; line-height: 1.52; }
.mentor-observation strong { display: block; margin-bottom: 5px; color: var(--brand-green); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.mentor-observation-content { position: relative; min-height: 19px; }
.mentor-observation-copy { margin: 0; }
.mentor-observation.is-locked .mentor-observation-content { min-height: 48px; overflow: hidden; border-radius: 11px; }
.mentor-observation.is-locked .mentor-observation-copy { filter: blur(5px); opacity: .32; user-select: none; pointer-events: none; }
.mentor-observation-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; color: var(--text); background: rgba(32,32,32,.48); font-size: 11px; font-weight: 750; text-align: center; -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.mentor-observation-lock svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--brand-green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.unfinished-card { border-color: rgba(93,214,44,.16); background: linear-gradient(145deg, rgba(51,116,24,.24), var(--brand-surface)); }
.unfinished-card strong { display: block; font-size: 13px; }
.unfinished-card p { margin: 5px 0 11px; color: var(--muted-2); font-size: 11px; line-height: 1.45; }

.app-view {
  grid-row: 2 / 5;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: 18px var(--gutter-right) 28px var(--gutter-left);
}
.app-view::-webkit-scrollbar { display: none; }
.view-content { min-width: 0; display: grid; gap: 12px; }
.view-content > * { min-width: 0; }
.view-header { padding: 2px 1px 5px; }
.view-header p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.start-context-banner { border: 1px solid rgba(93,214,44,.24); border-radius: 16px; padding: 13px 14px; background: linear-gradient(120deg, rgba(51,116,24,.38), var(--brand-surface)); }
.start-context-banner strong { display: block; color: var(--text); font-size: 13px; }
.start-context-banner span { display: block; margin-top: 4px; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.access-lock-banner { border: 1px dashed rgba(93,214,44,.26); border-radius: 17px; padding: 14px; background: linear-gradient(145deg, rgba(51,116,24,.18), var(--brand-surface)); }
.access-lock-banner > strong { display: block; margin-top: 6px; font-size: 15px; }
.access-lock-banner > p { margin: 6px 0 12px; color: var(--muted-2); font-size: 11px; line-height: 1.48; }
.access-lock-banner.is-subscription-paused { border-color: rgba(226,133,133,.44); background: linear-gradient(145deg, rgba(154,65,65,.25), rgba(42,31,31,.96) 76%); box-shadow: inset 0 0 24px rgba(154,65,65,.08); }
.access-lock-banner.is-subscription-paused .section-eyebrow { color: #E2A0A0; }
.access-lock-banner.is-subscription-paused > strong { color: #F0CCCC; }
.access-lock-banner.is-subscription-paused > p { color: rgba(240,204,204,.74); }
.view-card { border: 1px solid var(--line); border-radius: 18px; padding: 15px; background: var(--brand-surface); }
.view-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.view-card-heading > div { min-width: 0; }
.view-card-heading h2 { margin: 5px 0 0; font-size: 16px; line-height: 1.25; letter-spacing: -.02em; }
.view-card-heading > span { color: var(--brand-green); font-size: 11px; font-weight: 800; white-space: nowrap; }
.today-progress { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 14px; border-color: rgba(93,214,44,.18); }
.progress-ring { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.progress-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.progress-ring circle { fill: none; stroke-width: 4; }
.progress-ring-track { stroke: var(--line); }
.progress-ring-value { stroke: var(--lime); stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(93,214,44,.22)); }
.progress-ring strong { position: relative; z-index: 1; font-size: 17px; }
.today-progress-copy strong { display: block; font-size: 18px; letter-spacing: -.025em; }
.today-progress-copy span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.metric-card { min-height: 105px; border: 1px solid var(--line); border-radius: 16px; padding: 13px; display: flex; flex-direction: column; background: rgba(248,248,248,.025); }
.metric-icon { width: 31px; height: 31px; border: 1px solid rgba(93,214,44,.16); border-radius: 10px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.04); }
.metric-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.metric-card strong { margin-top: auto; padding-top: 13px; font-size: 20px; letter-spacing: -.025em; }
.metric-card span:last-child { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.task-list { display: grid; gap: 8px; margin-top: 13px; }
.task-row { min-width: 0; min-height: 58px; border: 1px solid var(--line); border-radius: 14px; padding: 9px 10px; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; background: rgba(248,248,248,.025); }
.task-row.done { opacity: .68; }
.task-complete-button { width: 40px; height: 40px; border: 1px solid rgba(93,214,44,.24); border-radius: 12px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.045); font-size: 18px; }
.task-row.done .task-complete-button { color: var(--on-accent); border-color: transparent; background: var(--lime); }
.task-complete-button:disabled { opacity: 1; }
.task-copy { min-width: 0; display: grid; gap: 4px; }
.task-copy strong { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.task-row.done .task-copy strong { color: var(--muted); text-decoration: line-through; }
.task-copy span { color: var(--muted); font-size: 10px; }
.empty-state { margin: 13px 0 0; border: 1px dashed rgba(93,214,44,.20); border-radius: 14px; padding: 18px 14px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.45; }
.book-card { overflow: hidden; border-color: rgba(93,214,44,.18); background: radial-gradient(circle at 92% 9%, rgba(93,214,44,.10), transparent 30%), var(--brand-surface); }
.book-card h2 { margin: 7px 0 0; font-size: 18px; letter-spacing: -.025em; }
.book-category { display: block; margin-top: 5px; color: var(--brand-green); font-size: 11px; }
.book-card p { margin: 11px 0 13px; color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.book-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reading-handoff-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; border-color: rgba(93,214,44,.18); background: radial-gradient(circle at 92% 9%, rgba(93,214,44,.09), transparent 31%), var(--brand-surface); }
.reading-handoff-icon { width: 44px; height: 44px; border: 1px solid rgba(93,214,44,.22); border-radius: 14px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.055); }
.reading-handoff-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reading-handoff-card h2 { margin: 5px 0 0; font-size: 17px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.reading-handoff-card p { margin: 7px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.48; }
.reading-handoff-card .book-actions,
.reading-handoff-card > small { grid-column: 1 / -1; }
.reading-handoff-card .book-actions { grid-template-columns: minmax(0, 1fr); }
.reading-handoff-card > small { color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }

.focus-hero { min-height: 238px; display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 17px; overflow: hidden; border-color: rgba(93,214,44,.24); background: radial-gradient(circle at 19% 48%, rgba(93,214,44,.12), transparent 31%), var(--brand-surface); }
.focus-orbit { width: 128px; height: 128px; border: 1px solid rgba(93,214,44,.30); border-radius: 50%; display: grid; place-items: center; position: relative; color: var(--text); background: radial-gradient(circle, rgba(93,214,44,.12), rgba(51,116,24,.22) 62%, transparent 63%); box-shadow: 0 0 32px rgba(93,214,44,.07), inset 0 0 26px rgba(93,214,44,.04); }
.focus-orbit::before,
.focus-orbit::after { content: ""; position: absolute; border: 1px solid rgba(93,214,44,.1); border-radius: 50%; }
.focus-orbit::before { inset: 10px; }
.focus-orbit::after { inset: 24px; border-color: rgba(93,214,44,.17); }
.focus-orbit > span { position: relative; z-index: 1; display: grid; text-align: center; }
.focus-orbit strong { font-size: 34px; line-height: .95; letter-spacing: -.045em; }
.focus-orbit strong.countdown { font-size: 27px; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.focus-orbit small { margin-top: 5px; color: var(--brand-green); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.focus-status { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-green); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.focus-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(93,214,44,.7); }
.focus-hero.is-active .focus-status i { animation: blink 1.4s ease-in-out infinite; }
.focus-cycle { display: inline-flex; width: fit-content; margin-top: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--muted); background: rgba(248,248,248,.035); font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.focus-hero-copy h2 { margin: 8px 0 0; font-size: 19px; line-height: 1.24; letter-spacing: -.025em; }
.focus-hero-copy p { margin: 7px 0 13px; color: var(--muted-2); font-size: 11px; line-height: 1.48; }
.focus-guide { display: grid; gap: 13px; }
.focus-guide h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; }
.focus-guide ol { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.focus-guide li { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; }
.focus-guide li > span { width: 28px; height: 28px; border: 1px solid rgba(93,214,44,.17); border-radius: 9px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.035); font-size: 10px; font-weight: 850; }
.focus-guide li p { margin: 0; color: var(--muted-2); font-size: 11px; line-height: 1.42; }

.progress-subnav { min-height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: rgba(248,248,248,.025); }
.progress-subnav button { min-height: 40px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; }
.progress-subnav button.active { color: var(--text); background: var(--brand-green-deep); box-shadow: inset 0 0 0 1px rgba(93,214,44,.24); }
.streak-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; border-color: rgba(93,214,44,.18); }
.streak-card h2 { margin: 7px 0 0; font-size: 19px; }
.streak-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.streak-value { min-width: 72px; height: 72px; border: 1px solid rgba(93,214,44,.23); border-radius: 22px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.045); font-size: 24px; font-weight: 850; }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.achievement-item { min-height: 83px; border: 1px solid var(--line); border-radius: 14px; padding: 11px; display: grid; align-content: space-between; gap: 9px; background: rgba(248,248,248,.025); }
.achievement-item span { color: var(--muted); font-size: 10px; }
.achievement-item strong { font-size: 15px; }
.progress-report-card { display: grid; gap: 13px; border-color: rgba(93,214,44,.2); background: radial-gradient(circle at 90% 4%, rgba(93,214,44,.09), transparent 32%), var(--brand-surface); }
.progress-report-card h2 { margin: 6px 0 0; font-size: 18px; line-height: 1.3; }
.progress-report-card p { margin: 7px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.48; }
.report-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.week-hero { border-color: rgba(93,214,44,.2); background: radial-gradient(circle at 88% 10%, rgba(93,214,44,.10), transparent 34%), var(--brand-surface); }
.week-hero h1 { margin: 7px 0 6px; font-size: 23px; letter-spacing: -.035em; }
.week-hero p { margin: 0; color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.week-chart { height: 150px; margin-top: 15px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 7px; }
.week-day { min-width: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 7px; align-items: end; text-align: center; }
.week-bar-track { width: 100%; height: 100%; border-radius: 8px; overflow: hidden; background: rgba(248,248,248,.055); }
.week-bar-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.week-bar { fill: var(--lime-soft); filter: drop-shadow(0 0 4px rgba(93,214,44,.2)); }
.week-day.is-today .week-bar-track { box-shadow: 0 0 0 1px rgba(93,214,44,.28); }
.week-day-label { color: var(--muted); font-size: 9px; }
.week-day.is-today .week-day-label { color: var(--lime); font-weight: 800; }
.comparison-list { display: grid; gap: 7px; margin-top: 13px; }
.comparison-row { min-height: 42px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted-2); font-size: 11px; }
.comparison-row strong { font-size: 12px; }
.comparison-row .up { color: var(--brand-green); }
.comparison-row .down { color: var(--text); text-decoration: underline; text-decoration-style: dotted; }
.comparison-row .same { color: var(--muted); }
.week-insight-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.week-side-card { min-height: 126px; padding: 13px; }
.week-side-card.strong { border-color: rgba(93,214,44,.2); background: linear-gradient(145deg, rgba(51,116,24,.32), var(--brand-surface)); }
.week-side-card.weak { border-color: var(--line); border-style: dashed; background: var(--brand-surface); }
.week-side-card p { margin: 11px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.48; }
.elite-week-card { display: grid; gap: 0; border-color: rgba(93,214,44,.24); background: radial-gradient(circle at 94% 4%, rgba(93,214,44,.11), transparent 31%), var(--brand-surface); }
.elite-week-card .view-card-heading > span { color: var(--brand-green); }
.elite-insight { padding: 12px 0 0; }
.elite-insight + .elite-insight { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.elite-insight strong { color: var(--brand-green); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.elite-insight p { margin: 5px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.48; }
.week-note p { margin: 8px 0 0; color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.week-next-step { display: grid; gap: 11px; border-color: rgba(93,214,44,.17); }
.week-next-step h2 { margin: 6px 0 0; font-size: 16px; line-height: 1.35; }
.week-plan-list { margin: 13px 0 0; padding: 0; display: grid; gap: 9px; list-style: none; counter-reset: week-plan; }
.week-plan-list li { min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; align-items: start; counter-increment: week-plan; }
.week-plan-list li > span { width: 26px; height: 26px; border: 1px solid rgba(93,214,44,.2); border-radius: 9px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.04); font-size: 10px; font-weight: 850; }
.week-plan-list li > span::before { content: counter(week-plan); }
.week-plan-list p { margin: 3px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.archived-report { padding: 0; overflow: hidden; }
.archived-report summary { cursor: pointer; padding: 14px 15px; color: var(--text); font-size: 12px; font-weight: 750; }
.archived-report[open] summary { border-bottom: 1px solid var(--line-soft); }
.archived-report p { margin: 0; padding: 14px 15px; color: var(--muted-2); font-size: 11px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }

.profile-view {
  grid-row: 2 / 5;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: 18px var(--gutter-right) 26px var(--gutter-left);
}
.profile-view::-webkit-scrollbar { display: none; }
.profile-loading { display: grid; gap: 13px; }
.profile-content { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; padding-bottom: 4px; }
.profile-content > *,
.profile-hero,
.profile-card,
.profile-stats,
.profile-actions,
.profile-edit-form,
.profile-card-heading { min-width: 0; }
.profile-hero {
  min-height: 112px;
  border: 1px solid rgba(93,214,44,.18);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  background:
    radial-gradient(circle at 84% 14%, rgba(93,214,44,.10), transparent 32%),
    var(--brand-surface);
}
.profile-avatar {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(93,214,44,.38);
  color: var(--lime);
  background: radial-gradient(circle at 45% 35%, rgba(93,214,44,.19), rgba(51,116,24,.38) 68%);
  box-shadow: 0 0 24px rgba(93,214,44,.09), inset 0 0 14px rgba(93,214,44,.06);
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
}
.profile-person { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-person h1 { margin: 0 0 4px; color: var(--brand-green); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.profile-person strong { font-size: 20px; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-person span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--brand-surface);
  overflow-wrap: anywhere;
}
.profile-card-eyebrow { display: block; color: var(--brand-green); font-size: 11px; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }
.profile-card-note { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.goal-card { border-color: rgba(93,214,44,.18); background: linear-gradient(145deg, rgba(51,116,24,.24), var(--brand-surface)); }
.goal-card .profile-card-heading { align-items: center; }
.goal-card p { margin: 9px 0 8px; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.48; }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-stat-card { min-height: 116px; display: flex; flex-direction: column; }
.profile-stat-card strong { margin-top: auto; padding-top: 18px; color: var(--text); font-size: 18px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.profile-stat-card strong.is-unavailable { font-size: 12px; line-height: 1.45; letter-spacing: 0; text-wrap: balance; }
.profile-stat-card > span:last-child { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.profile-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-card-heading > div { min-width: 0; }
.profile-card-heading h2,
.profile-help h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.02em; }
.profile-text-button {
  min-height: 44px;
  border: 1px solid rgba(93,214,44,.18);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--brand-green);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}
.profile-inline-edit { min-height: 38px; padding: 6px 10px; }
.profile-details { margin: 15px 0 0; display: grid; }
.profile-details > div { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line-soft); }
.profile-details dt { color: var(--muted); font-size: 12px; }
.profile-details dd { margin: 0; color: var(--text); font-size: 12px; font-weight: 700; text-align: right; }
.profile-edit-form { margin-top: 15px; display: grid; gap: 13px; }
.profile-edit-form label { display: grid; gap: 7px; color: var(--muted-2); font-size: 12px; font-weight: 700; }
.profile-edit-form label > span { color: var(--muted); font-size: 11px; font-weight: 500; }
.profile-edit-form input,
.profile-edit-form select,
.profile-edit-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(248,248,248,.22);
  border-radius: 12px;
  outline: 0;
  padding: 10px 12px;
  color: var(--text);
  background: var(--brand-black);
  font-size: 16px;
}
.profile-edit-form textarea { min-height: 86px; resize: vertical; line-height: 1.4; }
.profile-edit-form input:focus,
.profile-edit-form select:focus,
.profile-edit-form textarea:focus { border-color: rgba(93,214,44,.4); box-shadow: 0 0 0 3px rgba(93,214,44,.04); }
.profile-form-error { margin: 0; color: #ffaaaa; font-size: 12px; line-height: 1.45; }
.profile-form-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.profile-save-button,
.profile-cancel-button { min-height: 44px; border-radius: 12px; padding: 10px 14px; font-weight: 800; }
.profile-save-button { border: 0; color: var(--on-accent); background: var(--brand-green); }
.profile-cancel-button { border: 1px solid var(--line); color: var(--text); background: rgba(248,248,248,.035); }
.profile-edit-form.is-saving { pointer-events: none; }
.profile-edit-form.is-saving .profile-save-button { opacity: .78; filter: saturate(.8); }
.referral-card p { margin: 12px 0; color: var(--muted-2); font-size: 12px; line-height: 1.45; }
.referral-count { min-width: 34px; height: 30px; border: 1px solid rgba(93,214,44,.18); border-radius: 999px; display: grid; place-items: center; color: var(--brand-green); font-size: 11px; font-weight: 800; }
.referral-code-button {
  width: 100%;
  min-height: 54px;
  border: 1px dashed rgba(93,214,44,.25);
  border-radius: 13px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  background: rgba(93,214,44,.035);
  text-align: left;
  font-size: 11px;
}
.referral-code-button > span { min-width: 0; overflow-wrap: anywhere; }
.referral-code-button strong { min-width: 0; color: var(--text); font-size: 14px; text-align: center; letter-spacing: .06em; overflow-wrap: anywhere; }
.notification-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.notification-icon { width: 42px; height: 42px; border: 1px solid rgba(93,214,44,.18); border-radius: 13px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.045); }
.notification-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.notification-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notification-card strong { font-size: 13px; }
.notification-copy > span:last-child { color: var(--muted); font-size: 11px; }
.profile-help { border-color: rgba(93,214,44,.18); scroll-margin-top: 12px; }
.profile-help ol { list-style: none; margin: 15px 0 0; padding: 0; counter-reset: profile-steps; display: grid; gap: 12px; }
.profile-help li { counter-increment: profile-steps; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; }
.profile-help li::before { content: counter(profile-steps); grid-row: 1 / 3; width: 28px; height: 28px; border: 1px solid rgba(93,214,44,.22); border-radius: 9px; display: grid; place-items: center; color: var(--lime); background: rgba(93,214,44,.04); font-size: 11px; font-weight: 800; }
.profile-help li strong { font-size: 12px; }
.profile-help li span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.profile-actions { display: grid; gap: 9px; margin-top: 2px; }
.profile-primary-action,
.profile-secondary-action { width: 100%; min-height: 48px; border-radius: 14px; padding: 12px 14px; font-weight: 800; }
.profile-primary-action { border: 0; color: var(--on-accent); background: var(--brand-green); box-shadow: 0 8px 26px rgba(93,214,44,.1); }
.profile-secondary-action { border: 1px solid var(--line); color: var(--text); background: rgba(248,248,248,.035); }
.profile-error { margin: 40px auto; padding: 22px; max-width: 360px; text-align: center; border: 1px solid rgba(255,119,119,.22); border-radius: 20px; background: rgba(52,15,15,.18); }
.profile-error strong { display: block; }
.profile-error p { color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.profile-skeleton-card { border: 1px solid var(--line-soft); background: linear-gradient(100deg, #202020 20%, rgba(248,248,248,.08) 45%, #202020 70%); background-size: 240% 100%; animation: shimmer 1.4s infinite; }
.profile-skeleton { display: block; border-radius: 999px; background: rgba(248,248,248,.08); }
.profile-skeleton-avatar { width: 66px; height: 66px; flex: 0 0 66px; }
.profile-skeleton-copy { display: grid; gap: 12px; }
.profile-skeleton-line { width: 100px; height: 11px; }
.profile-skeleton-line.wide { width: min(190px, 45vw); height: 17px; margin-left: 2px; }
.profile-skeleton-block { height: 126px; border-radius: 18px; }
.profile-skeleton-block.short { height: 92px; }

.skeleton-stack { display: flex; flex-direction: column; gap: 14px; padding-right: 10%; }
.skeleton { border-radius: 19px 19px 19px 7px; background: linear-gradient(100deg, #202020 20%, rgba(248,248,248,.08) 45%, #202020 70%); background-size: 240% 100%; animation: shimmer 1.4s infinite; }
.skeleton-message { width: 100%; height: 106px; }
.skeleton-message.short { width: 77%; height: 70px; }
.error-card { margin: 24px auto; padding: 22px; max-width: 360px; text-align: center; border: 1px solid rgba(255,119,119,.22); border-radius: 20px; background: rgba(52,15,15,.18); }
.error-icon { width: 34px; height: 34px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; color: var(--danger); border: 1px solid rgba(255,119,119,.4); }
.error-card strong { display: block; }
.error-card p { color: var(--muted-2); font-size: 12px; line-height: 1.5; }
.secondary-button { min-height: 44px; border: 1px solid rgba(248,248,248,.16); color: var(--text); border-radius: 12px; padding: 11px 18px; background: rgba(248,248,248,.045); }

.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15,15,15,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bottom-sheet { position: fixed; z-index: 21; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,540px); max-height: calc(100dvh - 8px); overflow-y: auto; overscroll-behavior: contain; padding: 10px var(--gutter-right) calc(18px + var(--safe-bottom)) var(--gutter-left); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--brand-surface); box-shadow: 0 -18px 80px rgba(15,15,15,.62); animation: sheet-in .23s ease both; }
.sheet-handle { width: 38px; height: 4px; border-radius: 9px; background: rgba(248,248,248,.22); margin: 0 auto 17px; }
.bottom-sheet h2 { margin: 0 0 8px; font-size: 18px; }
.bottom-sheet p { color: var(--muted-2); font-size: 13px; line-height: 1.55; margin: 0 0 18px; }
.sheet-action { width: 100%; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: rgba(248,248,248,.04); padding: 13px; margin-top: 8px; font-weight: 700; }
.sheet-action.danger { color: #ff9c9c; border-color: rgba(255,119,119,.2); background: rgba(90,20,20,.18); }
.sheet-action.is-loading:disabled { opacity: .82; filter: none; }

.icon-button:disabled,
.message-tool:disabled,
.quick-chip:disabled,
.handoff-button:disabled,
.sheet-action:disabled,
.secondary-button:disabled,
.profile-text-button:disabled,
.profile-save-button:disabled,
.profile-cancel-button:disabled,
.referral-code-button:disabled,
.profile-primary-action:disabled,
.profile-secondary-action:disabled {
  opacity: .46;
  filter: saturate(.55);
  box-shadow: none;
}
.profile-edit-form.is-saving .profile-save-button:disabled { opacity: .78; filter: saturate(.8); }
.nav-item:disabled { opacity: .5; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(178px + var(--safe-bottom)); transform: translateX(-50%); width: max-content; max-width: min(420px, calc(100% - var(--gutter-left) - var(--gutter-right))); border: 1px solid rgba(93,214,44,.22); border-radius: 13px; padding: 11px 14px; color: var(--text); background: rgba(32,32,32,.98); box-shadow: 0 12px 40px rgba(15,15,15,.55); font-size: 12px; line-height: 1.4; text-align: center; animation: toast-in .2s ease both; }
.app-shell.profile-active ~ .toast,
.app-shell.content-active ~ .toast { bottom: calc(88px + var(--safe-bottom)); }
.jump-latest { position: sticky; bottom: 8px; z-index: 4; display: block; width: 44px; height: 44px; min-height: 44px; margin: 14px 0 0 auto; border: 1px solid rgba(93,214,44,.3); border-radius: 50%; padding: 0; color: var(--brand-green); background: var(--brand-surface); box-shadow: 0 8px 24px rgba(15,15,15,.48); font-size: 0; }
.jump-latest::after { content: "↓"; display: grid; place-items: center; font-size: 20px; line-height: 1; transform: translateY(-1px); }
.icon-button:focus-visible,
.context-card:focus-visible,
.send-button:focus-visible,
.message-tool:focus-visible,
.quick-chip:focus-visible,
.handoff-button:focus-visible,
.sheet-action:focus-visible,
.secondary-button:focus-visible,
.jump-latest:focus-visible,
.section-action:focus-visible,
.task-complete-button:focus-visible,
.progress-subnav button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.nav-item:focus-visible { outline: 0; background: rgba(93,214,44,.075); box-shadow: inset 0 0 0 1px rgba(93,214,44,.35); }
.sheet-action.danger:focus-visible { outline-color: #ff8f8f; }
.profile-text-button:focus-visible,
.profile-help:focus-visible,
.profile-edit-form input:focus-visible,
.profile-edit-form select:focus-visible,
.profile-save-button:focus-visible,
.profile-cancel-button:focus-visible,
.referral-code-button:focus-visible,
.profile-primary-action:focus-visible,
.profile-secondary-action:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes shimmer { to { background-position: -140% 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-in { from { transform: translate(-50%, 14px); opacity: 0; } }
@keyframes toast-in { from { transform: translate(-50%, 8px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 541px) and (min-height: 621px) {
  body { display: grid; place-items: center; padding: 18px; }
  .app-shell { height: min(920px, calc(var(--tg-viewport-stable-height, 100dvh) - 36px), calc(var(--app-visible-height, 100dvh) - 36px)); border: 1px solid rgba(93,214,44,.11); border-radius: 28px; overflow: hidden; box-shadow: 0 40px 120px rgba(15,15,15,.6); }
  .bottom-sheet { bottom: 18px; width: min(calc(100% - 36px), 540px); border-radius: 24px; border-bottom: 1px solid var(--line); }
}

.app-shell.keyboard-open .bottom-nav { display: none; }
.app-shell.keyboard-open ~ .toast { top: calc(var(--safe-top) + 58px); bottom: auto; }

@media (hover: hover) and (pointer: fine) {
  .icon-button:hover { border-color: rgba(93,214,44,.24); background: rgba(93,214,44,.055); }
  .context-card:hover { border-color: rgba(93,214,44,.48); }
  .message-tool:hover,
  .quick-chip:hover { color: var(--brand-green); border-color: rgba(93,214,44,.25); background: rgba(93,214,44,.05); }
  .handoff-button:hover,
  .section-action.primary:hover,
  .profile-save-button:hover,
  .profile-primary-action:hover { filter: brightness(1.04); }
  .nav-item:not(.locked):hover { color: var(--text); background: rgba(248,248,248,.035); }
}

@media (max-width: 360px) {
  :root {
    --gutter-left: max(env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px), var(--app-safe-area-inset-left, 0px), var(--app-content-safe-area-inset-left, 0px), 14px);
    --gutter-right: max(env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px), var(--app-safe-area-inset-right, 0px), var(--app-content-safe-area-inset-right, 0px), 14px);
  }
  .topbar { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 7px; }
  .icon-button { width: 44px; height: 44px; border-radius: 13px; }
  .avatar { width: 40px; height: 40px; flex-basis: 40px; }
  .mentor-identity { gap: 9px; }
  .identity-copy strong { font-size: 15px; }
  .context-card { margin-top: 8px; padding: 10px 11px; gap: 8px; }
  .context-card:not(.expanded) .context-copy > span { display: none; }
  .context-card strong { font-size: 11px; }
  .plan-pill { padding: 7px 9px; font-size: 10px; }
  .chat { padding-bottom: 58px; }
  .session-divider { margin: 12px 0; font-size: 10px; }
  .message-row.mentor { padding-right: 0; }
  .message-bubble { max-width: 92%; padding: 12px 13px; border-radius: 18px 18px 18px 7px; }
  .message-row.user .message-bubble { border-radius: 18px 18px 7px 18px; }
  .message-tools { gap: 5px; }
  .message-tool { padding-inline: 9px; }
  .action-card { padding: 11px; }
  .profile-view { padding-top: 14px; }
  .profile-content { gap: 11px; }
  .profile-card { padding: 14px; }
  .profile-hero { min-height: 100px; padding: 14px; gap: 12px; }
  .profile-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 19px; font-size: 21px; }
  .profile-person strong { font-size: 18px; }
  .profile-stats,
  .week-insight-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .profile-stat-card { min-height: 98px; }
  .profile-form-actions { grid-template-columns: minmax(0, 1fr) auto; }
  .dashboard-actions { grid-template-columns: minmax(0, 1fr); }
  .dashboard-actions .section-action:first-child { grid-column: auto; }
  .book-actions { grid-template-columns: minmax(0, 1fr); }
  .focus-hero { min-height: 0; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .focus-hero-copy { width: 100%; }
  .focus-hero-copy .section-action { width: 100%; }
  .bottom-nav { padding-top: 6px; }
  .nav-item { gap: 4px; font-size: clamp(9px, 2.65vw, 10px); }
  .nav-item::before { top: -7px; width: 34px; }
  .nav-lock { top: -2px; right: calc(50% - 22px); }
}

@media (max-width: 340px) {
  .bottom-nav {
    padding-left: max(env(safe-area-inset-left), var(--tg-safe-area-inset-left, 0px), var(--tg-content-safe-area-inset-left, 0px), var(--app-safe-area-inset-left, 0px), var(--app-content-safe-area-inset-left, 0px), 10px);
    padding-right: max(env(safe-area-inset-right), var(--tg-safe-area-inset-right, 0px), var(--tg-content-safe-area-inset-right, 0px), var(--app-safe-area-inset-right, 0px), var(--app-content-safe-area-inset-right, 0px), 10px);
  }
}

@media (max-height: 620px) {
  :root {
    --safe-top-floor: 6px;
    --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px), var(--app-safe-area-inset-bottom, 0px), var(--app-content-safe-area-inset-bottom, 0px), 5px);
  }
  .topbar { padding-bottom: 6px; }
  .context-card { margin-bottom: 0; }
  .composer-wrap { padding-top: 4px; padding-bottom: 6px; }
  .session-status { min-height: 17px; max-width: 100%; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .composer { min-height: 48px; }
  .bottom-nav { min-height: calc(62px + var(--safe-bottom)); padding-top: 5px; }
  .nav-item { min-height: 45px; }
  .nav-item::before { top: -6px; }
}

@media (max-height: 420px) and (orientation: landscape) {
  :root.telegram-fullscreen,
  :root.fullscreen-pending { --safe-top-floor: 44px; --safe-top-clearance: 6px; }
  .topbar { padding-top: var(--safe-top); padding-bottom: 4px; }
  .context-card { display: none; }
  .session-divider { display: none; }
  .chat { padding-top: 8px; }
  .composer-wrap { padding-top: 3px; padding-bottom: 4px; }
  .session-status { display: none; }
  .bottom-nav { min-height: calc(50px + var(--safe-bottom)); padding-top: 3px; }
  .nav-item { min-height: 44px; gap: 0; }
  .nav-item > span:last-child { display: none; }
  .nav-item::before { top: -4px; }
  .nav-lock { top: -3px; }
  .app-shell.fatal-state .chat { padding-top: 6px; padding-bottom: calc(6px + var(--safe-bottom)); }
  .app-shell.fatal-state .error-card { width: 100%; max-width: 440px; margin: 0 auto; padding: 10px 16px; }
  .app-shell.fatal-state .error-icon { width: 28px; height: 28px; margin-bottom: 5px; }
  .app-shell.fatal-state .error-card p { margin: 6px 0 8px; font-size: 11px; line-height: 1.35; }
  .bottom-sheet { max-height: calc(100dvh - 6px); padding-top: 7px; padding-bottom: calc(10px + var(--safe-bottom)); }
  .sheet-handle { margin-bottom: 10px; }
  .bottom-sheet h2 { font-size: 16px; }
  .bottom-sheet p { margin-bottom: 10px; font-size: 12px; }
  .sheet-action { min-height: 44px; padding: 9px; margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.low-performance .ambient { display: none; }
.low-performance .topbar,
.low-performance .composer-wrap,
.low-performance .sheet-backdrop { backdrop-filter: none; }
.low-performance .app-shell,
.low-performance .bottom-sheet,
.low-performance .toast { box-shadow: none; }
.app-inactive *, .app-inactive *::before, .app-inactive *::after { animation-play-state: paused !important; }
