:root {
  color-scheme: light;
  --primary-50: #edf8f4;
  --primary-100: #d8efe7;
  --primary-200: #b1dfcf;
  --primary-300: #7bc7b0;
  --primary-400: #48aa90;
  --primary-500: #288d75;
  --primary-600: #1b705c;
  --primary-700: #175b4c;
  --primary-800: #14483d;
  --primary-900: #113c34;
  --primary: var(--primary-600);
  --primary-hover: var(--primary-700);
  --accent: #e7b946;
  --bg: #f5f8f7;
  --bg-soft: #edf3f1;
  --surface: #ffffff;
  --surface-2: #f9fbfa;
  --border: #dce6e2;
  --border-strong: #c8d6d1;
  --text: #17312a;
  --text-soft: #3f5a51;
  --muted: #6f837c;
  --inverse: #ffffff;
  --success: #16835b;
  --danger: #b93939;
  --shadow-sm: 0 8px 24px rgba(17, 60, 52, .07);
  --shadow-md: 0 18px 44px rgba(17, 60, 52, .11);
  --shadow-lg: 0 28px 80px rgba(17, 60, 52, .15);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shell: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --primary-50: #153a31;
  --primary-100: #18483d;
  --primary-200: #1f5e4e;
  --primary-300: #287963;
  --primary-400: #33977c;
  --primary-500: #46b093;
  --primary-600: #6cc7ad;
  --primary-700: #94d8c4;
  --primary-800: #bae7da;
  --primary-900: #ddf5ed;
  --primary: var(--primary-500);
  --primary-hover: var(--primary-600);
  --accent: #f0ca67;
  --bg: #0d1714;
  --bg-soft: #101f1a;
  --surface: #15251f;
  --surface-2: #1a2d26;
  --border: #2b4038;
  --border-strong: #3c564d;
  --text: #eff8f5;
  --text-soft: #c6d9d2;
  --muted: #93aaa2;
  --inverse: #10231d;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, .32);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, textarea, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }

.shell { width: min(calc(100% - 32px), var(--shell)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  transform: translateY(-150%); padding: 10px 14px;
  background: var(--primary); color: var(--inverse);
  border-radius: 10px; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.header-inner {
  min-height: 74px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; background: var(--primary); color: var(--inverse);
  font-weight: 900; font-size: .82rem; box-shadow: var(--shadow-sm);
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: .98rem; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.language-switch {
  display: flex; padding: 3px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 12px;
}
.language-button {
  min-width: 38px; min-height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer; font-weight: 800;
}
.language-button.is-active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.icon-button {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); cursor: pointer;
}

.hero {
  position: relative; overflow: hidden;
  padding: clamp(72px, 10vw, 124px) 0 clamp(64px, 8vw, 100px);
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.hero-glow-one {
  width: 430px; height: 430px; top: -190px; left: -150px;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}
.hero-glow-two {
  width: 340px; height: 340px; right: -110px; top: 40px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  align-items: center; gap: clamp(36px, 7vw, 88px);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 26px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-soft); font-size: .82rem; font-weight: 750;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 15%, transparent); }
.eyebrow { margin-bottom: 10px; color: var(--primary); font-size: .82rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.hero h1 { margin-bottom: 20px; font-size: clamp(3rem, 7vw, 5.8rem); }
.hero-lead { max-width: 700px; margin-bottom: 30px; color: var(--text-soft); font-size: clamp(1.08rem, 2vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: 1px solid transparent; border-radius: 14px;
  cursor: pointer; font-weight: 800; text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--primary); color: var(--inverse); box-shadow: var(--shadow-sm); }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { background: var(--surface); border-color: var(--border-strong); }
.button-ghost { background: transparent; border-color: var(--border); color: var(--text-soft); }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--muted); font-size: .86rem; font-weight: 700; }

.welcome-card {
  position: relative; display: grid; gap: 20px; padding: 30px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(18px);
}
.mascot-orb {
  width: 70px; height: 70px; display: grid; place-items: center;
  border-radius: 24px; background:
    linear-gradient(145deg, var(--primary), var(--primary-400));
  color: var(--inverse); font-size: 2rem; font-weight: 950;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--primary) 25%, transparent);
}
.welcome-label { color: var(--primary); font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.welcome-card h2 { margin: 7px 0 10px; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.welcome-card p { margin-bottom: 0; color: var(--muted); }
.mini-actions { display: grid; gap: 10px; }
.mini-action {
  min-height: 52px; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 15px; color: var(--text); cursor: pointer; text-align: left; font-weight: 750;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.mini-action:hover { transform: translateX(4px); border-color: var(--primary-300); background: var(--primary-50); }

.section { padding: clamp(68px, 9vw, 110px) 0; }
.section-soft { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-heading {
  display: flex; align-items: end; justify-content: space-between; gap: 30px;
  margin-bottom: 34px;
}
.section-heading h2 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.3rem); }
.section-heading > p { max-width: 520px; margin-bottom: 0; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.quick-card {
  min-height: 190px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  padding: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text); cursor: pointer; text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,.02);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick-card:hover { transform: translateY(-5px); border-color: var(--primary-200); box-shadow: var(--shadow-md); }
.quick-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  margin-bottom: auto; border-radius: 16px; background: var(--primary-50); font-size: 1.45rem;
}
.quick-card strong { margin-top: 24px; font-size: 1.05rem; }
.quick-card small { margin-top: 5px; color: var(--muted); }

.chat-shell {
  overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.chat-topbar {
  min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.assistant-identity { display: flex; align-items: center; gap: 12px; }
.assistant-avatar, .message-avatar {
  flex: 0 0 auto; display: grid; place-items: center; background: var(--primary); color: var(--inverse); font-weight: 900;
}
.assistant-avatar { width: 46px; height: 46px; border-radius: 15px; }
.assistant-identity div:last-child { display: grid; }
.assistant-identity span { color: var(--muted); font-size: .78rem; }
.chat-messages {
  min-height: 430px; max-height: 640px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px; padding: 28px;
  scroll-behavior: smooth;
}
.message { display: flex; align-items: flex-start; gap: 12px; animation: message-in .26s ease both; }
.message-user { justify-content: flex-end; }
.message-user .message-content { align-items: flex-end; }
.message-avatar { width: 38px; height: 38px; border-radius: 12px; }
.message-content { max-width: min(78%, 780px); display: flex; flex-direction: column; }
.message-meta { display: flex; align-items: center; gap: 8px; margin: 0 3px 6px; color: var(--muted); font-size: .74rem; }
.message-meta strong { color: var(--text-soft); }
.message-bubble {
  padding: 15px 17px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 6px 19px 19px 19px; color: var(--text);
}
.message-user .message-bubble {
  background: var(--primary); border-color: var(--primary); color: var(--inverse);
  border-radius: 19px 6px 19px 19px;
}
.message-bubble p:last-child, .message-text p:last-child { margin-bottom: 0; }
.message-text { white-space: normal; overflow-wrap: anywhere; }
.message-text ul, .message-text ol { padding-left: 22px; }
.source-list {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}
.source-title { margin-bottom: 8px; color: var(--muted); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.source-list a { display: block; padding: 8px 0; color: var(--primary); font-size: .88rem; font-weight: 700; text-decoration: none; }
.source-list a:hover { text-decoration: underline; }
.suggestion-row {
  display: flex; gap: 9px; padding: 0 20px 16px; overflow-x: auto;
  scrollbar-width: thin;
}
.suggestion {
  flex: 0 0 auto; min-height: 38px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-soft); cursor: pointer; font-size: .82rem; font-weight: 750;
}
.suggestion:hover { border-color: var(--primary-300); color: var(--primary); }
.chat-form { padding: 18px 20px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.composer {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px;
  padding: 8px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; transition: border-color .16s ease, box-shadow .16s ease;
}
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.composer textarea {
  width: 100%; min-height: 46px; max-height: 170px; resize: none; padding: 11px 10px;
  background: transparent; border: 0; outline: 0; color: var(--text); line-height: 1.45;
}
.composer textarea::placeholder { color: var(--muted); }
.send-button {
  align-self: end; width: 46px; height: 46px; display: grid; place-items: center;
  border: 0; border-radius: 14px; background: var(--primary); color: var(--inverse);
  cursor: pointer; font-size: 1.05rem;
}
.send-button:disabled { opacity: .55; cursor: not-allowed; }
.chat-note { margin: 9px 4px 0; color: var(--muted); font-size: .74rem; text-align: center; }
.typing {
  display: inline-flex; gap: 5px; align-items: center; min-height: 22px;
}
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }

.site-footer { padding: 32px 0; background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .85rem; }
.footer-inner strong { color: var(--text); }
.footer-inner p { margin: 4px 0 0; }

@keyframes message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .welcome-card { max-width: 720px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .header-inner { min-height: 66px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .hero { padding-top: 58px; }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4.4rem); }
  .hero-actions .button { width: 100%; }
  .welcome-card { padding: 22px; border-radius: 24px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 155px; }
  .chat-topbar { align-items: flex-start; flex-direction: column; }
  .chat-topbar .button { width: 100%; }
  .chat-messages { min-height: 380px; padding: 18px 14px; }
  .message-content { max-width: 88%; }
  .suggestion-row { padding-inline: 14px; }
  .chat-form { padding: 14px; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 430px) {
  .language-switch { display: none; }
  .trust-row { gap: 10px 14px; }
  .message-content { max-width: 92%; }
  .message-avatar { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* =========================================================
   CampusAI v2.0.003 — Chat Experience refinements
   ========================================================= */

:root {
  --sticky-offset: 92px;
  --reading-width: 860px;
}

#quick-access,
#assistant {
  scroll-margin-top: var(--sticky-offset);
}

.hero {
  min-height: min(820px, calc(100svh - 74px));
  display: flex;
  align-items: center;
}

.hero-grid {
  width: 100%;
}

.chat-shell {
  max-width: 1240px;
  margin-inline: auto;
}

.chat-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.chat-messages {
  min-height: 460px;
  max-height: min(68vh, 720px);
  padding-inline: clamp(18px, 4vw, 52px);
}

.message {
  width: 100%;
}

.message-assistant .message-content {
  width: min(calc(100% - 50px), var(--reading-width));
  max-width: var(--reading-width);
}

.message-user .message-content {
  width: auto;
  max-width: min(72%, 720px);
}

.message-bubble {
  font-size: 1rem;
  line-height: 1.68;
}

.message-assistant .message-bubble {
  padding: clamp(17px, 2.5vw, 24px);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--primary-50) 62%, var(--surface)),
      var(--surface)
    );
}

.message-text p {
  margin-bottom: 1rem;
}

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

.message-text strong {
  color: var(--text);
  font-weight: 850;
}

.message-text h2,
.message-text h3,
.message-text h4 {
  margin: 1.25rem 0 .7rem;
  color: var(--text);
  letter-spacing: -.025em;
}

.message-text h2 { font-size: 1.32rem; }
.message-text h3 { font-size: 1.16rem; }
.message-text h4 { font-size: 1.04rem; }

.message-text ul,
.message-text ol {
  display: grid;
  gap: .45rem;
  margin: .75rem 0 1rem;
  padding-left: 1.35rem;
}

.message-text li::marker {
  color: var(--primary);
}

.message-text blockquote {
  margin: 1rem 0;
  padding: .85rem 1rem;
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: var(--primary-50);
  color: var(--text-soft);
}

.message-text code {
  padding: .12rem .35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .9em;
}

.message-text a {
  color: var(--primary);
  font-weight: 750;
  text-underline-offset: .18em;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}

.source-list[hidden] {
  display: none;
}

.source-title {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.source-card {
  display: grid !important;
  gap: 3px;
  padding: 12px 14px !important;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  text-decoration: none !important;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.source-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
}

.source-card__title {
  color: var(--text);
  font-size: .86rem;
  font-weight: 820;
  line-height: 1.35;
}

.source-card__meta {
  color: var(--muted);
  font-size: .72rem;
}

.chat-form {
  position: sticky;
  bottom: 0;
  z-index: 5;
  box-shadow: 0 -14px 35px color-mix(in srgb, var(--surface) 90%, transparent);
}

.composer {
  max-width: 1040px;
  margin-inline: auto;
}

.chat-note {
  max-width: 1040px;
  margin-inline: auto;
  margin-top: 9px;
}

@media (max-width: 720px) {
  :root {
    --sticky-offset: 78px;
  }

  .hero {
    min-height: auto;
  }

  .chat-messages {
    max-height: 62vh;
    padding-inline: 14px;
  }

  .message-assistant .message-content {
    width: calc(100% - 46px);
    max-width: calc(100% - 46px);
  }

  .message-user .message-content {
    max-width: 88%;
  }

  .message-bubble {
    font-size: .96rem;
  }

  .source-list {
    grid-template-columns: 1fr;
  }
}

.source-card__action {
  display: inline-flex;
  margin-top: .35rem;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.message-text a[href^="mailto:"],
.message-text a[href^="tel:"] {
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* CampusAI 3.4.0: identidad visual real */
.brand-mark,
.mascot-orb,
.assistant-avatar,
.message-avatar {
  overflow: hidden;
}

.brand-mark img,
.assistant-avatar img,
.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mascot-orb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* Sesión Google Workspace del profesorado */
.teacher-login-link, .teacher-session-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line, #d8e2df); border-radius: 999px;
  color: var(--ink, #173b34); text-decoration: none; font-weight: 700; background: #fff;
}
.teacher-session { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.teacher-session-badge { padding: 5px 9px; border-radius: 999px; background: #e7f7f1; color: #17624f; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.teacher-session-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
@media (max-width: 760px) { .teacher-session-name { display:none; } .teacher-login-link, .teacher-session-link { padding: 0 10px; font-size: .85rem; } }


/* =========================================================
   CampusAI 6.4.0 — Identidad visual FP Andra Mari
   ========================================================= */
:root {
  --primary-50: #eef7fb;
  --primary-100: #d9eef7;
  --primary-200: #b9dfef;
  --primary-300: #80c8e2;
  --primary-400: #25aee4;
  --primary-500: #008fd0;
  --primary-600: #0878a9;
  --primary-700: #155b83;
  --primary-800: #173f62;
  --primary-900: #142f4d;
  --primary: var(--primary-700);
  --primary-hover: var(--primary-800);
  --accent: #f39200;
  --text: #153451;
  --text-soft: #405b70;
  --muted: #728493;
}

html[data-theme="dark"] {
  --primary-50: #153246;
  --primary-100: #18425c;
  --primary-200: #1c5877;
  --primary-300: #26779b;
  --primary-400: #35a2cb;
  --primary-500: #61c1e3;
  --primary-600: #8ad3eb;
  --primary-700: #afe2f1;
  --primary-800: #d0eef7;
  --primary-900: #e9f8fc;
  --primary: var(--primary-500);
  --primary-hover: var(--primary-600);
}

.site-header {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-bottom: 0;
  box-shadow: 0 5px 22px rgba(21, 52, 81, .08);
}

.site-header::after {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #ed174c 0 24%, #f36f21 24% 49%, #f5cf00 49% 70%, #00a8e0 70% 86%, #ec008c 86% 100%);
}

.institutional-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: .76rem;
  font-weight: 700;
}

.institutional-inner {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.institutional-inner nav,
.institutional-contact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.institutional-inner a {
  text-decoration: none;
}
.institutional-inner a:hover { color: var(--primary); }

.header-inner { min-height: 82px; }
.brand { gap: 18px; }
.brand-mark {
  width: 154px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.brand-mark img {
  width: 154px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  object-position: left center;
}
.brand-copy strong {
  color: #173f62;
  font-size: 1.04rem;
}
.brand-copy small { color: #71818d; }

.teacher-login-link,
.teacher-session-link {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 800;
}
.teacher-session-badge {
  background: #e4f5ef;
  color: #176652;
}

.hero {
  background:
    radial-gradient(circle at 88% 15%, rgba(245, 207, 0, .18), transparent 26%),
    radial-gradient(circle at 8% 70%, rgba(237, 23, 76, .10), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, #fff4e8), var(--bg));
}
.hero h1 { color: #173f62; }
.status-pill { border-color: color-mix(in srgb, var(--primary) 26%, var(--border)); }
.button-primary {
  background: linear-gradient(135deg, #173f62, #0878a9);
}
.button-primary:hover { background: linear-gradient(135deg, #112f4b, #09698f); }
.welcome-card { border-top: 4px solid #f39200; }
.quick-card { border-top: 3px solid transparent; }
.quick-card:hover { border-top-color: #00a8e0; }
.quick-card:nth-child(2n):hover { border-top-color: #f39200; }
.quick-card:nth-child(3n):hover { border-top-color: #ed174c; }

@media (max-width: 920px) {
  .institutional-contact span:last-child { display: none; }
  .brand-copy { display: none; }
  .brand-mark, .brand-mark img { width: 132px; }
}

@media (max-width: 720px) {
  .institutional-bar { display: none; }
  .header-inner { min-height: 70px; }
  .brand-mark { width: 118px; height: 52px; }
  .brand-mark img { width: 118px; max-height: 52px; }
  .header-actions { gap: 6px; }
  .teacher-session-name { display: none; }
  .teacher-session-link, .teacher-login-link { padding: 8px 11px; font-size: .78rem; }
}
