:root {
  color-scheme: light;
  --ink: #21170f;
  --muted: #6f6258;
  --line: #f1d4bd;
  --paper: #fff4ea;
  --panel: #ffffff;
  --bot: #ffffff;
  --user: #ff7200;
  --accent: #ff7200;
  --accent-dark: #cc5500;
  --accent-deep: #7a3000;
  --accent-soft: #fff0e3;
  --accent-mid: #ffe0c2;
  --warm: #ffb347;
  --success: #268a55;
  --shadow: 0 22px 55px rgba(80, 43, 13, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 114, 0, 0.13), transparent 38%),
    linear-gradient(225deg, rgba(255, 179, 71, 0.22), transparent 32%),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  stroke-width: 2.4;
  vertical-align: -0.14em;
}

.icon-title {
  color: var(--accent);
  font-size: 0.95em;
}

.section-label .icon {
  margin-right: 6px;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  height: calc(100vh - 32px);
  min-height: 680px;
  margin: 16px auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
}

.sidebar,
.chat-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(241, 212, 189, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
}

.brand-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, white, var(--accent-soft));
}

.brand-logo {
  width: 100%;
  height: 96px;
  object-fit: contain;
  object-position: center;
  padding: 6px 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: white;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.eyebrow,
.section-label {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.05;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proof-strip {
  display: grid;
  gap: 8px;
}

.proof-strip div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: white;
}

.proof-strip strong {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}

.proof-strip span,
.stats-grid span,
.success-card span,
.success-card em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.status-card,
.success-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.quick-list {
  display: grid;
  gap: 10px;
}

.quick-list button,
.reset-btn,
.composer button,
.quick-replies button,
.dialog-actions button {
  border: 0;
  border-radius: 8px;
  font-weight: 700;
}

.quick-list button {
  min-height: 56px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.quick-list button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 5px 14px rgba(255, 114, 0, 0.13);
}

.quick-list .icon-badge .icon {
  color: var(--accent);
  font-size: 1.08rem;
}

.quick-list button:hover {
  border-color: rgba(255, 114, 0, 0.34);
  background: var(--accent-mid);
  box-shadow: 0 10px 24px rgba(255, 114, 0, 0.14);
  transform: translateY(-1px);
}

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

.stats-grid article {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: white;
}

.stats-grid strong {
  color: var(--accent);
  font-size: 1.35rem;
}

.success-card {
  display: grid;
  gap: 10px;
}

.success-card article {
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 3px;
}

.success-card article:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.status-card ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.chat-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(90deg, white, var(--accent-soft));
}

.counselor {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-header h2 {
  margin-bottom: 2px;
  font-size: clamp(1.12rem, 2.3vw, 1.45rem);
  display: flex;
  align-items: center;
  gap: 8px;
}

.online {
  margin: 0;
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(38, 138, 85, 0.14);
}

.reset-btn {
  color: white;
  background: var(--accent);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-actions button,
.header-actions a {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 114, 0, 0.18);
  border-radius: 8px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.header-actions .reset-btn {
  color: white;
  background: var(--accent);
}

.messages {
  padding: 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    linear-gradient(rgba(255, 244, 234, 0.88), rgba(255, 244, 234, 0.88)),
    radial-gradient(circle at 18px 18px, rgba(255, 114, 0, 0.11) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  max-width: min(690px, 90%);
}

.message-row.user {
  align-self: flex-end;
  justify-content: flex-end;
}

.message-row.bot {
  align-self: flex-start;
}

.bubble-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
}

.message-row.user .bubble-avatar {
  display: none;
}

.message {
  padding: 13px 15px;
  border-radius: 8px;
  line-height: 1.55;
  box-shadow: 0 8px 22px rgba(80, 43, 13, 0.08);
}

.message.bot {
  background: var(--bot);
  border: 1px solid #f3ddcc;
}

.message.user {
  color: white;
  background: linear-gradient(135deg, var(--user), var(--accent-dark));
}

.message h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

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

.message ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.message li + li {
  margin-top: 6px;
}

.welcome-card,
.recommendation-card,
.course-card,
.match-card,
.comparison-card,
.roadmap-card,
.conversion-card {
  display: grid;
  gap: 12px;
}

.welcome-card h3,
.recommendation-card h3,
.match-card h3,
.comparison-card h3,
.roadmap-card h3,
.conversion-card h3 {
  margin: 0;
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}

.benefit-list {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.benefit-list li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-grid,
.conversion-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.course-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, white, #fff8f2);
}

.course-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.course-card h3 {
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-badge {
  min-width: 76px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.match-row,
.compare-row {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) minmax(130px, 1.3fr) 44px;
  align-items: center;
  gap: 10px;
}

.rating-icons {
  display: inline-flex;
  gap: 2px;
  color: var(--accent);
}

.rating-icons .icon {
  font-size: 0.9rem;
}

.rating-filled {
  fill: currentColor;
}

.rating-empty {
  color: #d7b99d;
  fill: none;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #f5d7bc;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warm));
}

.roadmap-steps {
  display: grid;
  gap: 8px;
}

.roadmap-steps article {
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

.conversion-actions button,
.message .inline-action {
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.typing {
  width: 70px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d39a68;
  animation: blink 1s infinite ease-in-out;
}

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

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

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.quick-replies {
  min-height: 68px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-content: center;
  background: #fbfcfd;
}

.quick-replies:empty {
  display: none;
}

.quick-replies button {
  min-height: 40px;
  padding: 9px 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 114, 0, 0.18);
}

.quick-replies button:hover {
  background: var(--accent-mid);
}

.consult-btn {
  margin-top: 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font-weight: 800;
}

.composer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  background: white;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--ink);
  background: white;
}

input:focus {
  outline: 3px solid rgba(255, 114, 0, 0.18);
  border-color: var(--accent);
}

.composer button,
.dialog-actions button[value="submit"] {
  min-height: 46px;
  padding: 10px 18px;
  color: white;
  background: var(--accent);
}

.composer button:hover,
.dialog-actions button[value="submit"]:hover {
  background: var(--accent-dark);
}

dialog {
  width: min(460px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(22, 32, 42, 0.42);
}

.lead-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.lead-form h2 {
  margin-bottom: 0;
}

.lead-form p {
  margin-bottom: 4px;
  color: var(--muted);
}

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

.dialog-contact a {
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: white;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  padding: 10px 14px;
}

.dialog-actions button[value="cancel"] {
  color: var(--ink);
  background: var(--accent-soft);
}

@media (max-width: 900px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: none;
  }

  .chat-panel {
    height: min(820px, calc(100vh - 18px));
    min-height: 620px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 16px, 1180px);
    margin: 8px auto;
    gap: 10px;
  }

  .sidebar {
    display: none;
  }

  .chat-panel {
    height: calc(100vh - 16px);
    min-height: 0;
  }

  .chat-header,
  .messages,
  .quick-replies,
  .composer {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .message-row {
    max-width: 96%;
  }

  .course-grid,
  .conversion-actions,
  .dialog-contact {
    grid-template-columns: 1fr;
  }

  .match-row,
  .compare-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .reset-btn {
    padding: 9px 11px;
  }
}
