/* ==========================================================================
   KABaNata — PUP Office of the VP for Planning and Finance
   Design tokens: warm paper + PUP maroon/gold, Fraunces display,
   Public Sans body (civic/government typeface), IBM Plex Mono for figures.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Source+Sans+3:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  --ink: #1C1410;
  --ink-soft: #55483F;
  --paper: #FFFCF5;
  --paper-raised: #FFFFFF;
  --maroon: #800000;
  --maroon-deep: #4A0000;
  --maroon-tint: #F7E9E9;
  --gold: #B8860B;
  --gold-bright: #FFD700;
  --gold-soft: #F5E3A8;
  --mist: #F2ECDF;
  --line: #E6D9C2;

  --font-display: 'Marcellus', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --container: 1120px;
  --radius: 18px;
  --radius-sm: 10px;

  --nav-h: 64px;
}

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

body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--paper);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:500;
  line-height:1.08;
  margin:0 0 0.4em;
  letter-spacing:-0.01em;
  color:var(--ink);
}
h1{ font-size:clamp(2.6rem, 5.5vw, 4.6rem); font-weight:500; }
h2{ font-size:clamp(1.9rem, 3.4vw, 2.75rem); }
h3{ font-size:clamp(1.25rem, 1.8vw, 1.55rem); font-weight:600; }
p{ margin:0 0 1em; color:var(--ink-soft); }
a{ color:var(--maroon); text-decoration:none; }
a:hover{ text-decoration:underline; }
strong{ color:var(--ink); }

.eyebrow{
  font-family:var(--font-mono);
  font-size:0.72rem;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:var(--maroon);
  display:inline-flex;
  align-items:center;
  gap:0.5em;
  margin-bottom:1em;
}
.eyebrow::before {
  content: '';
  width: 10px;
  height: 10px;
  background-color: var(--gold);
  display: inline-block;
  /* Vector Star Mask */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/></svg>") no-repeat center / contain;
}

.wrap{
  max-width:var(--container);
  margin:0 auto;
  padding:0 28px;
}

section{ padding:96px 0; }
@media (max-width:720px){ section{ padding:64px 0; } }

/* ---------- Gov strip + Nav (seal-frame header) ---------- */
.gov-strip{
  background:var(--maroon-deep);
  color:var(--gold-soft);
  text-align:center;
  font-family:var(--font-mono);
  font-size:0.66rem;
  letter-spacing:0.16em;
  text-transform:uppercase;
  padding:7px 12px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

/* Sticky top navigation bar container */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  border-bottom: 3px solid var(--gold-bright);
  box-shadow: 0 6px 18px -12px rgba(0, 0, 0, 0.5);
}

/* Inner wrapper for logo, links, and toggle button */
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px 16px 11px 16px;
}

/* Brand Branding & Seal */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.seal-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.seal-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background-color: transparent;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text .eyebrow-mini {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 2px;
}
.brand-text .title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #FFFCF5;
}

/* Base Desktop Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: rgba(255, 252, 245, 0.72);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

/* CTA Button */
.nav-cta {
  background: var(--gold-bright);
  color: var(--maroon-deep) !important;
  padding: 9px 18px !important;
  border-radius: 999px;
  font-weight: 700 !important;
  border-bottom: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-cta:hover { background: #FFE657; text-decoration: none; }
.nav-cta img.nav-logo-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

/* Mobile Toggle Hamburger Icon */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #FFFCF5;
  margin: 5px 0;
}

/* Mobile Responsive Drawer (Triggered at screen widths <= 880px) */
@media (max-width: 880px) {
  .site-nav {
    border-bottom: none !important; /* Removes the gold line on the main header */
    box-shadow: none !important;    /* Removes dark shadow streaks from the header */
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--maroon-deep);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 28px;
    gap: 12px;
    border-bottom: none !important; /* Removes bottom border streak on the drawer */
    box-shadow: 0 8px 16px rgba(0,0,0,0.25); /* Subtle clean drop shadow below drawer */
  }

  .nav-links.is-open,
  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 8px 0;
    border: none !important; /* Strips out any remaining link borders */
  }

  .nav-links a.active {
    border: none !important; /* Prevents border on active menu links */
  }
}
/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--font-body); font-weight:600; font-size:0.94rem;
  padding:13px 24px; border-radius:999px; cursor:pointer;
  border:1px solid transparent; transition:transform .15s ease, background .15s ease;
}
.btn:hover{ text-decoration:none; }
.btn-primary{ background:var(--maroon); color:#fff; }
.btn-primary:hover{ background:var(--maroon-deep); transform:translateY(-1px); }
.btn-gold{ background:var(--gold); color:#FFFCF5; }
.btn-gold:hover{ background:#946C08; transform:translateY(-1px); }
.btn-ghost{ background:transparent; border-color:var(--line); color:var(--ink); }
.btn-ghost:hover{ border-color:var(--maroon); color:var(--maroon); }
.btn-row{ display:flex; gap:14px; flex-wrap:wrap; }

/* ---------- Hero (page-level, non-home) ---------- */
.page-hero{
  padding:72px 0 56px;
  border-bottom:1px solid var(--line);
}
.page-hero p.lede{ font-size:1.12rem; max-width:640px; }

/* ---------- Hero (home) ---------- */
.hero-home {
  position: relative; /* Needed for absolute positioning of children */
  color: #FFFCF5;
  padding: 80px 0 70px;
  overflow: hidden;
  /* Maintain base maroon background as a fallback */
  background: linear-gradient(180deg, #8C1010 0%, var(--maroon-deep) 55%, #260000 100%);
}
/* Remove the old line pattern overlay */
.hero-home::before { display: none; }
/* Container for the image and overlay */
.hero-bg-wrapper {
  position: absolute;
  inset: 0; /* Top:0, Right:0, Bottom:0, Left:0 */
  z-index: 0; /* Put behind content */
}
/* The campus image */
.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure image covers area without distortion */
  /* Optional: Slight scale animation on load for extra polish */
  animation: kenBurns 20s ease-out infinite alternate;
}
/* The high-opacity overlay to ensure readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  /* This is key: A deep maroon fade with 88% opacity to crush contrast */
  background: linear-gradient(0deg, rgba(74, 0, 0, 0.83) 0%, rgba(74, 0, 0, 0.90) 100%);
  z-index: 1; /* Sits on top of the image */
}
/* Ensure content sits above the background layers */
.hero-content {
  position: relative;
  z-index: 2;
}

.hero-grid{
  display:grid; grid-template-columns:1.1fr 0.9fr; gap:56px; align-items:center;
  position:relative; z-index:1;
}
@media (max-width:920px){ .hero-grid{ grid-template-columns:1fr; } }

.hero-home .eyebrow { color: var(--gold-soft); }
.hero-home .eyebrow::before { background: var(--gold); }
.hero-home h1 { color: #fff; } /* Bright white for main headline */
.hero-home p.lede { 
  color: #E4D6CC; /* Off-white/cream for description for readability */
  font-size: 1.14rem; max-width: 520px;
}
/* Optional: Subtle Ken Burns effect for the background image */
@keyframes kenBurns {
  from { transform: scale(1) translate(0%, 0%); }
  to { transform: scale(1.05) translate(-2%, -1%); }
}
/* Signature element: the PRINCESS ledger-chat demo */
.chat-demo{
  background:rgba(250,247,242,0.06);
  border:1px solid rgba(232,197,120,0.25);
  border-radius:var(--radius);
  padding:22px 22px 18px;
  backdrop-filter:blur(6px);
}
.chat-demo-head{
  display:flex; align-items:center; justify-content:space-between;
  padding-bottom:14px; margin-bottom:16px; border-bottom:1px dashed rgba(232,197,120,0.3);
}
/* Ensure the chat demo header logo displays and scales correctly */
.chat-demo-head img.chat-logo-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.chat-demo-head span{ 
  font-family: var(--font-mono); 
  font-size: 0.7rem; 
  letter-spacing: 0.1em; 
  color: var(--gold-soft); 
  text-transform: uppercase; 
}

.chat-dot{ 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: #7CC98A; 
  display: inline-block; 
  margin-right: 6px; 
  box-shadow: 0 0 0 3px rgba(124, 201, 138, 0.15); 
}

/* Messenger Row Wrapper */
.message-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}

.message-bot {
  justify-content: flex-start;
}

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

/* Profile Picture Placeholder Styling */
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--gold-soft); /* Fallback background if image is missing */
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble {
  max-width: 80%; 
  padding: 10px 14px; 
  border-radius: 18px; /* Messenger style round corners */
  font-size: 0.92rem; 
  line-height: 1.45;
}

.bubble-user {
  background: var(--gold-soft); /* Or standard Messenger blue depending on your theme */
  color: var(--maroon-deep); 
  border-bottom-right-radius: 4px;
}

.bubble-bot {
  background: rgba(255, 255, 255, 0.08); 
  color: #F6EFE6; 
  font-family: var(--font-body);
  border-bottom-left-radius: 4px;
}

.bubble-bot .caret {
  display: inline-block; 
  width: 2px; 
  height: 1em; 
  background: var(--maroon-deep);
  vertical-align: text-bottom; 
  animation: blink 1s step-end infinite;
}

@keyframes blink { 
  50% { opacity: 0; } 
}

.bubble-tag {
  font-family: var(--font-mono); 
  font-size: 0.62rem; 
  letter-spacing: 0.08em; 
  text-transform: uppercase;
  color: #8A7A6C; 
  margin-top: 2px;
}

/* ---------- Stat / quick-link strip ---------- */
.strip{
  display:flex; gap:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line);
  overflow-x:auto;
}
.strip a{
  flex:1 1 0; min-width:180px; padding:22px 24px; border-right:1px solid var(--line);
  color:var(--ink); display:block;
}
.strip a:last-child{ border-right:none; }
.strip a:hover{ background:var(--mist); text-decoration:none; }
.strip .num{ font-family:var(--font-mono); font-size:0.72rem; color:var(--maroon); display:block; margin-bottom:6px; }
.strip .label{ font-weight:600; font-size:0.95rem; }

/* ---------- Section heads ---------- */
.section-head{ max-width:640px; margin-bottom:52px; }
.section-head p{ font-size:1.05rem; }

/* ---------- Card grid ---------- */
.grid{ display:grid; gap:22px; }
.grid-3{ grid-template-columns:repeat(3, 1fr); }
.grid-2{ grid-template-columns:repeat(2, 1fr); }
@media (max-width:880px){ .grid-3,.grid-2{ grid-template-columns:1fr; } }

.card{
  background:var(--paper-raised);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:28px 26px;
  transition:border-color .15s ease, transform .15s ease;
}
.card:hover{ border-color:var(--maroon); transform:translateY(-2px); }
.card .tag{
  font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--maroon); display:block; margin-bottom:10px;
}
.card h3{ margin-bottom:8px; }
.card p{ font-size:0.94rem; margin-bottom:14px; }
.card .go{ font-size:0.86rem; font-weight:600; color:var(--maroon); }

.card-maroon{ background:var(--maroon-tint); border-color:var(--gold-soft); }

/* ---------- Presentation decks ---------- */
.deck-grid{
  display:grid; grid-template-columns:repeat(2, 1fr); gap:24px; margin-top:8px;
}
@media (max-width:880px){ .deck-grid{ grid-template-columns:1fr; } }

.deck-card{
  background:var(--paper-raised);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  transition:border-color .15s ease, transform .15s ease;
}
.deck-card:hover{ border-color:var(--maroon); transform:translateY(-2px); }

.deck-card-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 22px; border-bottom:1px solid var(--line); background:var(--mist);
}
.deck-card-head .tag{
  font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--maroon); margin:0;
}
.deck-expand{
  font-size:0.82rem; font-weight:600; color:var(--maroon); display:inline-flex; align-items:center; gap:6px;
  text-decoration:none;
}
.deck-expand:hover{ color:var(--gold); text-decoration:underline; }

.deck-frame-wrap{
  position:relative; width:100%; aspect-ratio:794 / 1151; background:var(--paper);
}
.deck-frame-wrap iframe{
  position:absolute; inset:0; width:100%; height:100%; border:0; display:block;
}

/* ---------- Office directory rows ---------- */
.office-row{
  display:grid; grid-template-columns:220px 1fr auto; gap:24px; align-items:center;
  padding:26px 0; border-bottom:1px solid var(--line);
}
.office-row:first-of-type{ border-top:1px solid var(--line); }
.office-row .index{ font-family:var(--font-mono); color:var(--ink-soft); font-size:0.8rem; }
.office-row h3{ margin-bottom:4px; }
.office-row p{ margin:0; font-size:0.92rem; }
@media (max-width:720px){
  .office-row{ grid-template-columns:1fr; gap:8px; }
}

/* ---------- Tutorial stepper ---------- */
.tut-steps{ counter-reset:step; }
.tut-step{
  display:grid; grid-template-columns:64px 1fr; gap:24px;
  padding:34px 0; border-bottom:1px solid var(--line);
}
.tut-step:first-child{ border-top:1px solid var(--line); }
.tut-step .step-num{
  counter-increment:step;
  font-family:var(--font-display); font-size:1.7rem; color:var(--gold);
}
.tut-step .step-num::before{ content: counter(step, decimal-leading-zero); }
.tut-step h3{ margin-bottom:8px; }
.tut-step .step-img{
  margin-top:16px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--mist); padding:14px 16px; font-family:var(--font-mono); font-size:0.8rem; color:var(--ink-soft);
}
@media (max-width:600px){ .tut-step{ grid-template-columns:1fr; gap:8px; } }

/* ---------- FAQ / accordion ---------- */
.faq-item{ border-bottom:1px solid var(--line); }
.faq-q{
  width:100%; text-align:left; background:none; border:0; cursor:pointer;
  padding:20px 0; font-family:var(--font-body); font-weight:600; font-size:1rem; color:var(--ink);
  display:flex; justify-content:space-between; align-items:center; gap:16px;
}
.faq-q .plus{ font-family:var(--font-mono); color:var(--maroon); transition:transform .2s ease; }
.faq-item.open .plus{ transform:rotate(45deg); }
.faq-a{ max-height:0; overflow:hidden; transition:max-height .25s ease; }
.faq-a p{ padding-bottom:20px; margin:0; font-size:0.95rem; }

/* ---------- Callout / PRINCESS panel ---------- */
.callout{
  background:var(--maroon-deep); color:#F6EFE6; border-radius:var(--radius);
  padding:48px; display:grid; grid-template-columns:1.3fr 0.7fr; gap:32px; align-items:center;
}
.callout h2{ color:#fff; }
.callout p{ color:#E4D6CC; }
@media (max-width:820px){ .callout{ grid-template-columns:1fr; padding:34px 24px; } }

/* ---------- Footer (dark, mirrors the nav to frame the page) ---------- */
footer{
  border-top:4px solid var(--gold-bright); padding:56px 0 34px; background:var(--maroon-deep);
}
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:32px; margin-bottom:40px; }
@media (max-width:780px){ .footer-grid{ grid-template-columns:1fr 1fr; } }
.footer-grid h4{ font-family:var(--font-mono); font-size:0.7rem; letter-spacing:0.1em; text-transform:uppercase; color:var(--gold-soft); margin-bottom:14px; }
.footer-grid p{ color:rgba(255,252,245,0.6); }
.footer-grid ul{ list-style:none; margin:0; padding:0; }
.footer-grid li{ margin-bottom:9px; }
.footer-grid a{ color:rgba(255,252,245,0.68); font-size:0.9rem; }
.footer-grid a:hover{ color:var(--gold-bright); }
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px;
  padding-top:24px; border-top:1px solid rgba(255,252,245,0.14);
  font-family:var(--font-mono); font-size:0.74rem; color:rgba(255,252,245,0.55);
}
.footer-bottom img{ filter:drop-shadow(0 0 0 transparent); }

/* ---------- Gold rule divider ---------- */
.rule-gold{
  height:3px; width:150px; margin:26px auto 0;
  background:linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}
.rule-gold.left{ margin:26px 0 0; }

/* ---------- Status pills ---------- */
.status-pill{
  font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.05em; text-transform:uppercase;
  padding:4px 11px; border-radius:999px; display:inline-flex; align-items:center; gap:6px;
}
.status-done{ background:rgba(15,157,99,0.12); color:#0F7B4F; }
.status-active{ background:rgba(184,134,11,0.15); color:var(--gold); }
.status-pipeline{ background:var(--mist); color:var(--ink-soft); }
.status-proposed{ background:rgba(255,215,0,0.14); color:var(--gold-bright); }
.status-dot{ width:7px; height:7px; border-radius:50%; background:currentColor; display:inline-block; }

/* ---------- Roadmap phase cards ---------- */
.phase-grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:22px; }
@media (max-width:880px){ .phase-grid{ grid-template-columns:1fr; } }
.phase-card{
  position:relative; background:var(--paper-raised); border:1px solid var(--line);
  border-radius:20px; padding:34px 24px 22px; display:flex; flex-direction:column; justify-content:space-between;
  transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.phase-card:hover{ border-color:var(--maroon); box-shadow:0 14px 32px -20px rgba(128,0,0,0.4); transform:translateY(-2px); }
.phase-card.featured{ border:2px solid var(--gold-bright); box-shadow:0 12px 28px -16px rgba(255,215,0,0.35); }
.phase-card.dark{ background:var(--maroon-deep); border-color:#5C1414; }
.phase-card.dark:hover{ border-color:var(--gold-bright); }
.phase-card.dark h3{ color:#FFFCF5; }
.phase-card.dark p{ color:rgba(255,252,245,0.68); }
.phase-badge{
  position:absolute; top:-14px; left:22px; background:var(--maroon-deep); color:var(--gold-soft);
  font-family:var(--font-mono); font-size:0.64rem; letter-spacing:0.07em; text-transform:uppercase;
  padding:5px 13px; border-radius:999px;
}
.phase-card.featured .phase-badge{ background:var(--gold-bright); color:var(--maroon-deep); }
.phase-card.dark .phase-badge{ background:var(--paper); color:var(--maroon-deep); }
.phase-icon{ color:var(--maroon); margin-bottom:12px; }
.phase-card.dark .phase-icon{ color:var(--gold-bright); }
.phase-icon svg{ width:26px; height:26px; }
.phase-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:7px; font-size:0.82rem; }
.phase-list li{ display:flex; align-items:center; gap:8px; color:var(--ink-soft); }
.phase-card.dark .phase-list li{ color:rgba(255,252,245,0.72); }
.phase-list li svg{ width:15px; height:15px; flex-shrink:0; }
.phase-list li.done svg{ color:#0F9D63; }
.phase-list li.pending svg{ color:var(--line); }
.phase-card.dark .phase-list li.pending svg{ color:rgba(255,215,0,0.32); }
.phase-list li.active-item{ background:rgba(184,134,11,0.08); margin:0 -8px; padding:6px 8px; border-radius:8px; border:1px solid rgba(184,134,11,0.25); }
.phase-list li.active-item svg{ color:var(--gold); }
.phase-foot{ margin-top:18px; padding-top:13px; border-top:1px solid var(--line); font-family:var(--font-mono); font-size:0.7rem; color:var(--ink-soft); }
.phase-card.dark .phase-foot{ border-top-color:#5C1414; color:rgba(255,252,245,0.5); }

/* ---------- Watermark star (subtle institutional texture) ---------- */
.watermark-star{ position:absolute; opacity:0.05; pointer-events:none; z-index:0; }
.watermark-star svg{ width:100%; height:100%; }

/* ---------- misc ---------- */
.pill{
  display:inline-block; padding:4px 12px; border-radius:999px; background:var(--gold-soft);
  color:var(--maroon-deep); font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.06em; text-transform:uppercase;
}
.divider{ height:1px; background:var(--line); margin:64px 0; }
.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:48px; }
@media (max-width:820px){ .two-col{ grid-template-columns:1fr; } }







/* ==========================================================================
   Video Background Section Styles
   ========================================================================== */
.video-bg-section {
  position: relative;
  overflow: hidden;
  padding: 120px 0;
  background: var(--maroon-deep);
}

.bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
  opacity: 0.3; /* Controls how prominent the background video appears */
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(74,0,0,0.85) 0%, rgba(28,20,16,0.92) 100%);
  z-index: 1;
}



/* ==========================================================================
   "What is KABaNata" Wireframe Background Section
   ========================================================================== */
.section-kabanata {
  position: relative;
  overflow: hidden;
  background: var(--paper); /* #FFFCF5 fallback */
}

.kabanata-bg-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Ken Burns animation for wireframe background */
.kabanata-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.35;
  filter: contrast(120%);
  
  /* Add animation */
  animation: wireframeKenBurns 28s ease-in-out infinite alternate;
  will-change: transform; /* Optimizes browser rendering performance */
}

@keyframes wireframeKenBurns {
  0% {
    transform: scale(1) translate(0%, 0%);
  }
  50% {
    transform: scale(1.08) translate(-1.5%, -1%);
  }
  100% {
    transform: scale(1.04) translate(1%, -1.5%);
  }
}

.kabanata-overlay {
  position: absolute;
  inset: 0;
  /* Reduced opacity so the line artwork shows through while keeping text legible */
  background: radial-gradient(circle at center, rgba(255, 252, 245, 0.35) 0%, rgba(255, 252, 245, 0.75) 100%);
  z-index: 1;
}

.relative-z {
  position: relative;
  z-index: 2;
}

/* Glassmorphism cards to keep content readable over background lines */
.section-kabanata .card {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(6px);
}

.section-kabanata .card-maroon {
  background: rgba(247, 233, 233, 0.92);
}

/* Hide the entire background wrapper on mobile phones */
@media (max-width: 767px) {
  .kabanata-bg-wrapper {
    display: none;
  }
}

/* ==========================================================================
   Print Stylesheet Optimization (Isolated to IGF Dashboard Per-Office)
   ========================================================================== */
@media print {
  /* Page-level rules: 7mm top/bottom, 10mm left/right margins */
  @page {
    size: landscape;
    margin: 7mm 10mm;
  }
/* Inject a custom header at the very top of the body */
  body.print-igf-dashboard-per-office::before {
    content: "Internally Generated Fund 2026 Dashboard Summary Report";
    display: block;
    font-size: 11pt;
    font-weight: bold;
    color: var(--maroon-deep, #5a0000);
    text-align: center;
    border-bottom: 1.5px solid #E6D9C2;
    padding-bottom: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Force absolute single-page containment */
  html, body.print-igf-dashboard-per-office {
    background: #ffffff !important;
    color: #1C1410 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.print-igf-dashboard-per-office .gov-strip,
  body.print-igf-dashboard-per-office .site-nav,
  body.print-igf-dashboard-per-office footer,
  body.print-igf-dashboard-per-office .print-hidden,
  body.print-igf-dashboard-per-office #passkey-input,
  body.print-igf-dashboard-per-office button,
  body.print-igf-dashboard-per-office .glass-panel:has(#passkey-input),
  body.print-igf-dashboard-per-office script,
  body.print-igf-dashboard-per-office noscript {
    display: none !important;
  }

  body.print-igf-dashboard-per-office .max-w-7xl {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  /* Force the primary metrics card grid to stay 2 columns on print */
  body.print-igf-dashboard-per-office .grid.grid-cols-1.md\:grid-cols-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3px !important;
    margin-bottom: 2px !important;
  }

  /* --- Extreme Summary Panel Compression & Border Removal --- */
  body.print-igf-dashboard-per-office .glass-panel {
    padding: 3px 6px !important;
    margin-bottom: 2px !important;
    box-shadow: none !important;
    border: none !important;
  }

  body.print-igf-dashboard-per-office .glass-panel:not(:has(table)) {
    border-radius: 3px !important;
  }

  body.print-igf-dashboard-per-office .glass-panel:has(table) {
    margin-top: 0 !important;
    padding-top: 2px !important;
  }

  body.print-igf-dashboard-per-office .glass-card {
    padding: 2px 4px !important;
    border-radius: 3px !important;
    border: none !important;
  }

  body.print-igf-dashboard-per-office .glass-panel h2 {
    font-size: 8pt !important;
    margin-bottom: 1px !important;
  }

  body.print-igf-dashboard-per-office .glass-panel p, 
  body.print-igf-dashboard-per-office .glass-panel span {
    font-size: 6pt !important;
    line-height: 1 !important;
  }

  body.print-igf-dashboard-per-office #res-adjusted, 
  body.print-igf-dashboard-per-office #res-remaining, 
  body.print-igf-dashboard-per-office #res-utilized, 
  body.print-igf-dashboard-per-office #res-estimated {
    font-size: 8.5pt !important;
    font-weight: 700 !important;
  }

  /* --- Table Optimization --- */
  body.print-igf-dashboard-per-office table {
    width: 100% !important;
    font-size: 6.5pt !important;
    border-collapse: collapse !important;
  }

  body.print-igf-dashboard-per-office th {
    background-color: var(--maroon-deep) !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 6.5pt !important;
  }

  body.print-igf-dashboard-per-office th, 
  body.print-igf-dashboard-per-office td {
    padding: 1.5px 3px !important;
    border: 1px solid #E6D9C2 !important;
    white-space: nowrap !important;
  }

  body.print-igf-dashboard-per-office td:first-child, 
  body.print-igf-dashboard-per-office th:first-child {
    white-space: normal !important;
    max-width: 220px !important;
  }
}
/* ==========================================================================
   Embedded Chat Widget Styles
   ========================================================================== */
.chat-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  font-family: var(--font-body);
}

.chat-toggle-btn {
  background: var(--maroon-deep);
  color: var(--gold-soft);
  border: 2px solid var(--gold-bright);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}

.chat-toggle-btn:hover {
  background: var(--maroon);
  transform: translateY(-2px);
}

.chat-toggle-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Chat Window Box */
.chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 48px);
  height: 480px;
  max-height: calc(100vh - 110px);   /* fallback */
  max-height: calc(100dvh - 110px);  /* mobile browsers with collapsing address bars */
  background: rgba(250, 247, 242, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(28,20,16,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-window.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* Desktop layout (centered, large) lives at the end of this file. */

.chat-header {
  background: rgba(90, 24, 24, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  color: #FFFCF5;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(232,197,120,0.7);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Added rule to fix giant header logo sizing --- */
.chat-header img,
.chat-header svg,
.chat-logo-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  border-radius: 50%;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #FFFCF5;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}



.chat-form {
  padding: 12px;
  background: rgba(250, 247, 242, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.35);
  display: flex;
  gap: 8px;
}

.chat-form input {
  flex: 1;
  min-width: 0;            /* lets the input shrink so the Send button is never pushed out of the window */
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  outline: none;
}

.chat-form input:focus {
  border-color: var(--maroon);
}

.chat-send-btn {
  flex-shrink: 0;          /* the button keeps its full size; the input gives up space instead */
  white-space: nowrap;
  background: var(--maroon);
  color: #fff;
  border: none;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.chat-send-btn:hover {
  background: var(--maroon-deep);
}

/* ==========================================================================
   Chat Bubble Component Styles
   ========================================================================== */
.bubble {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

/* Bot Message Styling */
.bubble-bot {
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--ink, #1c1410);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

/* User Message Styling */
.bubble-user {
  background: rgba(90, 24, 24, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232,197,120,0.25);
  color: #FFFCF5;
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 2px;
}

/* Embedded Chat Messages Container */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Fallback: solid backgrounds for browsers without backdrop-filter support,
   so the glass effect degrading gracefully doesn't leave anything unreadable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .chat-window { background: var(--paper-raised); }
  .chat-header { background: var(--maroon-deep); }
  .chat-form { background: var(--paper-raised); }
  .chat-form input { background: var(--paper); }
  .bubble-bot { background: var(--paper-raised, #f0eae1); }
  .bubble-user { background: var(--maroon-deep, #5a1818); }
}

/* ==========================================================================
   Videos Page — "KABaNata Watch" (YouTube-style clone, themed)
   ========================================================================== */

.watch-hero{
  padding:56px 0 40px;
  border-bottom:1px solid var(--line);
  background:var(--paper-raised);
}
.watch-hero .eyebrow{ margin-bottom:0.6em; }
.watch-hero p.lede{ font-size:1.05rem; max-width:640px; }

/* ---------- Search bar ---------- */
.yt-searchbar{
  display:flex; gap:10px; margin-top:26px; max-width:640px;
}
.yt-searchbar input{
  flex:1; padding:12px 18px; border-radius:999px; border:1px solid var(--line);
  background:var(--paper); font-family:var(--font-body); font-size:0.92rem; color:var(--ink);
  outline:none;
}
.yt-searchbar input:focus{ border-color:var(--maroon); }
.yt-searchbar button{
  display:flex; align-items:center; justify-content:center;
  width:46px; height:46px; border-radius:50%; border:1px solid var(--line);
  background:var(--maroon); color:#fff; cursor:pointer; flex-shrink:0;
}
.yt-searchbar button:hover{ background:var(--maroon-deep); }
.yt-searchbar button svg{ width:18px; height:18px; }

/* ---------- Category chip row ---------- */
.chip-row{
  display:flex; gap:10px; flex-wrap:nowrap; overflow-x:auto;
  padding:18px 0; border-bottom:1px solid var(--line); background:var(--paper);
  position:sticky; top:var(--nav-h); z-index:40;
  scrollbar-width:thin;
}
.chip-row::-webkit-scrollbar{ height:4px; }
.chip-row::-webkit-scrollbar-thumb{ background:var(--line); border-radius:4px; }
.chip{
  flex:0 0 auto; font-family:var(--font-body); font-size:0.84rem; font-weight:600;
  padding:8px 18px; border-radius:999px; border:1px solid var(--line);
  background:var(--paper-raised); color:var(--ink-soft); cursor:pointer;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
  white-space:nowrap;
}
.chip:hover{ border-color:var(--maroon); color:var(--maroon); }
.chip.is-active{ background:var(--maroon); border-color:var(--maroon); color:#fff; }

/* ---------- Video grid ---------- */
.video-grid{
  display:grid; grid-template-columns:repeat(4, 1fr); gap:28px 20px;
  padding:40px 0 20px;
}
@media (max-width:1040px){ .video-grid{ grid-template-columns:repeat(3, 1fr); } }
@media (max-width:780px){ .video-grid{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:520px){ .video-grid{ grid-template-columns:1fr; } }

.video-card{ cursor:pointer; }
.video-card .thumb{
  position:relative; width:100%; aspect-ratio:16/9; border-radius:var(--radius-sm);
  overflow:hidden; background:linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line);
}
.video-card .thumb::before{
  content:'';
  position:absolute; inset:0;
  background-image:
    radial-gradient(circle at 30% 25%, rgba(255,215,0,0.18) 0%, transparent 45%);
}
.video-card .thumb .play-badge{
  position:relative; z-index:1;
  width:52px; height:52px; border-radius:50%;
  background:rgba(255,252,245,0.14); border:1.5px solid rgba(232,197,120,0.55);
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease, background .15s ease;
}
.video-card .thumb .play-badge svg{ width:20px; height:20px; fill:var(--gold-bright); margin-left:3px; }
.video-card:hover .thumb .play-badge{ transform:scale(1.08); background:rgba(255,252,245,0.22); }
.video-card .duration-badge{
  position:absolute; bottom:8px; right:8px; z-index:1;
  background:rgba(28,20,16,0.82); color:#F6EFE6;
  font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.03em;
  padding:2px 7px; border-radius:5px;
}
.video-card .cat-badge{
  position:absolute; top:8px; left:8px; z-index:1;
  background:rgba(255,252,245,0.9); color:var(--maroon-deep);
  font-family:var(--font-mono); font-size:0.6rem; letter-spacing:0.06em; text-transform:uppercase;
  padding:3px 9px; border-radius:999px;
}

.video-card .video-info{
  display:flex; gap:11px; margin-top:12px;
}
.video-card .channel-avatar{
  flex-shrink:0; width:36px; height:36px; border-radius:50%;
  background:var(--maroon-tint); border:1px solid var(--gold-soft);
  color:var(--maroon-deep); font-family:var(--font-display); font-weight:700; font-size:0.95rem;
  display:flex; align-items:center; justify-content:center;
}
.video-card .video-title{
  font-family:var(--font-body); font-weight:600; font-size:0.94rem; color:var(--ink);
  line-height:1.35; margin-bottom:4px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.video-card .video-sub{ font-size:0.8rem; color:var(--ink-soft); line-height:1.5; }
.video-card:hover .video-title{ color:var(--maroon); }

/* ---------- Featured / continue-watching strip ---------- */
.featured-video{
  display:grid; grid-template-columns:1.3fr 0.7fr; gap:0;
  border:1px solid var(--line); border-radius:var(--radius); overflow:hidden;
  background:var(--paper-raised); margin-top:36px;
}
@media (max-width:820px){ .featured-video{ grid-template-columns:1fr; } }
.featured-video .thumb{
  border-radius:0; border:none; aspect-ratio:16/10;
}
.featured-video .thumb .play-badge{ width:68px; height:68px; }
.featured-video .thumb .play-badge svg{ width:26px; height:26px; }
.featured-video .fv-body{ padding:28px 30px; display:flex; flex-direction:column; justify-content:center; }
.featured-video .fv-body .tag{
  font-family:var(--font-mono); font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--maroon); display:block; margin-bottom:10px;
}
.featured-video .fv-body h3{ margin-bottom:10px; }
.featured-video .fv-body p{ font-size:0.94rem; margin-bottom:16px; }

/* ---------- Watch modal (lightbox player) ---------- */
.watch-modal{
  position:fixed; inset:0; z-index:1000;
  background:rgba(28,20,16,0.78);
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.watch-modal.is-open{ opacity:1; pointer-events:auto; }
.watch-modal-box{
  background:var(--paper-raised); border-radius:var(--radius); overflow:hidden;
  max-width:860px; width:100%; max-height:90vh; overflow-y:auto;
  border:1px solid var(--line);
  transform:translateY(14px); transition:transform .18s ease;
}
.watch-modal.is-open .watch-modal-box{ transform:translateY(0); }
.watch-modal-player{
  position:relative; width:100%; aspect-ratio:16/9;
  background:linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  display:flex; align-items:center; justify-content:center; flex-direction:column; gap:14px;
  color:rgba(255,252,245,0.85);
}
.watch-modal-player .play-badge{
  width:76px; height:76px; border-radius:50%;
  background:rgba(255,252,245,0.14); border:1.5px solid rgba(232,197,120,0.55);
  display:flex; align-items:center; justify-content:center;
}
.watch-modal-player .play-badge svg{ width:28px; height:28px; fill:var(--gold-bright); margin-left:4px; }
.watch-modal-player .placeholder-note{
  font-family:var(--font-mono); font-size:0.72rem; letter-spacing:0.06em; text-transform:uppercase;
  color:var(--gold-soft);
}
.watch-modal-close{
  position:absolute; top:14px; right:14px; z-index:2;
  width:34px; height:34px; border-radius:50%;
  background:rgba(28,20,16,0.55); color:#F6EFE6; border:none;
  font-size:1.2rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.watch-modal-close:hover{ background:rgba(28,20,16,0.8); }
.watch-modal-body{ padding:24px 28px 30px; }
.watch-modal-body .wm-meta{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px;
  margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--line);
}
.watch-modal-body h3{ margin-bottom:6px; }
.watch-modal-body .wm-channel{ display:flex; align-items:center; gap:10px; }
.watch-modal-body p.wm-desc{ font-size:0.94rem; }

@media (max-width:600px){
  .watch-modal-body{ padding:18px 18px 22px; }
}

/* ==========================================================================
   Floating Speech Cloud / Announcement Banner
   ========================================================================== */
.chat-announcement-cloud {
  position: absolute;
  bottom: 75px;
  right: -60px;
  width: 380px; /* Make the container wider to give the bubble more room */
  height: 250px; /* Fix the height to match the image proportions */
  
  /* Apply the PNG and make it fill the container */
  background: url('../assets/princessbubble.png') no-repeat center center;
  background-size: 100% 100%; /* Stretch it precisely to fit the box width and height */
  border: none;
  box-shadow: none;
  
  /* Top, Right, Bottom, Left padding: Keep text inside the yellow area, clear of the character on the right */
  padding: 33px 140px 29px 25px; 
  
  z-index: 1001;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--ink, #1c1410);
  animation: floatCloud 3s ease-in-out infinite alternate;
  box-sizing: border-box;
}
.cloud-text-rotator {
  transform: rotate(-2deg); /* Adjust angle as needed (e.g., -3deg, 2deg) */
  transform-origin: center center;
  width: 100%;
  height: 100%;
}

/* Remove the old CSS triangle pointers since your PNG already includes a tail */
.chat-announcement-cloud::after,
.chat-announcement-cloud::before {
  display: none;
}

.chat-announcement-cloud p {
  margin: 0;
  color: var(--ink-soft, #55483f);
}

.chat-announcement-cloud .cloud-badge {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  
  color: var(--maroon, #800000);
  padding: 1px 6px;
  border-radius: 999px;
  margin-bottom: 4px;
}

/* Smooth floating animation */
@keyframes floatCloud {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

/* Hide speech cloud when full chat window is opened */
.chat-widget-container:has(.chat-window:not(.hidden)) .chat-announcement-cloud {
  display: none;
}


/* Responsive adjustments for mobile chat avatars */
@media (max-width: 480px) {
  .chat-avatar {
    width: 22px;
    height: 22px;
  }
  
  .message-row {
    gap: 6px; /* Reduces space between avatar and bubble */
    margin-bottom: 8px;
  }

  .bubble {
    max-width: 85%; /* Gives chat bubbles a bit more room */
    padding: 8px 12px;
    font-size: 0.88rem;
  }
}


/* ==========================================================================
   Chat readability + rendered Markdown (bold, lists, links) in bot answers
   Applies to the chat window AND the homepage demo (.chat-demo) so both look identical.
   ========================================================================== */

/* Solid-enough bubbles so the page behind the glass never hurts contrast */
.chat-window .bubble,
.chat-demo .bubble {
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.chat-window .bubble-bot,
.chat-demo .bubble-bot {
  background: rgba(255, 253, 249, 0.94);
  border-color: rgba(28, 20, 16, 0.08);
}

/* Long answers: keep the avatar next to the START of the reply, not the bottom */
.chat-window .message-bot,
.chat-demo .message-bot { align-items: flex-start; }

/* Smooth, contained scrolling inside the chat */
.chat-messages {
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* Markdown elements inside bot bubbles (live chat + homepage demo) */
/* Paragraphs/list items in bot answers use the bubble's black text, not the grey global <p> colour */
.bubble-bot p,
.bubble-bot li { color: inherit; }
.bubble-bot p { margin: 0 0 8px; }
.bubble-bot p:last-child { margin-bottom: 0; }
.bubble-bot ul,
.bubble-bot ol { margin: 6px 0 8px; padding-left: 20px; }
.bubble-bot li { margin-bottom: 6px; }
.bubble-bot li:last-child { margin-bottom: 0; }
.bubble-bot strong { font-weight: 700; }
.bubble-bot a { color: var(--maroon, #800000); text-decoration: underline; }

/* Mobile: 16px+ input text stops iOS Safari from zooming the page on focus */
@media (max-width: 767px) {
  .chat-form input { font-size: 16px; }
}


/* ==========================================================================
   Desktop chat: centered, large "focus" window with a dimmed backdrop
   (screens 900px and up). Mobile/tablet keep the compact corner widget above.
   Placed last so it overrides the earlier .chat-window / .bubble rules.
   ========================================================================== */
@media (min-width: 900px) {

  /* Dimmed + blurred page behind the open chat. Sits behind the window,
     above the page. Clicking it closes the chat (see main.js). */
  .chat-widget-container::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(28, 10, 10, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .chat-widget-container:has(.chat-window:not(.hidden))::before {
    opacity: 1;
    pointer-events: auto;
  }

  /* The window is closed with the X, Esc or the backdrop, so the floating
     button would only sit on top of the Send button — hide it while open. */
  .chat-widget-container:has(.chat-window:not(.hidden)) .chat-toggle-btn {
    visibility: hidden;
  }

  /* Centered window */
  .chat-window {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(1100px, calc(100vw - 96px));
    max-width: none;
    height: min(880px, calc(100vh - 80px));
    height: min(880px, calc(100dvh - 80px));
    max-height: none;
    /* keeps the original frosted-glass look (background/border/blur from the base rules) */
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
  }
  .chat-window.hidden {
    transform: translate(-50%, calc(-50% + 14px)) scale(0.985);
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s 0.22s;
  }

  /* Header */
  .chat-header { padding: 16px 28px; }
  .chat-header-title { font-size: 0.85rem; }
  .chat-close-btn { font-size: 1.9rem; padding: 0 4px; }

  /* Conversation column: ~860px of readable width centered inside the big window */
  .chat-messages {
    padding: 28px clamp(24px, calc((100% - 860px) / 2), 140px);
    gap: 16px;
  }
  .chat-form {
    padding: 18px clamp(24px, calc((100% - 860px) / 2), 140px) 22px;
    gap: 12px;
  }

  /* Bigger, calmer text */
  .chat-window .message-row { gap: 12px; margin-bottom: 0; }
  .chat-window .chat-avatar { width: 38px; height: 38px; }
  .chat-window .bubble {
    font-size: 1.05rem;
    line-height: 1.65;
    padding: 14px 20px;
    border-radius: 16px;
  }
  .chat-window .bubble-bot { max-width: min(92%, 78ch); border-bottom-left-radius: 4px; }
  .chat-window .bubble-user { max-width: min(78%, 62ch); border-bottom-right-radius: 4px; }
  .chat-window .bubble-bot p { margin-bottom: 12px; }
  .chat-window .bubble-bot li { margin-bottom: 8px; }
  .chat-window .bubble-bot ul,
  .chat-window .bubble-bot ol { padding-left: 24px; }

  /* Larger input + button */
  .chat-form input { padding: 15px 20px; font-size: 1.05rem; }
  .chat-form input:focus { border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.12); }
  .chat-send-btn { padding: 0 28px; font-size: 1rem; }

  /* Don't scroll the page behind the open chat */
  body.chat-open { overflow: hidden; }
}
