:root {
  color-scheme: light;
  --school-purple: #8c7dbd;
  --school-purple-dark: #7565a7;
  --school-purple-soft: #f2eff8;
  --ink: #333333;
  --muted: #77737e;
  --line: #ded9e8;
  --paper: #ffffff;
  --page: #f7f6f9;
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); }
button, textarea { font: inherit; }
button { cursor: pointer; }

.shell { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 48px; }

.school-header {
  position: relative;
  min-height: 230px;
  display: flex;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: 42px clamp(28px, 6vw, 64px);
  color: #fff;
  background-image: url("https://www.zushalkova.sk/wp-content/uploads/2023/01/1-01-scaled.jpg");
  background-position: center 42%;
  background-size: cover;
}

.header-overlay { position: absolute; inset: 0; background: rgba(112, 91, 159, .78); }
.brand-mark, .header-copy { position: relative; z-index: 1; }

.brand-mark {
  flex: 0 0 82px;
  height: 96px;
  display: grid;
  place-content: center;
  border: 1px solid rgba(255,255,255,.62);
  text-align: center;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 20px;
  letter-spacing: .16em;
}

.brand-note { display: block; margin-bottom: -5px; font-size: 34px; line-height: 1; letter-spacing: 0; }
.header-copy p { margin: 0; color: rgba(255,255,255,.88); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { font-family: Oswald, "Arial Narrow", sans-serif; font-weight: 400; }
h1 { margin: 6px 0 9px; font-size: clamp(38px, 7vw, 58px); line-height: 1.08; letter-spacing: .02em; }

.assistant-panel {
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-top: 5px solid var(--school-purple);
  background: var(--paper);
}

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.section-label { margin: 0 0 5px; color: var(--school-purple-dark); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
h2 { margin: 0; font-size: clamp(28px, 5vw, 38px); line-height: 1.2; }

.status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: #625b6c; font-size: 12px; font-weight: 600; }
.status span { width: 8px; height: 8px; border-radius: 50%; background: #67a37a; }
.intro { max-width: 720px; margin: 16px 0 28px; color: #68636d; font-size: 15px; line-height: 1.7; }

.conversation { min-height: 150px; max-height: 540px; overflow-y: auto; padding: 24px; border: 1px solid var(--line); background: #fbfafc; scroll-behavior: smooth; }
.message { display: flex; gap: 13px; margin: 0 0 22px; }
.message:last-child { margin-bottom: 0; }
.message-user { justify-content: flex-end; }

.avatar { flex: 0 0 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--school-purple); font-family: Oswald, "Arial Narrow", sans-serif; font-size: 12px; letter-spacing: .08em; }
.message-body { max-width: min(680px, calc(100% - 52px)); }
.message-body > p { margin: 0; line-height: 1.7; }
.message-user .message-body { padding: 12px 16px; color: #fff; background: var(--school-purple-dark); }
.message-assistant .message-body { padding-top: 7px; }
.message-loading .message-body { color: var(--muted); }

.citation-link { display: inline-flex; align-items: center; justify-content: center; min-width: 21px; height: 21px; margin: 0 2px; color: var(--school-purple-dark); background: var(--school-purple-soft); font-size: 11px; font-weight: 700; text-decoration: none; vertical-align: .12em; }
.confidence { display: inline-block; margin-top: 12px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.sources-wrap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sources-wrap h3 { margin: 0 0 8px; font-size: 15px; letter-spacing: .04em; }
.sources { margin: 0; padding-left: 22px; }
.sources li { padding: 5px 0 8px 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.sources a { color: var(--school-purple-dark); font-weight: 700; text-underline-offset: 3px; }
.sources p { margin: 4px 0 0; }
.source-type { margin-left: 6px; color: #8b8492; font-size: 11px; font-weight: 400; }
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.feedback button { padding: 4px 10px; border: 1px solid var(--line); color: var(--school-purple-dark); background: #fff; font-size: 11px; font-weight: 700; }
.feedback button:hover, .feedback button:focus-visible { border-color: var(--school-purple); background: var(--school-purple-soft); }
.feedback button:disabled { opacity: .55; cursor: default; }
.feedback input { flex: 1 1 220px; min-width: 170px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.feedback input:focus-visible { outline: 2px solid var(--school-purple); outline-offset: 1px; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 13px; }
.examples button { padding: 8px 12px; border: 1px solid var(--school-purple); border-radius: 0; color: var(--school-purple-dark); background: #fff; font-size: 12px; font-weight: 600; }
.examples button:hover, .examples button:focus-visible { color: #fff; background: var(--school-purple); }

.question-row { display: grid; grid-template-columns: 1fr auto; border: 1px solid #bbb4c7; background: #fff; }
textarea { width: 100%; min-height: 70px; resize: vertical; border: 0; outline: 0; padding: 14px 16px; color: var(--ink); background: transparent; line-height: 1.5; }
textarea:focus { box-shadow: inset 0 0 0 2px rgba(140,125,189,.23); }
.question-row button { display: flex; align-items: center; gap: 10px; margin: 7px; padding: 11px 17px; border: 0; color: #fff; background: var(--school-purple); font-weight: 700; }
.question-row button:hover { background: var(--school-purple-dark); }
.question-row button:disabled { opacity: .55; cursor: wait; }
.form-note { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; color: #8a8690; font-size: 11px; }

footer { display: flex; justify-content: space-between; gap: 28px; padding: 20px 2px 0; color: #77727d; font-size: 11px; line-height: 1.55; }
footer p { max-width: 680px; margin: 0; }
footer a { flex: 0 0 auto; color: var(--school-purple-dark); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 680px) {
  .shell { width: 100%; padding: 0; }
  .school-header { min-height: 190px; padding: 30px 22px; }
  .brand-mark { flex-basis: 64px; height: 78px; font-size: 16px; }
  .brand-note { font-size: 27px; }
  .assistant-panel { border-left: 0; border-right: 0; padding: 26px 18px 30px; }
  .panel-heading { display: block; }
  .status { margin-top: 12px; }
  .conversation { max-height: 500px; padding: 18px 14px; }
  .question-row { grid-template-columns: 1fr; }
  .question-row button { justify-content: center; margin: 0 7px 7px; }
  footer { display: block; padding: 18px; }
  footer a { display: inline-block; margin-top: 8px; }
}

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