/* EranosX: shared styles for the public pages (chat, host, terms, privacy). */
:root {
  color-scheme: dark;
  /* Brand tokens shared with the marketing site (website/src/styles/global.css). */
  --bg: #07090c; --surface: #0f1319; --surface-2: #151a23; --text: #eef1f5; --muted: #8b95a5;
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .14);
  --accent: #0a8cff; --accent-hover: #3aa3ff; --accent-soft: rgba(10, 140, 255, .14); --on-accent: #03101f;
  --accent-2: #7cc6ff;
  --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .12); --warn: #ffb224; --warn-soft: rgba(255, 178, 36, .12);
  --err: #ff7b72; --err-soft: rgba(255, 123, 114, .12);
  --user-bubble: #1a2130; --code-bg: #0b0e13;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
  --radius: 14px; --radius-sm: 10px;
  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-weight: 550; text-decoration: none; color: var(--text); line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 24px rgba(10, 140, 255, .25); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.btn.lg { padding: 13px 20px; font-size: 16px; }
.btn.block { width: 100%; }
.field { display: block; width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.lbl { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.error-text { color: var(--err); font-size: 14px; min-height: 20px; margin: 8px 0 0; }

/* ---- top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 18px; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand .x { color: var(--accent); }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar nav a.navlink { color: var(--muted); padding: 8px 10px; border-radius: 8px; font-weight: 550; }
.topbar nav a.navlink:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.user-chip { font-size: 13px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- page sections */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 5px 11px; border-radius: 999px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.04; letter-spacing: -.035em; margin: 16px 0; font-weight: 600; }
.grad { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; background: linear-gradient(90deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { padding: 48px 0; }
.section h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 24px; max-width: 42em; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 22px; }
.feature .icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.feature .icon svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.notice { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.notice svg { flex: none; width: 20px; height: 20px; color: var(--warn); margin-top: 2px; }
.notice p { margin: 0; }
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--muted); }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---- live network card */
.live { padding: 22px; }
.live .row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.live .row:last-child { border-bottom: 0; }
.live .big { font-size: 34px; font-weight: 750; letter-spacing: -.02em; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 7px; vertical-align: 1px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.busy { background: var(--warn); } .dot.err { background: var(--err); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.err { background: var(--err-soft); color: var(--err); } .chip.accent { background: var(--accent-soft); color: var(--accent); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- modal */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 14, .55); display: flex; align-items: center;
  justify-content: center; padding: 16px; animation: fade .12s ease-out; }
.modal { width: 100%; max-width: 420px; padding: 26px; background: var(--surface); border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal .stack > * + * { margin-top: 12px; }
.modal .close { float: right; margin: -8px -8px 0 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.fine { font-size: 12px; color: var(--muted); margin-top: 16px !important; }
.code-input { font: 600 26px/1 var(--mono); letter-spacing: .35em; text-align: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* ---- rendered answers (markdown) */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h3, .md h4, .md h5 { margin: 18px 0 8px; line-height: 1.3; }
.md h3 { font-size: 18px; } .md h4 { font-size: 16px; } .md h5 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; } .md li + li { margin-top: 4px; }
.md blockquote { margin: 0 0 12px; padding: 2px 14px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.md code { font: 13.5px/1.5 var(--mono); background: var(--code-bg); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--surface-2); }
.codeblock { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.codeblock .bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.codeblock pre code { background: none; border: 0; padding: 0; font-size: 13px; white-space: pre; }
details.thinking { margin: 0 0 12px; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; color: var(--muted); font-size: 14px; }
details.thinking summary { cursor: pointer; font-weight: 600; }
details.thinking .md { margin-top: 8px; white-space: pre-wrap; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0 24px; gap: 28px; }
  .grid3, .grid2 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; }
  .wrap { padding: 0 16px; }
  .topbar nav a.navlink.optional { display: none; }
}
