
:root {
  --ai-red: #ff1717;
  --ai-red-dark: #b90000;
  --ai-bg: #060606;
  --ai-panel: #111111;
  --ai-panel-2: #171717;
  --ai-line: rgba(255,255,255,.09);
  --ai-muted: #929292;
  --ai-success: #38d678;
}

.ai-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(255,23,23,.12), transparent 34rem),
    var(--ai-bg);
  color: #f6f6f6;
}

.ai-shell { padding: 2rem 0 7rem; }

.ai-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-heading h1 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 900;
  line-height: .95;
  text-transform: uppercase;
}

.ai-heading p {
  max-width: 760px;
  margin: .6rem 0 0;
  color: var(--ai-muted);
}

.ai-panel {
  height: 100%;
  padding: 1.35rem;
  border: 1px solid var(--ai-line);
  border-radius: .9rem;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

.ai-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-topline h2,
.ai-topline h3 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-topline h2 { font-size: 1.55rem; }

.ai-kicker {
  color: var(--ai-red);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.ai-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
}

.coach-summary {
  position: sticky;
  top: 95px;
}

.coach-avatar {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--ai-red), var(--ai-red-dark));
  box-shadow: 0 18px 45px rgba(255,23,23,.18);
  font-size: 2.1rem;
}

.coach-summary h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.coach-summary p {
  color: var(--ai-muted);
  font-size: .8rem;
  text-align: center;
}

.context-list {
  display: grid;
  gap: .7rem;
  margin-top: 1rem;
}

.context-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .75rem;
  border-radius: .65rem;
  background: rgba(255,255,255,.03);
}

.context-item span {
  color: var(--ai-muted);
  font-size: .72rem;
}

.context-item strong {
  font-size: .78rem;
  text-align: right;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 690px;
}

.chat-header-ai {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ai-line);
}

.chat-status {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.chat-status-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: .65rem;
  background: rgba(255,23,23,.1);
  color: var(--ai-red);
}

.chat-status strong { display: block; }
.chat-status small { color: var(--ai-muted); }

.online-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .3rem;
  border-radius: 50%;
  background: var(--ai-success);
}

.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  min-height: 470px;
  max-height: 560px;
  overflow-y: auto;
  padding: 1.2rem .2rem;
}

.chat-message {
  max-width: 78%;
  padding: .9rem 1rem;
  border-radius: .8rem;
  font-size: .86rem;
  line-height: 1.55;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--ai-red);
  color: white;
  border-bottom-right-radius: .2rem;
}

.chat-message.ai {
  align-self: flex-start;
  background: #1b1b1b;
  border: 1px solid var(--ai-line);
  color: #ddd;
  border-bottom-left-radius: .2rem;
}

.chat-message.ai strong {
  display: block;
  margin-bottom: .35rem;
  color: white;
}

.chat-message.system {
  align-self: center;
  max-width: 90%;
  padding: .65rem .9rem;
  border: 1px dashed rgba(255,255,255,.13);
  background: rgba(255,255,255,.025);
  color: var(--ai-muted);
  font-size: .74rem;
  text-align: center;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .85rem 0 1rem;
  border-top: 1px solid var(--ai-line);
}

.quick-prompt {
  padding: .5rem .7rem;
  border: 1px solid rgba(255,23,23,.32);
  border-radius: 999px;
  background: rgba(255,23,23,.06);
  color: #ddd;
  font-size: .72rem;
}

.quick-prompt:hover {
  color: white;
  background: var(--ai-red);
  border-color: var(--ai-red);
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: .65rem;
}

.chat-composer textarea {
  min-height: 52px;
  max-height: 130px;
  resize: vertical;
  color: white;
  background: #0c0c0c;
  border: 1px solid var(--ai-line);
  border-radius: .6rem;
  padding: .75rem .85rem;
}

.chat-composer textarea:focus {
  outline: none;
  border-color: var(--ai-red);
  box-shadow: 0 0 0 .2rem rgba(255,23,23,.12);
}

.chat-send {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: .6rem;
  background: var(--ai-red);
  color: white;
}

.checkin-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: .75rem;
}

.checkin-card {
  padding: .9rem;
  border-radius: .65rem;
  background: rgba(255,255,255,.03);
}

.checkin-card strong {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.5rem;
}

.checkin-card span {
  color: var(--ai-muted);
  font-size: .68rem;
  text-transform: uppercase;
}

.preview-note {
  padding: .85rem 1rem;
  border: 1px solid rgba(255,176,32,.24);
  border-radius: .65rem;
  background: rgba(255,176,32,.06);
  color: #d9c08d;
  font-size: .78rem;
}

@media (max-width: 991.98px) {
  .ai-layout { grid-template-columns: 1fr; }
  .coach-summary { position: static; }
}

@media (max-width: 767.98px) {
  .ai-shell { padding-top: 1.25rem; }
  .ai-heading { flex-direction: column; align-items: flex-start; }
  .checkin-grid { grid-template-columns: repeat(2,1fr); }
  .chat-message { max-width: 90%; }
}
