@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "Raleway", Arial, sans-serif;
  color: #0a1e64;
  background: #f9f9ff;
  font-synthesis: none;
  --navy: #0a1e64;
  --blue: #0541f0;
  --blue-soft: #f3f7ff;
  --paper: #f9f9ff;
  --white: #ffffff;
  --line: #ced8fc;
  --line-warm: #d8d5cc;
  --muted: #526184;
  --cyan: #14c7bf;
  --coral: #ed7657;
  --warm-paper: #faf8f2;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow: hidden; color: var(--navy); background: var(--paper); }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }

.app-workspace { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; z-index: 20; height: 100vh; padding: 28px 18px 22px;
  display: flex; flex-direction: column; color: white; background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 13px; color: white; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: block; flex: 0 0 auto; object-fit: contain; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 19px; letter-spacing: .08em; }
.brand-copy small { margin-top: 2px; font-size: 9px; letter-spacing: .22em; opacity: .68; }
.brand--compact { margin: 0 10px 31px; }
.brand--compact .brand-mark { width: 38px; height: 38px; }
.brand--compact .brand-copy strong { font-size: 16px; }

.sidebar nav { display: grid; gap: 6px; }
.nav-item {
  min-height: 45px; padding: 12px 14px; border-radius: 8px; display: flex; align-items: center; gap: 13px;
  color: #b9c6d6; text-decoration: none; font-size: 14px; font-weight: 600; transition: .18s ease;
}
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: white; background: #ffffff0c; }
.nav-item--active { color: white; background: #ffffff12; box-shadow: inset 3px 0 var(--blue); }
.sidebar-foot {
  margin-top: auto; padding-top: 20px; border-top: 1px solid #ffffff16;
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center;
}
.sidebar-foot > span:last-child { min-width: 0; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { margin-top: 4px; color: #92a5bb; font-size: 9px; }
.data-status { width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; background: #ffffff10; }
.data-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px #14c7bf18; }

.main-panel { min-width: 0; height: 100vh; overflow: hidden; background: var(--paper); }
.mobile-header { display: none; }
.page { width: min(100%, 1680px); height: 100vh; margin: auto; padding: 0 clamp(20px, 3vw, 46px) 18px; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.intro {
  margin: 0 calc(-1 * clamp(20px, 3vw, 46px)); padding: 22px clamp(20px, 3vw, 46px) 19px;
  background: linear-gradient(135deg, #fff 0%, #f9f9ff 70%, #eef2ff 100%); border-bottom: 1px solid var(--line);
}
.hero-topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.live-dot { color: var(--cyan); letter-spacing: .03em; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--cyan); }
.intro h1 { margin: 13px 0 5px; color: var(--navy); font: 700 clamp(32px, 3vw, 46px)/1.05 "Nekst", "Raleway", sans-serif; letter-spacing: -.035em; }
.intro > p { max-width: 980px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.quick-prompts { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.quick-prompts button {
  padding: 8px 13px; border: 1px solid transparent; border-radius: 999px; color: var(--muted);
  background: transparent; font-size: 12px; font-weight: 700; text-align: left;
}
.quick-prompts button:first-child { color: var(--navy); border-color: #c9c7c0; background: var(--white); }
.quick-prompts button:hover { color: var(--blue); border-color: var(--line); background: var(--white); }

.consultation-grid { min-height: 0; padding-top: 18px; display: grid; grid-template-columns: minmax(430px, 1.08fr) minmax(390px, .92fr); gap: 18px; align-items: stretch; }
.dialogue-panel, .profile-panel, .shortlist-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.dialogue-panel {
  min-width: 0; height: 100%; min-height: 0; padding: 18px;
  display: flex; flex-direction: column; overflow: hidden;
}
.section-heading { display: flex; align-items: center; gap: 11px; padding-bottom: 17px; border-bottom: 1px solid #e8ecf8; }
.section-heading > span:last-child { min-width: 0; }
.section-heading strong, .section-heading small { display: block; }
.section-heading strong { font: 700 17px "Nekst", "Raleway", sans-serif; }
.section-heading small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.section-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-content: center; color: var(--blue); background: #0541f00b; }
.section-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.messages {
  min-height: 0; margin: 16px -7px 0 0; padding: 0 9px 16px 0; display: grid; align-content: start; gap: 16px;
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #b8c6ef transparent;
}
.message { max-width: 86%; display: flex; gap: 11px; align-items: flex-start; }
.message.user { justify-self: end; flex-direction: row-reverse; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-content: center; color: white; background: var(--blue); font-size: 12px; font-weight: 800; }
.message.user .avatar { background: var(--navy); }
.bubble { padding: 14px 16px; border: 1px solid #e4e9f8; border-radius: 4px 12px 12px 12px; color: var(--navy); background: var(--blue-soft); font-size: 14px; line-height: 1.62; }
.message.user .bubble { border-color: var(--navy); border-radius: 12px 4px 12px 12px; color: white; background: var(--navy); }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble a { color: var(--blue); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.message.user .bubble a { color: white; }
.typing .bubble { color: var(--muted); }

.cards { min-height: 0; padding: 14px; display: grid; grid-template-columns: 1fr; gap: 10px; overflow-y: auto; align-content: start; scrollbar-color: #b8c6ef transparent; }
.program-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); background: var(--white); transition: transform .18s, box-shadow .18s; }
.program-card:hover { transform: translateY(-1px); box-shadow: 0 10px 26px #10284a0c; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.program-card h2 { margin: 6px 0 5px; font: 700 17px/1.35 "Nekst", "Raleway", sans-serif; letter-spacing: -.01em; }
.code { color: var(--blue); font: 800 10px/1.3 "Raleway", sans-serif; letter-spacing: .07em; }
.fit-chip { padding: 6px 8px; border-radius: 99px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; white-space: nowrap; }
.institute { min-height: 28px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.group-programs { margin: 12px 0 14px; padding: 11px 12px; border-radius: 7px; background: #f4f6fd; font-size: 11px; }
.group-programs strong { display: block; margin-bottom: 7px; color: var(--blue); }
.group-programs ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.group-programs li { display: grid; grid-template-columns: 61px minmax(0, 1fr); gap: 7px; align-items: baseline; }
.group-programs a { color: var(--navy); text-decoration-color: #9eb0e9; text-underline-offset: 2px; }
.admission { margin: 14px 0; padding-left: 10px; border-left: 3px solid var(--cyan); font-size: 12px; line-height: 1.5; }
.admission strong { display: block; margin-bottom: 2px; }
.mini-section { margin-top: 13px; }
.mini-section h3 { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-list span { padding: 5px 7px; border-radius: 5px; color: var(--muted); background: #f3f5fb; font-size: 10px; }
.program-card details { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e8ecf8; font-size: 11px; line-height: 1.55; }
.program-card summary { color: var(--blue); cursor: pointer; font-weight: 700; }
.program-card ul { margin: 9px 0 0; padding-left: 18px; }
.source-link { display: inline-block; margin-top: 13px; color: var(--blue); font-size: 10px; font-weight: 800; text-decoration: none; }

.composer {
  z-index: 5; margin-top: auto; padding: 7px 7px 7px 16px; flex: 0 0 auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr) 42px auto; gap: 9px; align-items: center;
  border: 1px solid var(--line-warm); border-radius: 11px; background: var(--white); box-shadow: 0 16px 46px #10284a12;
}
.composer-search { width: 20px; height: 20px; fill: none; stroke: #87909c; stroke-width: 1.8; stroke-linecap: round; }
.composer textarea { width: 100%; min-height: 44px; max-height: 140px; padding: 12px 0; border: 0; outline: 0; resize: none; color: var(--navy); background: transparent; font-size: 14px; line-height: 1.45; }
.composer textarea::placeholder { color: #7b8294; }
.voice-button, .send-button { min-height: 42px; border: 0; border-radius: 7px; display: grid; place-content: center; }
.voice-button { width: 42px; color: var(--navy); background: #eef2ff; }
.voice-button:hover { color: var(--blue); }
.voice-button.active { color: white; background: var(--blue); animation: pulse 1.6s infinite; }
.send-button { padding: 0 15px; display: flex; align-items: center; gap: 8px; color: white; background: var(--navy); font-weight: 800; }
.send-button:hover { background: var(--blue); }
.voice-button svg, .send-button svg { width: 19px; height: 19px; fill: currentColor; }
.send-button svg { width: 16px; height: 16px; }
.voice-status { margin-top: 11px; color: var(--blue); text-align: center; font-size: 11px; font-weight: 700; }
.disclaimer { margin: 13px 0 0; color: var(--muted); text-align: center; font-size: 9px; line-height: 1.5; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px #0541f018; } }

.advisor-side { height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(230px, .9fr) minmax(0, 1.1fr); gap: 14px; }
.profile-panel { min-height: 0; padding: 16px; display: flex; flex-direction: column; overflow: hidden; }
.profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 15px; border-bottom: 1px solid #e8ecf8; }
.profile-heading b, .profile-heading small { display: block; }
.profile-heading b { font: 700 16px "Nekst", "Raleway", sans-serif; }
.profile-heading small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.profile-heading button { padding: 5px; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 800; }
.profile-form { min-height: 0; padding: 13px 4px 0 0; display: grid; gap: 10px; overflow-y: auto; scrollbar-color: #b8c6ef transparent; }
.profile-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.profile-form-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-form label, .ege-editor label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 700; }
.profile-form input, .profile-form select {
  width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid #d9e0f5; border-radius: 6px;
  color: var(--navy); outline: none; background: #fbfcff; font-size: 11px;
}
.profile-form input:focus, .profile-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0541f00e; }
.ege-editor { margin: 0; padding: 9px; border: 1px solid #e3e8f6; border-radius: 7px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.ege-editor legend { padding: 0 5px; color: var(--blue); font-size: 9px; font-weight: 800; }
.ege-editor input { text-align: center; font-variant-numeric: tabular-nums; }
.profile-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 2px; }
.profile-actions > span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.profile-save { min-height: 34px; padding: 0 13px; border: 0; border-radius: 6px; color: white; background: var(--blue); font-size: 10px; font-weight: 800; white-space: nowrap; }
.profile-save:hover { background: var(--navy); }
.profile-save:disabled { cursor: wait; opacity: .55; }

.shortlist-panel { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.shortlist-heading { padding: 15px 16px 13px; border-bottom: 1px solid #e8ecf8; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shortlist-heading b, .shortlist-heading small { display: block; }
.shortlist-heading b { font: 700 16px "Nekst", "Raleway", sans-serif; }
.shortlist-heading small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.shortlist-count { min-width: 28px; height: 28px; padding: 0 7px; border-radius: 99px; display: grid; place-content: center; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.empty-shortlist { min-height: 180px; padding: 35px 22px; display: grid; place-content: center; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.empty-shortlist span { color: var(--line); font-size: 31px; }
.empty-shortlist p { max-width: 300px; margin: 8px auto 0; }

button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #0541f035; outline-offset: 2px; }

@media (max-width: 1120px) {
  .consultation-grid { grid-template-columns: minmax(400px, 1fr) minmax(360px, .9fr); }
  .send-button span { display: none; }
  .send-button { width: 42px; padding: 0; justify-content: center; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app-workspace { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-header { height: 64px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--navy); }
  .mobile-header .brand { margin: 0; }
  .mobile-header .brand-mark { width: 34px; height: 34px; }
  .mobile-status { display: flex; align-items: center; gap: 7px; color: #b9c6d6; font-size: 10px; font-weight: 700; }
  .mobile-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
  .main-panel { height: auto; overflow: visible; }
  .page { height: auto; display: block; }
  .consultation-grid { grid-template-columns: 1fr; }
  .dialogue-panel { position: static; height: min(760px, calc(100dvh - 84px)); min-height: 560px; }
  .advisor-side { position: static; height: auto; min-height: 0; grid-template-rows: auto 650px; }
  .profile-panel { max-height: 560px; }
}

@media (max-width: 700px) {
  .page { padding: 0 14px 45px; }
  .intro { margin: 0 -14px; padding: 34px 18px 28px; }
  .hero-topline { display: block; }
  .live-dot { display: block; margin-top: 9px; }
  .intro h1 { margin-top: 24px; font-size: clamp(38px, 12vw, 54px); }
  .intro > p { font-size: 14px; }
  .quick-prompts { flex-wrap: nowrap; overflow-x: auto; margin-right: -18px; padding-right: 18px; scrollbar-width: thin; }
  .quick-prompts button { min-width: 240px; border-color: var(--line); background: var(--white); }
  .consultation-grid { padding-top: 15px; gap: 12px; }
  .dialogue-panel, .profile-panel, .shortlist-panel { border-radius: 8px; }
  .dialogue-panel { padding: 14px; }
  .profile-panel { padding: 15px; }
  .message { max-width: 96%; }
  .bubble { font-size: 13px; }
  .advisor-side { grid-template-rows: auto 620px; }
  .profile-form-row, .profile-form-row--three { grid-template-columns: 1fr; }
  .ege-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer { grid-template-columns: minmax(0, 1fr) 42px 42px; padding-left: 9px; }
  .composer-search { display: none; }
  .send-button { width: 42px; padding: 0; }
  .program-card { padding: 16px; }
}

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