/* Change these two colors to match ESA branding. */
:root {
  --brand: #1d4f91;
  --accent: #e8772e;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #52606d;
  --border: #dde2e8;
  --notice-bg: #fff7ed;
  --notice-border: #f6c89f;
  --radius: 14px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b2129;
    --text: #e6e9ee;
    --muted: #a3adba;
    --border: #2c3440;
    --notice-bg: #2a2118;
    --notice-border: #6b4a2c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); }
@media (prefers-color-scheme: dark) { a { color: #8db4ea; } }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.site-header { background: var(--brand); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; border: 2px solid rgba(255,255,255,.85); }
.intro-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.intro-hero h1 { margin: 0; }
.hero-img { width: 112px; height: 112px; border-radius: 20px; object-fit: cover; flex-shrink: 0; box-shadow: 0 6px 18px -8px rgba(16,24,40,.35); }
.logo { height: 40px; width: auto; }
.brand-name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.brand-sub { font-size: 13px; opacity: .85; }
.header-link { color: #fff; text-decoration: none; font-size: 14px; border: 1px solid rgba(255,255,255,.5); padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.header-link:hover { background: rgba(255,255,255,.12); }

.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding-top: 32px; padding-bottom: 32px; flex: 1; align-items: start; }

.intro h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 17px; margin: 0 0 24px; }
.intro h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 10px; }
.topics { margin: 0; padding-left: 20px; }
.topics li { margin: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 14px; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.chip:hover, .chip:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.notice { margin-top: 28px; background: var(--notice-bg); border: 1px solid var(--notice-border); border-radius: var(--radius); padding: 16px 18px; font-size: 14px; }

.chat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px -12px rgba(16,24,40,.18); overflow: hidden; display: flex; flex-direction: column; height: min(78vh, 760px); position: sticky; top: 24px; }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd2d9; }
.status-dot.online { background: #2f9e44; }
.status-dot.error { background: #d64545; }
.icon-btn { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.webchat { flex: 1; min-height: 0; background: #fafbfc; position: relative; }
.webchat > div { height: 100%; }
.chat-loading, .chat-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #52606d; font-size: 15px; }
.chat-error { color: #9b2c2c; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 16px 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding-top: 20px; }
  .chat-card { position: static; height: 72vh; min-height: 460px; order: -1; }
  .intro h1 { font-size: 24px; }
  .hero-img { width: 80px; height: 80px; border-radius: 16px; }
  .brand-sub { display: none; }
}
