/* Thinker Meeting — web shell (cloud pages). Same tokens as the local app (app/static/style.css). */
:root {
  --bg: #EEF2F4;
  --panel: #FFFFFF;
  --field: #F7F8FA;
  --soft: #F3F5F7;
  --ink: #19262B;
  --ink-2: #4A585E;
  --ink-3: #66757B;
  --line: #E2E7EA;
  --line-strong: #CBD3D8;
  --purple: #6D48FF;
  --purple-ink: #5732F0;
  --purple-soft: #EDE9FE;
  --purple-deep: #4C1D95;
  --purple-on-dark: #9B82FF;
  --side: #19262B;
  --side-2: #223238;
  --side-text: #E6EDF0;
  --side-muted: #9AAAB0;
  --rec: #D6363E;
  --rec-soft: #FDECEC;
  --ok: #138A4B;
  --ok-soft: #E3F5EA;
  --warn: #9A5B00;
  --warn-bg: #FFF5E0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 0 0 1px rgba(25, 38, 43, .04), 0 16px 36px -22px rgba(25, 38, 43, .28);
  --shadow-lg: 0 0 0 1px rgba(25, 38, 43, .05), 0 30px 60px -30px rgba(25, 38, 43, .45);
  --font: Inter, "Noto Sans Thai", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--purple); }
a:hover { color: var(--purple-ink); }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
.brand .rule { width: 1px; height: 20px; background: var(--line-strong); }
.brand .word { font-size: 18px; font-weight: 600; color: var(--purple); line-height: 1; }
.brand.sm img { height: 22px; } .brand.sm .rule { height: 18px; } .brand.sm .word { font-size: 17px; }
.brand.lg img { height: 32px; } .brand.lg .rule { height: 26px; } .brand.lg .word { font-size: 24px; }
.brand.on-dark .rule { background: rgba(255, 255, 255, .22); }
.brand.on-dark .word { color: var(--purple-on-dark); }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.wrap.narrow { max-width: 1160px; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.topbar .tagline { font-size: 13px; color: var(--ink-2); }
.topbar .end { margin-left: auto; }
@media (max-width: 640px) { .wrap { padding-left: 16px; padding-right: 16px; } }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--purple); margin-bottom: 6px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- buttons ---------- */
.btn { height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--ink); background: var(--field); }
.btn.primary { background: var(--purple); border-color: var(--purple); color: #FFFFFF; }
.btn.primary:hover { background: var(--purple-ink); border-color: var(--purple-ink); color: #FFFFFF; }
.btn.primary.glow { box-shadow: 0 10px 22px -12px rgba(109, 72, 255, .9); }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.md { height: 48px; }
.btn.sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(25, 38, 43, .05); }
.btn.dark { background: var(--side); border-color: var(--side); color: #FFFFFF; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn svg { flex: none; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--purple-soft); color: var(--purple-deep); white-space: nowrap; }
.pill.grey { background: var(--soft); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: #0E6B3A; }
.pill.lead { font-size: 12.5px; letter-spacing: .06em; color: var(--purple); padding: 5px 12px; }

/* ---------- icon tiles ---------- */
.tile { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--purple-soft); color: var(--purple); display: grid; place-items: center; }
.tile.lg { width: 56px; height: 56px; border-radius: 16px; }
.tile.md { width: 52px; height: 52px; border-radius: 15px; }
.tile.warn { background: var(--warn-bg); color: var(--warn); }
.tile.bad { background: var(--rec-soft); color: var(--rec); }
.step-num { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--purple); background: var(--purple-soft); }

/* ---------- command box + keycap ---------- */
.cmd { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 12px; background: var(--side); min-width: 0; }
.cmd code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; color: var(--side-text); white-space: nowrap; overflow-x: auto; padding: 10px 0; }
.cmd code .verb { color: var(--purple-on-dark); }
.cmd .btn { height: 40px; padding: 0 16px; border-radius: 9px; font-size: 14px; flex: none; }
.cmd.expired { background: var(--line); }
.cmd.expired code { color: var(--ink-3); }
.cmd.expired code .verb { color: var(--ink-3); }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; background: #FFFFFF;
  border: 1px solid var(--line-strong); box-shadow: 0 2px 0 var(--line-strong); font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- avatar chip ---------- */
.who { display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 99px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); font-size: 14px; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--purple); color: #FFFFFF; display: grid; place-items: center; font-size: 12px; font-weight: 700; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(109, 72, 255, .45); } 70%, 100% { box-shadow: 0 0 0 12px rgba(109, 72, 255, 0); } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--purple); animation: spin .9s linear infinite; }
.spinner.lg { width: 36px; height: 36px; border-width: 3px; border-color: var(--purple-soft); border-top-color: var(--purple); animation-duration: .8s; }
.pulse { animation: pulse 1.8s ease-out infinite; }
.pop { animation: pop .35s cubic-bezier(.2, .8, .2, 1.2) both; }
.fade { animation: fade 1.8s ease-in-out infinite; }
.nudge { animation: nudge 1.4s ease-in-out infinite; }
.up { animation: up .7s cubic-bezier(.2, .7, .2, 1) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; } .d5 { animation-delay: .4s; }
.bar-track { height: 6px; border-radius: 99px; background: var(--purple-soft); overflow: hidden; }
.bar-track > i { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--purple); animation: slide 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .pulse, .pop, .fade, .nudge, .up, .bar-track > i { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---------- dev state switcher (?dev=1 — mirrors the design's Tweaks) ---------- */
.devbar { position: fixed; right: 12px; bottom: 12px; z-index: 50; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 24px);
  padding: 6px 8px; border-radius: 10px; background: var(--side); color: var(--side-text); font-size: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.devbar select { font: inherit; font-size: 12px; border-radius: 6px; border: 0; padding: 3px 6px; }

/* ---------- "ตั้งค่า key" box (B4) — keys-modal.js ---------- */
.km-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(25, 38, 43, .55); display: flex; justify-content: center; align-items: flex-start; padding: 56px 16px 24px; overflow-y: auto; }
.km { position: relative; width: 600px; max-width: 100%; height: min(860px, calc(100vh - 80px)); display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); overflow: hidden; }
.km-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px 22px; }
.km-head h2 { font-size: 18px; font-weight: 700; }
.km-head p { margin-top: 1px; font-size: 12.5px; color: var(--ink-2); }
.km-x { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--soft); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.km-frame { flex: 1; min-height: 0; margin: 0 14px 14px; display: flex; flex-direction: column; border-radius: 14px; border: 2px solid var(--ink); overflow: hidden; background: #FFFFFF; }
.km-iframe { flex: 1; width: 100%; border: 0; display: block; }
.km-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 32px; text-align: center; }
.km-link { border: 0; background: transparent; padding: 0; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.km-confirm { position: absolute; inset: 0; background: rgba(255, 255, 255, .72); display: flex; align-items: center; justify-content: center; padding: 24px; }
.km-confirm > div { width: 100%; max-width: 380px; background: var(--panel); border-radius: 14px; padding: 22px; box-shadow: 0 24px 48px -20px rgba(25, 38, 43, .45), 0 0 0 1px var(--line); display: grid; gap: 10px; }
.km-confirm b { font-size: 17px; }
.km-confirm p { font-size: 13.5px; color: var(--ink-2); }
.km-confirm > div > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.km-danger { background: #B4232B; border-color: #B4232B; color: #FFFFFF; }
.km-danger:hover { background: #9A1D24; color: #FFFFFF; }
.km-toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px;
  background: var(--side); color: #FFFFFF; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); animation: toast 3s ease both; }
.km-toast span { width: 22px; height: 22px; border-radius: 50%; background: #34D17F; color: var(--side); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
@keyframes toast { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .km-toast { animation: none; } }
