:root { --fg:#1f2937; --muted:#6b7280; --line:#e5e7eb; --bg:#f9fafb; --card:#fff; --accent:#0e7490; --warn:#b45309; --bad:#b91c1c; --ok:#047857; }
* { box-sizing: border-box; }
body { margin:0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--fg); background:var(--bg); }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:10px 20px; background:#0f172a; color:#f8fafc; gap:12px; flex-wrap:wrap; }
.tagline { color:#94a3b8; font-size:13px; margin-left:8px; }
#who { font-size:14px; display:flex; gap:10px; align-items:center; }
main { max-width:1100px; margin:20px auto; padding:0 16px; }
.foot { text-align:center; color:var(--muted); font-size:12px; padding:24px 16px; }
h1 { font-size:22px; margin:0 0 12px; } h2 { font-size:18px; margin:20px 0 8px; } h3 { font-size:16px; margin:14px 0 6px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:14px; }
.grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:14px; }
.two { display:grid; grid-template-columns: 1.2fr 1fr; gap:14px; } @media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.muted { color:var(--muted); } .small { font-size:13px; }
.badge { display:inline-block; padding:1px 8px; border-radius:999px; font-size:12px; background:#e0f2fe; color:#075985; margin-right:4px; }
.badge.draft { background:#fef3c7; color:#92400e; } .badge.ready { background:#d1fae5; color:#065f46; } .badge.outline { background:#f3f4f6; color:#4b5563; }
button, .btn { background:var(--accent); color:#fff; border:0; border-radius:8px; padding:8px 14px; font-size:14px; cursor:pointer; text-decoration:none; display:inline-block; }
button.secondary, .btn.secondary { background:#fff; color:var(--accent); border:1px solid var(--accent); }
button.link { background:none; color:var(--accent); padding:0; text-decoration:underline; }
button:disabled { opacity:.5; cursor:not-allowed; }
input, select, textarea { font:inherit; padding:7px 9px; border:1px solid #cbd5e1; border-radius:7px; width:100%; background:#fff; }
textarea { min-height:110px; }
label { display:block; font-size:13px; color:var(--muted); margin:8px 0 3px; }
table { width:100%; border-collapse:collapse; } th, td { border-bottom:1px solid var(--line); padding:7px 6px; text-align:left; font-size:14px; vertical-align:top; } th { color:var(--muted); font-weight:600; }
.row { display:flex; gap:8px; align-items:end; flex-wrap:wrap; } .row > * { flex:1; min-width:140px; } .row > button { flex:0 0 auto; }
.chat { max-height:420px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:4px; }
.msg { padding:8px 11px; border-radius:10px; white-space:pre-wrap; max-width:92%; }
.msg.me { background:#e0f2fe; align-self:flex-end; } .msg.ai { background:#f1f5f9; } .msg.sys { background:#fef3c7; color:#78350f; }
.meter { height:8px; background:#e5e7eb; border-radius:4px; overflow:hidden; } .meter > div { height:100%; background:var(--accent); }
.err { color:var(--bad); } .okc { color:var(--ok); } .warnbox { background:#fffbeb; border:1px solid #f59e0b; border-radius:8px; padding:10px; font-size:14px; }
.tabs { display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; } .tabs button { background:#e2e8f0; color:var(--fg); } .tabs button.on { background:var(--accent); color:#fff; }
.chips { display:flex; flex-wrap:wrap; gap:6px; } .chips button { background:#f1f5f9; color:var(--fg); border:1px solid var(--line); font-size:13px; }
ul.clean { padding-left:18px; margin:4px 0; }
.toast { position:fixed; bottom:18px; right:18px; background:#0f172a; color:#fff; padding:10px 14px; border-radius:8px; font-size:14px; }
.brand a.home { color:#f8fafc; font-weight:700; text-decoration:none; }
.login-card { max-width:460px; margin:40px auto; text-align:center; }
.login-card .pw-form { text-align:left; }
.portal-pick { max-width:760px; margin:30px auto; text-align:center; }
a.portal { text-decoration:none; color:inherit; transition:transform .15s, box-shadow .15s; } a.portal:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(14,116,144,.15); }
.portal-icon { font-size:44px; }
.bio-btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:16px; font-size:17px; border-radius:14px; background:linear-gradient(135deg,#0e7490,#6d28d9); margin-top:14px; }
.bio { font-size:26px; display:inline-block; }
.login-card > .bio { font-size:56px; color:#0e7490; }
/* sign-in screens share the landing page look */
body.auth { background: radial-gradient(900px 600px at 85% -10%, #1e2a5a 0%, transparent 60%), radial-gradient(800px 500px at -10% 40%, #0b3a4a 0%, transparent 55%), #050b18; color: #e8eefc; min-height: 100vh; }
body.auth .card { background: rgba(13, 24, 48, .78); border-color: rgba(148, 163, 196, .2); color: #e8eefc; backdrop-filter: blur(10px); }
body.auth .muted, body.auth label { color: #93a3c4; } body.auth .foot { color: #6b7a99; }
body.auth a { color: #7dd3fc; } body.auth a.portal { color: #e8eefc; }
body.auth input { background: #0a1530; color: #e8eefc; border-color: #334155; }
body.auth .topbar { background: transparent; }
body.auth button.link { color: #7dd3fc; } body.auth .err { color: #fca5a5; }
body.auth a.portal:hover { box-shadow: 0 10px 30px rgba(34, 211, 238, .2); border-color: rgba(34, 211, 238, .5); }
.lang-switch { display:inline-flex; border:1px solid rgba(148,163,196,.35); border-radius:999px; padding:2px; gap:2px; }
.lang-switch button { background:none; color:#cbd5e1; padding:4px 10px; font-size:12px; border-radius:999px; }
.lang-switch button.on { background:#0e7490; color:#fff; }
html[data-lang="th"] body { font-family: "Noto Sans Thai", "Sukhumvit Set", "Sarabun", system-ui, sans-serif; line-height:1.65; }
html[data-lang="zh"] body { font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.setup { max-width:720px; margin:24px auto; } .setup h2 { margin-top:22px; }
pre.cmd { background:#020617; color:#7dd3fc; padding:10px 12px; border-radius:8px; overflow-x:auto; font-size:13px; user-select:all; }
label.check { display:flex; gap:8px; align-items:center; color:inherit; font-size:14px; margin-top:10px; }
body.auth textarea, body.auth select { background:#0a1530; color:#e8eefc; border-color:#334155; }
body.auth .tabs button { background:#1e293b; color:#cbd5e1; } body.auth .tabs button.on { background:#0e7490; color:#fff; }
body.auth .warnbox { background:rgba(245,185,66,.1); color:#fde68a; border-color:rgba(245,185,66,.5); }
.alert-card { border-color:#f59e0b; background:#fffbeb; } .alert-card tr.alert-high td { color:#991b1b; font-weight:600; }

/* login "still alive" spinner */
.spinner { display: inline-block; width: 1em; height: 1em; margin-right: .5em; vertical-align: -.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: eduai-spin .8s linear infinite; }
@keyframes eduai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
