/* TeX Gyre Heros: free Helvetica clone (GUST Font License, see assets/fonts/README-TeX-Gyre-Heros.txt) */
@font-face{font-family:"TeX Gyre Heros";font-style:normal;font-weight:400;font-display:swap;src:url(../assets/fonts/texgyreheros-regular.woff2) format("woff2")}
@font-face{font-family:"TeX Gyre Heros";font-style:italic;font-weight:400;font-display:swap;src:url(../assets/fonts/texgyreheros-italic.woff2) format("woff2")}
@font-face{font-family:"TeX Gyre Heros";font-style:normal;font-weight:700;font-display:swap;src:url(../assets/fonts/texgyreheros-bold.woff2) format("woff2")}
@font-face{font-family:"TeX Gyre Heros";font-style:italic;font-weight:700;font-display:swap;src:url(../assets/fonts/texgyreheros-bolditalic.woff2) format("woff2")}

  :root{
    /* Oxford palette: charcoal from the Oxford logo (#22272A) with neutral greys;
       blue is kept only as a small accent that matches Oxanna's illustration */
    --navy:#22272A; --navy-2:#30363A; --blue:#3f78c9; --blue-soft:#b9cbe6;
    --ink:#22272A; --muted:#6B7177; --line:#E4E6E8;
    --bg:#F5F5F4; --panel:#ffffff; --bubble-user:#22272A; --bubble-bot:#ffffff;
    --logo:#22272A;
    --radius:18px;
    /* Typeface: Oxford's brand font. Neue Haas Grotesk is a licensed font: it shows for people who have it
       installed; Mac/iPhone users get Helvetica; everyone else gets TeX Gyre Heros, a free Helvetica clone bundled in assets/fonts. */
    --font: "NeueHaasGroteskTextPro", "Neue Haas Grotesk™ Text", "Neue Haas Grotesk Text", "Helvetica Neue", Helvetica, "TeX Gyre Heros", Arial, sans-serif;
  }
  @media (prefers-color-scheme: dark){
    :root{
      --ink:#ECEDEE; --muted:#A1A6AB; --line:#33393D;
      --bg:#161A1C; --panel:#1E2326; --bubble-user:#3A4146; --bubble-bot:#22282B;
      --logo:#ECEDEE; --blue:#7fa8e6; --navy:#4A5257;
    }
  }
  *{box-sizing:border-box}
  html,body{margin:0}

  body{font-family:var(--font);background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased}

  .app{display:grid;grid-template-columns:340px 1fr;height:calc(100vh - var(--sh,71px));height:calc(100dvh - var(--sh,71px));overflow:hidden}


  /* ---------- Oxford Properties site header ---------- */
  .site-header{position:sticky;top:0;z-index:20;background:#fff;color:#22272A;border-bottom:1px solid #E4E6E8;flex:none}
  .sh-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:16px 32px 48px}
  .sh-logo{display:block;color:#22272A;flex:none;margin-top:-8px}
  .sh-logo svg{display:block;width:108px;height:32px}
  .sh-nav{flex:1;display:flex;justify-content:center}
  .sh-nav > ul{display:flex;gap:6px;margin:0;padding:0;list-style:none}
  .sh-nav li{position:relative;list-style:none}
  .sh-nav a{display:block;color:#22272A;text-decoration:none;font-size:14px;font-weight:500;white-space:nowrap;padding:10px 10px;border-radius:6px}
  .sh-nav > ul > li > a:hover,.sh-nav > ul > li:focus-within > a{text-decoration:underline;text-underline-offset:6px}
  .sh-nav .has-sub > ul{position:absolute;top:100%;left:0;min-width:200px;margin:0;padding:10px 6px;background:#fff;border:1px solid #E4E6E8;border-radius:10px;
                        box-shadow:0 14px 30px rgba(34,39,42,.12);opacity:0;visibility:hidden;transform:translateY(6px);transition:.15s}
  .sh-nav .has-sub:hover > ul,.sh-nav .has-sub:focus-within > ul{opacity:1;visibility:visible;transform:none}
  .sh-nav .has-sub > ul a{font-weight:400;padding:7px 12px}
  .sh-nav .has-sub > ul a:hover{background:#F5F5F4}
  .sh-nav li.label{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#8A9096;padding:12px 12px 4px}
  .sh-actions{display:flex;align-items:center;gap:16px;flex:none}
  .sh-btn{display:flex;align-items:center;border:1px solid #22272A;border-radius:4px;padding:10px 16px;color:#22272A;text-decoration:none;font-size:13px;font-weight:600;transition:.15s}
  .sh-btn:hover{background:#22272A;color:#fff}
  .sh-menu{display:none;border:0;background:none;color:#121314;padding:4px;cursor:pointer}
  @media (max-width:1180px){
    .sh-inner{padding:14px 16px 32px}
    .sh-menu{display:block}
    .sh-nav{position:absolute;top:100%;left:0;right:0;background:#fff;border-bottom:1px solid #E4E6E8;box-shadow:0 14px 30px rgba(34,39,42,.12);
            display:none;max-height:calc(100dvh - 70px);overflow-y:auto}
    .sh-nav.open{display:block}
    .sh-nav > ul{flex-direction:column;gap:0;padding:8px 8px 14px}
    .sh-nav .has-sub > ul{position:static;opacity:1;visibility:visible;transform:none;border:0;box-shadow:none;padding:0 0 6px 12px;min-width:0}
  }
  @media (max-width:520px){ .sh-btn{padding:8px 12px;font-size:12px} .sh-logo svg{width:88px;height:26px} }


  /* ---------- Oxford Properties site footer ---------- */
  .site-footer{background:#fff;color:#22272A;border-top:1px solid #E4E6E8}
  .sf-inner{padding:48px 32px 56px;max-width:1440px;margin:0 auto}
  .sf-top{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:32px;border-top:1px solid #22272A;border-bottom:1px solid #22272A;padding:18px 0}
  .sf-logo{display:block;color:#22272A}
  .sf-logo svg{display:block;width:108px;height:32px}
  .sf-nav{display:flex;justify-content:space-between;gap:16px;margin:0;padding:0 16px;list-style:none}
  .sf-nav a,.sf-legal a,.sf-social a{color:#22272A;text-decoration:none}
  .sf-nav a{font-size:15px;white-space:nowrap}
  .sf-nav a:hover,.sf-legal a:hover{text-decoration:underline;text-underline-offset:4px}
  .sf-right{display:flex;align-items:center;gap:16px}
  .sf-btn{display:flex;align-items:center;height:40px;padding:0 16px;border:1px solid #22272A;border-radius:4px;color:#22272A;text-decoration:none;font-size:14px;transition:.15s}
  .sf-btn:hover,.sf-up:hover{background:#22272A;color:#fff}
  .sf-up{display:grid;place-items:center;width:40px;height:40px;border:1px solid #22272A;border-radius:4px;background:#fff;color:#22272A;cursor:pointer;transition:.15s}
  .sf-bottom{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;padding-top:16px}
  .sf-legal{display:flex;flex-wrap:wrap;gap:8px 18px;margin:0;padding:0;list-style:none;font-size:13px}
  .sf-legal a{color:#5B6166}
  .sf-social{display:flex;gap:20px;flex:none}
  .sf-social a:hover{opacity:.6}
  .sf-copy{margin:16px 0 0;font-size:13px;color:#5B6166}
  @media (max-width:1180px){
    .sf-inner{padding:32px 16px 40px}
    .sf-top{grid-template-columns:1fr auto;grid-template-areas:"logo right" "nav right";align-items:start;gap:20px}
    .sf-logo{grid-area:logo}
    .sf-nav{grid-area:nav;flex-direction:column;justify-content:flex-start;gap:14px;padding:0}
    .sf-right{grid-area:right;align-self:stretch;flex-direction:column;justify-content:space-between;align-items:flex-end;gap:12px}
    .sf-up{order:-1;margin-bottom:auto}
    .sf-bottom{flex-direction:column-reverse;align-items:flex-start}
    .sf-legal{flex-direction:column;gap:12px}
  }

  /* ---------- Left: Oxanna panel ---------- */
  .hero{position:relative;background:linear-gradient(170deg,#22272A 0%,#2B3135 55%,#3A4146 100%);
        color:#fff;display:flex;flex-direction:column;overflow:hidden}
  .brand{padding:24px 28px 0;display:flex;align-items:center;justify-content:flex-start}
  .logo{display:block;height:26px;width:auto;color:#fff}
  .topbar .logo{height:22px;color:var(--logo);margin-right:6px}
  .status{display:flex;align-items:center;gap:8px;font-size:12px;opacity:.85}
  .dot{width:8px;height:8px;border-radius:50%;background:#5ee39a;box-shadow:0 0 0 3px rgba(94,227,154,.2)}
  .hero h1{margin:26px 28px 4px;font-size:34px;font-weight:700;letter-spacing:-.02em}
  .hero p{margin:0 28px;font-size:14px;line-height:1.55;color:#C9CDD1;max-width:270px}
  .figure{flex:1;min-height:0;display:flex;align-items:flex-end;justify-content:center;padding-top:16px}
  /* ---------- Oxanna: traced picture + face overlays (viewBox units = 2x the original image) ---------- */
  .oxanna{height:88%;width:auto;max-width:64%;margin-bottom:10px;overflow:visible;filter:drop-shadow(0 18px 30px rgba(0,0,0,.25))}
  .oxanna g{transform-box:view-box}
  /* idle: slow breathing with a gentle weight shift, pivoting at her feet */
  .oxanna .body{transform-origin:887px 3500px;transition:transform .9s cubic-bezier(.4,0,.2,1);animation:idle 12s ease-in-out infinite}
  @keyframes idle{
    0%,100%{transform:translateY(0) rotate(0)}
    17%{transform:translateY(-8px) rotate(0)}
    33%{transform:translateY(0) rotate(.5deg)}
    50%{transform:translateY(-8px) rotate(.5deg)}
    67%{transform:translateY(0) rotate(-.3deg)}
    83%{transform:translateY(-8px) rotate(0)}}
  /* blink: skin-coloured lids flash over the eyes */
  .oxanna .lids{opacity:0;animation:blink 5.5s infinite}
  @keyframes blink{0%,94.5%,97%,100%{opacity:0}95%,96.5%{opacity:1}}
  /* the eyes: by default the pupils sit exactly where they are in the picture */
  .oxanna .pupils{transition:transform .35s ease-out}
  .oxanna .mouthOpen{opacity:0}
  .oxanna.glance-l .pupils{transform:translate(-26px,0)}
  .oxanna.glance-r .pupils{transform:translate(4px,2px)}
  /* listening: you're typing, she looks toward the chat */
  .oxanna.listening .pupils{transform:translate(5px,3px)}
  /* thinking: eyes look up and away, slight lean */
  .oxanna.thinking .pupils{transform:translate(-20px,-8px)}
  .oxanna.thinking .body{animation:think 3s ease-in-out infinite}
  @keyframes think{0%,100%{transform:rotate(-.6deg)}50%{transform:rotate(-.9deg) translateY(-6px)}}
  /* talking: mouth moves, small bob */
  .oxanna.talking .mouthOpen{animation:talk .9s steps(1) infinite}
  @keyframes talk{0%{opacity:1}18%{opacity:0}30%{opacity:1}52%{opacity:.6}64%{opacity:0}78%{opacity:1}90%{opacity:0}}
  .oxanna.talking .body{animation:bob 1.8s ease-in-out infinite}
  @keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px) rotate(.3deg)}}

  @media (prefers-reduced-motion: reduce){
    .oxanna *{animation:none !important;transition:none !important}
  }
  .hero::after{content:"";position:absolute;inset:auto -80px -120px -80px;height:260px;border-radius:50%;
               background:radial-gradient(closest-side,rgba(169,196,239,.35),transparent);pointer-events:none}

  /* ---------- Right: chat ---------- */
  .chat{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg)}
  .topbar{display:flex;align-items:center;gap:12px;padding:16px 24px;border-bottom:1px solid var(--line);background:var(--panel)}
  .topbar .avatar{width:40px;height:40px}
  .topbar .name{font-weight:600}
  .topbar .sub{font-size:12px;color:var(--muted)}
  .topbar .spacer{flex:1}
  .ghost{border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:10px;padding:8px 12px;font:inherit;font-size:13px;cursor:pointer}
  .ghost:hover{border-color:var(--ink)}

  .avatar{border-radius:50%;background:#dfe9f8 url(../assets/oxanna-avatar.png) center/cover no-repeat;flex:none;
          box-shadow:0 0 0 2px var(--panel),0 0 0 3px var(--blue-soft)}

  .messages{flex:1;min-height:0;overflow-y:auto;padding:28px 24px 12px;scroll-behavior:smooth}
  .inner{max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:18px}

  .welcome{text-align:center;padding:24px 0 8px}
  .welcome .avatar{width:84px;height:84px;margin:0 auto 14px}
  .welcome h2{margin:0 0 6px;font-size:22px;letter-spacing:-.01em}
  .welcome p{margin:0;color:var(--muted);font-size:14px}
  .chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:22px;text-align:left}
  .chip{border:1px solid var(--line);background:var(--panel);border-radius:14px;padding:14px 16px;cursor:pointer;font:inherit;color:var(--ink);text-align:left;transition:.15s}
  .chip:hover{border-color:var(--ink);transform:translateY(-1px)}
  .chip b{display:block;font-size:13px;font-weight:600;margin-bottom:3px}
  .chip span{font-size:12.5px;color:var(--muted)}

  .row{display:flex;gap:10px;align-items:flex-end}
  .row.user{justify-content:flex-end}
  .row .avatar{width:32px;height:32px}
  .bubble{max-width:min(620px,80%);padding:12px 16px;border-radius:var(--radius);font-size:14.5px;line-height:1.55;white-space:pre-wrap;word-wrap:break-word}
  .bot .bubble{background:var(--bubble-bot);border:1px solid var(--line);border-bottom-left-radius:6px}
  .user .bubble{background:var(--bubble-user);color:#fff;border-bottom-right-radius:6px}
  .bubble a{color:var(--blue)}
  .stack{display:flex;flex-direction:column;gap:8px;max-width:min(620px,80%)}
  .stack .bubble{max-width:100%}
  .sources{display:flex;flex-wrap:wrap;gap:6px;font-size:12px;color:var(--muted);align-items:center}
  .src{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--panel);border-radius:999px;padding:4px 10px;color:var(--ink)}
  .src::before{content:"";width:6px;height:6px;border-radius:2px;background:var(--blue)}
  .actions{display:flex;flex-wrap:wrap;gap:8px}
  .act{border:1px solid var(--blue);background:transparent;color:var(--blue);border-radius:999px;padding:7px 14px;font:inherit;font-size:13px;font-weight:500;cursor:pointer}
  .act.primary{background:var(--navy);border-color:var(--navy);color:#fff}
  .act:hover:not(:disabled){filter:brightness(1.1)}
  .act:disabled{opacity:.4;cursor:default}
  .steps{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}
  .steps i{width:22px;height:4px;border-radius:2px;background:var(--line)}
  .steps i.on{background:var(--blue)}
  .card{border:1px solid var(--line);background:var(--panel);border-radius:14px;padding:14px 16px;font-size:13.5px}
  .card h4{margin:0 0 8px;font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px}
  .card .ok{width:18px;height:18px;border-radius:50%;background:#2fa66a;color:#fff;display:grid;place-items:center;font-size:11px}
  .card dl{margin:0;display:grid;grid-template-columns:max-content 1fr;gap:4px 14px}
  .card dt{color:var(--muted)} .card dd{margin:0}
  .bubble.md{white-space:normal}
  .bubble.md > :first-child{margin-top:0} .bubble.md > :last-child{margin-bottom:0}
  .bubble.md p{margin:0 0 10px}
  .bubble.md h3,.bubble.md h4,.bubble.md h5,.bubble.md h6{margin:14px 0 6px;font-size:15px;font-weight:600;letter-spacing:-.01em}
  .bubble.md h4,.bubble.md h5,.bubble.md h6{font-size:14px;color:var(--muted)}
  .bubble.md ol{margin:6px 0 10px;padding-left:22px} .bubble.md ol li{margin:3px 0}
  .bubble.md ul{margin:6px 0 10px}
  .bubble.md li > p{margin:0}
  .bubble.md a{color:var(--blue);text-decoration:underline;text-underline-offset:2px}
  .bubble.md a:not([href]){color:inherit;text-decoration:none}
  .bubble.md blockquote{margin:8px 0;padding:4px 12px;border-left:3px solid var(--blue-soft);color:var(--muted)}
  .bubble.md hr{border:0;border-top:1px solid var(--line);margin:12px 0}
  .bubble.md mark{background:rgba(74,134,216,.2);color:inherit;border-radius:3px;padding:0 2px}
  .bubble.md dl{margin:6px 0 10px;display:grid;grid-template-columns:max-content 1fr;gap:4px 14px} .bubble.md dt{font-weight:600} .bubble.md dd{margin:0}
  .bubble.md .tbl{overflow-x:auto;margin:8px 0 10px;border:1px solid var(--line);border-radius:10px}
  .bubble.md table{border-collapse:collapse;width:100%;font-size:13.5px}
  .bubble.md th,.bubble.md td{padding:7px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line)}
  .bubble.md th{background:rgba(74,134,216,.08);font-weight:600}
  .bubble.md tr:last-child td{border-bottom:0}
  .bubble.md caption{caption-side:top;text-align:left;padding:6px 10px;font-weight:600}
  .bubble.md ul{margin:6px 0;padding-left:20px} .bubble.md li{margin:2px 0}
  .bubble.md code{font-family:ui-monospace,Menlo,monospace;font-size:13px;background:rgba(74,134,216,.12);padding:1px 5px;border-radius:5px}
  .bubble.md pre{background:#0f1b2e;color:#e8eef8;padding:12px;border-radius:10px;overflow-x:auto;white-space:pre}
  .bubble.md pre code{background:none;padding:0;color:inherit}
  .bubble.err{border-color:#e5a3a3;background:#fdf3f3;color:#8a2a2a}
  .typing{display:inline-flex;gap:4px;padding:4px 0}
  .typing i{width:7px;height:7px;border-radius:50%;background:var(--blue-soft);animation:b 1.2s infinite}
  .typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
  @keyframes b{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}

  .composer{padding:12px 24px 18px}
  .box{max-width:780px;margin:0 auto;display:flex;align-items:flex-end;gap:10px;background:var(--panel);border:1px solid var(--line);
       border-radius:20px;padding:10px 10px 10px 18px;box-shadow:0 6px 24px rgba(29,58,99,.08)}
  .box:focus-within{border-color:var(--muted)}
  textarea{flex:1;border:0;outline:0;resize:none;background:transparent;color:var(--ink);font:inherit;font-size:15px;line-height:1.5;max-height:160px;padding:6px 0}
  .send{width:40px;height:40px;border-radius:12px;border:0;background:var(--navy);color:#fff;cursor:pointer;display:grid;place-items:center;flex:none}
  .send:disabled{opacity:.35;cursor:default}
  .send svg{width:18px;height:18px}
  .fine{max-width:780px;margin:8px auto 0;text-align:center;font-size:11.5px;color:var(--muted)}

  @media (max-width:900px){
    .app{grid-template-columns:1fr}
    .hero{display:none}
    .messages{padding:20px 16px 8px}
    .composer{padding:10px 16px 14px}
    .topbar{padding:12px 16px}
    .chips{grid-template-columns:1fr}
  }

/* ---------- Live mini Oxanna (header, welcome, typing) ---------- */
.avatar{position:relative;overflow:hidden}
.avatar.live{background:#dfe9f8}
.avatar.live svg{position:absolute;inset:0;width:100%;height:100%}
.oxanna.mini{filter:none;overflow:hidden;cursor:default;height:100%;width:100%;max-width:none;margin:0}
.oxanna.mini .body{animation:none !important}
.oxanna.mini .shadow{display:none}

/* ---------- Streaming ---------- */
.bubble.streaming > :last-child::after,
.bubble.streaming:empty::after{content:"";display:inline-block;width:7px;height:15px;margin-left:3px;vertical-align:-2px;
  background:var(--blue);border-radius:2px;animation:caret 1s steps(1) infinite}
.bubble.streaming ul > li:last-child::after,.bubble.streaming ol > li:last-child::after{content:none}
@keyframes caret{50%{opacity:0}}

/* ---------- Send / Stop ---------- */
.send.stop{background:var(--ink);color:var(--panel)}
.send.stop svg{width:16px;height:16px}

/* ---------- Reply actions: copy, thumbs, retry ---------- */
.msg-actions{display:flex;align-items:center;gap:2px;margin-top:-2px;opacity:.55;transition:opacity .15s}
.row.bot:hover .msg-actions,.msg-actions:focus-within,.row.bot:last-child .msg-actions{opacity:1}
@media (hover:none){.msg-actions{opacity:1}}
.icon-btn{width:30px;height:30px;display:grid;place-items:center;border:0;background:transparent;color:var(--muted);border-radius:8px;cursor:pointer}
.icon-btn svg{width:17px;height:17px}
.icon-btn:hover{background:rgba(34,39,42,.07);color:var(--ink)}
.icon-btn[aria-pressed="true"]{color:var(--ink);background:rgba(34,39,42,.08)}
.icon-btn.done{color:#2f8f5b}
.thanks{font-size:12px;color:var(--muted);margin-left:6px}
.note{font-size:12px;color:var(--muted);font-style:italic;padding:2px 4px}
.act.retry{display:inline-flex;align-items:center;gap:6px;border-color:var(--ink);color:var(--ink)}
.act.retry svg{width:15px;height:15px}
.stopped-row .stack{padding-bottom:4px}
@media (prefers-color-scheme: dark){
  .icon-btn:hover,.icon-btn[aria-pressed="true"]{background:rgba(255,255,255,.08)}
}
@media (prefers-reduced-motion: reduce){ .bubble.streaming *::after{animation:none} }

/* avatar lines up with the start of each reply (actions sit underneath) */
.row.bot{align-items:flex-start}
.row.bot .avatar{margin-top:2px}
