:root {
  --green: #22c55e;
  --green-d: #16a34a;
  --green-l: #f0fdf4;
  --ink: #14211a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --red: #dc2626;
  --red-l: #fef2f2;
  --amber: #d97706;
  --amber-l: #fffbeb;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Noto Sans Thai', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: var(--green-d); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
.top { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.top .in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--green); display: grid; place-items: center; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--green-d); }
.top .sp { flex: 1; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 9px; cursor: pointer; font: inherit; display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { background: #f1f5f9; }
.btn.pri { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.pri:hover { background: var(--green-d); }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; width: 100%; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bbf7d0; border-color: var(--green); }
label.f { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; min-height: 460px; tab-size: 2; }
.tabs { display: flex; gap: 4px; background: #eef2f5; padding: 4px; border-radius: 11px; margin: 16px 0; overflow-x: auto; }
.tabs a { padding: 7px 14px; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.tabs a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.tabs a:hover { text-decoration: none; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 10px; background: #f8fafc; }
td { padding: 9px 10px; border-top: 1px solid #f1f5f9; vertical-align: top; }
tr.click:hover td { background: #f8fafc; cursor: pointer; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.p-ok { background: #dcfce7; color: #15803d; }
.p-bad { background: #fee2e2; color: #b91c1c; }
.p-skip { background: #f1f5f9; color: #64748b; }
.p-tag { background: var(--green-l); color: var(--green-d); font-weight: 500; }
.p-warn { background: #fef3c7; color: #b45309; }
.drop { border: 2px dashed #cbd5e1; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: #fff; }
.drop.over { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.run-bar { background: var(--green-l); border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.run-bar pre { margin: 8px 0 0; max-height: 160px; overflow: auto; font-size: 12px; background: #fff; border-radius: 8px; padding: 8px; white-space: pre-wrap; }
.spin { width: 14px; height: 14px; border: 2px solid #bbf7d0; border-top-color: var(--green-d); border-radius: 50%; display: inline-block; animation: s 0.8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.err { color: var(--red); }
.box-err { background: var(--red-l); border: 1px solid #fecaca; color: #991b1b; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.box-ok { background: var(--green-l); border: 1px solid #bbf7d0; color: #166534; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; }
.steps li { padding: 3px 0; font-size: 13px; }
.steps code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; }
.steps li.failed code { background: var(--red-l); color: #991b1b; }
.steps li.skipped { opacity: 0.45; }
.shot { max-width: 360px; max-height: 240px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 4px 22px; cursor: zoom-in; display: block; }
details.test { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
details.test.bad { border-color: #fecaca; }
details.test summary { padding: 12px 14px; cursor: pointer; }
details.test .body { padding: 0 14px 14px 34px; }
.zoom { position: fixed; inset: 0; background: rgba(15,23,42,.85); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 30px; z-index: 50; cursor: zoom-out; }
.zoom img { max-width: min(1200px, 100%); border-radius: 8px; }
#toast { position: fixed; bottom: 18px; right: 18px; z-index: 60; display: grid; gap: 8px; }
#toast div { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 360px; }
#toast div.bad { background: var(--red); }
.center { min-height: 80vh; display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; }
.help { font-size: 12.5px; line-height: 1.6; }
.help code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; }
.help table td { padding: 4px 6px; font-size: 12px; }
.editor { display: grid; grid-template-columns: 1fr 340px; gap: 14px; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 1fr 1.4fr 90px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr 1fr; } }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.run-bar { position: sticky; top: 8px; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.run-bar .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.run-bar > div + div, .run-bar details { margin-top: 6px; }
.run-bar details summary { cursor: pointer; color: var(--muted, #6b7280); }
.run-bar.done-ok { background: #f0fdf4; border-color: #86efac; position: static; }
.run-bar.done-bad { background: #fef2f2; border-color: #fca5a5; position: static; }
.pbar { height: 8px; background: #fff; border: 1px solid #bbf7d0; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.pbar-fill { height: 100%; background: #22c55e; transition: width .6s ease; }
.pbar-fill.bad { background: linear-gradient(90deg, #22c55e, #f59e0b); }
.live-card { border-color: #86efac; }
.live-list { max-height: 360px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.live-list table td { padding: 6px 10px; vertical-align: top; }
.live-list td:first-child { width: 28px; text-align: center; }
.live-list tr.live-now { background: #fefce8; }
.live-list tr.live-bad { background: #fef2f2; }
