*{box-sizing:border-box;margin:0;padding:0}
:root{
  --navy:#003781; --blue:#0072CE; --blue-soft:#e8f1fb; --line:#e2e6ec;
  --ink:#12212f; --muted:#6b7c8f; --bg:#eef1f5; --card:#fff;
  --ok:#0d7a4a; --ok-soft:#e3f6ec; --warn:#a86200; --warn-soft:#fdf1dd;
  --bad:#b3261e; --bad-soft:#fdeceb; --gray-soft:#eef1f5; --gold:#8a6d00;
}
body{
  font-family:'Noto Sans Thai','Sarabun',Loma,Tahoma,sans-serif;
  background:var(--bg); color:var(--ink);
  line-height:1.45; font-size:14px;
  padding:26px 22px 40px;
}
.pagehead {
  max-width:1400px; margin:0 auto 20px;
  display:flex; flex-wrap:wrap; gap:14px;
  align-items:flex-end; justify-content:space-between;
}
.pagehead h1 {
  font-size:20px; color:var(--navy);
}
.pagehead p {
  font-size:13px; color:var(--muted); margin-top:4px;
}
.togglebtn {
  border:1px solid var(--blue); background:#fff; color:var(--blue);
  border-radius:999px; padding:9px 16px; font:inherit; font-weight:600;
  cursor:pointer;
}
.togglebtn.on { background:var(--blue); color:#fff; }
.row {
  max-width:1400px; margin:0 auto;
  display:flex; gap:20px; align-items:flex-start; flex-wrap:wrap;
}
.frameWrap {
  display:flex; flex-direction:column; gap:8px;
}
.frameLabel {
  font-size:12px; font-weight:600; color:var(--muted); padding-left:6px;
}
.screen {
  width:412px; height:1010px; background:var(--card);
  border-radius:26px; overflow:hidden;
  box-shadow:0 10px 30px rgba(18,33,47,.14);
  border:1px solid #d7dde5; display:flex; flex-direction:column;
  position:relative;
}
/* chrome */
.topbar {
  background:var(--navy); color:#fff;
  padding:13px 15px 11px; flex:0 0 auto;
}
.topbar .ttl {
  font-size:14px; font-weight:700;
}
.topbar .sub {
  font-size:11.5px; opacity:.82; margin-top:2px;
}
.body {
  flex:1 1 auto; overflow-y:auto;
  padding:13px 13px 16px;
}
.body::-webkit-scrollbar { width:0; }
.nav {
  flex:0 0 auto; display:flex;
  border-top:1px solid var(--line); background:#fff;
}
.nav div {
  flex:1; text-align:center; padding:7px 1px 8px;
  font-size:9px; color:var(--muted); cursor:pointer;
  letter-spacing:-.3px;
}
.nav div b {
  display:block; font-size:15px; line-height:1.25; font-weight:400;
}
.nav div.active {
  color:var(--blue); font-weight:700;
}
/* pieces */
.sec {
  margin-bottom:13px;
}
.sec h3 {
  font-size:12px; text-transform:uppercase;
  letter-spacing:.4px; color:var(--muted);
  margin-bottom:7px; display:flex;
  justify-content:space-between; align-items:center;
}
.sec h3 em {
  font-style:normal; text-transform:none; letter-spacing:0;
  color:var(--blue); font-size:11.5px; font-weight:700;
  cursor:pointer;
}
.kpis {
  display:grid; grid-template-columns:repeat(3,1fr); gap:7px;
}
.kpi {
  background:var(--gray-soft); border-radius:12px;
  padding:8px 9px;
}
.kpi b {
  display:block; font-size:16px; color:var(--navy);
}
.kpi span {
  font-size:10.5px; color:var(--muted);
}
.card {
  background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:11px; margin-bottom:9px;
  position:relative; cursor:pointer;
}
.card:hover {
  border-color:#b9cade;
  box-shadow:0 3px 10px rgba(18,33,47,.06);
}
.card .ct {
  font-size:13.5px; font-weight:700; padding-right:22px;
}
.card .why {
  font-size:11.5px; color:#3f5062; margin-top:5px;
  background:#f7f9fc; border-left:3px solid var(--blue);
  border-radius:6px; padding:6px 8px;
}
.card .why b { color:var(--navy); }
.card.sel {
  border-color:var(--blue);
  box-shadow:0 0 0 2px var(--blue-soft);
}
.meta {
  display:flex; flex-wrap:wrap; gap:5px; margin-top:6px;
}
.tag {
  font-size:10.5px; border-radius:999px;
  padding:2px 8px; background:var(--gray-soft);
  color:#46586b;
}
.tag.blue {
  background:var(--blue-soft); color:var(--navy);
}
.tag.ok { background:var(--ok-soft); color:var(--ok); }
.tag.warn { background:var(--warn-soft); color:var(--warn); }
.tag.bad { background:var(--bad-soft); color:var(--bad); }
.tag.ghost {
  background:#fff; border:1px solid var(--line);
}
.chips {
  display:flex; gap:5px; flex-wrap:wrap;
  margin-bottom:9px;
}
.chip {
  font-size:11px; border:1px solid var(--line);
  border-radius:999px; padding:4px 10px;
  background:#fff; cursor:pointer; color:#46586b;
}
.chip.on {
  background:var(--navy); border-color:var(--navy);
  color:#fff; font-weight:600;
}
.chip.soc.on {
  background:var(--blue); border-color:var(--blue);
}
.btn {
  border:0; border-radius:9px;
  padding:7px 11px; font:inherit; font-size:11.5px;
  font-weight:700; cursor:pointer;
  background:var(--gray-soft); color:#3c4d5f;
}
.btn.pri { background:var(--blue); color:#fff; }
.btn.ok { background:var(--ok); color:#fff; }
.btn.bad { background:var(--bad-soft); color:var(--bad); }
.btn.g {
  border:1px solid var(--line); background:#fff;
}
.btn.wa { background:var(--warn-soft); color:var(--warn); }
.btn.wide { width:100%; padding:10px; }
.kv {
  display:flex; justify-content:space-between;
  align-items:center; font-size:11.5px;
  padding:6px 0; border-bottom:1px dashed var(--line);
  gap:8px;
}
.kv:last-child { border-bottom:0; }
.kv i { font-style:normal; color:var(--muted); }
.bar {
  height:6px; border-radius:999px;
  background:var(--gray-soft); overflow:hidden; margin-top:7px;
}
.bar i {
  display:block; height:100%; width:0;
  background:var(--blue);
}
/* template grid */
.tgrid {
  display:grid; grid-template-columns:1fr 1fr; gap:8px;
}
.tcard {
  border:1px solid var(--line); border-radius:12px;
  overflow:hidden; cursor:pointer; background:#fff;
  position:relative;
}
.tcard.sel {
  border-color:var(--blue);
  box-shadow:0 0 0 2px var(--blue-soft);
}
.thumb {
  height:88px;
  background:linear-gradient(135deg,#dfe8f2 0%,#c9d9ea 45%,#eef3f9 100%);
  display:flex; align-items:center; justify-content:center;
  color:#5a7a94;
}
.thumb span {
  font-size:10px; color:#5f7488;
  background:rgba(255,255,255,.75);
  border-radius:999px; padding:2px 8px;
}
.thumb.v {
  background:linear-gradient(135deg,#dde7f6 0%,#b9cbe4 50%,#e7eef8 100%);
}
.tcard .tn {
  font-size:11px; padding:6px 7px; font-weight:600;
  line-height:1.35;
}
.tcard .tm {
  font-size:10px; color:var(--muted);
  padding:0 7px 7px;
}
.tcard .tick {
  position:absolute; top:6px; left:6px;
  width:18px; height:18px; border-radius:50%;
  background:var(--blue); color:#fff;
  font-size:11px; line-height:18px; text-align:center;
  display:none;
}
.tcard.sel .tick { display:block; }
.pager {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; margin-top:9px; font-size:11px; color:var(--muted);
}
.hint {
  font-size:10.5px; color:var(--muted); margin-top:6px;
  line-height:1.5;
}
.socrow {
  border:1px solid var(--line); border-radius:12px;
  padding:8px 9px; margin-bottom:6px;
  display:flex; align-items:center; gap:8px; cursor:pointer;
}
.socrow.on {
  border-color:var(--blue); background:#f6faff;
}
.cbx {
  width:17px; height:17px; border-radius:5px;
  border:1.5px solid #b9cade; flex:0 0 auto;
  position:relative; background:#fff;
}
.socrow.on .cbx {
  background:var(--blue); border-color:var(--blue);
}
.socrow.on .cbx::after {
  content:"✓"; color:#fff; font-size:11px;
  position:absolute; top:0; left:3px;
}
.socrow .sn {
  font-size:12px; font-weight:600; flex:1;
}
.socrow .sn i {
  font-style:normal; display:block;
  font-weight:400; font-size:10.5px; color:var(--muted);
}
pre.prompt {
  background:#f7f9fc; border:1px solid var(--line);
  border-radius:10px; padding:8px 9px; font-size:10.5px;
  line-height:1.5; white-space:pre-wrap;
  color:#2b3c4e; margin-top:5px;
}
.prow {
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; margin-top:8px;
}
.prow b { font-size:11.5px; }
.inp {
  border:1px solid var(--line); border-radius:9px;
  padding:7px 9px; font:inherit; font-size:11.5px;
  width:100%; background:#fff;
}
.inp.mini {
  width:auto; padding:5px 7px; font-size:11px;
}
.legal {
  border:1px dashed #c9a83c; background:#fffdf3;
  border-radius:12px; padding:9px; font-size:11px; color:#5c4a10;
}
.legal em {
  font-style:normal; color:var(--gold); font-weight:700;
  display:block; margin-bottom:4px;
}
.legal.warnline {
  color:var(--bad); font-weight:700;
  margin-top:6px; border-top:1px dashed #c9a83c;
  padding-top:5px; display:block;
}
.drop {
  border:1.5px dashed #b9cade; border-radius:12px;
  padding:13px 11px; text-align:center;
  background:#f9fbfd; cursor:pointer;
}
.drop b {
  display:block; font-size:12.5px; color:var(--navy);
}
.drop span {
  font-size:10.5px; color:var(--muted);
}
.radio { display:flex; gap:7px; }
.ropt {
  flex:1; border:1px solid var(--line); border-radius:12px;
  padding:9px; cursor:pointer; background:#fff;
}
.ropt.on {
  border-color:var(--blue); background:#f6faff;
  box-shadow:0 0 0 2px var(--blue-soft);
}
.ropt b {
  display:block; font-size:12px;
}
.ropt span {
  font-size:10.5px; color:var(--muted);
  display:block; margin-top:2px; line-height:1.4;
}
.ropt .dot2 {
  width:15px; height:15px; border-radius:50%;
  border:1.5px solid #b9cade;
  display:inline-block; vertical-align:-3px; margin-right:5px;
}
.ropt.on .dot2 {
  border:4.5px solid var(--blue);
}
.mediaprev {
  border:1px solid var(--line); border-radius:12px;
  padding:9px; display:flex; gap:9px; align-items:center;
  background:#fff;
}
.mediaprev .ico {
  width:52px; height:52px; border-radius:10px;
  background:linear-gradient(135deg,#c9d9ea,#eef3f9);
  flex:0 0 auto; display:flex;
  align-items:center; justify-content:center;
  font-size:16px; color:#41607e;
}
.timebox {
  border:1px solid var(--line); border-radius:12px;
  padding:9px; margin-bottom:7px; background:#fff;
}
.timebox .th {
  display:flex; justify-content:space-between;
  font-size:12px; font-weight:700; margin-bottom:7px;
}
.timebox .th em {
  font-style:normal; font-size:10px; font-weight:400;
  color:var(--muted);
}
.tline {
  display:flex; gap:6px; align-items:center;
}
.recommend {
  background:var(--blue-soft); color:var(--navy);
  font-size:10.5px; border-radius:8px;
  padding:6px 8px; margin-top:7px;
}
.toast {
  position:absolute; left:50%; bottom:70px;
  transform:translate(-50%,10px); background:#12212f;
  color:#fff; font-size:11.5px; padding:8px 13px;
  border-radius:999px; opacity:0; pointer-events:none;
  transition:.2s; z-index:20; max-width:340px;
  text-align:center;
}
.toast.show {
  opacity:1; transform:translate(-50%,0);
}
/* review */
.qchip {
  display:none; position:absolute; top:-9px; right:-9px;
  width:19px; height:19px; border-radius:50%;
  background:#e2542b; color:#fff; font-size:10.5px;
  font-weight:700; line-height:19px; text-align:center;
  z-index:12; cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,.25);
}
body.review .q {
  outline:1.5px dashed #e2542b; outline-offset:2px;
  border-radius:12px;
}
body.review .qchip {
  display:block;
}
.qtip {
  display:none; position:absolute; top:14px; right:0;
  width:245px; background:#fff; border:1.5px solid #e2542b;
  border-radius:12px; padding:10px 11px; font-size:11px;
  color:#7a2a12; box-shadow:0 8px 22px rgba(0,0,0,.18);
  z-index:15; text-align:left; line-height:1.45;
}
.qtip.show { display:block; }
.qtip b {
  display:block; color:#e2542b; margin-bottom:3px;
  font-size:10.5px;
}
.legend {
  max-width:1400px; margin:22px auto 0;
  background:#fff; border:1px solid var(--line);
  border-radius:16px; padding:16px 18px; display:none;
}
body.review .legend { display:block; }
.legend h2 {
  font-size:15px; color:var(--navy); margin-bottom:8px;
}
.legend ol {
  margin-left:18px;
}
.legend li {
  font-size:12.5px; margin-bottom:6px;
  color:#2b3c4e;
}
.legend li b {
  color:#e2542b;
}
/* solo render mode */
body.solo {
  padding:0; background:#fff;
}
body.solo .pagehead,
body.solo .legend { display:none; }
body.solo .row { gap:0; max-width:none; }
body.solo .frameLabel { display:none; }
body.solo .screen {
  height:auto; min-height:800px;
}
body.solo .body {
  overflow:visible;
}
body.solo .qtip,
body.solo .qchip { display:none !important; }
