/* ════════════════════════════════════════════════════════════════
   Резюмэйт — Mirra chat styles
   Dark theme = default. Light theme via [data-theme="light"].
   ════════════════════════════════════════════════════════════════ */

/* ── Theme tokens ──────────────────────────────────────────────── */

:root,
[data-theme="dark"] {
  --bg: #0a0612;
  --bg-2: #14091f;
  --bg-3: #1c0e2c;
  --surface: rgba(253, 246, 238, 0.045);
  --surface-2: rgba(253, 246, 238, 0.08);
  --surface-3: rgba(253, 246, 238, 0.12);
  --fg: #fdf6ee;
  --fg-soft: #e5dcd0;
  --muted: #9a8eaa;
  --muted-2: #6b5d7e;
  --line: rgba(253, 246, 238, 0.1);
  --line-2: rgba(253, 246, 238, 0.18);
  --warm: #ff7849;
  --hot: #ff2d8c;
  --violet: #9333ea;
  --good: #4ade80;
  --bad: #fb7185;
  --gradient: linear-gradient(135deg, #ff7849, #ff2d8c, #9333ea);
  --gauge-track: rgba(255, 255, 255, 0.08);
  --user-bubble: rgba(255, 120, 73, 0.18);
  --user-bubble-border: rgba(255, 120, 73, 0.28);
  --shadow-card: 0 24px 60px -20px rgba(255, 45, 140, 0.3);
  --shadow-soft: 0 12px 36px -12px rgba(0, 0, 0, 0.4);
  --sidebar-toggle-hover-bg: var(--surface-2);
  --sidebar-toggle-hover-border: var(--line);
  --sidebar-toggle-divider: #fff;
}

[data-theme="light"] {
  --bg: #fbf7f1;
  --bg-2: #f5efe5;
  --bg-3: #ece4d6;
  --surface: rgba(20, 9, 31, 0.04);
  --surface-2: rgba(20, 9, 31, 0.07);
  --surface-3: rgba(20, 9, 31, 0.1);
  --fg: #1a0e26;
  --fg-soft: #2c1c3d;
  --muted: #7a6c8c;
  --muted-2: #a89bb8;
  --line: rgba(20, 9, 31, 0.1);
  --line-2: rgba(20, 9, 31, 0.18);
  --warm: #ea580c;
  --hot: #db2777;
  --violet: #7c3aed;
  --good: #16a34a;
  --bad: #dc2626;
  --gradient: linear-gradient(135deg, #ea580c, #db2777, #7c3aed);
  --gauge-track: rgba(20, 9, 31, 0.08);
  --user-bubble: rgba(234, 88, 12, 0.12);
  --user-bubble-border: rgba(234, 88, 12, 0.3);
  --shadow-card: 0 24px 60px -20px rgba(219, 39, 119, 0.18);
  --shadow-soft: 0 8px 24px -8px rgba(20, 9, 31, 0.15);
  --sidebar-toggle-hover-bg: rgba(20, 9, 31, 0.07);
  --sidebar-toggle-hover-border: rgba(20, 9, 31, 0.14);
  --sidebar-toggle-divider: currentColor;
}

/* ── Base ──────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter Tight', Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--warm) 18%, transparent), transparent 45%),
    radial-gradient(circle at 85% 70%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ── Top nav (only on non-chat pages) ──────────────────────────── */

/* -- App sidebar ------------------------------------------------------ */

:root {
  --sidebar-w: 284px;
  --sidebar-collapsed-w: 76px;
  --chat-content-w: 1104px;
  --chat-radius: 22px;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: color-mix(in srgb, var(--bg) 92%, black);
  border-right: 1px solid var(--line);
  color: var(--fg);
  transition: width 0.22s ease, background-color 0.25s ease;
}

.app-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.22s ease;
}

.app-sidebar__top,
.app-sidebar__bottom,
.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-sidebar__top {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 4px;
}

.app-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.app-sidebar__brand,
.app-sidebar__item {
  min-width: 0;
  height: 44px;
  border-radius: 12px;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  position: relative;
}

.app-sidebar__brand {
  flex: 1;
  padding: 0 10px;
  font-weight: 800;
}

.app-sidebar__item {
  width: 100%;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.app-sidebar__item:hover,
.app-sidebar__item.is-active {
  background: var(--surface-2);
  border-color: var(--line);
}

.app-sidebar__item.is-active {
  color: var(--fg);
}

.app-sidebar__item--accent {
  background: color-mix(in srgb, var(--warm) 12%, transparent);
  border-color: color-mix(in srgb, var(--warm) 24%, transparent);
}

.app-sidebar__button {
  border: 1px solid transparent;
  text-align: left;
}

.app-sidebar__form {
  margin: 0;
}

.app-sidebar__icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
}

.app-sidebar__icon svg,
.composer--full button svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-sidebar__icon svg {
  width: 21px;
  height: 21px;
}

.app-sidebar .theme-toggle__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  margin-top: -12px;
}

.app-sidebar #themeToggle {
  padding-left: 48px;
}

.sidebar-collapsed .app-sidebar .theme-toggle__icon {
  left: 50%;
  margin-left: -12px;
}

.sidebar-collapsed .app-sidebar #themeToggle {
  padding-left: 0;
}

.app-sidebar__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-sidebar__label--truncate {
  display: block;
}

.app-sidebar__toggle {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.app-sidebar__toggle:hover {
  background: var(--sidebar-toggle-hover-bg);
  border-color: var(--sidebar-toggle-hover-border);
}

.app-sidebar__toggle:hover::after,
.app-sidebar__toggle:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 94%, white 6%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.app-sidebar__toggle-icon {
  display: block;
  width: 20px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 6px;
  position: relative;
  opacity: 0.92;
}

.app-sidebar__toggle-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: var(--sidebar-toggle-divider);
}

.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-w);
  align-items: center;
}

.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-w);
}

.sidebar-collapsed .app-sidebar__label {
  opacity: 0;
  width: 0;
}

.sidebar-collapsed .app-sidebar__brand,
.sidebar-collapsed .app-sidebar__item {
  justify-content: center;
  width: 44px;
  min-width: 44px;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .app-sidebar__nav,
.sidebar-collapsed .app-sidebar__bottom {
  align-items: center;
  width: 44px;
}

.sidebar-collapsed .app-sidebar__form {
  width: 44px;
}

.sidebar-collapsed .app-sidebar__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.sidebar-collapsed .app-sidebar .theme-toggle__icon {
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.sidebar-collapsed .app-sidebar__top {
  justify-content: center;
  min-height: 48px;
}

.sidebar-collapsed .app-sidebar__brand {
  display: none;
}

.sidebar-collapsed .app-sidebar__toggle {
  order: -1;
  background: transparent;
}

.sidebar-collapsed .app-sidebar__toggle::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: var(--gradient);
  opacity: 1;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.sidebar-collapsed .app-sidebar__toggle .app-sidebar__toggle-icon {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.sidebar-collapsed .app-sidebar__toggle:hover,
.sidebar-collapsed .app-sidebar__toggle:focus-visible {
  background: var(--sidebar-toggle-hover-bg);
  border-color: var(--sidebar-toggle-hover-border);
}

.sidebar-collapsed .app-sidebar__toggle:hover::before,
.sidebar-collapsed .app-sidebar__toggle:focus-visible::before {
  opacity: 0;
  transform: scale(0.84);
}

.sidebar-collapsed .app-sidebar__toggle:hover .app-sidebar__toggle-icon,
.sidebar-collapsed .app-sidebar__toggle:focus-visible .app-sidebar__toggle-icon {
  opacity: 0.92;
  transform: scale(1);
}

.sidebar-collapsed .app-sidebar [data-tooltip]:hover::after,
.sidebar-collapsed .app-sidebar [data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 94%, white 6%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.nav {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand,
.nav a {
  color: var(--fg);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--gradient);
}

.nav__links {
  display: flex;
  gap: 24px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

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

.nav__links a:hover {
  color: var(--fg);
}

/* ── Theme toggle button ───────────────────────────────────────── */

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 16px;
  transition: background 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  background: var(--surface-2);
  transform: rotate(10deg);
}

.theme-toggle__icon {
  position: absolute;
  transition: opacity 0.3s, transform 0.3s;
}

[data-theme="dark"] .theme-toggle__icon--sun { opacity: 0; transform: rotate(-30deg); }
[data-theme="dark"] .theme-toggle__icon--moon { opacity: 1; transform: rotate(0); }
[data-theme="light"] .theme-toggle__icon--sun { opacity: 1; transform: rotate(0); }
[data-theme="light"] .theme-toggle__icon--moon { opacity: 0; transform: rotate(30deg); }

/* ── Landing hero ──────────────────────────────────────────────── */

.hero {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 56px 28px 90px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 52px;
  align-items: center;
}

.badge {
  display: inline-flex;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--warm) 30%, transparent);
  border-radius: 999px;
  color: var(--warm);
  background: color-mix(in srgb, var(--warm) 8%, transparent);
  font-size: 13px;
  margin-bottom: 22px;
}

.scribble {
  color: var(--warm);
  font-size: 22px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  transform: rotate(-2deg);
  display: inline-block;
}

h1 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 12px 0 20px;
}

h1 em {
  font-style: italic;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 19px;
}

.cta-row,
.trust {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--gradient);
  color: white;
  text-decoration: none;
  padding: 16px 26px;
  font-weight: 700;
  cursor: pointer;
}

.cta-meta,
.trust {
  color: var(--muted);
  font-size: 14px;
}

.trust span::before {
  content: "✓";
  margin-right: 6px;
  color: var(--good);
}

.preview-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  padding: 24px;
}

.preview-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}

.ava {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--gradient);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
}

.ava--large {
  width: 64px;
  height: 64px;
  font-size: 30px;
}

.bubble {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 13px 16px;
  border-radius: 6px 18px 18px 18px;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.bubble--user {
  margin-left: auto;
  border-radius: 18px 6px 18px 18px;
  background: var(--user-bubble);
  border-color: var(--user-bubble-border);
}

.score-mini {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--warm) 25%, transparent);
  border-radius: 18px;
}

.score-mini__num {
  font-size: 68px;
  line-height: 1;
  color: var(--warm);
  font-weight: 900;
}

/* ════════════════════════════════════════════════════════════════
   FULL-SCREEN CHAT
   ════════════════════════════════════════════════════════════════ */

.chat-fullscreen {
  position: fixed;
  inset: 0 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  z-index: 1;
  transition: left 0.22s ease;
}

.sidebar-collapsed .chat-fullscreen {
  left: var(--sidebar-collapsed-w);
}

.chat-fab {
  position: fixed;
  top: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  z-index: 20;
  backdrop-filter: blur(14px);
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

.chat-fab:hover {
  background: var(--surface-2);
  transform: scale(1.05);
}

.chat-fab a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.chat-fab--home { left: 16px; }
.chat-fab--theme { right: 16px; position: fixed; }

/* ── Feed ──────────────────────────────────────────────────────── */

.feed--full {
  flex: 1;
  overflow-y: auto;
  padding: 60px 0 24px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.feed--full::-webkit-scrollbar {
  width: 8px;
}

.feed--full::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
}

.feed--full > * {
  max-width: var(--chat-content-w);
  margin-left: auto;
  margin-right: auto;
  padding: 0 48px;
}

/* ── Messages ──────────────────────────────────────────────────── */

.msg {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  animation: pop-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg--full {
  max-width: 100% !important;
}

.msg__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 78%;
}

.msg__body--full {
  flex: 1;
  margin-left: 0;
  max-width: 100%;
}

.msg__ava {
  display: none;
}

.msg--user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg--user .msg__body {
  align-items: flex-end;
}

.msg--user .msg__ava {
  background: var(--surface-2);
  color: var(--fg);
  font-family: inherit;
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
}

.msg__bubble {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--chat-radius);
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  color: var(--fg-soft);
}

.msg--agent .msg__bubble {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

.msg__bubble--ghost {
  background: transparent;
  border-color: transparent;
}

.upload-msg .msg__body,
.typing-msg .msg__body {
  max-width: 78%;
}

.upload-msg .msg__bubble,
.typing-msg .msg__bubble {
  padding-left: 0;
  padding-right: 0;
}

.msg__bubble strong {
  color: var(--warm);
  font-weight: 600;
}

.msg__bubble p {
  margin: 0 0 10px;
}

.msg__bubble p:last-child,
.msg__bubble ul:last-child,
.msg__bubble pre:last-child {
  margin-bottom: 0;
}

.msg__bubble h4 {
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--warm) 26%, transparent);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 650;
}

.msg__bubble h4:first-child {
  margin-top: 0;
}

.msg__bubble h3 {
  margin: 0 0 12px;
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.msg__bubble hr {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: color-mix(in srgb, var(--warm) 22%, transparent);
}

.msg__bubble ul {
  margin: 6px 0 12px;
  padding-left: 20px;
}

.msg__bubble li {
  margin: 0 0 7px;
  padding-left: 2px;
}

.msg__bubble li::marker {
  color: var(--warm);
}

.msg__bubble .report-line {
  margin: 7px 0;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--warm) 35%, transparent);
  color: var(--fg-soft);
}

.msg__bubble .report-line span {
  color: var(--warm);
  font-weight: 650;
}

.msg__bubble .report-pair-title {
  margin: 14px 0 8px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
}

.msg__bubble .report-line--example {
  margin: 6px 0 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warm);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.msg__bubble em {
  color: var(--fg);
  font-style: italic;
}

.msg__bubble code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
}

.msg__bubble pre {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  color: var(--fg);
  overflow-x: auto;
  white-space: pre-wrap;
}

.msg__bubble pre code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.45;
}

.msg__bubble--coach {
  width: 100%;
  color: var(--fg-soft);
}

.coach-report {
  display: grid;
  gap: 14px;
  width: min(100%, 980px);
}

.coach-report__hero {
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--warm) 22%, var(--line));
  border-radius: var(--chat-radius);
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--hot) 12%, transparent), transparent 36%),
    color-mix(in srgb, var(--surface-2) 58%, transparent);
}

.coach-report__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warm) 12%, transparent);
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
}

.coach-report__hero h3 {
  margin: 0;
  color: var(--fg);
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.08;
  font-weight: 800;
}

.coach-report__hero p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.coach-report__cards {
  display: grid;
  gap: 12px;
}

.coach-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--chat-radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 76%, transparent), color-mix(in srgb, var(--surface) 56%, transparent));
  box-shadow: 0 16px 44px -34px color-mix(in srgb, var(--hot) 55%, black);
}

.coach-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.coach-card__step {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--gradient);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--hot) 72%, black);
}

.coach-card__kicker {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--warm) 22%, transparent);
  border-radius: 999px;
  color: var(--warm);
  background: color-mix(in srgb, var(--warm) 8%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.coach-card h4 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--fg);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
}

.coach-card__content {
  display: grid;
  gap: 10px;
}

.coach-card__block {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 28%, transparent);
}

.coach-card__block-title {
  margin-bottom: 8px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 850;
}

.coach-card__block p {
  margin: 0 0 8px;
  color: var(--fg-soft);
  font-size: 14px;
  line-height: 1.48;
}

.coach-card__block p:last-child {
  margin-bottom: 0;
}

.coach-actions {
  display: grid;
  gap: 7px;
}

.coach-action {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
  min-height: 34px;
  padding: 8px 9px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 64%, transparent);
  color: var(--fg-soft);
  font-size: 14px;
  line-height: 1.38;
}

.coach-action__mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good);
  font-size: 12px;
  font-weight: 900;
}

.coach-card .report-line {
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid color-mix(in srgb, var(--warm) 45%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}

.coach-card .report-pair-title {
  margin: 10px 0 8px;
}

@media (max-width: 720px) {
  .coach-report {
    width: 100%;
  }

  .coach-report__hero,
  .coach-card {
    padding: 15px;
  }

  .coach-card h4 {
    font-size: 18px;
  }

  .coach-card__step {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 14px;
  }
}

.msg--user .msg__bubble {
  background: var(--user-bubble);
  border-color: var(--user-bubble-border);
  border-radius: var(--chat-radius);
  color: var(--fg);
}

.msg__time {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
  padding: 0 4px;
}

.msg--user .msg__time {
  text-align: right;
}

/* ── Typing indicator ──────────────────────────────────────────── */

.typing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  min-width: 28px;
  min-height: 24px;
}

.typing span {
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

.typing-style--star .typing {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--warm);
}

.typing-style--star .typing span {
  display: none;
}

.typing-style--star .typing::before {
  content: "✦";
  font-size: 22px;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: typing-star-spin 1.2s linear infinite, typing-star-pulse 1.8s ease-in-out infinite;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes typing-star-spin {
  to { transform: rotate(360deg); }
}

@keyframes typing-star-pulse {
  0%, 100% { opacity: 0.55; filter: drop-shadow(0 0 0 rgba(255, 120, 73, 0)); }
  50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 120, 73, 0.45)); }
}

/* ── Upload bubble (in-feed) ───────────────────────────────────── */

.upload-bubble {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--warm) 45%, transparent);
  background: color-mix(in srgb, var(--warm) 6%, transparent);
  padding: 18px 20px;
  border-radius: var(--chat-radius);
  cursor: pointer;
  max-width: 360px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.upload-bubble:hover {
  background: color-mix(in srgb, var(--warm) 12%, transparent);
  border-color: var(--warm);
  transform: translateY(-1px);
}

.upload-bubble__icon {
  font-size: 28px;
  flex-shrink: 0;
}

.upload-bubble__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-bubble__text strong {
  font-weight: 600;
  font-size: 15px;
}

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

/* ── Progress card (streaming rows) ────────────────────────────── */

.progress-card {
  background: color-mix(in srgb, var(--warm) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--warm) 20%, transparent);
  border-radius: 14px;
  padding: 14px 18px;
  max-width: 380px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--fg-soft);
  transition: opacity 0.3s;
  animation: row-in 0.4s ease both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.progress-row--done {
  opacity: 0.55;
}

.progress-row__check {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--warm);
  font-size: 12px;
  flex-shrink: 0;
}

.progress-row--done .progress-row__check {
  color: var(--good);
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--warm);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════════
   SCORE CARD (the viral image)
   ════════════════════════════════════════════════════════════════ */

.score-card {
  aspect-ratio: 1200 / 630;
  background:
    radial-gradient(circle at 75% 30%, color-mix(in srgb, var(--hot) 25%, transparent), transparent 50%),
    radial-gradient(circle at 25% 70%, color-mix(in srgb, var(--violet) 25%, transparent), transparent 50%),
    linear-gradient(135deg, #1a0a2e, #0a0612);
  border-radius: 18px;
  padding: 30px 36px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--warm) 25%, transparent);
  box-shadow: var(--shadow-card);
  max-width: 660px;
  color: #fdf6ee;
}

[data-theme="light"] .score-card {
  background:
    radial-gradient(circle at 75% 30%, color-mix(in srgb, var(--hot) 18%, transparent), transparent 50%),
    radial-gradient(circle at 25% 70%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 50%),
    linear-gradient(135deg, #2d1245, #1a0a2e);
}

.score-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.score-card__gauge {
  width: 150px;
  height: 150px;
  position: relative;
  flex-shrink: 0;
}

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

.score-card__track {
  stroke: rgba(255, 255, 255, 0.08);
}

.score-card__fill {
  stroke: url(#scoreGradient);
  stroke-linecap: round;
}

.score-card__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-card__num {
  font-family: 'Instrument Serif', serif;
  font-size: 58px;
  line-height: 1;
  background: linear-gradient(135deg, #ff7849, #ff2d8c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 400;
}

.score-card__total {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-top: 2px;
}

.score-card__right {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.score-card__brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  margin-bottom: 14px;
}

.score-card__brand-dot {
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, #ff7849, #ff2d8c);
  border-radius: 50%;
}

.score-card__insight {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
  color: #fdf6ee;
  margin-bottom: 10px;
}

.score-card__insight::before {
  content: '"';
  color: #ff7849;
  font-size: 30px;
  line-height: 0;
  vertical-align: -8px;
  margin-right: 2px;
}

.score-card__insight::after {
  content: '"';
  color: #ff7849;
  font-size: 30px;
  line-height: 0;
  vertical-align: -8px;
  margin-left: 2px;
}

.score-card__author {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 14px;
}

.score-card__url {
  font-size: 11px;
  color: #ff7849;
  margin-top: auto;
  border-top: 1px solid rgba(255, 120, 73, 0.2);
  padding-top: 10px;
}

@media (max-width: 600px) {
  .score-card {
    padding: 20px;
    gap: 16px;
  }
  .score-card__gauge {
    width: 110px;
    height: 110px;
  }
  .score-card__num {
    font-size: 42px;
  }
  .score-card__insight {
    font-size: 16px;
  }
}

/* ════════════════════════════════════════════════════════════════
   SHARE ROW
   ════════════════════════════════════════════════════════════════ */

.share-row {
  max-width: 660px;
}

.share-row__title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.share-row__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 9px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
  text-decoration: none;
}

.share-btn:hover {
  background: color-mix(in srgb, var(--warm) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--warm) 40%, var(--line));
  color: var(--warm);
  transform: translateY(-1px);
}

.share-btn--primary {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

.share-btn--primary:hover {
  background: var(--gradient);
  color: white;
  transform: translateY(-2px);
}

.share-btn__icon {
  font-weight: 700;
  font-size: 14px;
}

/* ════════════════════════════════════════════════════════════════
   SKILLS CARDS
   ════════════════════════════════════════════════════════════════ */

.skills-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 620px;
}

.skills-panel {
  width: min(100%, 920px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

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

.skill-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.skill-card--mini {
  grid-template-columns: 32px 1fr;
  gap: 9px;
  min-height: 66px;
  padding: 9px 10px;
  border-radius: 8px;
}

.skill-card:hover {
  background: color-mix(in srgb, var(--warm) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--warm) 30%, var(--line));
  transform: translateX(2px);
}

.skill-card__emoji {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warm) 10%, transparent);
  font-size: 22px;
}

.skill-card--mini .skill-card__emoji {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 17px;
}

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

.skill-card__name {
  font-weight: 600;
  font-size: 15px;
}

.skill-card--mini .skill-card__name {
  font-size: 13px;
  line-height: 1.15;
}

.skill-card__desc {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-card--mini .skill-card__desc {
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .skills-panel__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .skills-panel {
    width: 100%;
  }
  .skills-panel__grid {
    grid-template-columns: 1fr;
  }
}

.skill-card__price {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--gradient);
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Skill detail (expanded card) ──────────────────────────────── */

.skill-detail {
  background: color-mix(in srgb, var(--warm) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--warm) 25%, transparent);
  border-radius: 18px;
  padding: 22px 24px;
  max-width: 620px;
}

.skill-detail__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.skill-detail__emoji {
  font-size: 28px;
  width: 50px;
  height: 50px;
  background: color-mix(in srgb, var(--warm) 15%, transparent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-detail__title {
  font-family: inherit;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  flex: 1;
}

.skill-detail__price {
  background: var(--gradient);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.skill-detail__long {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 18px;
}

.skill-detail__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────────── */

.btn-primary {
  flex: 1;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 13px 22px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--hot) 60%, transparent);
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 200px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary--full {
  width: 100%;
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 13px 22px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  color: var(--fg);
  background: var(--surface-2);
}

.btn-ghost--full {
  width: 100%;
}

/* ── Payment card ──────────────────────────────────────────────── */

.payment-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-card__head {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.payment-card__amount {
  font-family: 'Instrument Serif', serif;
  font-size: 40px;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

/* ── PDF attachment ────────────────────────────────────────────── */

.pdf-attachment {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.2s, border-color 0.2s;
  max-width: 360px;
}

.pdf-attachment:hover {
  background: color-mix(in srgb, var(--warm) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--warm) 30%, var(--line));
}

.pdf-attachment__icon {
  background: var(--gradient);
  color: white;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.pdf-attachment__info {
  flex: 1;
  min-width: 0;
}

.pdf-attachment__name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-attachment__size {
  font-size: 12px;
  color: var(--muted);
}

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

/* ════════════════════════════════════════════════════════════════
   COMPOSER
   ════════════════════════════════════════════════════════════════ */

.composer-wrap {
  background: var(--bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  padding: 14px 48px 18px;
}

.composer-wrap > * {
  max-width: var(--chat-content-w);
  margin-left: auto;
  margin-right: auto;
}

.quick-replies {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding: 0 22px 4px 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.quick-reply {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.quick-reply:hover {
  color: var(--warm);
  border-color: color-mix(in srgb, var(--warm) 50%, var(--line));
  background: color-mix(in srgb, var(--warm) 6%, var(--surface));
}

.msg--starter-bubbles {
  margin-top: -6px;
}

.starter-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: var(--chat-content-w);
}

.starter-bubble {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg-soft);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.starter-bubble:hover {
  color: var(--warm);
  border-color: color-mix(in srgb, var(--warm) 55%, var(--line));
  background: color-mix(in srgb, var(--warm) 8%, var(--surface));
  transform: translateY(-1px);
}

.composer--full {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--chat-radius);
  min-height: 58px;
  padding: 8px;
  transition: border-color 0.2s;
}

.composer--full:focus-within {
  border-color: var(--warm);
}

.limit-banner {
  max-width: var(--chat-content-w);
  margin: 0 auto 8px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--warm) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--warm) 10%, var(--surface));
  color: var(--fg);
  font-size: 13px;
}

.limit-banner[hidden] {
  display: none;
}

.composer__attach {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--fg) !important;
  font: inherit;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}

.composer__attach:hover {
  background: var(--surface-3) !important;
  transform: translateY(-1px);
}

.composer--full textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  padding: 9px 0;
  resize: none;
  min-height: 40px;
  max-height: 140px;
  line-height: 1.4;
  overflow-y: auto;
}

.composer--full textarea::placeholder {
  color: var(--muted-2);
}

.composer--full button {
  background: var(--gradient);
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.composer--full button:hover {
  transform: scale(1.06);
}

.composer-hint {
  text-align: center;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 8px;
}

/* ════════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  color: var(--fg);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: var(--shadow-soft);
}

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

/* ════════════════════════════════════════════════════════════════
   STATIC PAGES (support, share landing, etc.)
   ════════════════════════════════════════════════════════════════ */

.text-page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 60px 28px;
}

.text-page h1 {
  font-size: 56px;
}

.plans-page {
  max-width: 1120px;
}

.plans-page > p {
  max-width: 680px;
  color: var(--muted);
  margin: -8px 0 30px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.pricing-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, transparent), var(--surface));
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--warm) 64%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--warm) 9%, var(--surface-2)), var(--surface));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--warm) 20%, transparent),
    0 24px 58px -32px color-mix(in srgb, var(--warm) 72%, transparent);
}

.pricing-card--featured {
  border-color: color-mix(in srgb, var(--warm) 78%, var(--line));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--warm) 42%, transparent),
    0 24px 56px -34px color-mix(in srgb, var(--warm) 78%, transparent);
}

.pricing-card--featured::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--warm) 18%, transparent), transparent 48%);
  pointer-events: none;
}

.pricing-card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warm) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warm) 28%, transparent);
  color: var(--warm);
  position: relative;
  z-index: 1;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pricing-card:hover .pricing-card__icon {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--warm) 62%, transparent);
  background: color-mix(in srgb, var(--warm) 18%, var(--surface));
}

.pricing-card__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pricing-card__eyebrow {
  margin-top: 20px;
  color: var(--warm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.pricing-card h2 {
  margin: 10px 0 0;
  color: var(--fg);
  font-size: 32px;
  line-height: 1.05;
  position: relative;
  z-index: 1;
}

.pricing-card__price {
  margin-top: 14px;
  color: var(--fg);
  font-size: 22px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.pricing-card p {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

.pricing-card__action {
  margin-top: auto;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--warm) 42%, var(--line));
  background: color-mix(in srgb, var(--warm) 10%, transparent);
  color: var(--fg);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pricing-card__action:hover {
  transform: translateY(-1px);
  border-color: var(--warm);
  background: color-mix(in srgb, var(--warm) 18%, transparent);
}

.pricing-card:hover .pricing-card__action {
  border-color: color-mix(in srgb, var(--warm) 68%, var(--line));
}

.support-box {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 20px;
  border-radius: 18px;
}

.share-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 32px;
}

.share-page img {
  width: min(100%, 900px);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.error-text {
  color: var(--bad);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 860px) {
  :root {
    --sidebar-w: 76px;
  }
  .app-sidebar {
    align-items: center;
  }
  .app-sidebar__label {
    opacity: 0;
    width: 0;
  }
  .app-sidebar__brand,
  .app-sidebar__item {
    justify-content: center;
    width: 44px;
    min-width: 44px;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .app-sidebar__nav,
  .app-sidebar__bottom {
    align-items: center;
    width: 44px;
  }
  .app-sidebar__form {
    width: 44px;
  }
  .app-sidebar__icon {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
  }
  .app-sidebar__top {
    flex-direction: row;
    justify-content: center;
    min-height: 48px;
  }
  .app-sidebar__brand {
    display: none;
  }
  .app-sidebar__toggle {
    order: -1;
  }
  .app-sidebar__toggle::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 999px;
    background: var(--warm);
    opacity: 1;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }
  .app-sidebar__toggle .app-sidebar__toggle-icon {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.16s ease, transform 0.16s ease;
  }
  .app-sidebar__toggle:hover,
  .app-sidebar__toggle:focus-visible {
    background: var(--sidebar-toggle-hover-bg);
    border-color: var(--sidebar-toggle-hover-border);
  }
  .app-sidebar__toggle:hover::before,
  .app-sidebar__toggle:focus-visible::before {
    opacity: 0;
    transform: scale(0.84);
  }
  .app-sidebar__toggle:hover .app-sidebar__toggle-icon,
  .app-sidebar__toggle:focus-visible .app-sidebar__toggle-icon {
    opacity: 0.92;
    transform: scale(1);
  }
  .app-sidebar .theme-toggle__icon {
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
  }
  .app-sidebar #themeToggle {
    padding-left: 0;
  }
  .app-sidebar [data-tooltip]:hover::after,
  .app-sidebar [data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    padding: 8px 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg) 94%, white 6%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    color: var(--fg);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .msg {
    max-width: 100%;
  }
  .msg__body {
    max-width: 92%;
  }
  .msg__body--full {
    margin-left: 0;
    max-width: 100%;
  }
  .feed--full > * {
    padding: 0 16px;
  }
  .composer-wrap {
    padding: 12px 16px 14px;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .text-page h1 {
    font-size: 42px;
  }
}

/* ════════════════════════════════════════════════════════════════
   AUTH PAGES (register, login, account, forgot, reset)
   ════════════════════════════════════════════════════════════════ */

.auth-page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 32px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
}

.auth-card__title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 38px;
  margin: 0 0 8px;
}

.auth-card__lead {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14.5px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field > span {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.form-field input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 11px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.form-field input:focus {
  border-color: var(--warm);
  background: color-mix(in srgb, var(--warm) 4%, var(--bg));
}

.form-field input::placeholder {
  color: var(--muted-2);
}

.auth-card__footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-card__footer a {
  color: var(--warm);
  text-decoration: none;
}

.auth-card__footer a:hover {
  text-decoration: underline;
}

.auth-sep {
  margin: 0 6px;
  color: var(--muted-2);
}

/* Cloudflare Turnstile container */
.cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 2px 0;
}

.captcha-box {
  display: flex;
  justify-content: center;
  min-height: 70px;
}

.captcha-box__fallback {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ── Nav additions: user pill + logout ──────────────────────────── */

.nav__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--fg) !important;
  font-size: 13px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__user:hover {
  background: var(--surface-2);
}

.nav__logout {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  transition: color 0.2s;
}

.nav__logout:hover {
  color: var(--warm);
}

.nav__cta {
  background: var(--gradient);
  color: white !important;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Flash messages ─────────────────────────────────────────────── */

.flash-stack {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 90%;
  width: 480px;
}

.flash {
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  animation: flash-in 0.3s ease;
}

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

.flash--error {
  border-color: color-mix(in srgb, var(--bad) 40%, var(--line));
  background: color-mix(in srgb, var(--bad) 8%, var(--surface));
}

.flash--ok {
  border-color: color-mix(in srgb, var(--good) 40%, var(--line));
  background: color-mix(in srgb, var(--good) 8%, var(--surface));
}

.flash--info {
  border-color: color-mix(in srgb, var(--warm) 40%, var(--line));
  background: color-mix(in srgb, var(--warm) 8%, var(--surface));
  word-break: break-all;
  font-size: 13px;
}

/* ════════════════════════════════════════════════════════════════
   ACCOUNT PAGE
   ════════════════════════════════════════════════════════════════ */

.account-page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 28px 60px;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px 28px;
  backdrop-filter: blur(20px);
}

.account-card--wide {
  grid-column: 1 / -1;
}

.account-card__title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 32px;
  margin: 0 0 18px;
}

.account-card__title--sub {
  font-size: 22px;
  margin-bottom: 16px;
}

.account-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.account-row:last-child {
  border-bottom: none;
}

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

.account-row__value {
  color: var(--fg);
  font-weight: 500;
}

.account-empty {
  color: var(--muted);
  font-size: 14px;
}

.account-empty a {
  color: var(--warm);
  text-decoration: none;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.history-item__score {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 18px;
}

.history-item__status {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--muted);
}

.history-item__status--done {
  background: color-mix(in srgb, var(--good) 15%, transparent);
  color: var(--good);
}

.history-item__status--paid {
  background: color-mix(in srgb, var(--warm) 15%, transparent);
  color: var(--warm);
}

.history-item__status--payment_pending,
.history-item__status--payment_required {
  background: color-mix(in srgb, var(--warm) 15%, transparent);
  color: var(--warm);
}

.history-item__status--failed {
  background: color-mix(in srgb, var(--bad) 15%, transparent);
  color: var(--bad);
}

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

.history-item__title,
.history-item__insight {
  font-size: 14px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item__date {
  font-size: 12px;
  color: var(--muted-2);
}

.history-item__pdf {
  color: var(--warm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.history-item__pdf:hover {
  text-decoration: underline;
}

.history-item__pdf--muted {
  color: var(--muted);
  cursor: default;
}

.history-item__pdf--muted:hover {
  text-decoration: none;
}

.result-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.result-detail__back {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.result-detail__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.result-detail__text {
  white-space: pre-wrap;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 28px 22px;
  }
  .auth-card__title {
    font-size: 30px;
  }
}

/* ── Skill detail: post-choice state ─────────────────────────────
   Once the user clicked Start/Pay/Skip, the card stays in chat but
   visibly marked as "decided" — buttons replaced with a status pill. */

.skill-detail--used {
  opacity: 0.7;
}

.skill-detail--used .skill-detail__head,
.skill-detail--used .skill-detail__long {
  opacity: 0.85;
}

.skill-detail__used-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
}
