:root {
  --dark: #0b1220;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d7e6fb;
  --paper: #f4f8ff;
  --panel: #ffffff;
  --green: #12c982;
  --green-2: #2df1ac;
  --blue: #2563eb;
  --blue-2: #0ea5e9;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --accent-dark: #1d4ed8;
  --accent-rgb: 37, 99, 235;
  --accent-2-rgb: 14, 165, 233;
  --accent-muted-rgb: 30, 64, 175;
  --hero-wash-rgb: 219, 234, 254;
  --navy: #0f172a;
  --brand-glow: rgba(18, 201, 130, 0.2);
  --ice: #eaf4ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.link-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -8rem, rgba(var(--accent-2-rgb), 0.32), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #eef6ff 46%, #f8fbff 100%);
  color: var(--ink);
  transition: background 700ms ease, color 700ms ease;
}

@media (prefers-reduced-motion: no-preference) {
  .link-page.is-motion-scrolling::after {
    content: "";
    position: fixed;
    inset: 58px 0 0;
    z-index: 9;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0)),
      repeating-linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 18px, rgba(37, 99, 235, 0.08) 20px);
    mix-blend-mode: multiply;
    animation: motionStreak 620ms ease-out both;
    will-change: opacity, transform;
  }

  .link-page.is-motion-scrolling .bitecheck-nav-link img {
    animation: bitecheckNavRush 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: filter, transform;
  }
}

.link-page.theme-iron {
  --accent: #475569;
  --accent-2: #94a3b8;
  --accent-dark: #334155;
  --accent-rgb: 71, 85, 105;
  --accent-2-rgb: 148, 163, 184;
  --accent-muted-rgb: 51, 65, 85;
  --hero-wash-rgb: 226, 232, 240;
}

.link-page.theme-forest {
  --accent: #166534;
  --accent-2: #22c55e;
  --accent-dark: #14532d;
  --accent-rgb: 22, 101, 52;
  --accent-2-rgb: 34, 197, 94;
  --accent-muted-rgb: 20, 83, 45;
  --hero-wash-rgb: 220, 252, 231;
}

.link-page.theme-burgundy {
  --accent: #991b1b;
  --accent-2: #f97316;
  --accent-dark: #7f1d1d;
  --accent-rgb: 153, 27, 27;
  --accent-2-rgb: 249, 115, 22;
  --accent-muted-rgb: 127, 29, 29;
  --hero-wash-rgb: 254, 226, 226;
}

.link-page.theme-gold {
  --accent: #92400e;
  --accent-2: #d97706;
  --accent-dark: #78350f;
  --accent-rgb: 146, 64, 14;
  --accent-2-rgb: 217, 119, 6;
  --accent-muted-rgb: 120, 53, 15;
  --hero-wash-rgb: 254, 243, 199;
}

.link-page.theme-night {
  --accent: #1e3a8a;
  --accent-2: #0891b2;
  --accent-dark: #172554;
  --accent-rgb: 30, 58, 138;
  --accent-2-rgb: 8, 145, 178;
  --accent-muted-rgb: 30, 64, 175;
  --hero-wash-rgb: 219, 234, 254;
}

.bio-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  left: 0;
  transform: none;
  padding: 0 max(18px, calc((100% - 480px) / 2 + 18px));
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
  background:
    radial-gradient(circle at 50% 0, rgba(var(--accent-2-rgb), 0.1), transparent 340px),
    linear-gradient(180deg, rgba(248, 251, 255, 0.84), rgba(238, 246, 255, 0.58));
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.06);
}

.bio-nav a {
  color: rgba(15, 23, 42, 0.66);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.bio-nav .brand {
  color: var(--ink);
  font-size: 1rem;
  text-transform: none;
}

.bio-nav div {
  display: contents;
}

.bitecheck-nav-link {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  width: 124px;
  height: 34px;
  padding: 4px 8px;
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  box-shadow: 0 0 18px var(--brand-glow);
  transform: translate(-50%, -50%);
}

.bio-nav div > a:not(.bitecheck-nav-link) {
  margin-left: auto;
}

.bitecheck-nav-link img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.bio-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 76px 14px 38px;
}

.hero {
  display: grid;
  justify-items: center;
  text-align: center;
}

.hero-quote {
  min-height: 42px;
  margin: 0 0 2px;
  color: rgba(var(--accent-muted-rgb), 0.5);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.4;
}

.hero-image-wrap {
  position: relative;
  width: 100%;
  height: 292px;
  overflow: visible;
  display: grid;
  place-items: start center;
  margin: 0 0 -4px;
  isolation: isolate;
}

.hero-image-wrap::before {
  content: "";
  position: absolute;
  top: -34px;
  left: 50%;
  z-index: 0;
  width: min(132%, 560px);
  height: 440px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 43%, rgba(var(--hero-wash-rgb), 0.32) 0%, rgba(var(--hero-wash-rgb), 0.16) 34%, rgba(var(--accent-2-rgb), 0.08) 54%, rgba(255, 255, 255, 0) 76%);
  filter: blur(16px);
  pointer-events: none;
}

.hero-word {
  position: absolute;
  top: -14px;
  left: 50%;
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
  color: transparent;
  -webkit-text-stroke: 1.1px rgba(var(--accent-rgb), 0.34);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(5.2rem, 21vw, 7.6rem);
  line-height: 1;
  letter-spacing: 0.04em;
  z-index: 1;
  cursor: pointer;
  transform-origin: center;
  transition: -webkit-text-stroke-color 700ms ease, filter 700ms ease;
}

.hero-word:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.72);
  outline-offset: 5px;
}

.hero-word.is-popping {
  animation: heroWordPop 360ms cubic-bezier(0.19, 1, 0.22, 1);
}

.hero-word.is-spectrum {
  filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.24));
}

@keyframes heroWordPop {
  0% {
    transform: translateX(-50%) scale(1);
  }

  48% {
    transform: translateX(-50%) scale(1.07);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

.hero-image-wrap img {
  position: relative;
  z-index: 2;
  width: min(66%, 260px);
  max-width: none;
  height: auto;
  transform: translateY(32px);
  filter: saturate(1.08) contrast(1.07) drop-shadow(0 18px 28px rgba(15, 23, 42, 0.24));
  pointer-events: none;
}

.handle,
.trainer-title,
.trainer-copy {
  margin: 0;
}

.handle {
  color: rgba(var(--accent-muted-rgb), 0.68);
  font-weight: 950;
  position: relative;
  z-index: 2;
  margin-top: 10px;
  text-shadow: 0 3px 16px rgba(255, 255, 255, 0.78);
}

.hero h1 {
  position: relative;
  z-index: 2;
  margin: 12px 0 8px;
  color: var(--ink);
  font-size: clamp(2.6rem, 12vw, 4rem);
  line-height: 0.95;
  text-shadow: 0 8px 26px rgba(255, 255, 255, 0.86);
}

.trainer-title {
  max-width: 360px;
  font-size: 0.9rem;
  font-weight: 950;
  color: var(--accent-dark);
}

.trainer-copy {
  max-width: 390px;
  margin-top: 10px;
  color: rgba(15, 23, 42, 0.68);
  line-height: 1.55;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 4px;
}

.pill-row span {
  padding: 7px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.08);
  font-size: 0.76rem;
  font-weight: 850;
}

.link-stack {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.action {
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.action::after {
  content: ">";
  grid-column: 2;
  grid-row: 1 / span 2;
  color: rgba(var(--accent-rgb), 0.76);
  font-weight: 950;
}

.action.primary {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-2));
  color: #fff;
  box-shadow: 0 18px 32px rgba(var(--accent-rgb), 0.28);
}

.action span {
  font-weight: 950;
}

.action small {
  color: rgba(15, 23, 42, 0.54);
  font-weight: 800;
}

.action.primary small,
.action.primary::after {
  color: rgba(255, 255, 255, 0.78);
}

.panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

#quick-check,
#apply {
  scroll-margin-top: 82px;
}

@keyframes motionStreak {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }

  34% {
    opacity: 0.54;
  }

  100% {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes bitecheckNavRush {
  0% {
    filter: blur(0) drop-shadow(0 0 18px var(--brand-glow));
    transform: translateY(0) scale(1);
  }

  42% {
    filter: blur(2px) drop-shadow(0 0 24px rgba(18, 201, 130, 0.4));
    transform: translateY(2px) scale(1.08);
  }

  100% {
    filter: blur(0) drop-shadow(0 0 18px var(--brand-glow));
    transform: translateY(0) scale(1);
  }
}

.panel-logo {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 12px;
  margin: -6px auto -4px;
  color: var(--ink);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.panel-logo-mark {
  position: relative;
  width: clamp(70px, 18vw, 100px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 7px solid var(--green);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 54%, rgba(18, 201, 130, 0.1), rgba(18, 201, 130, 0));
  box-shadow: 0 18px 36px rgba(18, 201, 130, 0.18);
}

.panel-logo-mark::before {
  content: "";
  position: absolute;
  left: 20%;
  top: 42%;
  width: 48%;
  height: 24%;
  border-left: 9px solid var(--green);
  border-bottom: 9px solid var(--green);
  transform: rotate(-45deg);
  transform-origin: center;
}

.panel-logo-mark::after {
  content: none;
}

.panel-logo-word {
  color: var(--ink);
  justify-self: center;
}

.panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 7vw, 2.5rem);
  line-height: 0.95;
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.link-page .kicker {
  color: rgba(var(--accent-rgb), 0.62);
}

label {
  display: grid;
  gap: 7px;
  color: rgba(15, 23, 42, 0.58);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

input,
select {
  padding: 0 12px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(15, 23, 42, 0.38);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.54);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

}

button:not(.hero-word) {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 950;
}

.quick-form,
.apply-form {
  display: grid;
  gap: 12px;
}

.application-panel {
  position: relative;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-2-rgb), 0.16), transparent 15rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
}

.application-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 58%);
}

.application-header,
.apply-form,
.application-output,
.application-tags {
  position: relative;
  z-index: 1;
}

.application-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 18px 18px 0;
}

.application-badge {
  display: grid;
  gap: 2px;
  min-width: 74px;
  padding: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 24px rgba(var(--accent-rgb), 0.08);
  text-align: center;
}

.application-badge strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
}

.application-badge span {
  color: rgba(var(--accent-muted-rgb), 0.62);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.application-progress {
  position: relative;
  z-index: 1;
  height: 8px;
  margin: 14px 18px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.11);
}

.application-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-2));
  transition: width 240ms ease;
}

.application-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 0;
}

.application-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(var(--accent-muted-rgb), 0.72);
  font-size: 0.72rem;
  font-weight: 900;
}

.application-panel .apply-form {
  padding: 16px 18px 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-card {
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.field-card input,
.field-card textarea {
  border-color: rgba(var(--accent-rgb), 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.goal-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.goal-field legend {
  padding: 0 6px;
  color: rgba(15, 23, 42, 0.58);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.goal-field label {
  display: block;
}

.goal-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.goal-field span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.86);
  color: rgba(15, 23, 42, 0.74);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  text-transform: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.goal-field input:checked + span {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.42);
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(var(--accent-rgb), 0.2);
}

.struggle-card textarea {
  min-height: 116px;
}

.application-submit {
  min-height: 62px;
  display: grid;
  gap: 2px;
  align-content: center;
  background: linear-gradient(135deg, var(--ink), var(--accent-dark));
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.application-submit span,
.application-submit small {
  display: block;
}

.application-submit small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
}

.application-output {
  margin: 0 18px 18px;
}

.application-output.is-ready {
  border-color: rgba(var(--accent-rgb), 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-2-rgb), 0.12), transparent 12rem),
    #fff;
}

.quick-output {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 8px;
  background: #f8fbff;
}

.quick-output strong {
  color: var(--ink);
}

.quick-output p {
  margin: 0;
  color: rgba(15, 23, 42, 0.62);
  line-height: 1.45;
}

.launch-panel {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(var(--accent-2-rgb), 0.18), transparent 11rem),
    rgba(255, 255, 255, 0.94);
}

.launch-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.launch-topline span {
  padding: 6px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: rgba(var(--accent-muted-rgb), 0.72);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.launch-panel p {
  margin: 0;
  color: rgba(15, 23, 42, 0.64);
  line-height: 1.5;
}

.launch-lede {
  color: var(--ink) !important;
  font-size: 1rem;
  font-weight: 950;
}

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

.launch-grid span {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.13);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.76);
  color: rgba(15, 23, 42, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.launch-cta {
  margin-top: 2px;
}

.app-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -10%, rgba(14, 165, 233, 0.2), transparent 28rem),
    var(--paper);
  color: var(--ink);
}

.chat-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-right: 1px solid #d7e6fb;
  background:
    radial-gradient(circle at 24% 0%, rgba(14, 165, 233, 0.2), transparent 16rem),
    linear-gradient(180deg, #0f172a, #172554);
  color: #f8fbff;
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sidebar-brand .brand-mark {
  width: 42px;
  height: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(18, 201, 130, 0.38);
  border-radius: 8px;
  background: rgba(18, 201, 130, 0.11);
  object-fit: cover;
  box-shadow: 0 0 22px rgba(18, 201, 130, 0.22);
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.chat-logo {
  width: min(240px, 72vw);
  height: auto;
  display: block;
  margin: 0 0 8px;
  border-radius: 8px;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.18));
}

.sidebar-brand small,
.sidebar-note,
.history-panel p,
.history-item small {
  color: rgba(248, 251, 255, 0.62);
}

.sidebar-note {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
}

.new-chat {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  color: #f8fbff;
  text-align: left;
  padding: 0 14px;
}

.target-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
}

.target-card div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}

.target-card div:last-child {
  border-right: 0;
}

.target-card strong {
  font-size: 1.15rem;
}

.target-card small {
  color: rgba(248, 251, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.history-panel p {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
}

.history-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #f8fbff;
  text-align: left;
}

.history-item.active,
.history-item:hover {
  border-color: rgba(18, 201, 130, 0.28);
  background: rgba(18, 201, 130, 0.12);
}

.chat-main {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 78% 0%, rgba(14, 165, 233, 0.18), transparent 22rem),
    linear-gradient(180deg, rgba(219, 234, 254, 0.74), transparent 300px),
    var(--paper);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 22px 28px 14px;
}

.chat-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.92;
}

.mode-toggle {
  min-width: 300px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mode-button {
  background: transparent;
  color: var(--muted);
}

.mode-button.active {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.85fr;
  gap: 10px;
  padding: 0 28px 14px;
}

.app-page label {
  color: var(--muted);
}

.app-page input,
.app-page select,
.app-page textarea {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.wide {
  grid-column: span 2;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 28px 16px;
}

.prompt-grid button {
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.conversation {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px 28px 26px;
}

.chat-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 760px);
  gap: 12px;
  align-items: start;
}

.chat-message.user {
  justify-content: end;
  grid-template-columns: minmax(0, 760px) 42px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
}

.chat-message.user .avatar {
  grid-column: 2;
  grid-row: 1;
  background: var(--blue);
}

.bubble {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.08);
  line-height: 1.5;
}

.chat-message.user .bubble {
  grid-column: 1;
  border-color: var(--blue);
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
}

.bubble strong {
  display: block;
  margin-bottom: 6px;
}

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

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

.bubble ul {
  margin: 8px 0 0;
  padding-left: 19px;
}

.weekly-plan {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.weekly-plan section {
  padding: 12px;
  border-radius: 8px;
  background: #eff6ff;
}

.weekly-plan h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.source-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line);
  background: rgba(244, 248, 255, 0.94);
}

.composer textarea {
  min-height: 48px;
  max-height: 150px;
  resize: none;
}

.composer button {
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
}

@media (max-width: 980px) {
  .chat-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
  }

  .history-panel {
    display: none;
  }

  .chat-header {
    align-items: start;
    flex-direction: column;
  }

  .mode-toggle {
    width: 100%;
    min-width: 0;
  }

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

  .form-grid,
  .goal-field {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .bio-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-image-wrap {
    height: 224px;
  }

  .hero-word {
    top: -14px;
  }

  .hero-image-wrap::before {
    top: -32px;
    width: min(134%, 460px);
    height: 360px;
  }

  .hero-image-wrap img {
    width: min(65%, 238px);
    transform: translateY(30px);
  }

  .handle {
    margin-top: 14px;
  }

  .chat-header,
  .profile-grid,
  .prompt-grid,
  .conversation,
  .composer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .profile-grid,
  .prompt-grid,
  .composer {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .chat-message,
  .chat-message.user {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .chat-message.user .avatar {
    grid-column: 1;
  }

  .chat-message.user .bubble {
    grid-column: 2;
  }

  .avatar {
    width: 34px;
  }
}
