/* Blueprint — Newton CI: dark, green #00e676 + cyan #22d3ee, Inter (EN) / Kanit + Sarabun (TH) */
[hidden] { display: none !important; }
:root {
  --bg: #0a0a0a; --surface: #111; --surface2: #1a1a1a; --border: #222;
  --text: #e0e0e0; --muted: #888; --accent: #00e676; --accent-hover: #00c864; --accent2: #22d3ee;
  --err: #f87171; --radius: 12px;
  --font: "Inter", sans-serif; --font-head: "Inter", sans-serif;
}
html[lang="th"] { --font: "Sarabun", "Inter", sans-serif; --font-head: "Kanit", "Inter", sans-serif; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; font-size: 16px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: #fff; }
a { color: var(--accent); }
p + p { margin-top: 10px; }

/* nav */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: rgba(10,10,10,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 1px; font-family: "Inter", sans-serif; font-size: 1.2em; font-weight: 700; color: #fff; text-decoration: none; }
.brand img { height: 1.25em; width: auto; margin-right: 1px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: .9em; margin-left: 20px; }
.top nav a:hover { color: var(--accent); }
.top nav a.nav-cta { background: var(--accent); color: #fff; padding: 7px 16px; border-radius: 8px; font-weight: 600; }
.top nav a.nav-cta:hover { background: var(--accent-hover); }

/* layout */
.wrap { max-width: 960px; margin: 0 auto; padding: 40px 16px; }
.narrow { max-width: 520px; }
.center { text-align: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 22px; }
.card h1 { margin: 8px 0 12px; font-size: 1.7em; }
.icon-big { font-size: 44px; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px 22px; font: inherit; font-family: "Inter", var(--font); font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .2s, background .2s; }
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.big { padding: 14px 36px; font-size: 1.08em; }
.btn.full { width: 100%; text-align: center; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.note { color: var(--muted); font-size: .88em; margin-top: 12px; }
.note.left { text-align: left; margin: 4px 0 0; }
.error { color: var(--err); margin-top: 10px; }
.banner { background: rgba(0,230,118,.08); border: 1px solid rgba(0,230,118,.35); color: #fff; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.foot { text-align: center; color: var(--muted); font-size: .8em; padding: 28px 16px 44px; border-top: 1px solid var(--border); margin-top: 24px; }
.grad { background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent2) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* home */
.hero { text-align: center; max-width: 800px; margin: 0 auto; padding: 40px 0 10px; }
.hero-logo { width: 120px; height: auto; margin-bottom: 18px; }
.kicker { display: inline-block; border: 1px solid rgba(0,230,118,.55); border-radius: 99px; padding: 8px 20px; font-family: var(--font-head); font-size: clamp(1em, 3.2vw, 1.2em); font-weight: 700; color: var(--accent); background: rgba(0,230,118,.10); box-shadow: 0 0 24px rgba(0,230,118,.15); }
.hero h1 { font-size: clamp(2em, 5vw, 3.1em); font-weight: 800; margin: 16px 0; text-wrap: balance; }
.lead { font-size: 18px; color: #ddd; max-width: 680px; margin: 0 auto; line-height: 1.8; }
.signup { max-width: 520px; margin: 28px auto 0; text-align: left; }
.signup label { font-weight: 600; display: block; margin-bottom: 6px; color: #fff; }
.signup .row { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.signup .row .btn { padding: 14px 40px; font-size: 1.08em; }
.signup input[type=email] { width: 100%; min-width: 0; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font: inherit; }
.signup input[type=email]:focus { outline: none; border-color: var(--accent); }
.signup .note { text-align: center; }
.how { margin-top: 56px; }
.how h2 { text-align: center; font-size: 1.6em; margin-bottom: 20px; }
.how ol { list-style: none; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.how li { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.how h3 { font-size: 1.05em; margin-bottom: 4px; }
.how p { color: var(--muted); font-size: .94em; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,230,118,.12); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.sample { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 40px auto 0; }

/* chat */
.bubble { max-width: 92%; padding: 12px 15px; border-radius: 16px; overflow-wrap: anywhere; }
.bubble.ai { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; align-self: flex-start; }
.bubble.me { background: var(--accent); color: #0a0a0a; font-weight: 500; border-top-right-radius: 4px; align-self: flex-end; white-space: pre-wrap; }
.bubble.typing { color: var(--muted); font-style: italic; }
.bubble.err { color: var(--err); }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble h1 { font-size: 1.3em; margin: 4px 0 10px; } .bubble h2 { font-size: 1.1em; margin: 16px 0 6px; color: var(--accent); } .bubble h3 { font-size: 1em; margin: 12px 0 4px; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.bubble strong { color: #fff; }
.bubble pre { position: relative; background: var(--surface2); border: 1px solid var(--border); color: #d6d6d6; padding: 46px 14px 14px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; font-size: 13.5px; margin: 8px 0; }
.bubble code { font-family: ui-monospace, Menlo, monospace; }
.copy { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-family: "Inter", var(--font); font-size: 13px; font-weight: 700; cursor: pointer; }
.chatwrap { display: flex; max-width: 1100px; margin: 0 auto; min-height: calc(100vh - 61px); }
.side { width: 260px; flex: none; border-right: 1px solid var(--border); padding: 16px; background: var(--bg); }
.side h4 { margin: 18px 0 6px; color: var(--muted); font-size: .75em; text-transform: uppercase; letter-spacing: .06em; }
.side ul { list-style: none; }
.side li a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side li.on a, .side li a:hover { background: var(--surface2); color: #fff; }
.chat { flex: 1; min-width: 0; padding: 16px; display: flex; flex-direction: column; position: relative; }
.log { display: flex; flex-direction: column; gap: 10px; flex: 1; padding-bottom: 12px; }
.composer { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer textarea { flex: 1; resize: none; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font: inherit; min-width: 0; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.cta { background: linear-gradient(135deg, rgba(0,230,118,.10), rgba(34,211,238,.08)); border: 1px solid rgba(0,230,118,.45); border-radius: 16px; padding: 18px; margin: 8px 0; }
.cta h3 { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.cta h3 img { height: 1.6em; }
.cta p { color: #ccc; margin-bottom: 12px; }
.sidetoggle { display: none; position: absolute; top: 8px; left: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 18px; padding: 4px 10px; z-index: 3; }
@media (max-width: 800px) {
  .side { display: none; position: fixed; inset: 61px 0 0 0; width: auto; z-index: 40; }
  .side.open { display: block; }
  .sidetoggle { display: block; }
  .chat { padding: 52px 12px 8px; }
  .bubble { max-width: 100%; }
  .top nav a { margin-left: 14px; }
}

/* pricing + pay */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 24px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; }
.plan.hot { border: 1px solid var(--accent); box-shadow: 0 0 0 1px rgba(0,230,118,.25), 0 10px 40px rgba(0,230,118,.08); }
.plan h2 { font-size: 1.2em; }
.price { font-family: "Inter", sans-serif; font-size: 2.4em; font-weight: 800; color: #fff; margin: 6px 0; }
.plan > p { color: #bbb; }
.plan > p.price { color: #fff; }
.plan ul { padding-left: 18px; color: var(--muted); margin: 14px 0 20px; flex: 1; }
.qrbox { margin: 18px 0 4px; }
.qrbox img { background: #fff; padding: 10px; border-radius: 12px; max-width: 100%; height: auto; }
#element { margin: 18px 0; text-align: left; }
