/* ════════════════════════════════════════════════════════════
   ALICELIUM THEME KIT — Alicentia Design System (V012-aligned)
   Material Blue + Glassmorphism · one family with Alicentia (V012)

   วิธีใช้ (ปรับจาก dev-kit: ฟอนต์เป็น self-host ทั้งหมด — ไม่มี request ออกนอก origin):
   1) ลำดับ link ใน <head> ของ base.html:
      fonts.css (Prompt + Material Symbols subset ใน /static/fonts/)
      → tokens.css (สีทั้งหมด + AA fixes) → theme.css (ไฟล์นี้)

   2) เปลี่ยนสีแบรนด์ได้ที่ตัวแปร --blue (และ --blue-700) ที่เดียว
      ทั้งเว็บจะเปลี่ยนตามทันที

   หมายเหตุ: token, ปุ่ม, การ์ด, โลโก้, ไอคอน, ระยะห่าง และ max-width
   ปรับให้ตรงกับ assets/css/style.css ของ V012 (Alicentia)
   Components: .topbar .btn .card .panel .badge .alert .progress
               .hero(.hero-grid/.side/.statgrid) .section-title
               .accordion(details.topic) .tool .plan-card + utilities
   ════════════════════════════════════════════════════════════ */

:root {
  /* สีทั้งหมดอยู่ใน tokens.css (ต้อง link ก่อนไฟล์นี้) — ห้ามประกาศสีใหม่ที่นี่
     dev-kit :root เดิมถูกย้ายเข้า tokens.css แล้ว (รวม --blue-800, --bg-soft, --line) */
  --shadow:      0 10px 30px rgba(2,6,23,.08);
  --shadow-soft: 0 8px 20px rgba(2,6,23,.06);
  --shadow-blue: 0 14px 26px rgba(26,115,232,.22);

  --r16: 16px;
  --r24: 24px;
  --max: 1340px;         /* ตรงกับ V012 */
}

/* ─── Reset ───────────────────────────────────── */
* { box-sizing: border-box; }
/* html เท่านั้น — ห้ามใส่ height:100% ให้ body เพราะจะบีบ containing block ของ
   position:sticky ให้สูงแค่ 1 viewport แล้ว topbar หลุดหายหลังเลื่อนพ้น ~1 จอ
   (body มี min-height:100% ด้านล่างอยู่แล้ว พื้นหลัง gradient จึงยังเต็มจอ) */
html { height: 100%; }
/* กันหน้าขยับเวลาสลับหน้า (สั้น↔ยาว) — ตรงกับ V012 */
html { scrollbar-gutter: stable; overflow-y: scroll; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Prompt", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(26,115,232,.14), transparent 58%),
    radial-gradient(900px 520px at 85% 10%, rgba(26,115,232,.11), transparent 55%),
    var(--bg);
}

/* ─── Layout ──────────────────────────────────── */
.container { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
section { padding: 18px 0; }

/* ─── Typography (ตรงสเกล V012) ───────────────── */
h1, h2, h3, h4, h5, h6 { color: var(--ink); margin-top: 0; }
h1 { margin: 12px 0 10px; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.2px; font-weight: 700; }
h2 { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.1px; font-weight: 600; }
h3 { font-size: clamp(17px, 1.8vw, 20px); line-height: 1.3; font-weight: 600; }
.lead { margin: 0 0 14px; color: rgba(31,41,55,.84); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.7; max-width: 70ch; }
.grad { background: linear-gradient(120deg, var(--blue), var(--special));
        -webkit-background-clip: text; background-clip: text; color: transparent; }
a { color: var(--color-link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue-700); }

/* ─── Icons (Material Symbols) ────────────────── */
/* .icon = สเปกเดียวกับ V012 · .material-symbols-rounded = alias ใช้ได้เหมือนกัน */
.icon,
.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-variation-settings: 'FILL' 0, 'wght' 520, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}
.icon { font-size: 18px; }
.icon.filled, .icon.active,
.material-symbols-rounded.filled, .material-symbols-rounded.active {
  font-variation-settings: 'FILL' 1, 'wght' 520, 'GRAD' 0, 'opsz' 24;
}
.icon-sm { font-size: 18px; } .icon-md { font-size: 24px; }
.icon-lg { font-size: 32px; } .icon-xl { font-size: 44px; }

/* ─── Topbar (sticky frosted glass) ───────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  background: rgba(246,248,252,.76);
  border-bottom: 1px solid rgba(15,23,42,.08);
}
.topbar-inner,
.nav-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; }
.nav { display: flex; gap: 10px; margin-left: auto; align-items: center; }
/* จัดเมนูไว้กลาง topbar จริง ๆ (แนว alicentia) — ซ้าย/ขวากินพื้นที่เท่ากัน เมนูจึงอยู่กึ่งกลาง */
.topbar-inner > .brand-lockup { flex: 1 1 0; min-width: 0; }
.topbar-inner > .nav { margin-left: 0; }
.topbar-inner > .actions, .topbar-inner > .user-bar { flex: 1 1 0; display: flex; justify-content: flex-end; }
.navlink { color: rgba(31,41,55,.92); font-weight: 500; font-size: 13px; padding: 8px 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; }
.navlink .icon { font-size: 17px; color: var(--c-gray-600); }
.navlink:hover { background: rgba(26,115,232,.08); color: var(--ink); }
.navlink:hover .icon { color: var(--blue); }
.actions { display: flex; align-items: center; gap: 10px; }

/* ปุ่มล็อกอิน pill โลโก้ Google (แนว alicentia.me) — โลโก้ G ใช้ token --g-* */
.g-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 999px; background: rgba(26,115,232,.07); border: 1px solid rgba(26,115,232,.22);
  color: var(--blue-700); font-weight: 700; font-size: 13.5px; text-decoration: none;
  transition: background .15s, box-shadow .15s; }
.g-pill:hover { background: rgba(26,115,232,.12); box-shadow: var(--shadow-soft); color: var(--blue-700); }
.g-pill svg { flex-shrink: 0; }

/* ─── Logo + Brand (โลโก้เรืองแสง ✨ แบบ V012) ─── */
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.logo {
  position: relative; overflow: hidden;
  width: 38px; height: 38px; border-radius: 14px;
  background: linear-gradient(145deg, #2563eb 0%, #1557b0 100%);
  box-shadow: 0 10px 18px rgba(26,115,232,.25);
  display: grid; place-items: center;
  color: #fff; font-weight: 900; font-size: 18px; letter-spacing: -.03em;
  flex-shrink: 0;
}
.logo .logo-ai {
  position: absolute; top: 8px; right: 6px;
  font-size: 10px; line-height: 1; color: rgba(255,255,255,.90);
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1;
  animation: aiGlow 2.5s ease-in-out infinite;
}
@keyframes aiGlow {
  0%,100% { opacity: .90; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.15); }
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong, .brand > .bt { font-size: 15px; color: var(--ink); font-weight: 700; }
.brand small, .brand span { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ─── Button (Pill) ───────────────────────────── */
.btn {
  border: 1px solid rgba(26,115,232,.16);
  background: rgba(26,115,232,.08);
  color: var(--blue-700);
  padding: 10px 14px; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); background: rgba(26,115,232,.12); }
.btn.primary { background: var(--blue); color: #fff; border-color: rgba(26,115,232,.55); box-shadow: var(--shadow-blue); }
.btn.primary:hover { background: #1767CF; color: #fff; }
.btn.danger  { background: rgba(234,67,53,.08);  border-color: rgba(234,67,53,.16);  color: var(--danger); }
.btn.success { background: rgba(52,168,83,.08);  border-color: rgba(52,168,83,.16);  color: var(--success); }
.btn.ghost   { background: transparent; border-color: rgba(15,23,42,.10); }
.btn.ghost:hover { background: rgba(15,23,42,.03); }
.btn.large   { padding: 14px 24px; font-size: 15px; }
.btn.small   { padding: 6px 10px;  font-size: 12px; }
.w100 { width: 100%; justify-content: center; }

/* ─── Card (Glassmorphism) ────────────────────── */
.card {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--r24);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-compact  { padding: 16px; }
.card-spacious { padding: 32px; }

/* Panel = การ์ดเนื้อหา (ตรงกับ .panel V012) */
.panel {
  padding: 14px; border-radius: var(--r24);
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 12px 26px rgba(2,6,23,.06);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  color: rgba(31,41,55,.86); font-size: 13px;
}

/* ─── Badge ───────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(26,115,232,.18);
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
  font-size: 13px; font-weight: 500; color: rgba(31,41,55,.92);
  width: fit-content;
}
.badge.success { background: rgba(52,168,83,.1);  border-color: rgba(52,168,83,.3);  color: var(--success); }
.badge.danger  { background: rgba(234,67,53,.1);  border-color: rgba(234,67,53,.3);  color: var(--danger); }
.badge.warning { background: rgba(249,171,0,.1);  border-color: rgba(249,171,0,.3);  color: var(--color-warning-text); }
.badge.special { background: rgba(156,39,176,.1); border-color: rgba(156,39,176,.3); color: var(--special); }
.badge.gold    { background: rgba(249,171,0,.12); border-color: rgba(249,171,0,.35); color: var(--color-warning-text); }
.badge.compact { padding: 5px 11px; box-shadow: none; font-size: 12px; font-weight: 600; }

/* Eyebrow = badge หน้า hero */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(26,115,232,.18);
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
  font-size: 13px; font-weight: 500; color: rgba(31,41,55,.92);
  width: fit-content;
}

/* ─── Section title (V012) ────────────────────── */
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 12px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 20px; letter-spacing: -.1px; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; max-width: 70ch; }
/* alias เดิม */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head .tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--blue); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ─── Hero (grid + side stat card แบบ V012) ────── */
.hero { padding: 34px 0 18px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: stretch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }

/* Search bar (AliceLium) — โทน frosted เดียวกัน */
.searchbar { display: flex; gap: 8px; align-items: center;
  background: rgba(255,255,255,.9); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 8px 8px 20px; box-shadow: var(--shadow); }
.searchbar input { border: none; outline: none; background: transparent; flex: 1;
  font-family: inherit; font-size: 15px; color: var(--text); padding: 8px 0; }

/* Side glass card + soft blue glow (V012 .side) */
.side { padding: 14px; position: relative; overflow: hidden;
  background: rgba(255,255,255,.86); border: 1px solid rgba(15,23,42,.10);
  border-radius: var(--r24); box-shadow: var(--shadow); }
.side::before {
  content: ""; position: absolute; inset: -2px; pointer-events: none; opacity: .95;
  background:
    radial-gradient(520px 320px at 20% 12%, rgba(26,115,232,.18), transparent 55%),
    radial-gradient(520px 320px at 85% 10%, rgba(26,115,232,.12), transparent 55%);
}
.side > * { position: relative; z-index: 1; }

/* แถว "ป้าย — ค่า" ใช้ร่วมกันในการ์ดโควตาและผลลัพธ์เครื่องมือฝั่งเบราว์เซอร์
   (เดิมใช้ .qrow ในเทมเพลตแต่ไม่เคยมีกฎ CSS → ป้ายกับค่าติดกันเป็นก้อนเดียว) */
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted); padding: 3px 0; }

/* Stat grid (V012) */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card {
  border-radius: 18px; padding: 12px;
  background: rgba(255,255,255,.9); border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
}
.stat-card .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat-card .v { margin-top: 6px; font-weight: 800; color: var(--ink); }
/* stat แบบแถวตัวเลขใน hero landing เดิม */
.stats { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.stat b { display: block; font-size: 26px; color: var(--ink); font-weight: 700; }
.stat span { font-size: 13px; color: var(--muted); }

/* ─── Progress Bar ────────────────────────────── */
.progress { height: 10px; background: rgba(15,23,42,.08); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), rgba(26,115,232,.55)); border-radius: 999px; transition: width .3s ease; }

/* ─── Accordion topics (V012 details.topic) ───── */
.accordion { display: flex; flex-direction: column; gap: 12px; }
details.topic {
  border-radius: var(--r24);
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 12px 26px rgba(2,6,23,.06);
  overflow: clip;
}
summary.topic-head {
  cursor: pointer; list-style: none; user-select: none;
  padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
summary.topic-head::-webkit-details-marker { display: none; }
.head-left { display: flex; align-items: center; gap: 10px; }
.topic-ic {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 16px;
  display: grid; place-items: center;
  background: rgba(26,115,232,.10); color: var(--blue-700);
  border: 1px solid rgba(26,115,232,.18);
}
.topic-title { display: flex; flex-direction: column; line-height: 1.2; }
.topic-title b { color: var(--ink); font-size: 14px; }
.topic-title span { color: var(--muted); font-size: 12.5px; }
.chev {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(15,23,42,.06); border: 1px solid rgba(15,23,42,.10);
  color: rgba(31,41,55,.86); transition: transform .2s ease;
}
details[open] .chev { transform: rotate(180deg); }
.topic-body { padding: 0 14px 14px; border-top: 1px solid rgba(15,23,42,.08); }

/* Tabs (V012) */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 10px; }
.tab { border-radius: 999px; border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.72); padding: 8px 12px; font-size: 13px; font-weight: 700;
  color: rgba(31,41,55,.9); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.tab.active { background: rgba(26,115,232,.12); border-color: rgba(26,115,232,.22); color: var(--blue-700); }

/* ─── Tool / feature card ─────────────────────── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool { background: rgba(255,255,255,.86); border: 1px solid var(--border); border-radius: 18px;
  padding: 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 24px rgba(2,6,23,.04);
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(26,115,232,.3); }
.tool .ti { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  flex-shrink: 0; background: rgba(26,115,232,.1); color: var(--blue-700); border: 1px solid rgba(26,115,232,.18); }
.tool .tt { font-weight: 600; color: var(--ink); font-size: 14px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* คำโปรยบนการ์ดต้องบรรทัดเดียวแบบ mockup — ยาวกว่านั้นการ์ดสูงไม่เท่ากันทั้งหน้า
   (รายละเอียดเต็มอยู่ที่หน้าเครื่องมือ ไม่ใช่หน้าที่ของการ์ด) */
.tool .ts { font-size: 12px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tool.ai .ti, .tool.special .ti { background: rgba(156,39,176,.1); color: var(--special); border-color: rgba(156,39,176,.22); }
.tool.thai .ti, .tool.warning .ti { background: rgba(249,171,0,.12); color: #B07000; border-color: rgba(249,171,0,.28); }

/* ─── Category pills ──────────────────────────── */
.cats { display: flex; gap: 8px; flex-wrap: wrap; }
.cat { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; border: 1px solid var(--border);
  background: rgba(255,255,255,.72); color: rgba(31,41,55,.9); cursor: pointer; user-select: none; transition: all .15s; }
.cat:hover { border-color: rgba(26,115,232,.3); color: var(--blue-700); background: rgba(26,115,232,.06); }
.cat.active { background: rgba(26,115,232,.12); color: var(--blue-700); border-color: rgba(26,115,232,.22); }

/* ─── Pricing plan (V012 .plan-card) ──────────── */
.plans, .price-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.plan-card, .plan {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow); padding: 16px;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.plan-card:hover, .plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card.recommended, .plan.featured {
  border-color: rgba(26,115,232,.35);
  box-shadow: 0 16px 40px rgba(26,115,232,.16);
  transform: translateY(-2px);
}
.ribbon {
  position: absolute; top: 12px; right: 12px;
  background: rgba(26,115,232,.10); color: var(--blue-700);
  border: 1px solid rgba(26,115,232,.25);
  padding: 6px 10px; border-radius: 999px; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12px; padding: 6px 10px; border-radius: 999px;
  background: rgba(0,0,0,.04); color: var(--ink); border: 1px solid var(--line);
}
.plan-badge.hot { background: rgba(26,115,232,.10); border-color: rgba(26,115,232,.25); color: var(--blue-700); }
.plan-name { margin: 10px 0 6px; font-size: 18px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price .price { font-size: 34px; font-weight: 900; letter-spacing: -.6px; color: var(--ink); }
.plan-price .per { color: var(--muted); font-size: 13px; }
.plan-sub { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.plan-features { margin: 12px 0 14px; padding: 0; list-style: none; display: grid; gap: 10px; flex: 1; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: 14px; }
.plan-features .icon.ok, .plan-features .ok .icon { color: var(--blue-700); font-variation-settings: 'FILL' 1; }
.plan-features li.off { color: var(--muted); }
.plan-features li.off .icon { color: rgba(15,23,42,.25); }
.plan-actions { display: grid; gap: 10px; margin-top: auto; }

/* ─── Callout (V012 lesson callout) ───────────── */
.callout { border-radius: 16px; border: 1px solid rgba(26,115,232,.18);
  background: rgba(26,115,232,.07); padding: 10px 12px; color: rgba(31,41,55,.86);
  font-size: 13px; line-height: 1.7; }
.callout b { color: var(--blue-700); }

/* ─── Form Elements ───────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], textarea, select {
  font-family: inherit; font-size: 15px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--r16);
  background: rgba(255,255,255,.9); color: var(--text); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.12); }
label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }

/* ─── Alert / Notice ──────────────────────────── */
.alert { padding: 16px 20px; border-radius: var(--r16); display: flex; align-items: flex-start; gap: 12px; margin: 16px 0; }
.alert.info    { background: rgba(26,115,232,.08); border-left: 4px solid var(--blue);    color: var(--blue-700); }
.alert.success { background: rgba(52,168,83,.08);  border-left: 4px solid var(--success); color: #1E7E34; }
.alert.warning { background: rgba(249,171,0,.08);  border-left: 4px solid var(--warning); color: var(--color-warning-text); }
.alert.danger  { background: rgba(234,67,53,.08);  border-left: 4px solid var(--danger);  color: #B71C1C; }

/* ─── Drop zone ───────────────────────────────── */
.dropzone { border: 2px dashed rgba(26,115,232,.35); border-radius: var(--r24); padding: 40px 24px;
  text-align: center; background: rgba(26,115,232,.04); cursor: pointer; transition: all .15s; }
.dropzone:hover { background: rgba(26,115,232,.08); border-color: var(--blue); }

/* ─── Ad slot ─────────────────────────────────── */
.ad { border: 1px dashed rgba(15,23,42,.2); border-radius: var(--r16); padding: 14px; text-align: center;
  color: var(--muted); font-size: 13px; background: rgba(255,255,255,.5); }

/* ─── Footer ──────────────────────────────────── */
footer { margin-top: 40px; border-top: 1px solid var(--border); background: rgba(255,255,255,.5); padding: 40px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid h4 { font-size: 14px; margin-bottom: 14px; }
.foot-grid a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.foot-grid a:hover { color: var(--blue); }
.foot-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
.family { display: flex; gap: 10px; flex-wrap: wrap; }
.family span { padding: 5px 12px; border-radius: 999px; background: rgba(26,115,232,.08);
  font-size: 12px; font-weight: 600; color: var(--blue-700); }

/* ─── Utilities ───────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-blue   { color: var(--blue); }
.mt-1{margin-top:8px;}  .mt-2{margin-top:16px;}  .mt-3{margin-top:24px;}  .mt-4{margin-top:32px;}  .mt-6{margin-top:48px;}
.mb-1{margin-bottom:8px;}.mb-2{margin-bottom:16px;}.mb-3{margin-bottom:24px;}.mb-4{margin-bottom:32px;}.mb-6{margin-bottom:48px;}
.flex{display:flex;} .flex-col{flex-direction:column;}
.items-center{align-items:center;} .justify-center{justify-content:center;} .justify-between{justify-content:space-between;}
.gap-1{gap:8px;} .gap-2{gap:16px;} .gap-3{gap:24px;}
.grid{display:grid;}
.grid-2{grid-template-columns:repeat(2,1fr);gap:16px;}
.grid-3{grid-template-columns:repeat(3,1fr);gap:16px;}
.grid-4{grid-template-columns:repeat(4,1fr);gap:16px;}

/* ─── Animation ───────────────────────────────── */
@keyframes pulse  { 0%,100%{transform:scale(1);} 50%{transform:scale(1.05);} }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }
.animate-pulse   { animation: pulse 2s infinite; }
.animate-fadein  { animation: fadeIn .3s ease-out; }

/* ─── Responsive (breakpoints ตาม V012) ───────── */
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .nav .navlink { display: none; }
}
@media (max-width: 860px) {
  .plans, .price-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .statgrid { grid-template-columns: 1fr; }
  .stats { gap: 20px; }
}

/* พื้นที่ลากวางไฟล์ของเครื่องมือรูป — img-kit ใส่คลาส .is-drag ตอนลากไฟล์เข้ามา
   ไม่มีกฎนี้ = ผู้ใช้ลากไฟล์มาแล้วไม่มีอะไรตอบสนอง ไม่รู้ว่าปล่อยตรงไหนได้ */
[data-imgdrop] { cursor: pointer; transition: border-color .15s, background .15s; }
[data-imgdrop].is-drag { border-color: var(--blue) !important;
  background: rgba(26,115,232,.07) !important; }

/* ─── File rows (ไฟล์ล่าสุด / dashboard) — ยกจาก mockup-states.html
   DESIGN_SYSTEM §3 อ้าง .file-row แต่ theme-kit.css ต้นทางไม่มี (อยู่ใน mockup เท่านั้น) ─── */
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.78); margin-top: 8px; }
.file-row .l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(26,115,232,.10); color: var(--blue-700); border: 1px solid rgba(26,115,232,.18); flex-shrink: 0; }
.file-ic.danger { background: rgba(234,67,53,.10); color: var(--danger); border-color: rgba(234,67,53,.22); }
.file-name { font-size: 13.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12px; color: var(--muted); }

/* ─── ราง "เห็นก่อนสั่ง" (static/js/pdf-preview.js) ───────────────────────────
   กล่องพรีวิวหน้า PDF + ชั้นวาด overlay ของเครื่องมือ (ครอป / ใส่ข้อความ / เซ็น)

   .pv-stage ล็อก aspect-ratio ตามขนาดหน้าจริงตั้งแต่ก่อนภาพมาถึง — ไม่ล็อกไว้
   หน้าเว็บจะกระโดดตอนภาพโหลดเสร็จ และกรอบที่ผู้ใช้เพิ่งลากจะเลื่อนตาม
   .pv-layer ทับ .pv-img พอดีเป๊ะเสมอ เพราะพิกัดที่รางคืนให้เป็นสัดส่วน 0..1 ของกรอบภาพ */
.pv-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; font-size: 14px; color: var(--ink); }
.pv-nav { display: flex; align-items: center; gap: 6px; }
.pv-nav .btn[disabled] { opacity: .4; pointer-events: none; }

.pv-stage { position: relative; width: 100%; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-soft);
  /* ภาพเอกสารเป็นพื้นขาว — เงาบาง ๆ ช่วยให้เห็นขอบกระดาษบนพื้นเว็บที่ก็ขาว */
  box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.pv-img { display: block; width: 100%; height: 100%; object-fit: contain;
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
/* touch-action:none จำเป็นบนมือถือ — ไม่ใส่แล้วการลากกรอบจะกลายเป็นการเลื่อนหน้าเว็บ */
.pv-layer { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }

.pv-spin { display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 28px; color: var(--muted); font-size: 14px; }
.pv-spin .material-symbols-rounded { animation: pv-turn 1.4s linear infinite; }
@keyframes pv-turn { to { transform: rotate(360deg); } }
.pv-msg { margin-top: 10px; }

/* ── กรอบเลือกพื้นที่ (เครื่องมือครอป) ──
   ใช้ box-shadow กว้างมหาศาลแทน div บังสี่ด้าน — มืดนอกกรอบด้วย element เดียว
   ย้ายกรอบแล้วส่วนมืดตามทันทีโดยไม่ต้องคำนวณสี่เหลี่ยมรอบนอกเอง */
.pv-sel { position: absolute; border: 2px solid var(--blue);
  box-shadow: 0 0 0 9999px rgba(11,18,32,.45); cursor: move; }
.pv-grip { position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--blue); }
.pv-grip[data-g="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.pv-grip[data-g="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.pv-grip[data-g="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.pv-grip[data-g="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
/* จอสัมผัสไม่มีเมาส์ให้เล็ง — ขยายพื้นที่กดโดยไม่ขยายวงกลมที่เห็น */
@media (pointer: coarse) {
  .pv-grip::after { content: ""; position: absolute; inset: -12px; }
}
.pv-size { position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  white-space: nowrap; background: rgba(11,18,32,.72); color: var(--card); }

/* ─── ไทม์ไลน์ตัดคลิปวิดีโอ (static/js/video-timeline.js) ────────────────────
   ทุกอย่างเกิดในเครื่องผู้ใช้ — <video> เล่นจาก object URL ไม่มีการอัปโหลดเพื่อพรีวิว

   .vt-bar เป็นแถบไทม์ไลน์ · .vt-sel คือช่วงที่เลือก (ตำแหน่งเป็น % เสมอ ไม่ใช่ px
   เพื่อให้ย่อ/ขยายหน้าต่างแล้วช่วงที่เลือกไม่เลื่อน) · .vt-head-line คือหัวอ่าน
   touch-action:none จำเป็นบนมือถือ ไม่ใส่แล้วการลากที่จับกลายเป็นการเลื่อนหน้าเว็บ */
.vt-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; font-size: 14px; color: var(--ink); }
.vt-meta { font-size: 12.5px; }

.vt-stage { border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: rgba(11,18,32,.92); display: grid; place-items: center; }
/* คลิปแนวตั้งจากมือถือสูงมาก — จำกัดความสูงไว้ ไม่งั้นปุ่มควบคุมหลุดจอ */
.vt-video { display: block; width: 100%; max-height: 46vh; object-fit: contain;
  background: rgba(11,18,32,.92); }

.vt-bar { position: relative; height: 44px; margin-top: 10px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--line); cursor: pointer;
  touch-action: none; -webkit-user-select: none; user-select: none; }
.vt-bar:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.vt-sel { position: absolute; top: -1px; bottom: -1px; border-radius: 10px;
  background: rgba(26,115,232,.18); border: 1px solid var(--blue); cursor: grab; }
.vt-grip { position: absolute; top: 50%; width: 16px; height: 30px; margin-top: -15px;
  border-radius: 6px; background: var(--card); border: 2px solid var(--blue);
  cursor: ew-resize; box-shadow: 0 1px 3px rgba(15,23,42,.25); }
.vt-grip[data-g="in"]  { left: -9px; }
.vt-grip[data-g="out"] { right: -9px; }
/* จอสัมผัสไม่มีเมาส์ให้เล็ง — ขยายพื้นที่กดโดยไม่ขยายรูปที่เห็น */
@media (pointer: coarse) { .vt-grip::after { content: ""; position: absolute; inset: -14px -10px; } }
.vt-head-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--danger); pointer-events: none; }

.vt-times { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px;
  font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.vt-times b { color: var(--ink); font-variant-numeric: tabular-nums; }

.vt-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.vt-controls .vt-spacer { flex: 1 1 auto; }
.vt-controls .btn.is-on { background: var(--blue); color: var(--card); border-color: var(--blue); }
.vt-keys { font-size: 12px; line-height: 1.8; margin: 10px 0 0; }
.vt-msg { margin-top: 10px; }
@media (max-width: 520px) {
  .vt-controls .vt-spacer { display: none; }
  .vt-keys { display: none; }  /* ไม่มีคีย์บอร์ดให้ใช้อยู่แล้ว บอกไปก็รกจอ */
}

/* ══════════════════════════════════════════════════════════════════════════
   หน้าเครื่องมือ — โครงมาตรฐานที่ทุกเครื่องมือใช้ร่วมกัน (app/templates/tools/_tool_base.html)

   ปัญหาเดิม: เนื้อหาถูกบีบไว้ที่ max-width 720px ทั้งที่ header/footer กว้าง 1340px
   → บนจอ 1440px มีที่ว่างข้างละ 310px และทุกอย่างต่อกันเป็นแถวเดียวยาว 2,700px
   ผู้ใช้ต้องเลื่อนผ่าน "วิธีใช้/คำถาม/เครื่องมือที่เกี่ยวข้อง" ทั้งที่มาทำงานอย่างเดียว

   โครงใหม่ = สองคอลัมน์:
     ซ้าย  (ยืดหยุ่น) พื้นที่ทำงานจริง — สิ่งเดียวที่ผู้ใช้มาทำ
     ขวา   (คงที่ 340px, ติดหนึบ) ข้อมูลประกอบที่ต้องเห็นแต่ไม่ควรขวางทาง
   แล้วค่อยตามด้วยคำถาม/เครื่องมือที่เกี่ยวข้องแบบเต็มความกว้างด้านล่าง

   ทำไมแถบข้างเป็น 340px คงที่ ไม่ใช่สัดส่วน: เนื้อหาในนั้นเป็นรายการสั้น ๆ
   ถ้าใช้ fr มันจะยืดจนบรรทัดยาวเกินอ่านสบายบนจอกว้าง ส่วนคอลัมน์ซ้ายยืดได้เพราะ
   เป็นพื้นที่ทำงานที่ยิ่งกว้างยิ่งดี (ตารางไฟล์ ไทม์ไลน์วิดีโอ พรีวิว PDF)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── หัวหน้า: ไอคอน + ชื่อ + คำโปรย + ป้ายข้อมูลจริง ── */
.tool-head { display: flex; align-items: flex-start; gap: 16px; margin: 6px 0 18px; }
.tool-head-ic {
  width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: rgba(26,115,232,.10); color: var(--blue-700); border: 1px solid rgba(26,115,232,.18);
}
.tool-head-ic .material-symbols-rounded { font-size: 30px; }
.tool-head-txt { min-width: 0; flex: 1; }
.tool-head h1 { margin: 0 0 4px; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.4px; line-height: 1.2; }
.tool-head .sub { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 68ch; }

/* ป้ายข้อมูล — ตอบคำถามที่ผู้ใช้ถามก่อนอัปโหลดเสมอ: ใหญ่ได้แค่ไหน ไฟล์อยู่นานแค่ไหน ทำงานที่ไหน
   วางไว้ใต้ชื่อเรื่องเพราะเป็นสิ่งที่ต้องรู้ "ก่อน" ลงมือ ไม่ใช่หลังจากอัปเสร็จแล้วเจอ error */
.tool-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fact {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  color: var(--text); background: rgba(255,255,255,.78); border: 1px solid var(--line);
}
.fact .material-symbols-rounded { font-size: 16px; color: var(--muted); }
.fact.good { background: rgba(52,168,83,.09); border-color: rgba(52,168,83,.26); color: var(--color-success-text); }
.fact.good .material-symbols-rounded { color: var(--success); }

/* ── โครงสองคอลัมน์ ── */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.tool-work { min-width: 0; }
/* 78px = ความสูง topbar ที่ sticky อยู่ + ระยะหายใจ ไม่งั้นหัวแถบข้างมุดใต้เมนู */
.tool-aside { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px;
  /* จอเตี้ย (โน้ตบุ๊ก 1440×700 หรือหน้าต่างที่ถูกย่อ) แถบข้างอาจสูงกว่าจอ
     ถ้าไม่กันไว้ ส่วนล่างของแถบจะเลื่อนไปดูไม่ได้เลยเพราะมันติดหนึบอยู่กับที่
     ให้เลื่อนในตัวมันเองแทน — เกิดขึ้นเฉพาะตอนที่จำเป็นจริง ๆ */
  max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; }

.aside-card { background: rgba(255,255,255,.86); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 18px; }
.aside-card h3 { margin: 0 0 12px; font-size: 14px; color: var(--ink); letter-spacing: -.1px;
  display: flex; align-items: center; gap: 8px; }
.aside-card h3 .material-symbols-rounded { font-size: 18px; color: var(--blue); }

/* วิธีใช้ — แนวตั้งในแถบข้าง แทนที่จะเป็นการ์ดสามใบขวางกลางหน้า
   เลขขั้นตอนเป็นวงกลมทึบเพื่อให้กวาดตาแล้วรู้ทันทีว่าเป็นลำดับ ไม่ใช่รายการทั่วไป */
.steps-v { display: flex; flex-direction: column; gap: 12px; }
.step-v { display: flex; gap: 10px; align-items: flex-start; }
.step-n { width: 22px; height: 22px; flex: none; border-radius: 999px; display: grid; place-items: center;
  background: var(--blue); color: var(--card); font-size: 12px; font-weight: 700; margin-top: 1px; }
.step-v p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--text); }
.step-v b { color: var(--ink); font-weight: 600; }

/* รายการข้อเท็จจริงในแถบข้าง — คู่ "หัวข้อ / ค่า" ที่อ่านเร็ว */
.kv { display: flex; flex-direction: column; gap: 9px; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv-row > span { color: var(--muted); }
.kv-row > b { color: var(--ink); font-weight: 600; text-align: right; }

/* ── ส่วนล่างเต็มความกว้าง ── */
.tool-more { margin-top: 34px; }
/* คำถามที่พบบ่อยเดิมยาว 700px ในคอลัมน์เดียว — สองคอลัมน์บนจอกว้างทำให้เห็นครบโดยไม่ต้องเลื่อน
   ใช้ grid ไม่ใช่ columns เพราะ columns ตัด <details> ที่กางอยู่ขาดครึ่งข้ามคอลัมน์ */
.faq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.faq-cols > .accordion { gap: 12px; }

@media (max-width: 1100px) {
  .tool-layout { grid-template-columns: 1fr; }
  /* แถบข้างเลิกติดหนึบเมื่อไหลลงมาอยู่ใต้พื้นที่ทำงาน — ติดหนึบในโหมดคอลัมน์เดียวไม่มีประโยชน์ */
  .tool-aside { position: static; }
  .faq-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tool-head { gap: 12px; }
  .tool-head-ic { width: 46px; height: 46px; border-radius: 15px; }
  .tool-head-ic .material-symbols-rounded { font-size: 25px; }
}

/* ══════════════════════════════════════════════════════════════════
   สารบัญเครื่องมือ (/tools) · หน้าหมวด · จานสั่งงาน Ctrl+K
   ── ต่อท้ายไฟล์เท่านั้น ไม่แก้กฎเดิมด้านบน ──
   ══════════════════════════════════════════════════════════════════ */

/* ช่องค้นหา: กฎ input[type=search] ทั่วไปด้านบนมี specificity เท่ากับ .searchbar input
   และอยู่ทีหลัง จึงชนะเสมอ — ต้องยกน้ำหนักด้วยการระบุ type เข้าไปด้วย
   (home.html แก้ปัญหาเดียวกันนี้ในสไตล์ของตัวเองมาก่อน กฎนี้ทำให้หน้าอื่นได้ด้วย) */
.searchbar input[type="search"] {
  border: none; background: transparent; box-shadow: none;
  border-radius: 0; padding: 8px 0; width: auto; flex: 1;
}
.searchbar input[type="search"]:focus { border: none; box-shadow: none; outline: none; }
.searchbar input[type="search"]::-webkit-search-cancel-button { display: none; }

/* ป้ายบรรทัดที่สามของการ์ดเครื่องมือ — "ทำงานในเครื่องคุณ" / "รับไฟล์โดยไม่อัปโหลด"
   ตัวเล็กและสีเขียวจาง ๆ โดยตั้งใจ: เป็นข้อเท็จจริงประกอบ ไม่ใช่คำโฆษณาที่ต้องแย่งสายตา
   กับชื่อเครื่องมือ */
.tool .tl {
  display: flex; align-items: center; gap: 4px; margin-top: 6px;
  font-size: 11px; font-weight: 600; color: var(--color-success-text);
}
.tool .tl .material-symbols-rounded { font-size: 14px; color: var(--color-success); }

/* ── จานสั่งงาน Ctrl+K ─────────────────────────────────────────────
   ใช้ position:fixed ครอบทั้งจอ และวางกล่องไว้ค่อนไปทางบน (ไม่ใช่กึ่งกลางแนวตั้ง)
   เพราะพอผลลัพธ์งอกออกมา กล่องที่จัดกึ่งกลางจะขยับขึ้นลงตามจำนวนแถวจนตาลาย */
.ts-pal { position: fixed; inset: 0; z-index: 90; display: flex;
  align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.ts-pal[hidden] { display: none; }
.ts-pal-back { position: absolute; inset: 0; background: rgba(15,23,42,.42); }
.ts-pal-box { position: relative; width: 100%; max-width: 620px;
  background: var(--color-surface); border: 1px solid var(--line);
  border-radius: var(--r16); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; max-height: 76vh; }
.ts-pal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); }
.ts-pal-head .material-symbols-rounded { color: var(--muted); flex-shrink: 0; }
.ts-pal-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font: inherit; font-size: 15px; color: var(--color-ink); padding: 4px 0; }
.ts-pal-input::-webkit-search-cancel-button { display: none; }
.ts-pal-esc { border: 1px solid var(--line); background: var(--color-bg-soft);
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 600;
  border-radius: 7px; padding: 3px 8px; cursor: pointer; flex-shrink: 0; }
.ts-pal-list { overflow-y: auto; padding: 6px; }
.ts-pal-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: 11px; text-decoration: none; color: var(--text); }
.ts-pal-row .material-symbols-rounded { color: var(--color-primary); flex-shrink: 0; }
.ts-pal-row span:nth-child(2) { flex: 1; min-width: 0; }
.ts-pal-row b { display: block; color: var(--color-ink); font-size: 14px; font-weight: 600; }
.ts-pal-row i { display: block; font-style: normal; color: var(--muted); font-size: 12px;
  line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-pal-row.is-active { background: rgba(26,115,232,.1); }
.ts-pal-tag { flex-shrink: 0; font-size: 10.5px; font-weight: 700;
  color: var(--color-success-text); background: rgba(52,168,83,.12);
  border-radius: 999px; padding: 3px 9px; }
.ts-pal-empty { margin: 0; padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13.5px; }
.ts-pal-foot { border-top: 1px solid var(--line); padding: 8px 14px;
  font-size: 11.5px; color: var(--muted); text-align: right; }
/* ล็อกไม่ให้หน้าหลังเลื่อนตามตอนจานเปิดอยู่ */
body.ts-pal-on { overflow: hidden; }

@media (max-width: 560px) {
  .ts-pal { padding: 6vh 10px 10px; }
  .ts-pal-foot { display: none; }
  .ts-pal-tag { display: none; }
}
