/* ════════════════════════════════════════════════════════════════
   ลุงซาเล้ง · ระบบทำคอนเทนต์
   โทน: ใบชั่งน้ำหนักของร้านรับซื้อ — กระดาษสะอาด หมึกน้ำเงินสำเนา ตรายางสถานะ เหลืองตาชั่งเฉพาะ "รอคุณ"
   ════════════════════════════════════════════════════════════════ */
:root{
  --bg:#F3F4F1; --surface:#FFFFFF; --sunk:#ECEEE9; --line:#D7DCD4; --line-2:#E7EAE4;
  --ink:#16201B; --ink-2:#3B4640; --ink-3:#5C6761;
  --blue:#2747A8; --blue-2:#1D3787; --blue-soft:#E8EDFA; --blue-line:#B9C6EE;
  --yellow:#F2B400; --yellow-soft:#FFF5D6; --yellow-ink:#5E4500;
  --green:#17784C; --green-soft:#E2F2E9; --red:#B42318; --red-soft:#FCEAE8;
  --r-lg:16px; --r:12px; --r-sm:9px;
  --shadow:0 1px 2px rgba(22,32,27,.05),0 6px 20px rgba(22,32,27,.07);
  --ui:"Noto Sans Thai",system-ui,-apple-system,"Segoe UI",sans-serif;
  --read:"Noto Sans Thai Looped","Noto Sans Thai",system-ui,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --tab-h:64px; --top-h:56px;
  /* สีเฉพาะจุด — แยกเป็นตัวแปรเพื่อให้โหมดมืดเปลี่ยนได้ครบ */
  --on-blue:#FFFFFF; --on-green:#FFFFFF; --on-red:#FFFFFF;
  --red-line:#F2C9C4; --red-2:#8F1C13; --green-2:#105C3A; --yellow-line:#F3DE9C; --wait-ink:#3A2B00;
  --muted-ink:#8A928D; --hover:#FAFBF9; --line-hover:#BFC6BC; --placeholder:#8C958F;
  --track:#C9CFC6; --knob:#FFFFFF; --grip:#A7AFA9; --chev:#B5BCB7;
  --glass:rgba(255,255,255,.96); --glass-2:rgba(255,255,255,.97);
  --scrim:rgba(18,26,22,.42); --sheet-shadow:0 -10px 40px rgba(0,0,0,.18);
  --toast-bg:#16201B; --toast-ink:#FFFFFF; --toast-act:rgba(255,255,255,.16); --toast-act-2:rgba(255,255,255,.28);
  --mark-bg:#16201B; --mark-ink:#FFFFFF; --star:#B58A00; --purple:#6B4FA0;
  --purple-soft:#EFEAF7; --purple-ink:#523B80; --seg-shadow:0 1px 2px rgba(0,0,0,.08); --knob-shadow:0 1px 3px rgba(0,0,0,.2); --toast-shadow:0 8px 28px rgba(0,0,0,.25);
  color-scheme:light;
}
/* โหมดมืด — เขียวเทาเข้ม (ไม่ดำสนิท อ่านนานไม่ล้าตา) · ฟ้าสว่างขึ้นให้ตัดกับพื้น */
:root[data-theme="dark"]{
  --bg:#0F1311; --surface:#171C19; --sunk:#202622; --line:#323A35; --line-2:#262D29;
  --ink:#E7ECE8; --ink-2:#C3CBC5; --ink-3:#98A39C;
  --blue:#8AA6F5; --blue-2:#A9BFFA; --blue-soft:#1B2645; --blue-line:#3A4E8C;
  --yellow:#F2B400; --yellow-soft:#2E260C; --yellow-ink:#F3D27A;
  --green:#5CC58F; --green-soft:#14291D; --red:#F28B80; --red-soft:#35191A;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
  --on-blue:#0B1430; --on-green:#06210F; --on-red:#2A0806;
  --red-line:#6B2A26; --red-2:#F6A69D; --green-2:#7FD6A8; --yellow-line:#5C4A12; --wait-ink:#2A1F00;
  --muted-ink:#7D8780; --hover:#1E2420; --line-hover:#4A534D; --placeholder:#6F7972;
  --track:#3D4540; --knob:#E7ECE8; --grip:#6F7972; --chev:#5E6862;
  --glass:rgba(23,28,25,.92); --glass-2:rgba(23,28,25,.95);
  --scrim:rgba(0,0,0,.6); --sheet-shadow:0 -10px 40px rgba(0,0,0,.5);
  --toast-bg:#E7ECE8; --toast-ink:#0F1311; --toast-act:rgba(0,0,0,.08); --toast-act-2:rgba(0,0,0,.16);
  --mark-bg:#E7ECE8; --mark-ink:#0F1311; --star:#E8BE45; --purple:#B9A2EC;
  --purple-soft:#251D36; --purple-ink:#CDBDF2; --seg-shadow:0 1px 2px rgba(0,0,0,.5); --knob-shadow:0 1px 3px rgba(0,0,0,.5); --toast-shadow:0 8px 28px rgba(0,0,0,.6);
  color-scheme:dark;
}
*{box-sizing:border-box}
html{font-size:17px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(min-width:1000px){html{font-size:16px}}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--ui);line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:var(--blue);text-decoration:none} a:hover{text-decoration:underline}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;padding:0}
img,svg{display:block}
h1,h2,h3,p{margin:0}
h1{font-size:1.45rem;line-height:1.35;font-weight:700;letter-spacing:-.005em}
h2{font-size:1.12rem;line-height:1.4;font-weight:700}
h3{font-size:1rem;line-height:1.45;font-weight:600}
@media(min-width:1000px){h1{font-size:1.7rem}}
:focus-visible{outline:3px solid var(--blue-line);outline-offset:2px;border-radius:6px}
::selection{background:var(--blue-soft)}

/* ───── utilities (เท่าที่ใช้จริง) ───── */
.muted{color:var(--ink-3)} .ink2{color:var(--ink-2)} .small{font-size:.9rem} .xs{font-size:.8rem}
.ok{color:var(--green)} .bad{color:var(--red)} .strong{font-weight:600}
.row{display:flex;align-items:center;gap:.6rem} .col{display:flex;flex-direction:column;gap:.75rem}
.wrap{flex-wrap:wrap} .between{justify-content:space-between} .start{align-items:flex-start} .grow{flex:1;min-width:0}
.gap-1{gap:.35rem} .gap-2{gap:.5rem} .gap-3{gap:.75rem} .gap-4{gap:1rem}
.mt-1{margin-top:.25rem} .mt-2{margin-top:.5rem} .mt-3{margin-top:.75rem} .mt-4{margin-top:1rem} .mt-5{margin-top:1.5rem} .mt-6{margin-top:2rem}
.mb-1{margin-bottom:.25rem} .mb-2{margin-bottom:.5rem} .mb-3{margin-bottom:.75rem} .mb-4{margin-bottom:1rem}
.truncate{overflow:hidden;white-space:nowrap;text-overflow:ellipsis} .nowrap{white-space:nowrap}
.clamp2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.clamp1{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.hide-mobile{display:none} @media(min-width:1000px){.hide-mobile{display:initial}.hide-desktop{display:none!important}}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ไอคอนขนาดเริ่มต้น — กฎเฉพาะด้านล่างทับได้ */
.ico svg{width:1.15em;height:1.15em}

/* ════════ shell ════════ */
.shell{min-height:100vh}
.side{display:none}
.topbar{position:sticky;top:0;z-index:30;height:var(--top-h);background:var(--glass);backdrop-filter:saturate(1.4) blur(8px);
  border-bottom:1px solid var(--line-2);display:flex;align-items:center;gap:.25rem;padding:0 .5rem 0 1rem;padding-top:env(safe-area-inset-top)}
.topbar .t{font-weight:700;font-size:1.05rem;flex:1;min-width:0}
.topbar .back{display:flex;align-items:center;gap:.15rem;color:var(--ink-2);font-weight:500;padding:.5rem .4rem .5rem 0;margin-left:-.4rem}
.topbar .back svg{width:24px;height:24px}
.main{padding:1rem 1rem calc(var(--tab-h) + 2rem + env(safe-area-inset-bottom));max-width:1120px;margin:0 auto}
.main.focus{padding-bottom:calc(7rem + env(safe-area-inset-bottom))}
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--surface);border-top:1px solid var(--line-2);
  display:grid;grid-template-columns:repeat(5,1fr);padding-bottom:env(safe-area-inset-bottom)}
.tabbar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.15rem;height:var(--tab-h);color:var(--ink-3);font-size:.78rem;font-weight:500;text-decoration:none}
.tabbar a svg{width:24px;height:24px} .tabbar a.on{color:var(--blue);font-weight:700}
.tabbar a .dot{position:absolute;margin:-18px 0 0 22px;width:9px;height:9px;border-radius:9px;background:var(--yellow);box-shadow:0 0 0 2px var(--surface)}
@media(min-width:1000px){
  .shell{display:grid;grid-template-columns:248px 1fr}
  .side{display:flex;flex-direction:column;position:sticky;top:0;height:100vh;background:var(--surface);border-right:1px solid var(--line-2);padding:1.25rem .9rem}
  .side .brand{display:flex;align-items:center;gap:.6rem;font-weight:700;font-size:1.15rem;padding:0 .55rem 1.25rem}
  .side nav a{display:flex;align-items:center;gap:.7rem;padding:.6rem .7rem;border-radius:var(--r-sm);color:var(--ink-2);font-weight:500;text-decoration:none;position:relative}
  .side nav a svg{width:20px;height:20px} .side nav a:hover{background:var(--sunk)}
  .side nav a.on{background:var(--blue-soft);color:var(--blue-2);font-weight:700}
  .side nav a .dot{width:8px;height:8px;border-radius:8px;background:var(--yellow);margin-left:auto}
  .side .foot{margin-top:auto;padding:.75rem .55rem 0;border-top:1px solid var(--line-2);font-size:.88rem;color:var(--ink-3)}
  .topbar,.tabbar{display:none}
  .main,.main.focus{padding:2rem 2.5rem 4rem}
}
.mark{width:30px;height:30px;border-radius:8px;background:var(--mark-bg);color:var(--mark-ink);display:grid;place-items:center;font-weight:700;font-size:.95rem}

/* ════════ page header ════════ */
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1.1rem}
.page-head .sub{color:var(--ink-3);margin-top:.2rem}
.crumb{display:inline-flex;align-items:center;gap:.2rem;color:var(--ink-3);font-size:.92rem;font-weight:500;margin-bottom:.35rem;text-decoration:none}
.crumb svg{width:18px;height:18px} .crumb:hover{color:var(--ink);text-decoration:none}

/* ════════ buttons ════════ */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:46px;padding:0 1.15rem;border-radius:var(--r);
  font-weight:600;background:var(--blue);color:var(--on-blue);white-space:nowrap;text-decoration:none;transition:background .12s,box-shadow .12s;user-select:none}
.btn:hover{background:var(--blue-2);text-decoration:none} .btn:active{transform:translateY(1px)}
.btn svg{width:19px;height:19px;flex-shrink:0}
.btn:disabled,.btn[aria-disabled=true]{opacity:.45;pointer-events:none}
.btn.secondary{background:var(--surface);color:var(--ink);border:1.5px solid var(--line)} .btn.secondary:hover{background:var(--sunk)}
.btn.ghost{background:transparent;color:var(--ink-2)} .btn.ghost:hover{background:var(--sunk)}
.btn.danger{background:var(--surface);color:var(--red);border:1.5px solid var(--red-line)} .btn.danger:hover{background:var(--red-soft)}
.btn.danger-solid{background:var(--red)} .btn.danger-solid:hover{background:var(--red-2)}
.btn.ok{background:var(--green)} .btn.ok:hover{background:var(--green-2)}
.btn.sm{min-height:38px;padding:0 .85rem;font-size:.92rem;border-radius:var(--r-sm)} .btn.sm svg{width:17px;height:17px}
.btn.lg{min-height:54px;font-size:1.05rem;padding:0 1.4rem}
.btn.block{width:100%}
.icon-btn{width:42px;height:42px;display:inline-grid;place-items:center;border-radius:var(--r-sm);color:var(--ink-2)} .icon-btn:hover{background:var(--sunk)}
.icon-btn svg{width:22px;height:22px}
.link-btn{color:var(--blue);font-weight:600} .link-btn:hover{text-decoration:underline}

/* ════════ status stamp (ตรายาง) ════════ */
.stamp{display:inline-flex;align-items:center;gap:.3rem;padding:.12rem .55rem;border:2px solid currentColor;border-radius:6px;
  font-size:.82rem;font-weight:700;line-height:1.35;transform:rotate(-2deg);white-space:nowrap;background:var(--surface)}
.stamp.draft{color:var(--ink-3)} .stamp.approved{color:var(--blue)} .stamp.published{color:var(--green)} .stamp.archived{color:var(--muted-ink);border-style:dashed}
.stamp.wait{color:var(--yellow-ink);background:var(--yellow-soft);border-color:var(--yellow)} .stamp.failed{color:var(--red)} .stamp.running{color:var(--blue)}
.stamp.hard{color:var(--red)} .stamp.soft{color:var(--ink-3)}
.chip{display:inline-flex;align-items:center;gap:.3rem;padding:.18rem .6rem;border-radius:999px;font-size:.84rem;font-weight:500;background:var(--sunk);color:var(--ink-2);white-space:nowrap}
.chip.ok{background:var(--green-soft);color:var(--green)} .chip.bad{background:var(--red-soft);color:var(--red)} .chip.blue{background:var(--blue-soft);color:var(--blue-2)}
.chip.yellow{background:var(--yellow-soft);color:var(--yellow-ink)}
.chip svg{width:14px;height:14px}

/* ════════ surfaces ════════ */
.panel{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r-lg)}
.panel.pad{padding:1.1rem 1.15rem} @media(min-width:1000px){.panel.pad{padding:1.35rem 1.5rem}}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.75rem}
.section{margin-top:1.75rem} .section>.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;margin-bottom:.6rem}
.section-head h2 .count{font-weight:500;color:var(--ink-3);margin-left:.35rem}

.list{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r-lg);overflow:hidden}
.list>.item{display:flex;align-items:center;gap:.85rem;padding:.9rem 1.1rem;border-bottom:1px solid var(--line-2);color:inherit;text-decoration:none;min-height:60px}
.list>.item:last-child{border-bottom:0}
.list>a.item:hover,.list>button.item:hover,.list>.item.click:hover{background:var(--hover);text-decoration:none}
.list>button.item{width:100%;text-align:left}
.item .title{font-weight:600;line-height:1.45} .item .meta{font-size:.86rem;color:var(--ink-3);margin-top:.15rem;display:flex;flex-wrap:wrap;gap:.2rem .7rem}
.item .chev{color:var(--line);width:20px;height:20px;flex-shrink:0}
.item.off{opacity:.55}

.attention{display:block;background:var(--surface);border:1px solid var(--line-2);border-left:6px solid var(--yellow);border-radius:var(--r-lg);padding:1rem 1.15rem;color:inherit;text-decoration:none}
.attention:hover{box-shadow:var(--shadow);text-decoration:none}
.attention .kicker{display:flex;align-items:center;gap:.4rem;font-size:.86rem;font-weight:700;color:var(--yellow-ink)}
.attention.failed{border-left-color:var(--red)} .attention.failed .kicker{color:var(--red)}
.attention.running{border-left-color:var(--blue-line)} .attention.running .kicker{color:var(--blue)}

.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem;padding:2.2rem 1rem;color:var(--ink-3)}
.empty svg{width:40px;height:40px;color:var(--line)} .empty .t{color:var(--ink-2);font-weight:600}
.loading{display:grid;place-items:center;padding:3rem}
.spin{display:inline-block;width:20px;height:20px;border:3px solid var(--line);border-top-color:var(--blue);border-radius:50%;animation:spin .9s linear infinite;flex-shrink:0}
.spin.lg{width:36px;height:36px;border-width:4px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ════════ reading ════════ */
.reading{font-family:var(--read);font-size:1.12rem;line-height:1.85;color:var(--ink);white-space:pre-wrap;word-break:break-word;max-width:40em}
@media(min-width:1000px){.reading{font-size:1.1rem}}
.reading.box{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r-lg);padding:1.1rem 1.2rem;max-width:none}
@media(min-width:1000px){.reading.box{padding:1.4rem 1.6rem}}
.reading.empty-text{color:var(--ink-3);font-style:normal}
.prose{font-family:var(--read);font-size:1.06rem;line-height:1.8;color:var(--ink);max-width:42em;word-break:break-word}
.prose>*:first-child{margin-top:0} .prose>*:last-child{margin-bottom:0}
.prose h1,.prose h2,.prose h3,.prose h4{font-family:var(--ui);margin:1.2em 0 .45em;line-height:1.4}
.prose h1{font-size:1.25rem} .prose h2{font-size:1.15rem} .prose h3,.prose h4{font-size:1.04rem}
.prose p{margin:.55em 0} .prose ul,.prose ol{margin:.5em 0;padding-left:1.35em} .prose li{margin:.3em 0} .prose li::marker{color:var(--ink-3)}
.prose strong{font-weight:600;color:var(--ink)} .prose blockquote{margin:.7em 0;padding:.2em 0 .2em 1em;border-left:3px solid var(--line);color:var(--ink-2)}
.prose code{font-family:var(--mono);font-size:.86em;background:var(--sunk);padding:.1em .35em;border-radius:5px}
.prose pre{background:var(--sunk);padding:.75em .9em;border-radius:var(--r-sm);overflow-x:auto;white-space:pre-wrap}
.prose pre code{background:none;padding:0}
.prose hr{border:0;border-top:1px solid var(--line);margin:1.2em 0}
.prose table{border-collapse:collapse;width:100%;font-size:.95rem;display:block;overflow-x:auto} .prose th,.prose td{border:1px solid var(--line);padding:.4em .6em;text-align:left;vertical-align:top}
.prose th{background:var(--sunk);font-family:var(--ui);font-weight:600}
.prose a{word-break:break-all}
.prose.compact{font-size:.98rem;line-height:1.7}

/* ════════ forms ════════ */
.field{display:block;margin-bottom:1rem}
.field>.lbl{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;font-size:.92rem;font-weight:600;color:var(--ink-2);margin-bottom:.35rem}
.field>.lbl .opt{font-weight:400;color:var(--ink-3)}
.field>.help{display:block;font-size:.84rem;color:var(--ink-3);margin-top:.35rem;line-height:1.5}
input[type=text],input[type=url],input[type=password],input[type=number],input[type=search],input[type=time],select,textarea{
  width:100%;background:var(--surface);border:1.5px solid var(--line);border-radius:var(--r-sm);padding:.62rem .8rem;
  font:inherit;font-size:1rem;color:var(--ink);min-height:46px;transition:border-color .12s,box-shadow .12s;appearance:none}
select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235C6761' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .6rem center;padding-right:2.2rem}
textarea{line-height:1.7;resize:vertical;min-height:120px}
textarea.reading-edit{font-family:var(--read);font-size:1.08rem;line-height:1.85;padding:1rem 1.1rem}
textarea.prompt{font-size:.95rem;line-height:1.65}
input:hover,select:hover,textarea:hover{border-color:var(--line-hover)}
input:focus,select:focus,textarea:focus{outline:0;border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft)}
input::placeholder,textarea::placeholder{color:var(--placeholder)}
.search{position:relative} .search svg{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);width:19px;height:19px;color:var(--ink-3);pointer-events:none}
.search input{padding-left:2.4rem}
.check{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;user-select:none}
.check input{width:20px;height:20px;accent-color:var(--blue);margin:0}
.pills{display:flex;flex-wrap:wrap;gap:.45rem}
.pill{display:inline-flex;align-items:center;gap:.35rem;padding:.38rem .8rem;border:1.5px solid var(--line);border-radius:999px;background:var(--surface);font-size:.92rem;cursor:pointer;user-select:none}
.pill input{display:none} .pill.on{border-color:var(--blue);background:var(--blue-soft);color:var(--blue-2);font-weight:600}
.pill .n{font-size:.78rem;color:var(--ink-3);font-weight:500}
.switch{position:relative;display:inline-flex;align-items:center;gap:.6rem;cursor:pointer;user-select:none}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch .track{width:44px;height:26px;border-radius:26px;background:var(--track);position:relative;transition:background .15s;flex-shrink:0}
.switch .track::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--knob);box-shadow:var(--knob-shadow);transition:transform .15s}
.switch input:checked+.track{background:var(--green)} .switch input:checked+.track::after{transform:translateX(18px)}
.switch input:focus-visible+.track{box-shadow:0 0 0 3px var(--blue-soft)}
.form-row{display:grid;gap:0 .9rem;grid-template-columns:1fr} @media(min-width:640px){.form-row.two{grid-template-columns:1fr 1fr}.form-row.three{grid-template-columns:1fr 1fr 1fr}}

/* ════════ segmented + tabs ════════ */
.seg{display:inline-flex;background:var(--sunk);border-radius:var(--r);padding:4px;gap:2px;max-width:100%;overflow-x:auto;scrollbar-width:none}
.seg::-webkit-scrollbar{display:none}
.seg button{padding:.42rem .9rem;border-radius:9px;font-weight:500;color:var(--ink-2);white-space:nowrap;font-size:.95rem}
.seg button.on{background:var(--surface);color:var(--ink);font-weight:700;box-shadow:var(--seg-shadow)}
.seg button .n{color:var(--ink-3);font-weight:500;margin-left:.25rem;font-size:.85em}
.tabs{display:flex;gap:.2rem;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none;margin-bottom:1rem}
.tabs::-webkit-scrollbar{display:none}
.tabs button{padding:.65rem .9rem;font-weight:600;color:var(--ink-3);border-bottom:3px solid transparent;margin-bottom:-1px;white-space:nowrap}
.tabs button.on{color:var(--ink);border-bottom-color:var(--blue)} .tabs button:hover{color:var(--ink)}
.tabs button .n{font-weight:500;color:var(--ink-3);font-size:.85em;margin-left:.2rem}
.toolbar{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-bottom:1rem}
.toolbar .search{flex:1;min-width:200px}

/* ════════ checks row ════════ */
.checks{display:flex;flex-wrap:wrap;gap:.4rem}

/* ════════ action bar ════════ */
.actionbar{position:fixed;left:0;right:0;bottom:0;z-index:25;background:var(--glass-2);backdrop-filter:blur(8px);border-top:1px solid var(--line-2);
  padding:.7rem 1rem calc(.7rem + env(safe-area-inset-bottom));display:flex;gap:.6rem;align-items:center}
.actionbar .btn{flex:1}
.actionbar .btn.secondary,.actionbar .btn.ghost{flex:0 0 auto}
@media(min-width:1000px){.actionbar{position:sticky;bottom:1rem;border:1px solid var(--line-2);border-radius:var(--r-lg);box-shadow:var(--shadow);margin-top:1.25rem;padding:.75rem}
  .actionbar .btn{flex:0 0 auto}}

/* ════════ work page ════════ */
.layout-2{display:grid;gap:1.25rem;grid-template-columns:minmax(0,1fr)}
@media(min-width:1000px){.layout-2{grid-template-columns:minmax(0,1fr) 320px;gap:2rem;align-items:start}
  .layout-2>aside{position:sticky;top:1.5rem}}
.progress{display:flex;align-items:center;gap:.75rem;margin:.6rem 0 1.25rem}
.progress .bar{flex:1;height:8px;border-radius:8px;background:var(--sunk);overflow:hidden}
.progress .bar>i{display:block;height:100%;background:var(--blue);border-radius:8px;transition:width .4s}
.progress .lbl{font-size:.9rem;color:var(--ink-2);font-weight:600;white-space:nowrap}
.steps{list-style:none;margin:0;padding:0}
.steps>li{border-bottom:1px solid var(--line-2)} .steps>li:last-child{border-bottom:0}
.step-row{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;padding:.75rem .2rem}
.step-row .ic{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;background:var(--sunk);color:var(--ink-3);font-size:.82rem;font-weight:700}
.step-row .ic svg{width:16px;height:16px}
.step-row.done .ic{background:var(--green-soft);color:var(--green)} .step-row.wait .ic{background:var(--yellow);color:var(--wait-ink)}
.step-row.now .ic{background:var(--blue-soft);color:var(--blue)} .step-row.error .ic{background:var(--red-soft);color:var(--red)}
.step-row .nm{font-weight:600;line-height:1.35} .step-row .sb{font-size:.84rem;color:var(--ink-3)}
.step-body{padding:0 .2rem 1rem 2.6rem}
.idea{display:block;background:var(--surface);border:2px solid var(--line-2);border-radius:var(--r-lg);padding:1rem 1.1rem;cursor:pointer;transition:border-color .12s,box-shadow .12s;text-align:left;width:100%}
.idea:hover{border-color:var(--line)} .idea.on{border-color:var(--blue);box-shadow:0 0 0 4px var(--blue-soft)}
.idea .top{display:flex;gap:.75rem;align-items:flex-start}
.idea .num{width:30px;height:30px;border-radius:50%;border:2px solid var(--line);display:grid;place-items:center;font-weight:700;color:var(--ink-3);flex-shrink:0;font-size:.95rem}
.idea.on .num{background:var(--blue);border-color:var(--blue);color:var(--on-blue)}
.idea .ttl{font-weight:700;font-size:1.08rem;line-height:1.4}
.idea .hook{font-family:var(--read);margin-top:.5rem;padding:.55rem .8rem;background:var(--sunk);border-radius:var(--r-sm);font-size:1rem;line-height:1.65}
.idea .fields{margin:.6rem 0 0;display:grid;gap:.45rem}
.idea .fields>div{font-family:var(--read);font-size:1rem;line-height:1.7}
.idea .fields b{font-family:var(--ui);font-weight:600;color:var(--ink-2);font-size:.88rem;display:block;line-height:1.4}
.note-box{background:var(--yellow-soft);border:1px solid var(--yellow-line);border-radius:var(--r);padding:.75rem .9rem;font-size:.95rem;color:var(--yellow-ink)}
.info-box{background:var(--blue-soft);border-radius:var(--r);padding:.75rem .9rem;font-size:.95rem;color:var(--blue-2)}
.big-state{text-align:center;padding:2.5rem 1rem}
.big-state .t{font-size:1.15rem;font-weight:700;margin-top:1rem}

/* ════════ editors ════════ */
.edit-wrap{position:relative}
.edit-tools{display:flex;align-items:center;gap:.4rem;margin-bottom:.55rem}
.counter{font-size:.82rem;color:var(--ink-3);font-variant-numeric:tabular-nums}
.counter.over{color:var(--red);font-weight:700}
.kv{display:grid;grid-template-columns:auto 1fr;gap:.45rem 1rem;font-size:.92rem} .kv dt{color:var(--ink-3)} .kv dd{margin:0;min-width:0;overflow-wrap:anywhere}
.drag-handle{cursor:grab;color:var(--grip);touch-action:none;padding:.6rem .5rem;margin:-.4rem 0 -.4rem -.5rem;display:grid;place-items:center;border-radius:8px}
.drag-handle:hover{background:var(--sunk);color:var(--ink-2)} .drag-handle svg{width:20px;height:20px} .drag-handle svg{width:20px;height:20px}
.sortable-ghost{opacity:.35;background:var(--blue-soft)!important}
.num-badge{width:26px;height:26px;border-radius:50%;background:var(--sunk);color:var(--ink-2);display:grid;place-items:center;font-size:.82rem;font-weight:700;flex-shrink:0}
.ph-chips{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.45rem}
.ph-chips button{font-family:var(--mono);font-size:.78rem;padding:.15rem .45rem;border-radius:6px;background:var(--sunk);color:var(--ink-2)} .ph-chips button:hover{background:var(--blue-soft);color:var(--blue-2)}
.table{width:100%;border-collapse:collapse} .table th{font-size:.84rem;color:var(--ink-3);font-weight:600;text-align:left;padding:.35rem .4rem}
.table td{padding:.3rem .4rem;vertical-align:middle} .table input{min-height:40px}

/* ════════ sheet / dialog ════════ */
.overlay{position:fixed;inset:0;z-index:50;background:var(--scrim);display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
@keyframes fade{from{opacity:0}}
.sheet{background:var(--surface);width:100%;max-height:92vh;display:flex;flex-direction:column;border-radius:20px 20px 0 0;box-shadow:var(--sheet-shadow);animation:up .2s ease-out}
@keyframes up{from{transform:translateY(24px);opacity:.6}}
.sheet>header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.9rem .6rem .5rem 1.15rem}
.sheet>header h2{font-size:1.12rem}
.sheet>.body{overflow-y:auto;padding:.4rem 1.15rem 1rem;-webkit-overflow-scrolling:touch}
.sheet>footer{display:flex;gap:.6rem;padding:.75rem 1.15rem calc(.75rem + env(safe-area-inset-bottom));border-top:1px solid var(--line-2)}
.sheet>footer .btn{flex:1} .sheet>footer .btn.ghost,.sheet>footer .btn.danger{flex:0 0 auto}
.sheet.wide{max-width:none}
@media(min-width:760px){.overlay{align-items:center;padding:2rem}
  .sheet{max-width:600px;border-radius:var(--r-lg);max-height:86vh}
  .sheet.wide{max-width:900px}
  .sheet>footer{padding-bottom:.9rem}}
.sheet .grabber{width:40px;height:5px;border-radius:5px;background:var(--line);margin:.5rem auto 0}
@media(min-width:760px){.sheet .grabber{display:none}}
.menu{position:absolute;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);min-width:220px;padding:.35rem;z-index:40}
.menu button,.menu a{display:flex;align-items:center;gap:.6rem;width:100%;padding:.65rem .75rem;border-radius:8px;text-align:left;color:var(--ink);font-weight:500;text-decoration:none}
.menu button:hover,.menu a:hover{background:var(--sunk);text-decoration:none} .menu svg{width:19px;height:19px;color:var(--ink-3)}
.menu .danger{color:var(--red)} .menu .danger svg{color:var(--red)} .menu hr{border:0;border-top:1px solid var(--line-2);margin:.3rem .2rem}
.menu-wrap{position:relative}

/* ════════ toast ════════ */
.toast{position:fixed;left:50%;bottom:calc(var(--tab-h) + 1rem + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:70;
  background:var(--toast-bg);color:var(--toast-ink);padding:.75rem 1.1rem;border-radius:var(--r);font-weight:500;box-shadow:var(--toast-shadow);max-width:calc(100vw - 2rem);
  display:flex;align-items:center;gap:.5rem;animation:up .18s ease-out}
.toast.bad{background:var(--red)} .toast svg{width:19px;height:19px}
.focus-route .toast{bottom:calc(6rem + env(safe-area-inset-bottom))}
@media(min-width:1000px){.toast,.focus-route .toast{bottom:2rem;left:auto;right:2rem;transform:none}}

/* ════════ login ════════ */
.login{min-height:100vh;display:grid;place-items:center;padding:1.5rem}
.login .box{width:100%;max-width:380px}

@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ════════ เพิ่มเติม ════════ */
.shell.bare{display:block}
@media(max-width:999px){.crumb{display:none}}
.title-edit{font:inherit;font-size:1.4rem;font-weight:700;line-height:1.35;border:1.5px solid transparent;background:transparent;padding:.1rem .35rem;margin-left:-.4rem;width:calc(100% + .4rem);min-height:0;resize:none;border-radius:8px;color:var(--ink);overflow:hidden}
.title-edit:hover{border-color:var(--line)} .title-edit:focus{background:var(--surface);border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft)}
@media(min-width:1000px){.title-edit{font-size:1.65rem}}
.agent-grid{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr)}
@media(min-width:1000px){.agent-grid{grid-template-columns:380px minmax(0,1fr);gap:1.5rem;align-items:start}}
.settings{max-width:820px}
.job{padding-bottom:1rem;border-bottom:1px solid var(--line-2)} .job:last-child{padding-bottom:0;border-bottom:0}
.item.start{align-items:flex-start}
.list>.item .title .muted{font-weight:400}
button.item:disabled{opacity:.6}
.panel-head h2 .ico svg,.panel-head h2 svg{width:22px;height:22px;color:var(--ink-3)}

.num-badge svg{width:15px;height:15px}
@media(max-width:999px){.main{padding-top:calc(1rem + env(safe-area-inset-top))}}
.table th{white-space:nowrap}
.inline-gap{display:inline-flex;flex-wrap:wrap;gap:0 .4rem;align-items:baseline}
.mark{font-family:var(--read);font-size:1rem}

.toast-act{margin-left:.6rem;padding:.2rem .65rem;border-radius:8px;background:var(--toast-act);color:var(--toast-ink);font-weight:700}
.toast-act:hover{background:var(--toast-act-2)}
.x-btn{width:38px;height:38px;display:inline-grid;place-items:center;border-radius:var(--r-sm);color:var(--ink-3);flex-shrink:0}
.x-btn:hover{background:var(--red-soft);color:var(--red)} .x-btn svg{width:19px;height:19px}
.sel{width:22px;height:22px;accent-color:var(--blue);flex-shrink:0;margin:0}
.item.picked{background:var(--blue-soft)}
.choice-list{display:flex;flex-direction:column;gap:.6rem}
.choice-btn{display:flex;gap:.8rem;align-items:flex-start;text-align:left;width:100%;padding:.85rem 1rem;border:1.5px solid var(--line);border-radius:var(--r);background:var(--surface)}
.choice-btn:hover{border-color:var(--blue);background:var(--blue-soft)} .choice-btn.danger:hover{border-color:var(--red);background:var(--red-soft)}
.choice-btn .ico svg{width:22px;height:22px;color:var(--ink-3);margin-top:.1rem} .choice-btn.danger .ico svg,.choice-btn.danger .strong{color:var(--red)}
.attention .acts{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.ev{display:flex;align-items:flex-start;gap:.9rem;padding:.75rem 0;border-bottom:1px solid var(--line-2)} .ev:last-child{border-bottom:0}
.toast{width:max-content;max-width:calc(100vw - 2rem)}
.toast-act{white-space:nowrap;flex-shrink:0}
fieldset{border:0;padding:0;margin:0;min-width:0}
.switch input:disabled+.track{opacity:.45;cursor:not-allowed} .switch:has(input:disabled){cursor:not-allowed}
fieldset:disabled input,fieldset:disabled textarea,fieldset:disabled select{background:var(--sunk);color:var(--ink-2)}

.metric-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
.metric-grid>div{background:var(--sunk);border-radius:var(--r-sm);padding:.55rem .6rem;display:flex;flex-direction:column}
.metric-grid b{font-size:1.15rem;line-height:1.2;font-variant-numeric:tabular-nums} .metric-grid span{font-size:.78rem;color:var(--ink-3)}
.num-badge{font-family:var(--read)}

.tab-link{padding:.65rem .9rem;font-weight:600;color:var(--ink-3);border-bottom:3px solid transparent;margin-bottom:-1px;white-space:nowrap;text-decoration:none}
.tab-link.on{color:var(--ink);border-bottom-color:var(--blue)} .tab-link:hover{color:var(--ink);text-decoration:none}

.bars{display:flex;flex-direction:column;gap:.45rem}
.bar-row{display:grid;grid-template-columns:minmax(4.5rem,8rem) 1fr auto;gap:.6rem;align-items:center;font-size:.92rem}
.bar-row .bl{color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar-row .bt{height:12px;background:var(--sunk);border-radius:6px;overflow:hidden}
.bar-row .bt i{display:block;height:100%;background:var(--blue);border-radius:6px}
.bar-row .bv{font-variant-numeric:tabular-nums;font-weight:600;white-space:nowrap} .bar-row .bv small{font-weight:400;color:var(--ink-3);margin-left:.3rem}
.bar-row.dim .bt i{background:var(--line)} .bar-row.dim .bv{color:var(--ink-3);font-weight:400}
.kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:.6rem} @media(min-width:760px){.kpis{grid-template-columns:repeat(4,1fr)}}
.kpi{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r);padding:.8rem .9rem;display:flex;flex-direction:column;gap:.1rem}
.kpi span{font-size:.84rem;color:var(--ink-3)} .kpi b{font-size:1.5rem;line-height:1.2;font-variant-numeric:tabular-nums} .kpi em{font-style:normal;font-size:.84rem;font-weight:600}
.grid-2{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr)} @media(min-width:900px){.grid-2{grid-template-columns:1fr 1fr}}

@media(max-width:600px){.tabs button,.tab-link{padding:.6rem .5rem;font-size:.93rem}.tabs{gap:0}}

/* ปุ่มสีบนพื้นสี + คลาสแทนสีที่เคยเขียนตรงในหน้าจอ */
.btn.ok{color:var(--on-green)} .btn.danger-solid{color:var(--on-red)}
.danger-line{border-color:var(--red-line)!important} .stars{color:var(--star);letter-spacing:.05em} .chev{color:var(--chev)}
.purple{color:var(--purple)} .attention.learn{border-left-color:var(--purple)}
.toast svg{color:inherit}

.theme-btn{display:inline-flex;align-items:center;gap:.3rem;font-size:.8rem;color:var(--ink-3);padding:.15rem .4rem;border-radius:6px}
.theme-btn:hover{background:var(--sunk);color:var(--ink)} .theme-btn svg{width:15px;height:15px}
.seg button svg{width:15px;height:15px;display:inline-block;vertical-align:-2px;margin-right:.25rem}

/* ════════ แดชบอร์ด ════════ */
.alerts{display:flex;flex-direction:column;gap:.5rem}
.alert-row{display:flex;align-items:center;gap:.75rem;padding:.75rem .9rem;border-radius:var(--r);background:var(--surface);border:1px solid var(--line-2);border-left:5px solid var(--blue);color:inherit;text-decoration:none}
.alert-row:hover{background:var(--hover);text-decoration:none}
.alert-row .ai{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--blue-soft);color:var(--blue);flex-shrink:0} .alert-row .ai svg{width:18px;height:18px}
.alert-row.bad{border-left-color:var(--red)} .alert-row.bad .ai{background:var(--red-soft);color:var(--red)}
.alert-row.warn{border-left-color:var(--yellow)} .alert-row.warn .ai{background:var(--yellow-soft);color:var(--yellow-ink)}
.alert-row.learn{border-left-color:var(--purple)} .alert-row.learn .ai{color:var(--purple)}
.all-good{display:flex;align-items:center;gap:.5rem;padding:.7rem .9rem;border-radius:var(--r);background:var(--green-soft);color:var(--green);font-weight:600} .all-good svg{width:18px;height:18px}
.pipe{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem}
.pipe-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:.7rem .4rem;border-radius:var(--r);background:var(--surface);border:1px solid var(--line-2);color:inherit;text-decoration:none;text-align:center}
.pipe-tile:hover{border-color:var(--blue-line);text-decoration:none} .pipe-tile b{font-size:1.45rem;line-height:1.2;font-variant-numeric:tabular-nums} .pipe-tile span{font-size:.8rem;color:var(--ink-3);line-height:1.3}
.pipe-tile.hot{border-color:var(--yellow);background:var(--yellow-soft)} .pipe-tile.hot span{color:var(--yellow-ink);font-weight:600}
.vbars{display:grid;grid-template-columns:repeat(14,1fr);gap:4px;height:96px;align-items:end}
.vb{display:flex;flex-direction:column;align-items:center;height:100%;justify-content:flex-end;gap:3px}
.vb i{display:block;width:100%;max-width:22px;background:var(--blue);border-radius:4px 4px 2px 2px;min-height:0} .vb i.zero{height:3px!important;background:var(--line)}
.vb span{font-size:.68rem;color:var(--ink-3);line-height:1}
.dash-grid{display:grid;gap:1.5rem;grid-template-columns:minmax(0,1fr)} @media(min-width:1000px){.dash-grid{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}}
.sys-row{display:flex;align-items:flex-start;gap:.65rem;padding:.5rem 0;border-bottom:1px solid var(--line-2)} .sys-row:last-child{border-bottom:0}
.dot-s{width:10px;height:10px;border-radius:50%;background:var(--line);margin-top:.45rem;flex-shrink:0}
.dot-s.ok{background:var(--green)} .dot-s.bad{background:var(--red)} .dot-s.run{background:var(--yellow)}
.section-head h2 .count{margin-left:.4rem;font-size:.9rem;color:var(--ink-3);font-weight:500}

.mark svg{width:20px;height:20px}

.ph-warn{margin-top:.5rem;padding:.5rem .7rem;border-radius:var(--r-sm);background:var(--red-soft);color:var(--red);font-size:.88rem}
.ph-legend{margin-top:.6rem} .ph-legend summary{cursor:pointer;font-size:.88rem;color:var(--blue);font-weight:600}
.ph-legend table{width:100%;border-collapse:collapse;margin-top:.5rem;font-size:.9rem}
.ph-legend td{padding:.45rem .3rem;border-top:1px solid var(--line-2);vertical-align:top} .ph-legend td:first-child{width:1%;white-space:nowrap;padding-right:.8rem}
.ph-legend code{font-family:var(--mono);font-size:.84rem;background:var(--sunk);padding:.1rem .35rem;border-radius:5px}
.prompt-view{white-space:pre-wrap;word-break:break-word;font-family:var(--mono);font-size:.82rem;line-height:1.55;background:var(--sunk);border:1px solid var(--line-2);border-radius:var(--r-sm);padding:.8rem;max-height:55vh;overflow:auto;margin:0}

.sortable-ghost{opacity:.35} .sortable-chosen{background:var(--blue-soft)}
.sortable-drag{box-shadow:var(--shadow);background:var(--surface);border-radius:var(--r);opacity:.95}
.move-btns{display:flex;gap:.25rem} .move-btns .icon-btn{width:42px;height:42px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.move-btns .icon-btn:disabled{opacity:.3} .move-btns svg{width:20px;height:20px}
@media(max-width:600px){.hide-sm{display:none}}

/* แหล่งข่าว: สถานะต่อแหล่ง */
.feed-line{display:flex;align-items:flex-start;gap:.4rem;font-size:.86rem;color:var(--ink-3);margin-top:.15rem;line-height:1.45}
.feed-line .dot,.feed-last .dot{width:8px;height:8px;border-radius:50%;background:var(--line);flex-shrink:0;margin-top:.45rem}
.st-ok .dot{background:var(--green)} .st-fallback .dot{background:var(--blue)} .st-quiet .dot{background:var(--yellow)} .st-fail .dot{background:var(--red)}
.feed-line.st-fail{color:var(--red)} .feed-line.st-quiet{color:var(--yellow-ink)} .feed-line.st-fallback{color:var(--blue-2)} .feed-line.st-ok{color:var(--green)}
.feed-last{display:flex;gap:.55rem;align-items:flex-start;padding:.65rem .8rem;border-radius:var(--r);background:var(--sunk);font-size:.92rem}
.feed-test{padding:.75rem .9rem;border-radius:var(--r);font-size:.95rem;background:var(--sunk);border:1px solid var(--line-2)}
.feed-test.st-ok{background:var(--green-soft);border-color:transparent;color:var(--green-2)}
.feed-test.st-fallback{background:var(--blue-soft);border-color:transparent;color:var(--blue-2)}
.feed-test.st-quiet{background:var(--yellow-soft);border-color:var(--yellow-line);color:var(--yellow-ink)}
.feed-test.st-fail{background:var(--red-soft);border-color:var(--red-line);color:var(--red-2)}
.feed-test .btn.secondary{background:var(--surface)}
/* เลือกโพสต์จากเพจ */
.fbpost{display:block;width:100%;padding:.7rem .8rem;border:1px solid var(--line-2);border-radius:var(--r-sm);background:var(--surface);color:inherit;font:inherit;cursor:pointer}
.fbpost:hover:not(:disabled){border-color:var(--blue)} .fbpost.sug{border-color:var(--blue);background:var(--blue-soft)}
.fbpost.cur{border-color:var(--green);opacity:.8;cursor:default} .fbpost:disabled{cursor:default}
.fbpost-img{width:64px;height:64px;object-fit:cover;border-radius:8px;flex-shrink:0;background:var(--sunk)}
.fbpost-text{font-size:.93rem;line-height:1.55;margin-top:.25rem;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-line;overflow-wrap:anywhere}
/* หน้าทีม: แต่ละขั้นได้อ่านอะไร */
.reads{display:flex;gap:.35rem;align-items:flex-start;font-size:.82rem;color:var(--ink-3);margin-top:.3rem;line-height:1.45}
.reads .ico{width:14px;flex-shrink:0;margin-top:.12rem}
.reads.warn{color:var(--yellow-ink);font-weight:600}
/* ขั้นที่ค้นเว็บ: คำค้นแนะนำของ Google */
.search-box{border-top:1px dashed var(--line-2);padding-top:.6rem}
.search-sugg{width:100%;height:92px;border:0;border-radius:var(--r-sm);background:var(--surface);color-scheme:normal}
/* อ่านเนื้อข่าวจากลิงก์ (หัวข้อ) */
.art-box{background:var(--sunk);border-radius:var(--r-sm);padding:.7rem .8rem}
.art-item{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r-sm);padding:.6rem .7rem}
.art-item.bad{border-color:var(--red-line);background:var(--red-soft)}
.art-item .ico.ok,.art-item svg.ok{color:var(--green-2)} .art-item .ico.bad,.art-item svg.bad{color:var(--red-2)}
.art-text{white-space:pre-line;font-size:.92rem;line-height:1.6;color:var(--ink-2,inherit);overflow-wrap:anywhere}
.feed-sum .chip{cursor:pointer;border:1px solid transparent} .feed-sum .chip.on{border-color:currentColor;font-weight:700}
.mono-url{font-family:var(--mono);font-size:.8rem;word-break:break-all}
.feed-cat{font-size:.78rem;margin-top:.2rem;font-weight:600;letter-spacing:.01em} .feed-cat.cat-s{color:var(--green)} .feed-cat.cat-t{color:var(--yellow-ink)}
/* เรดาร์รอบล่าสุด */
.radar-sum{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.radar-sum .rs{display:flex;flex-direction:column;padding:.75rem .85rem;border-radius:var(--r);background:var(--sunk)}
.radar-sum .rs b{font-size:1.6rem;line-height:1.15;font-variant-numeric:tabular-nums}
.radar-sum .rs span{font-size:.86rem;font-weight:600;color:var(--ink-2)} .radar-sum .rs small{font-size:.8rem;color:var(--ink-3);margin-top:.15rem}
.radar-item.picked{background:var(--green-soft)} .radar-item .icon-btn svg{width:18px;height:18px}
.radar-last{display:flex;align-items:flex-start;gap:.6rem;padding:.7rem .85rem;border-radius:var(--r);background:var(--sunk);font-size:.9rem}
.radar-item.rescued{background:var(--blue-soft)}
/* ไฟล์เสียง/ภาพจากขั้นอ่านออกเสียง/ขั้นทำภาพ (v3.19) */
.media-list{display:flex;flex-direction:column;gap:.75rem}
.media-audio{display:flex;flex-direction:column;gap:.55rem;padding:.8rem .9rem;border-radius:var(--r);background:var(--sunk)}
.media-audio .ico svg{width:18px;height:18px;color:var(--ink-3)}
.media-audio audio{width:100%;height:44px;display:block}
.media-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
@media(min-width:1000px){.media-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.media-grid figure{margin:0;display:flex;flex-direction:column;gap:.3rem;min-width:0}
.media-grid figure>a{display:block;border-radius:var(--r-sm);overflow:hidden;background:var(--sunk);border:1px solid var(--line-2)}
.media-grid img{display:block;width:100%;height:auto;object-fit:cover}
.media-grid figcaption{display:flex;align-items:center;gap:.3rem;font-size:.82rem;font-weight:600;color:var(--ink-2);min-width:0}
.media-grid figcaption .grow{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.media-grid figcaption .dl{display:inline-grid;place-items:center;width:34px;height:34px;flex-shrink:0;border-radius:var(--r-sm);color:var(--ink-2)}
.media-grid figcaption .dl:hover{background:var(--sunk)} .media-grid figcaption .dl svg{width:18px;height:18px}
.media-missing{aspect-ratio:4/5;display:grid;place-items:center;text-align:center;padding:.8rem;border-radius:var(--r-sm);border:1.5px dashed var(--line);color:var(--ink-3)}
.cost-line{display:flex;align-items:flex-start;gap:.4rem;padding:.55rem .7rem;border-radius:var(--r-sm);background:var(--sunk);color:var(--ink-2);line-height:1.5}
.cost-line .ico svg{width:17px;height:17px;margin-top:.15rem;color:var(--ink-3)}

/* หน้า agent โหมดง่าย (v3.20) */
.easy{display:flex;flex-direction:column;gap:.9rem;max-width:760px}
.readlist{display:flex;flex-direction:column}
.readlist .ri{display:flex;align-items:center;gap:.8rem;min-height:48px;padding:.5rem 0;border-top:1px solid var(--line-2);cursor:pointer}
.readlist .ri input{width:20px;height:20px;margin:0;flex-shrink:0;accent-color:var(--green);cursor:pointer}
.readlist .ri .t{font-weight:600;font-size:.98rem}
.readlist .ri .h{display:block;font-size:.82rem;color:var(--ink-3);font-weight:400;line-height:1.45;margin-top:.1rem}
.readlist .ri .n{flex-shrink:0;font-size:.8rem;color:var(--ink-3);white-space:nowrap}
.readlist .ri.locked{cursor:default} .readlist .ri.locked input{cursor:default}
.more-btn{display:inline-flex;align-items:center;gap:.4rem;margin-top:.15rem;padding:.6rem 0;color:var(--blue);font-weight:600;font-size:.92rem;border-top:1px solid var(--line-2);width:100%}
.more-btn svg{width:17px;height:17px}
.gate-row{display:flex;align-items:center;gap:.9rem}
.adv-toggle{display:flex;align-items:center;gap:.8rem;width:100%;min-height:64px;padding:.8rem 1.15rem;border:1px solid var(--line-2);border-radius:var(--r-lg);background:var(--surface);text-align:left;color:var(--ink)}
.adv-toggle:hover{background:var(--hover)} .adv-toggle svg{width:20px;height:20px;color:var(--ink-3);flex-shrink:0}
.pill.locked{cursor:help}
@media(min-width:1000px){.actionbar.narrow{max-width:760px}}

/* ════════ v3.21 — ไอคอน · Content · Agent ════════ */
.itile{display:inline-grid;place-items:center;flex-shrink:0}
.itile svg{display:block}
.c-blue{background:var(--blue-soft);color:var(--blue-2)} .c-green{background:var(--green-soft);color:var(--green-2)}
.c-yellow{background:var(--yellow-soft);color:var(--yellow-ink)} .c-purple{background:var(--purple-soft);color:var(--purple-ink)}
.c-red{background:var(--red-soft);color:var(--red-2)} .c-gray{background:var(--sunk);color:var(--ink-2)}
.trend{font-size:.8em;font-weight:600;margin-left:.25rem} .trend.up{color:var(--green)} .trend.down{color:var(--red)}
.mtop{display:flex;align-items:center;gap:.5rem;margin:-.25rem 0 .5rem}
.mtop .grow{font-weight:700}
@media(min-width:1000px){.mtop{display:none}}
.side .foot .setlink{display:flex;align-items:center;gap:.6rem;padding:.55rem .15rem;margin-bottom:.4rem;color:var(--ink-2);font-weight:500;text-decoration:none;border-radius:var(--r-sm)}
.side .foot .setlink.on{color:var(--blue-2);font-weight:700} .side .foot .setlink svg{width:20px;height:20px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.75rem;margin-bottom:1rem}
.kpi{background:var(--surface);border:1px solid var(--line-2);border-radius:var(--r-lg);padding:.85rem 1rem;display:flex;flex-direction:column}
.kpi .l{font-size:.85rem;color:var(--ink-3)} .kpi .v{font-size:1.6rem;font-weight:700;line-height:1.3}
.fgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:1rem}
.fcard{display:flex;flex-direction:column;gap:.85rem;padding:1.1rem;background:var(--surface);border:1px solid var(--line-2);border-radius:18px;color:var(--ink);text-decoration:none;text-align:left}
.fcard:hover{border-color:var(--line-hover);text-decoration:none}
.fcard .hd{display:flex;align-items:center;gap:.75rem} .fcard .nm{font-size:1.1rem;font-weight:700;line-height:1.3}
.fcard .meta{font-size:.85rem;color:var(--ink-3)}
.fcard.add{align-items:center;justify-content:center;min-height:150px;border:2px dashed var(--line);background:transparent;color:var(--ink-2)}
.fcard.add svg{width:28px;height:28px}
.mstats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
.mstat{display:flex;flex-direction:column;padding:.6rem .75rem;border-radius:12px;background:var(--bg)}
.mstat .l{font-size:.8rem;color:var(--ink-3)} .mstat .v{font-size:1.15rem;font-weight:700}
.badge-good{align-self:flex-start;padding:.15rem .6rem;border-radius:999px;background:var(--green-soft);color:var(--green-2);font-size:.8rem;font-weight:600;white-space:nowrap}
.badge-low{align-self:flex-start;padding:.15rem .6rem;border-radius:999px;background:var(--sunk);color:var(--ink-2);font-size:.8rem;font-weight:600;white-space:nowrap}
.fewnote{display:flex;align-items:flex-start;gap:.5rem;padding:.7rem .85rem;border-radius:12px;background:var(--sunk);color:var(--ink-2);font-size:.88rem;line-height:1.55}
.fewnote svg{width:18px;height:18px;flex-shrink:0;margin-top:.15rem}
.notice{display:flex;align-items:center;gap:.8rem;padding:.85rem 1.1rem;border-radius:14px;background:var(--yellow-soft);border:1px solid var(--yellow-line);color:var(--yellow-ink);text-decoration:none;margin-bottom:1rem}
.notice:hover{text-decoration:none;filter:brightness(.98)} .notice svg{width:22px;height:22px;flex-shrink:0}
.split{display:flex;flex-wrap:wrap;align-items:flex-start;gap:1.25rem}
.split>.main-col{flex:999 1 520px;min-width:0;display:flex;flex-direction:column;gap:1.25rem}
.split>.side-col{flex:1 1 330px;min-width:0;display:flex;flex-direction:column;gap:1.25rem}
.bars{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:.6rem;align-items:end;height:180px;border-bottom:1px solid var(--line)}
.bars .b{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:.2rem;height:100%;font-size:.75rem;color:var(--ink-2)}
.bars .b i{display:block;width:100%;border-radius:6px 6px 0 0;background:var(--blue-line)} .bars .b.recent i{background:var(--blue)}
.bars .b.recent span{color:var(--blue-2);font-weight:600}
.barlabels{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:.6rem;font-size:.72rem;color:var(--ink-3);text-align:center;margin-top:.35rem}
.vs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem}
.vs>div{display:flex;flex-direction:column;gap:.1rem;padding:.75rem .85rem;border-radius:12px}
.vs .ai{background:var(--blue-soft);color:var(--blue-2)} .vs .man{background:var(--sunk);color:var(--ink-2)}
.vs .big{font-size:1.3rem;font-weight:700}
.meter{height:10px;border-radius:10px;background:var(--sunk);overflow:hidden} .meter i{display:block;height:100%;border-radius:10px;background:var(--green)}
table.tbl{width:100%;border-collapse:collapse;font-size:.92rem} table.tbl th{font-size:.8rem;color:var(--ink-3);font-weight:600;text-align:left;padding:.45rem .5rem}
table.tbl td{padding:.6rem .5rem;border-top:1px solid var(--line-2)} table.tbl .r{text-align:right}
.pcard{display:flex;flex-direction:column;gap:.75rem;padding:1.1rem;background:var(--surface);border:1px solid var(--line-2);border-radius:18px;color:var(--ink);text-align:left;cursor:pointer}
.pcard:hover{border-color:var(--line-hover)} .pcard.warn{border:1.5px solid var(--yellow-line)} .pcard.off{opacity:.6}
.pcard .hd{display:flex;align-items:center;gap:.75rem} .pcard .nm{font-size:1.05rem;font-weight:700;line-height:1.3} .pcard .role{font-size:.86rem;color:var(--ink-3)}
.fchips{display:flex;flex-wrap:wrap;gap:.35rem} .fchips span{padding:.1rem .6rem;border-radius:999px;background:var(--bg);border:1px solid var(--line-2);font-size:.78rem;color:var(--ink-2)}
.pstats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;padding-top:.7rem;border-top:1px solid var(--line-2)}
.pstats span{display:flex;flex-direction:column} .pstats .l{font-size:.78rem;color:var(--ink-3)} .pstats .v{font-weight:700}
.warnline{display:flex;align-items:flex-start;gap:.45rem;padding:.55rem .7rem;border-radius:10px;background:var(--yellow-soft);color:var(--yellow-ink);font-size:.86rem;line-height:1.5}
.warnline svg{width:17px;height:17px;flex-shrink:0;margin-top:.15rem}
.utabs{display:flex;gap:.25rem;border-bottom:1px solid var(--line);margin-bottom:1rem;overflow-x:auto}
.utabs a,.utabs button{display:inline-flex;align-items:center;gap:.4rem;min-height:46px;padding:0 .9rem;color:var(--ink-2);font-weight:500;text-decoration:none;border-bottom:3px solid transparent;margin-bottom:-1px;white-space:nowrap}
.utabs .on{color:var(--ink);font-weight:700;border-bottom-color:var(--blue)}
.icongrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(50px,1fr));gap:.45rem;max-height:340px;overflow:auto;padding:2px}
.icongrid button{height:50px;border:1.5px solid var(--line-2);border-radius:12px;background:var(--surface);color:var(--ink-2);display:grid;place-items:center}
.icongrid button:hover{border-color:var(--line-hover)} .icongrid button.on{border:2px solid var(--blue);background:var(--blue-soft);color:var(--blue-2)}
.swatches{display:flex;flex-wrap:wrap;gap:.55rem} .swatches button{width:36px;height:36px;border-radius:50%;border:1.5px solid var(--line)}
.swatches button.on{box-shadow:0 0 0 3px var(--surface),0 0 0 5px var(--blue)}
.hm-card{background:var(--surface);border:1px solid var(--line-2);border-radius:16px;padding:.9rem 1rem;display:flex;flex-direction:column;gap:.6rem}
.hm-card .thumb{width:72px;height:72px;border-radius:10px;background:var(--sunk);object-fit:cover;flex-shrink:0;display:grid;place-items:center;color:var(--muted-ink)}
.hm-card .thumb svg{width:26px;height:26px}
.fpick{display:flex;flex-wrap:wrap;gap:.4rem}
.fpick button{min-height:40px;padding:0 .8rem;border:1.5px solid var(--line);border-radius:999px;background:var(--surface);font-size:.9rem;color:var(--ink);display:inline-flex;align-items:center;gap:.35rem}
.fpick button.guess{border-color:var(--blue);background:var(--blue-soft);color:var(--blue-2);font-weight:600}
.itile-btn{position:relative;flex-shrink:0;border-radius:18px;line-height:0}
.itile-btn .pen{position:absolute;right:-4px;bottom:-4px;width:24px;height:24px;border-radius:50%;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;color:var(--ink-2)}
.itile-btn .pen svg{width:13px;height:13px} .itile-btn:hover .pen{color:var(--blue-2);border-color:var(--blue)}
.itile-btn:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
.list.flat{background:transparent;border:0;border-radius:0}
.list.flat>.item{padding:.7rem .25rem;gap:.7rem}
.pcard:focus-visible,.fcard:focus-visible{outline:3px solid var(--blue);outline-offset:2px}
.utabs .chip{margin-left:.1rem}
.mtop .mark svg{width:20px;height:20px} .mtop .icon-btn svg{width:22px;height:22px}
.mb-5{margin-bottom:1.75rem}
.ph-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end;align-items:center}
@media(max-width:999px){
  .page-head:has(.ph-actions){flex-wrap:wrap}
  .page-head .ph-actions{width:100%;justify-content:space-between}
  .ph-desk{display:none!important}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
  .kpi{padding:.6rem .8rem} .kpi .v{font-size:1.3rem} .kpi:last-child:nth-child(odd){grid-column:1/-1}
  .fgrid{grid-template-columns:minmax(0,1fr)}
}
/* v3.22 — ทีมเดียว */
.list.flat>.item.step-item{flex-direction:column;align-items:stretch;gap:.35rem}
.list.flat>.item.step-item.open{background:var(--bg);border-radius:14px;padding:.7rem .6rem;margin:.25rem -.35rem}
.tweak{display:flex;flex-direction:column;gap:.75rem;margin-top:.35rem;padding:.85rem .9rem;border-radius:12px;background:var(--surface);border:1px solid var(--line-2)}
.scope{display:inline-flex;align-items:center;gap:.25rem;padding:.05rem .55rem;border-radius:999px;font-size:.74rem;font-weight:600;white-space:nowrap;vertical-align:2px;margin-left:.4rem}
.scope.all{background:var(--blue-soft);color:var(--blue-2)} .scope.here{background:var(--yellow-soft);color:var(--yellow-ink)}
.fmt-switch{display:flex;flex-wrap:wrap;gap:.4rem}
.fmt-switch a{display:inline-flex;align-items:center;gap:.4rem;min-height:40px;padding:0 .8rem 0 .35rem;border-radius:999px;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);font-size:.9rem;text-decoration:none}
.fmt-switch a.on{border-color:var(--blue);background:var(--blue-soft);color:var(--blue-2);font-weight:700}
.fmt-switch a .loc{color:var(--yellow-ink);font-weight:600;font-size:.78rem}
.newfmt-num{width:32px;height:32px;border-radius:50%;background:var(--blue);color:#fff;display:inline-grid;place-items:center;font-weight:700;flex-shrink:0}
.pick-row{display:flex;align-items:center;gap:.6rem;min-height:56px;padding:.3rem 0;border-top:1px solid var(--line-2)}
.pick-row:first-of-type{border-top:0}
.merge-card{display:flex;flex-direction:column;gap:.75rem;padding:1rem 0;border-top:1px solid var(--line-2)}
.merge-card:first-of-type{border-top:0}
.optcard{flex:1 1 260px;display:flex;align-items:flex-start;gap:.6rem;padding:.75rem .9rem;border-radius:14px;border:1.5px solid var(--line);background:var(--surface);cursor:pointer}
.optcard.on{border-color:var(--blue);background:var(--blue-soft)}
.optcard input{margin-top:.2rem;accent-color:var(--blue);width:18px;height:18px}
.col>.optcard{flex:none}
.split.how>.main-col{flex:1.35 1 480px} .split.how>.side-col{flex:1 1 430px}
