:root {
  --primary: #1e1e1c;
  --accent: #a1d9eb;
  --background: #f2f4f6;
  --surface: #ffffff;
  --ink: #171a2b;
  --muted: #70758b;
  --line: rgba(24, 28, 48, 0.1);
  --shadow: 0 24px 70px rgba(41, 43, 78, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.ambient { position: fixed; width: 34rem; height: 34rem; border-radius: 50%; filter: blur(90px); opacity: .13; pointer-events: none; }
.ambient-one { top: -16rem; right: -8rem; background: var(--primary); }
.ambient-two { bottom: -20rem; left: -12rem; background: var(--accent); }
.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 48px; position: relative; }

.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--primary); box-shadow: 0 9px 24px color-mix(in srgb, var(--primary) 32%, transparent); }
.brand-mark svg { width: 28px; fill: none; stroke: white; stroke-width: 2; stroke-linejoin: round; }
.brand-mark .brand-mark-inner { stroke: var(--accent); }
.brand-logo { width: 112px; height: 48px; object-fit: contain; object-position: left center; }
.hidden { display: none; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.status { display: flex; align-items: center; gap: 8px; color: #4e5368; font-size: 12px; font-weight: 650; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 76%, transparent); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #57b76d; box-shadow: 0 0 0 5px rgba(87, 183, 109, .14); }

.workspace { min-height: 710px; display: grid; grid-template-columns: 290px 1fr; background: var(--surface); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; }
.context-panel { padding: 34px 28px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, var(--primary)); }
.panel-heading { margin-bottom: 34px; }
.eyebrow { display: block; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
h1, h2, p { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.03em; }
label { display: block; margin: 22px 0 8px; color: #5f6478; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
input, select { height: 48px; border-radius: 12px; padding: 0 13px; font-size: 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.select-wrap { position: relative; }
select { appearance: none; padding-right: 34px; }
.select-wrap::after { content: "⌄"; position: absolute; right: 14px; top: 10px; color: var(--muted); pointer-events: none; }
.privacy-note { display: flex; gap: 11px; margin-top: 34px; padding: 15px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 28%, var(--surface)); color: #35464b; }
.privacy-note svg { width: 21px; min-width: 21px; fill: var(--accent); }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { font-size: 12px; margin-bottom: 4px; }
.privacy-note span { font-size: 11px; line-height: 1.45; opacity: .8; }

.chat-panel { display: flex; flex-direction: column; min-width: 0; }
.chat-header { padding: 46px 52px 25px; border-bottom: 1px solid var(--line); }
.chat-header h1 { max-width: 720px; margin-bottom: 10px; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; letter-spacing: -.045em; }
.chat-header p { max-width: 660px; margin-bottom: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.conversation { flex: 1; min-height: 280px; max-height: 390px; padding: 30px 52px; overflow-y: auto; }
.message { display: flex; gap: 12px; margin-bottom: 22px; animation: arrive .28s ease-out; }
.user-message { justify-content: flex-end; }
.avatar { width: 34px; height: 34px; min-width: 34px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--primary); font-size: 10px; font-weight: 800; }
.bubble { max-width: min(650px, 82%); padding: 15px 17px; border-radius: 7px 18px 18px 18px; background: color-mix(in srgb, var(--primary) 7%, var(--surface)); line-height: 1.55; font-size: 14px; }
.bubble p { margin: 0; white-space: pre-wrap; }
.user-message .bubble { color: white; background: var(--primary); border-radius: 18px 7px 18px 18px; }
.source { display: flex; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.typing::after { content: ""; display: inline-block; width: 22px; height: 6px; background: radial-gradient(circle, var(--primary) 2px, transparent 3px) 0 0/8px 8px; animation: pulse 1s infinite; }

.composer { display: flex; align-items: flex-end; gap: 12px; margin: 0 52px; padding: 10px 10px 10px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(35,38,68,.08); }
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent), 0 12px 32px rgba(35,38,68,.08); }
textarea { min-height: 38px; max-height: 120px; resize: none; border: 0; padding: 9px 0 4px; line-height: 1.45; }
textarea:focus { box-shadow: none; }
button { min-height: 44px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 13px; padding: 0 17px; color: white; background: var(--primary); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; transition: transform .15s, opacity .15s; }
button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .55; transform: none; }
button svg { width: 18px; fill: currentColor; }
.disclaimer { margin: 12px 52px 24px; color: #9195a6; font-size: 10px; text-align: center; }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { opacity: .35; } }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 20px, 620px); padding-top: 10px; }
  .status { display: none; }
  .workspace { grid-template-columns: 1fr; border-radius: 20px; }
  .context-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 23px; }
  .panel-heading { margin-bottom: 15px; }
  .context-panel label { margin-top: 13px; }
  .privacy-note { display: none; }
  .chat-header, .conversation { padding-left: 23px; padding-right: 23px; }
  .chat-header { padding-top: 30px; }
  .conversation { min-height: 260px; }
  .composer { margin: 0 16px; }
  .disclaimer { margin-left: 20px; margin-right: 20px; }
  button span { display: none; }
  button { padding: 0 13px; }
}
