:root {
  --bg: #ffffff; --bg-alt: #f5f5f7; --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #86868b; --line: #d2d2d7;
  --blue: #0071e3; --blue-hover: #0077ed; --link: #0066cc; --card: #ffffff;
  --crim: #bf4800; --civil: #0a6cbc; --ok: #248a3d; --err: #d70015;
  --nav: rgba(255,255,255,.72);
  --g1: #0071e3; --g2: #8e5af7; --g3: #e0428b;
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --bg: #000; --bg-alt: #111113; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #86868b; --line: #3a3a3c; --card: #1c1c1e; --link: #2997ff; --nav: rgba(22,22,23,.72); --crim: #ff9f0a; --civil: #64d2ff; --ok: #30d158; --err: #ff453a; }
}
:root[data-theme=dark] { --bg: #000; --bg-alt: #111113; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #86868b; --line: #3a3a3c; --card: #1c1c1e; --link: #2997ff; --nav: rgba(22,22,23,.72); --crim: #ff9f0a; --civil: #64d2ff; --ok: #30d158; --err: #ff453a; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--link); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 18px; border-radius: 99px; font-size: 14px; transition: top .2s var(--ease); }
.skip:focus { top: 8px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.nav-in { max-width: 1024px; margin: 0 auto; height: 48px; display: flex; align-items: center; gap: 28px; padding: 0 22px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { position: relative; color: var(--ink); opacity: .8; font-size: 13px; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px; border-radius: 2px; background: var(--ink); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav-links a[aria-current=true] { opacity: 1; }
.nav-links a[aria-current=true]::after { transform: scaleX(1); }
.nav-cta { font-size: 12.5px; background: var(--blue); color: #fff; padding: 3px 13px; border-radius: 99px; line-height: 1.7; transition: background .2s; }
.nav-cta:hover { background: var(--blue-hover); }
.nav-burger { display: none; background: none; border: 0; width: 36px; height: 36px; position: relative; cursor: pointer; margin-left: 0; }
.nav-burger span { position: absolute; left: 9px; right: 9px; height: 1.5px; background: var(--ink); transition: .25s; }
.nav-burger span:first-child { top: 14px; } .nav-burger span:last-child { top: 21px; }
.nav-burger[aria-expanded=true] span:first-child { top: 17px; transform: rotate(45deg); }
.nav-burger[aria-expanded=true] span:last-child { top: 17px; transform: rotate(-45deg); }

/* type */
.eyebrow { font-size: 17px; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; letter-spacing: -.005em; }
/* ภาษาไทยมีสระ/วรรณยุกต์สูงต่ำ — ระยะบรรทัดของหัวข้อใหญ่ต้องไม่ต่ำกว่า ~1.32 ไม่งั้นบรรทัดบนกับล่างทับกัน */
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.32; text-wrap: balance; }
h1 { font-size: clamp(40px, 7.4vw, 84px); font-weight: 700; line-height: 1.34; }
h2 { font-size: clamp(32px, 5.2vw, 56px); font-weight: 700; }
.lead { font-size: clamp(18px, 2.2vw, 24px); line-height: 1.55; color: var(--ink-2); font-weight: 400; max-width: 34em; margin: 18px auto 0; text-wrap: pretty; }
.grad { background: linear-gradient(92deg, var(--g1) 0%, var(--g2) 55%, var(--g3) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .08em; }
.fine { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* buttons */
.actions { display: flex; gap: 22px; justify-content: center; align-items: center; margin-top: 30px; flex-wrap: wrap; }
.btn-pill { display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; padding: 11px 24px; border-radius: 99px; font-size: 17px; font-weight: 500; transition: background .2s, transform .15s; }
.btn-pill.sm { padding: 5px 16px; font-size: 14px; }
.btn-pill.primary { background: var(--blue); color: #fff; } .btn-pill.primary:hover { background: var(--blue-hover); }
.btn-pill.ghost { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); } .btn-pill.ghost:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.btn-pill.light { background: #fff; color: #1d1d1f; } .btn-pill.light:hover { background: #e8e8ed; }
.btn-pill:active { transform: scale(.97); }
.btn-pill:focus-visible { outline-offset: 3px; border-radius: 99px; }
.link-arrow { font-size: 19px; } .link-arrow::after { content: ' ›'; }
.link-arrow:hover { text-decoration: underline; }

/* sections */
.hero { text-align: center; padding: clamp(24px, 5vw, 56px) 22px 60px; max-width: 1024px; margin: 0 auto; }
.sec { padding: clamp(64px, 11vw, 120px) 0; }
.sec.alt { background: var(--bg-alt); }
.sec.dark { background: #000; color: #f5f5f7; --ink: #f5f5f7; --ink-2: #a1a1a6; }
.wrap { max-width: 1024px; margin: 0 auto; padding: 0 22px; }
.wrap.narrow { max-width: 780px; }
.sec-head { text-align: center; margin-bottom: 44px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 64px; }
.stat { padding: 8px; } .stat b { display: block; font-size: clamp(30px, 5vw, 52px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: 15px; }

/* scales of justice */
.scales-wrap { width: clamp(176px, 26vw, 256px); margin: 0 auto clamp(16px, 3vw, 30px); color: var(--ink); will-change: transform, opacity;
  transform: translate3d(0, calc(var(--p, 0) * 30px), 0); opacity: calc(1 - var(--p, 0) * .4); }
.scales { --amp: 6deg; display: block; width: 100%; height: auto; overflow: visible; color: var(--ink); }
.scales-wrap .scales { --amp: var(--amp-live, 6deg); }
.scales .d { stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.scales .bowl { fill-opacity: 0; }
.scales .beam { transform-origin: 200px 70px; }
.scales .pan, .scales .dish { transform-origin: 60px 70px; }
.scales .pan.r, .scales .dish.r { transform-origin: 340px 70px; }
.scales.play .d { animation: s-draw var(--dur, .65s) cubic-bezier(.4,0,.2,1) calc(var(--d, 0s) * .28) forwards; }
.scales.play .bowl { animation: s-draw var(--dur, .65s) cubic-bezier(.4,0,.2,1) calc(var(--d, 0s) * .28) forwards, s-fill .5s ease-out calc(var(--d, 0s) * .28 + var(--dur, .65s) * .7) forwards; }
.scales.play .beam { animation: s-tilt 7.5s ease-in-out 2.4s infinite both; }
.scales.play .pan { animation: s-untilt 7.5s ease-in-out 2.4s infinite both; }
.scales.play .dish { animation: s-dish 7.5s ease-in-out 2.7s infinite both; }
.scales.mini { --amp: 4deg; --dur: .5s; }
@keyframes s-draw { to { stroke-dashoffset: 0; } }
@keyframes s-fill { to { fill-opacity: .92; } }
@keyframes s-tilt { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(var(--amp)); } 75% { transform: rotate(calc(var(--amp) * -1)); } }
@keyframes s-untilt { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(calc(var(--amp) * -1)); } 75% { transform: rotate(var(--amp)); } }
@keyframes s-dish { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(calc(var(--amp) * -.22)); } 75% { transform: rotate(calc(var(--amp) * .22)); } }
.mini-scales { width: 78px; margin: 0 auto 16px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  /* ผู้ใช้ที่ลดการเคลื่อนไหว: ยังเห็นเส้นค่อย ๆ วาดเข้า แต่ไม่มีการโยก/เลื่อนตาม scroll */
  .scales.play .beam, .scales.play .pan, .scales.play .dish { animation: none; }
  .scales-wrap { transform: none; opacity: 1; }
}

/* library */
.search { position: relative; max-width: 560px; margin: 0 auto 18px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; border: 0; background: var(--card); border-radius: 14px; padding: 15px 18px 15px 46px; font-size: 17px; box-shadow: 0 0 0 1px var(--line) inset; transition: box-shadow .2s; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 55%, transparent); }
.chips { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
.kindseg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.kindseg button { border: 0; background: transparent; padding: 6px 20px; border-radius: 9px; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s; }
.kindseg button:hover { color: var(--ink); }
.kindseg button[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.kindseg button:focus-visible { outline-offset: 1px; }
.lawrow { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.chip { border: 0; background: var(--card); box-shadow: 0 0 0 1px var(--line) inset; padding: 6px 15px; border-radius: 99px; cursor: pointer; font-size: 14.5px; transition: .15s; }
.chip:hover { box-shadow: 0 0 0 1px var(--ink-3) inset; }
.chip:focus-visible { outline-offset: 3px; border-radius: 99px; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip small { opacity: .55; margin-left: 5px; font-size: 12.5px; }
.pillsel { position: relative; display: inline-block; }
.pillsel select { appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; font-size: 14.5px; max-width: min(300px, 78vw); padding: 6px 34px 6px 15px; border-radius: 99px; color: var(--ink); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center; box-shadow: 0 0 0 1px var(--line) inset; text-overflow: ellipsis; }
.pillsel select:hover { box-shadow: 0 0 0 1px var(--ink-3) inset; }
.pillsel.on select { background-color: var(--ink); color: var(--bg); box-shadow: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.count { text-align: center; font-size: 13.5px; color: var(--ink-3); margin: 0 0 16px; min-height: 1.6em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 0; border-radius: 22px; padding: 22px 24px 20px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: transform .25s var(--ease), box-shadow .25s; box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent); }
.card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 14px 34px rgba(0,0,0,.09); }
.card:active { transform: scale(.985); }
.card:focus-visible { outline-offset: 3px; border-radius: 22px; }
.card .law { font-size: 13px; color: var(--ink-3); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.card .sec-no { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.card .sec-no small { font-size: 15px; font-weight: 500; color: var(--ink-3); margin-right: 4px; letter-spacing: 0; }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.card p { margin: 0; font-size: 14.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.skel { min-height: 168px; pointer-events: none; box-shadow: none; background: linear-gradient(100deg, var(--card) 30%, color-mix(in srgb, var(--ink) 6%, var(--card)) 50%, var(--card) 70%) 0 0 / 220% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.tag { font-size: 12px; padding: 1px 9px; border-radius: 99px; font-weight: 600; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tag.crim { color: var(--crim); background: color-mix(in srgb, var(--crim) 12%, transparent); }
.tag.civil { color: var(--civil); background: color-mix(in srgb, var(--civil) 12%, transparent); }
.tag.warn { color: var(--crim); background: color-mix(in srgb, var(--crim) 12%, transparent); }
.more { text-align: center; margin-top: 28px; }
.empty { grid-column: 1/-1; text-align: center; color: var(--ink-2); padding: 44px 0; display: grid; gap: 14px; justify-items: center; }
.empty p { margin: 0; }

/* jurisdiction */
.finder { background: var(--bg-alt); border-radius: 28px; padding: 28px; display: grid; gap: 18px; }
.finder-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: color-mix(in srgb, var(--ink) 8%, transparent); border-radius: 10px; padding: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 22px; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 500; transition: .2s; }
.seg input:checked + span { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 70%, transparent); }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sel { display: grid; gap: 6px; align-content: start; min-width: 0; }
.sel > span { font-size: 14px; font-weight: 600; line-height: 1.4; } .sel small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.sel select { width: 100%; appearance: none; -webkit-appearance: none; border: 0; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 16px center; border-radius: 12px; padding: 13px 40px 13px 16px; font-size: 16px; box-shadow: 0 0 0 1px var(--line) inset; cursor: pointer; text-overflow: ellipsis; transition: box-shadow .2s, opacity .25s; }
.sel select:hover:not(:disabled) { box-shadow: 0 0 0 1px var(--ink-3) inset; }
.sel select:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 55%, transparent); }
.sel select:disabled { opacity: .45; cursor: not-allowed; }
.sel select option { color: #1d1d1f; background: #fff; }
.court-out { display: grid; }
.jhint { text-align: center; color: var(--ink-3); margin: 0; padding: 14px 0 6px; font-size: 15px; }
.jcard { background: var(--card); border-radius: 22px; padding: 22px 24px 24px; animation: rise .55s var(--ease) both; }
.jhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 18px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.jhead .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.addr { margin: 2px 0 0; font-size: clamp(19px, 3vw, 24px); font-weight: 650; letter-spacing: -.01em; line-height: 1.4; }
.addr .muted { color: var(--ink-3); font-weight: 500; }
.zip { align-self: center; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 99px; padding: 4px 14px; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zip b { color: var(--ink); font-weight: 650; letter-spacing: .02em; }
.jsec { margin-top: 22px; animation: rise .55s var(--ease) both; animation-delay: calc(min(var(--i, 0), 10) * 45ms); }
.jsec h4 { margin: 0 0 10px; font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: -.005em; }
.jsec.minor h4 { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.court-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.court { background: var(--bg-alt); border-radius: 14px; padding: 11px 14px 12px; font-size: 15px; line-height: 1.45; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; animation: rise .5s var(--ease) both; animation-delay: calc(min(var(--i, 0), 14) * 35ms + 80ms); }
.court .cn { font-weight: 550; }
.court small { display: block; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.court.hl { background: color-mix(in srgb, var(--blue) 8%, var(--card)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--blue) 50%, transparent) inset; }
.badge { display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 0 9px; border-radius: 99px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.badge.pending { color: var(--crim); background: color-mix(in srgb, var(--crim) 13%, transparent); }
.badge.match { color: var(--link); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.jwarn { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--crim) 9%, transparent); border-radius: 14px; padding: 11px 14px; font-size: 14px; line-height: 1.55; color: var(--ink); }
.jwarn::before { content: '!'; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--crim); color: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 2px; }
.jnote { margin: 18px 0 0; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 26px 0 14px; }
.rule { background: var(--bg-alt); border-radius: 22px; padding: 22px; }
.rule h3 { font-size: 17px; margin-bottom: 8px; font-weight: 600; } .rule p { margin: 0; color: var(--ink-2); font-size: 15px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* process */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.steps li { counter-increment: s; background: var(--card); border-radius: 22px; padding: 22px 26px 22px 80px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 24px; top: 20px; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.steps h3 { font-size: 19px; font-weight: 600; margin-bottom: 4px; } .steps p { margin: 0; color: var(--ink-2); font-size: 15.5px; } .steps .ref { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* feature tiles */
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tile { background: #161617; border-radius: 28px; padding: 30px 28px 34px; min-height: 240px; display: flex; flex-direction: column; justify-content: flex-end; }
.tile h3 { font-size: 27px; font-weight: 700; margin-bottom: 10px; } .tile p { margin: 0; color: #a1a1a6; font-size: 15.5px; }
.actions.center { margin-top: 44px; }

/* footer */
.foot { background: var(--bg-alt); padding: 36px 0 48px; font-size: 13px; color: var(--ink-3); }
.foot p { margin: 0 0 10px; max-width: 70ch; } .foot strong { color: var(--ink-2); }
.foot.sf { padding: clamp(40px, 6vw, 64px) 0 28px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.sf-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.15fr 1.3fr; gap: 36px 40px; padding-bottom: 36px; }
.sf-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.sf-logo b { font-weight: 700; background: linear-gradient(92deg, #0071e3, #8e5af7 60%, #e0428b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sf-mark { height: 28px; width: auto; display: block; }
.foot .sf-name { margin: 14px 0 6px; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.5; }
.foot .sf-desc { margin: 0 0 18px; font-size: 13.5px; line-height: 1.7; max-width: 38ch; }
.sf-cta { text-decoration: none; }
.sf-h { margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .01em; color: var(--ink); line-height: 1.4; }
.sf-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.sf-col a { color: var(--ink-2); font-size: 14px; line-height: 1.5; transition: color .15s; }
.sf-col a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.sf-addr { font-style: normal; display: grid; gap: 3px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.sf-addr b { color: var(--ink); font-weight: 600; font-size: 14px; }
.sf-contacts { margin-top: 14px !important; }
.sf-contacts li { font-size: 14px; color: var(--ink-2); }
.sf-contacts li > a > span, .sf-contacts li > span { color: var(--ink-3); margin-right: 4px; }
.sf-bottom { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); padding-top: 20px; display: grid; grid-template-columns: 1fr auto; gap: 8px 28px; align-items: start; }
.foot .sf-copy { grid-column: 1; margin: 0; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.foot .sf-legal { grid-column: 1; margin: 0; max-width: 78ch; font-size: 12.5px; line-height: 1.7; }
.foot .sf-links { grid-column: 2; grid-row: 1 / span 2; margin: 0; display: flex; gap: 18px; font-size: 13px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sf-links a { color: var(--ink-2); } .sf-links a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.sf-links .sf-admin { color: var(--ink-3); font-size: 12px; }
@media (max-width: 900px) { .sf-grid { grid-template-columns: 1fr 1fr; } .sf-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .sf-grid { grid-template-columns: 1fr; gap: 28px; }
  .sf-bottom { grid-template-columns: 1fr; }
  .foot .sf-links { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 6px; }
}

/* sheet */
dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog[open] { display: grid; place-items: end center; }
@media (min-width: 700px) { dialog[open] { place-items: center; } }
dialog article { position: relative; background: var(--card); width: min(680px, 100%); max-height: 90vh; max-height: 90dvh; overflow: auto; overscroll-behavior: contain; border-radius: 28px 28px 0 0; padding: 34px 32px 36px; animation: up .35s var(--ease); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
@media (min-width: 700px) { dialog article { border-radius: 28px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.x { position: absolute; right: 16px; top: 16px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 10%, transparent); cursor: pointer; transition: background .2s; }
.x:hover { background: color-mix(in srgb, var(--ink) 18%, transparent); }
.detail h3 { font-size: 30px; font-weight: 700; margin: 8px 0 16px; padding-right: 30px; }
.detail dl { display: grid; grid-template-columns: 8em 1fr; gap: 12px 18px; margin: 0; font-size: 16px; }
.detail dt { color: var(--ink-3); font-size: 14px; padding-top: 2px; } .detail dd { margin: 0; }
.detail .box { background: var(--bg-alt); border-radius: 14px; padding: 12px 16px; margin-top: 16px; font-size: 15px; }
.detail .cta { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .detail dl { grid-template-columns: 1fr; gap: 2px; } .detail dt { margin-top: 10px; } }

/* reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; }
  dialog article, .jcard, .jsec, .court { animation: none; }
  .card.skel { animation: none; }
  .card, .card:hover { transition: none; transform: none; }
}

@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 48px 0 auto 0; background: var(--bg); flex-direction: column; gap: 0; padding: 8px 22px 18px; margin: 0; border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .25s; }
  .nav-links a { font-size: 17px; padding: 12px 0; border-bottom: 1px solid var(--line); opacity: 1; }
  .nav-links a::after { display: none; }
  .nav-links a[aria-current=true] { color: var(--ink); font-weight: 600; }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-burger { display: block; } .nav-cta { margin-left: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 48px; }
  .steps li { padding-left: 74px; }
  .finder { padding: 20px; border-radius: 24px; }
  .fields { grid-template-columns: 1fr; }
  .jcard { padding: 18px 18px 20px; }
  .court-list { grid-template-columns: 1fr; }
  .sec-head { margin-bottom: 32px; }
  dialog article { padding: 30px 22px 32px; }
}

[hidden] { display: none !important; }

.logo-mark { height: var(--logo-h, 22px); width: auto; display: block; }
/* โลโก้เป็น SVG ที่ใช้สี currentColor จึงสลับโหมดมืดเองได้ ไม่ต้อง invert */

.nav-in { height: auto; min-height: 48px; padding-top: 4px; padding-bottom: 4px; }

.logo-text { font-weight: 500; letter-spacing: -.01em; display: flex; flex-direction: column; line-height: 1.15; }
.logo-text .lt-th { font-size: 14px; font-weight: 600; white-space: nowrap; }
.logo-text .lt-en { font-size: 10.5px; font-weight: 400; letter-spacing: .03em; color: var(--ink-2); white-space: nowrap; }
.logo-text b { font-weight: 700; background: linear-gradient(92deg, #0071e3, #8e5af7 60%, #e0428b); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 1px; }
.logo { gap: 9px; }

.firm { font-style: normal; display: grid; gap: 2px; margin: 14px 0 12px; font-size: 13.5px; color: var(--ink-2); }
.firm b { color: var(--ink); font-weight: 600; font-size: 14px; }

/* ---------- โหลดข้อมูลแบบนุ่ม ๆ (ไม่ให้โผล่พรึบ) ---------- */
@keyframes sf-pop { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.cards .card.pop { animation: sf-pop .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 38ms); }
.cards .card.skel { animation: sf-pulse 1.4s ease-in-out infinite; }
@keyframes sf-pulse { 50% { opacity: .55; } }
#results[aria-busy=false], #steps, .rules, .court-out { animation: sf-fade .4s ease both; }
@keyframes sf-fade { from { opacity: 0; } to { opacity: 1; } }
#steps li { animation: sf-pop .5s var(--ease) both; }
#steps li:nth-child(2) { animation-delay: .06s; } #steps li:nth-child(3) { animation-delay: .12s; } #steps li:nth-child(4) { animation-delay: .18s; }
#steps li:nth-child(5) { animation-delay: .24s; } #steps li:nth-child(n+6) { animation-delay: .3s; }
select, input { transition: box-shadow .2s, background-color .2s; }
.court-out > * { animation: sf-pop .45s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .cards .card.pop, .cards .card.skel, #results[aria-busy=false], #steps, #steps li, .rules, .court-out, .court-out > * { animation: none; } }

/* โลโก้/ชื่อสำนักงาน: ขาว-ดำตามโหมด คนละบรรทัด (ไทย / อังกฤษ) */
.logo-text .lt-th, .sf-logo .lt-th { color: var(--ink); }
.logo-text .lt-en, .sf-logo .lt-en { color: var(--ink-2); }
.sf-logo { color: var(--ink); }
.sf-copy { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.sf-copy-name { display: flex; flex-direction: column; line-height: 1.35; }
.sf-copy-name > span:last-child { color: var(--ink-3); }

/* ==========================================================================
   มือถือ (portrait) — เว็บสาธารณะ: ออกแบบจากจอโทรศัพท์แนวตั้งก่อน
   (ต่อท้ายไฟล์ · ไม่แตะหน้าจอ ≥ 1024px)  กฎ: ปุ่ม/ลิงก์กดได้ ≥ 44px · ช่องกรอก 16px · ขอบข้าง 18px
   ========================================================================== */
a, button, select, input, textarea, label, summary { touch-action: manipulation; }
.nav-cta { white-space: nowrap; }
@media (hover: none) {
  .card:hover { transform: none; box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent); }
  .btn-pill:hover, .chip:hover, .nav-links a:hover { transform: none; }
}

@media (max-width: 760px) {
  :root { --gut: 18px; }
  html { scroll-padding-top: 72px; }
  body { overflow-wrap: break-word; }

  /* --- แถบเมนู: โลโก้ + ปุ่มเข้าสู่ระบบ + แฮมเบอร์เกอร์ในบรรทัดเดียว --- */
  .nav { padding-top: env(safe-area-inset-top, 0px); }
  .nav-in { min-height: 56px; gap: 6px; padding: 4px max(var(--gut), env(safe-area-inset-right)) 4px max(var(--gut), env(safe-area-inset-left)); }
  .logo { min-width: 0; min-height: 44px; gap: 8px; flex: 0 1 auto; }
  .logo-mark { --logo-h: 24px; flex: none; }
  .logo-text .lt-th { font-size: 14px; }
  .logo-text .lt-en { font-size: 11px; }
  .nav-cta { position: relative; margin-left: auto; flex: none; font-size: 13px; padding: 5px 14px; line-height: 1.5; }
  .nav-cta::before { content: ''; position: absolute; inset: -8px -3px; } /* ขยายพื้นที่กดเป็น 44px โดยไม่เปลี่ยนหน้าตา */
  .nav-burger { width: 44px; height: 44px; margin-right: -10px; flex: none; }
  .nav-burger span { left: 12px; right: 12px; height: 2px; border-radius: 2px; }
  .nav-burger span:first-child { top: 16px; } .nav-burger span:last-child { top: 25px; }
  .nav-burger[aria-expanded=true] span:first-child, .nav-burger[aria-expanded=true] span:last-child { top: 21px; }
  .nav-links { position: absolute; inset: 100% 0 auto 0; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain;
    padding: 4px max(var(--gut), env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom, 0px)) max(var(--gut), env(safe-area-inset-left));
    box-shadow: 0 22px 36px -12px rgba(0, 0, 0, .22); visibility: hidden; transition: transform .25s var(--ease), opacity .25s, visibility 0s .25s; }
  .nav-links.open { visibility: visible; transition-delay: 0s; }
  .nav-links a { display: flex; align-items: center; min-height: 52px; padding: 6px 0; }
  .nav-links a:last-child { border-bottom: 0; }

  /* --- ตัวอักษร / ระยะห่าง --- */
  h1 { font-size: clamp(34px, 9.8vw, 44px); }
  h2 { font-size: clamp(27px, 7.6vw, 34px); }
  .eyebrow { font-size: 15px; margin-bottom: 8px; }
  .lead { font-size: 17px; line-height: 1.65; margin-top: 14px; }
  .fine { font-size: 14px; }
  .count { font-size: 14px; }
  .hero { padding: 16px var(--gut) 44px; }
  .scales-wrap { width: clamp(150px, 42vw, 190px); margin-bottom: 16px; }
  .sec { padding: 52px 0; }
  .wrap { padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); }
  .sec-head { margin-bottom: 26px; }
  .actions { gap: 6px 22px; margin-top: 24px; }
  .btn-pill { min-height: 48px; padding: 11px 26px; }
  .btn-pill.sm { min-height: 44px; padding: 8px 18px; }
  .link-arrow { display: inline-flex; align-items: center; min-height: 44px; font-size: 17px; }
  .stats { margin-top: 36px; gap: 18px 12px; }

  /* --- คลังกฎหมาย: ค้นหา / ตัวกรองเลื่อนแนวนอน / การ์ดแน่นขึ้น --- */
  .search input { padding: 15px 16px 15px 46px; -webkit-appearance: none; appearance: none; }
  .chips { align-items: stretch; gap: 12px; margin-bottom: 18px; }
  .kindseg { display: flex; }
  .kindseg button { flex: 1; min-height: 44px; padding: 6px 4px; font-size: 15.5px; }
  .lawrow { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--gut) * -1); padding: 2px var(--gut) 6px; scroll-padding: 0 var(--gut); scroll-snap-type: x proximity; }
  .lawrow::-webkit-scrollbar { display: none; }
  .lawrow > * { flex: none; scroll-snap-align: start; }
  .chip { min-height: 44px; padding: 0 16px; font-size: 15px; }
  .pillsel select { min-height: 44px; font-size: 16px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 12px; }
  .card { padding: 18px 18px 16px; border-radius: 20px; min-height: 44px; }
  .card .sec-no { font-size: 30px; }
  .card h3 { font-size: 18px; }
  .card p { font-size: 15px; }
  .card.skel { min-height: 130px; }
  .tag { font-size: 12.5px; }
  .more { margin-top: 20px; }

  /* --- เขตอำนาจศาล --- */
  .finder { padding: 16px; gap: 16px; }
  .finder-top { flex-wrap: nowrap; gap: 10px; }
  .seg { display: flex; flex: 1; }
  .seg label { flex: 1; }
  .seg span { min-height: 44px; display: grid; place-items: center; padding: 6px 12px; font-size: 16px; }
  .sel > span { font-size: 15px; }
  .sel small { font-size: 13px; }
  .sel select { min-height: 50px; }
  .court { font-size: 15.5px; }
  .court small { font-size: 13px; }
  .badge { font-size: 12px; }
  .rules { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); margin-top: 20px; }
  .rule { padding: 18px; border-radius: 20px; }

  /* --- ขั้นตอน / ไทล์ --- */
  .steps li { padding: 16px 16px 16px 62px; border-radius: 20px; }
  .steps li::before { left: 14px; top: 14px; width: 36px; height: 36px; font-size: 16px; }
  .steps h3 { font-size: 18px; }
  .steps p { font-size: 15.5px; line-height: 1.65; }
  .steps .ref { font-size: 13.5px; }
  .tile { min-height: 0; padding: 24px 22px 26px; border-radius: 24px; }
  .tile h3 { font-size: 23px; }
  .feat { grid-template-columns: 1fr; gap: 12px; }
  .actions.center { margin-top: 28px; }

  /* --- ท้ายเว็บ: ลิงก์ 2 คอลัมน์ ปุ่มกดสบายนิ้ว --- */
  .foot.sf { padding: 40px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
  .sf-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .sf-brand, .sf-firm { grid-column: 1 / -1; }
  .sf-col ul { gap: 0; }
  .sf-col a { display: flex; align-items: center; min-height: 44px; font-size: 15px; overflow-wrap: anywhere; }
  .sf-col ul.sf-contacts a { min-height: 40px; }
  .sf-h { font-size: 14px; margin-bottom: 6px; }
  .sf-desc { font-size: 14px; }
  .sf-links { gap: 0 20px !important; }
  .sf-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px !important; }
  .foot .sf-legal { font-size: 13px; }
  .sf-addr { font-size: 14px; }

  /* --- แผ่นรายละเอียดมาตรา (dialog) = bottom sheet --- */
  dialog article { display: flex; flex-direction: column; width: 100%; max-height: 92vh; max-height: 92dvh; padding: 0; overflow: hidden; border-radius: 24px 24px 0 0; box-shadow: 0 -12px 50px rgba(0, 0, 0, .3); animation: sheet-up .34s var(--ease) both; }
  dialog article::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); pointer-events: none; z-index: 2; }
  #sheetBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 30px max(var(--gut), env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom, 0px)) max(var(--gut), env(safe-area-inset-left)); }
  .x { top: 8px; right: max(8px, env(safe-area-inset-right)); width: 44px; height: 44px; font-size: 16px; z-index: 3; }
  .detail h3 { font-size: 24px; margin: 6px 0 14px; padding-right: 44px; }
  .detail dl { font-size: 16px; }
  .detail .cta .btn-pill { flex: 1 1 100%; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 400px) {
  .logo-text .lt-th { font-size: 13.5px; }
  .nav-cta { padding: 5px 11px; }
  .stat b { font-size: 30px; }
}
@media (max-width: 340px) { .nav-cta { display: none; } }
/* จอแนวนอนเตี้ย ๆ (โทรศัพท์หมุนข้าง): ลดความสูงแถบเมนูและแผ่นรายละเอียด */
@media (max-height: 480px) and (max-width: 1000px) {
  .nav-in { min-height: 48px; }
  dialog article { max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .hero { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-links, .nav-links.open { transition: none; }
  dialog article { animation: none; }
}

/* การ์ดมาตรา (มือถือ): เลขมาตราซ้าย · ป้ายกฎหมายขวา — ลดความสูงต่อการ์ด */
@media (max-width: 760px) {
  .cards > .card:not(.skel) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; }
  .card .sec-no { grid-column: 1; grid-row: 1; }
  .card .law { grid-column: 2; grid-row: 1; justify-self: end; }
  .card h3, .card p { grid-column: 1 / -1; }
  .sf-logo { min-height: 44px; }
}
/* จอสัมผัสที่กว้างกว่า 760px (โทรศัพท์หมุนข้าง / แท็บเล็ต): ขยายพื้นที่กดเป็น 44px และช่องกรอก 16px */
@media (pointer: coarse) and (max-width: 1023px) and (min-width: 761px) {
  .chip, .kindseg button, .pillsel select, .btn-pill.sm, .seg span { min-height: 44px; }
  .pillsel select, .sel select { font-size: 16px; }
  .seg span { display: grid; place-items: center; }
  .nav-cta { padding: 8px 16px; }
  .sf-col a, .sf-links a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 760px) {
  .hero { padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); }
}
/* หน้าจอกลาง 761–940px (โทรศัพท์หมุนข้าง / แท็บเล็ตแนวตั้ง): เมนูลิงก์ต้องไม่ตัดบรรทัดกลางคำ */
.nav-links a { white-space: nowrap; }
@media (min-width: 761px) and (max-width: 940px) {
  .nav-in { gap: 14px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .nav-links { gap: 14px; }
  .logo-text .lt-th { font-size: 13.5px; }
  .logo { gap: 7px; }
}

/* ตราชั่งหัวหน้า: พ้นจอแล้วหยุดโยก (site.js สลับคลาส .off) */
.scales-wrap.off .scales.play .beam, .scales-wrap.off .scales.play .pan, .scales-wrap.off .scales.play .dish { animation-play-state: paused; }
/* ประกาศบนหัวเว็บ (แอดมินตั้งจากหลังบ้าน) และเวลาทำการท้ายเว็บ */
.announce { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 8px 16px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.5; text-align: center; }
.announce p { margin: 0; }
.announce a { color: inherit; text-decoration: underline; font-weight: 600; }
.announce button { border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; padding: 6px 8px; font-size: 14px; }
.announce button:hover { opacity: 1; }
.sf-hours { margin: 10px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.sf-hours b { color: var(--ink); font-weight: 600; }

/* หน้าบทความ — ใช้โทเคนสีจาก site.css (รองรับโหมดมืดอัตโนมัติ) */
.ar-main { padding-top: 44px; min-height: 70vh; }
.ar-hero { text-align: center; padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px); }
.ar-hero h1 { font-size: clamp(34px, 6vw, 60px); }
.ar-search { margin-bottom: 22px; }
#arcats { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }

.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding-bottom: clamp(56px, 9vw, 100px); }
.ar-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 22px; background: var(--bg-alt); color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s var(--ease); animation: ar-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.ar-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 0, 0, .09); }
.ar-card h2, .ar-card h3 { font-size: 21px; line-height: 1.35; letter-spacing: -.01em; }
.ar-card p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.ar-cat { align-self: flex-start; font-size: 12.5px; font-weight: 600; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); padding: 2px 11px; border-radius: 99px; }
.ar-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ar-refs i { font-style: normal; font-size: 12.5px; color: var(--ink-2); padding: 1px 9px; border-radius: 99px; box-shadow: 0 0 0 1px var(--line) inset; }
.ar-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 28px; }
.ar-facts div { padding: 18px 20px; border-radius: 20px; background: var(--bg-alt); }
.ar-facts b { display: block; font-size: 17px; line-height: 1.4; margin-bottom: 4px; }
.ar-facts span { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.ar-meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--ink-3); }
@keyframes ar-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.ar-skel { display: grid; gap: 14px; padding: 80px 0; }
.ar-skel i { display: block; height: 86px; border-radius: 18px; background: linear-gradient(100deg, var(--bg-alt) 30%, color-mix(in srgb, var(--bg-alt) 60%, var(--bg)) 50%, var(--bg-alt) 70%); background-size: 200% 100%; animation: ar-shim 1.3s linear infinite; }
@keyframes ar-shim { to { background-position: -200% 0; } }

/* หน้าอ่าน */
.ar-read { max-width: 1080px; }
.ar-crumb { margin: 8px 0 0; font-size: 14.5px; }
.ar-crumb a { color: var(--link); }
.ar-head { padding: 22px 0 28px; max-width: 760px; }
.ar-head h1 { font-size: clamp(28px, 4.6vw, 46px); line-height: 1.34; margin: 12px 0 10px; }
.ar-sub { margin: 0; font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); }
.ar-head .ar-meta { margin: 14px 0 0; padding: 0; }
.ar-review { margin: 12px 0 0; }
/* ป้ายสถานะการตรวจ: ร่าง = เหลือง · ตรวจแล้ว = เขียว · ตรวจแล้วโดยนักกฎหมาย = ฟ้า */
.ar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ar-rv { --rv: #a15c00; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; line-height: 1.5; padding: 2px 10px 2px 8px; border-radius: 99px; color: var(--rv); background: color-mix(in srgb, var(--rv) 13%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rv) 22%, transparent) inset; }
.ar-rv svg { flex: none; }
.ar-rv.full { font-size: 14px; padding: 4px 14px 4px 11px; gap: 7px; }
.ar-rv.checked { --rv: var(--ok); }
.ar-rv.lawyer { --rv: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .ar-rv.draft { --rv: #ffb340; } }
:root[data-theme=dark] .ar-rv.draft { --rv: #ffb340; }

.ar-cols { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; align-items: start; }
.ar-toc { position: sticky; top: 64px; font-size: 14px; max-height: calc(100vh - 84px); overflow: auto; }
.ar-toc summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; list-style: none; }
.ar-toc summary::-webkit-details-marker { display: none; }
.ar-toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.ar-toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-2); line-height: 1.4; transition: color .2s, border-color .2s; }
.ar-toc a:hover { color: var(--ink); }
.ar-toc a[aria-current=true] { color: var(--ink); border-left-color: var(--blue); font-weight: 600; }

.ar-body { max-width: 720px; font-size: 18px; line-height: 1.85; }
.ar-body p { margin: 0 0 1.1em; text-wrap: pretty; }
.ar-summary { font-size: 20px; color: var(--ink-2); }
.ar-key { background: var(--bg-alt); border-radius: 20px; padding: 20px 24px; margin: 0 0 8px; }
.ar-key ul { margin: 8px 0 0; padding-left: 1.2em; }
.ar-key li { margin-bottom: 6px; }
.ar-sec { padding-top: 36px; scroll-margin-top: 70px; }
.ar-sec h2 { font-size: clamp(23px, 3vw, 30px); margin-bottom: 14px; }
.ar-sec ul, .ar-sec ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.ar-sec li { margin-bottom: 6px; }

.ar-table { overflow-x: auto; margin: 0 0 1.2em; border-radius: 14px; box-shadow: 0 0 0 1px var(--line) inset; }
.ar-table table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.6; min-width: 480px; }
.ar-table th, .ar-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ar-table th { background: var(--bg-alt); font-weight: 600; white-space: nowrap; }
.ar-table tr:last-child td { border-bottom: 0; }

.ar-callout { border-radius: 16px; padding: 14px 18px; margin: 0 0 1.2em; font-size: 16.5px; line-height: 1.75; border-left: 4px solid var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.ar-callout p { margin: 4px 0 0; }
.ar-callout.warn { border-color: #ff9f0a; background: color-mix(in srgb, #ff9f0a 10%, transparent); }
.ar-callout.law { border-color: #8e5af7; background: color-mix(in srgb, #8e5af7 9%, transparent); }

.ar-steps { list-style: none; padding: 0 !important; counter-reset: st; }
.ar-steps li { position: relative; padding: 0 0 0 52px; margin-bottom: 20px; counter-increment: st; }
.ar-steps li::before { content: counter(st); position: absolute; left: 0; top: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 600; display: grid; place-items: center; font-size: 15px; }
.ar-steps p { margin: 2px 0 0; color: var(--ink-2); }
.ar-check { list-style: none; padding: 0 !important; }
.ar-check label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.ar-check input { width: 20px; height: 20px; margin-top: 7px; flex: none; accent-color: var(--blue); }
.ar-check input:checked + span { color: var(--ink-3); text-decoration: line-through; }

.ar-rel, .ar-prec { display: grid; gap: 12px; }
.ar-rel-card, .ar-prec article { background: var(--bg-alt); border-radius: 18px; padding: 16px 20px; font-size: 16px; line-height: 1.65; }
.ar-rel-card p, .ar-prec p { margin: 4px 0 0; }
.ar-rel-card p span { color: var(--ink-3); font-size: 14px; margin-right: 6px; }
.ar-rel-name { color: var(--ink-2); }
.ar-rel-card .btn-pill { margin-top: 10px; }
.ar-prec-topic { color: var(--ink-2); }
.ar-src-link { font-size: 14px; color: var(--link); }
.ar-flag { font-size: 14px; color: var(--ink-2); }
.ar-flag.warn { color: #a15c00; }
.ar-flag.inline { display: inline-block; padding: 0 8px; border-radius: 99px; background: color-mix(in srgb, #ff9f0a 16%, transparent); font-size: 12.5px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .ar-flag.warn { color: #ffb340; } }

.ar-faq { border-bottom: 1px solid var(--line); }
.ar-faq summary { cursor: pointer; padding: 14px 28px 14px 0; font-weight: 600; position: relative; list-style: none; line-height: 1.5; }
.ar-faq summary::-webkit-details-marker { display: none; }
.ar-faq summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font-size: 24px; font-weight: 300; color: var(--ink-3); transition: transform .25s var(--ease); }
.ar-faq[open] summary::after { transform: rotate(45deg); }
.ar-faq p { margin: 0 0 16px; color: var(--ink-2); }
.ar-sources { font-size: 15px; word-break: break-word; }
.ar-sources a { color: var(--link); }

.ar-disclaimer { margin-top: 44px; padding: 18px 22px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line) inset; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.ar-disclaimer p { margin: 4px 0 0; }
.ar-cta { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 24px; padding: 24px 28px; border-radius: 24px; background: #000; color: #f5f5f7; }
.ar-cta p { margin: 4px 0 0; color: #a1a1a6; font-size: 15px; line-height: 1.6; max-width: 32em; }
.ar-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0 72px; }
.ar-pn a { display: block; padding: 14px 18px; border-radius: 16px; background: var(--bg-alt); font-size: 15px; line-height: 1.5; font-weight: 500; }
.ar-pn a small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.ar-pn a.r { text-align: right; }
.ar-empty { text-align: center; padding: 120px 0; }
.ar-empty h1 { font-size: 32px; }
.ar-empty p { color: var(--ink-2); }

@media (max-width: 900px) {
  .ar-cols { grid-template-columns: 1fr; gap: 18px; }
  .ar-toc { position: static; max-height: none; background: var(--bg-alt); border-radius: 16px; padding: 14px 18px; }
  .ar-body { font-size: 17px; }
  .ar-pn { grid-template-columns: 1fr; }
}
/* ---------- หน้าแรก: คดีออนไลน์ (ตัวช่วยเลือกสถานการณ์ / เส้นทาง / CTA) ---------- */
#articles .ar-facts { margin-bottom: 40px; }
#articles .ar-grid { padding-bottom: 0; margin-bottom: 36px; }
.pk-h { font-size: clamp(21px, 2.6vw, 26px); font-weight: 700; letter-spacing: -.015em; }
.pk-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 52px 0 18px; }
.pk-row .link-arrow { font-size: 16px; }

.pk { margin: 0 0 56px; }
.pk-head { text-align: center; margin-bottom: 22px; }
.pk-head h3 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; }
.pk-head p { margin: 8px auto 0; color: var(--ink-2); font-size: 16px; max-width: 36em; }
.pk-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pk-opt { position: relative; display: grid; gap: 3px; align-content: start; text-align: left; border: 0; cursor: pointer; padding: 16px 18px 16px 62px; border-radius: 20px; background: var(--bg-alt); color: var(--ink); min-height: 92px;
  box-shadow: 0 0 0 1.5px transparent inset; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s; }
.pk-opt svg { position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; padding: 6px; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 11%, transparent); transition: background .25s, color .25s, transform .35s var(--ease); }
.pk-opt b { font-size: 16px; line-height: 1.4; font-weight: 600; }
.pk-opt span { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.pk-opt:hover { transform: translateY(-2px); }
.pk-opt:hover svg { transform: scale(1.06) rotate(-4deg); }
.pk-opt:active { transform: scale(.985); }
.pk-opt:focus-visible { outline-offset: 3px; border-radius: 20px; }
.pk-opt[aria-pressed=true] { background: var(--card); box-shadow: 0 0 0 2px var(--blue) inset, 0 10px 28px rgba(0, 0, 0, .08); }
.pk-opt[aria-pressed=true] svg { background: var(--blue); color: #fff; }

.pk-out { margin-top: 16px; scroll-margin-top: 70px; }
.pk-card { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 26px; padding: 26px 28px; border-radius: 26px; background: var(--bg-alt); animation: pk-in .45s var(--ease) both; }
.pk-main h4 { margin: 0 0 12px; font-size: 19px; line-height: 1.4; letter-spacing: -.01em; }
.pk-first { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: pk; display: grid; gap: 10px; }
.pk-first li { position: relative; counter-increment: pk; padding-left: 36px; font-size: 15.5px; line-height: 1.65; animation: pk-in .5s var(--ease) both; animation-delay: calc(var(--n, 0) * 70ms + 80ms); }
.pk-first li:nth-child(2) { --n: 1; } .pk-first li:nth-child(3) { --n: 2; }
.pk-first li::before { content: counter(pk); position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.pk-paths { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pk-paths span { font-size: 13px; color: var(--ink-3); margin-right: 4px; }
.pk-paths i { font-style: normal; font-size: 13px; padding: 2px 11px; border-radius: 99px; background: var(--card); box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink-2); }
.pk-side { display: flex; flex-direction: column; gap: 10px; align-items: stretch; padding: 18px 20px; border-radius: 18px; background: var(--card); align-self: start; }
.pk-time { margin: 0 0 4px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.pk-time b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.pk-side .btn-pill { text-align: center; text-decoration: none; }
.pk-note { margin: 12px 4px 0; }
@keyframes pk-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.rm-wrap { margin: 0 0 4px; }
.rm-wrap .pk-h { text-align: center; margin-bottom: 22px; }
.rm { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; position: relative; counter-reset: rm; }
.rm::before { content: ''; position: absolute; left: 12.5%; right: 12.5%; top: 20px; height: 2px; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3)); opacity: .35; transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .15s; }
.rm-wrap.in .rm::before { transform: scaleX(1); }
.rm li { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 6px; opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i) * 140ms + 200ms); }
.rm-wrap.in .rm li { opacity: 1; transform: none; }
.rm-n { position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 0 0 6px var(--bg); margin-bottom: 8px; }
.rm li:nth-child(3) .rm-n { background: linear-gradient(135deg, var(--g2), var(--g3)); }
.rm li:nth-child(4) .rm-n { background: linear-gradient(135deg, var(--g3), #ff6a3d); }
.rm b { font-size: 17px; line-height: 1.4; }
.rm p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); max-width: 24ch; }
.rm a { font-size: 13.5px; margin-top: 2px; } .rm a::after { content: ' ›'; }

.hcta { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; margin-top: 8px; padding: clamp(24px, 4vw, 36px) clamp(22px, 4vw, 40px); border-radius: 28px; color: #f5f5f7;
  background: radial-gradient(120% 140% at 0% 0%, rgba(0, 113, 227, .38), transparent 55%), radial-gradient(110% 130% at 100% 100%, rgba(224, 66, 139, .30), transparent 55%), #111113; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.hcta h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: #fff; }
.hcta p { margin: 8px 0 0; max-width: 38em; color: #b4b4b9; font-size: 15px; line-height: 1.7; }
.hcta .btn-pill { flex: none; text-decoration: none; }

@media (max-width: 860px) {
  .pk-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-card { grid-template-columns: 1fr; padding: 22px 20px; }
  .rm { grid-template-columns: 1fr 1fr; gap: 28px 14px; }
  .rm::before { display: none; }
}
@media (max-width: 520px) {
  .pk-opts { gap: 10px; }
  .pk-opt { padding: 14px 14px 14px 14px; min-height: 0; }
  .pk-opt svg { position: static; margin-bottom: 6px; }
  .rm { grid-template-columns: 1fr; text-align: left; gap: 22px; }
  .rm li { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: flex-start; column-gap: 14px; padding: 0; display: grid; grid-template-columns: 42px 1fr; }
  .rm-n { grid-row: 1 / span 4; margin: 0; }
  .rm p { max-width: none; }
  .hcta .btn-pill { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ar-card, .ar-skel i, .pk-card, .pk-first li { animation: none; } .ar-card { transition: none; }
  .pk-opt, .pk-opt svg { transition: none; } .pk-opt:hover, .pk-opt:hover svg { transform: none; }
  .rm::before { transform: none; transition: none; } .rm li { opacity: 1; transform: none; transition: none; }
}
@media print { .nav, .foot, .ar-toc, .ar-cta, .ar-pn, .ar-crumb { display: none !important; } .ar-cols { display: block; } }

.ar-main > .wrap { animation: ar-swap .4s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ar-swap { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ar-main > .wrap { animation: none; } }

/* ==========================================================================
   มือถือ (portrait) — บทความ / ตัวช่วยเลือกสถานการณ์ / หน้านโยบาย
   ========================================================================== */
@media (max-width: 900px) {
  /* คอลัมน์เดียวต้องเป็น minmax(0,1fr) ไม่งั้นตาราง (min-width) ดันทั้งหน้าให้กว้างเกินจอ */
  .ar-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: none) {
  .ar-card:hover, .pk-opt:hover, .pk-opt:hover svg { transform: none; box-shadow: none; }
  .pk-opt[aria-pressed=true], .pk-opt[aria-pressed=true]:hover { box-shadow: 0 0 0 2px var(--blue) inset, 0 10px 28px rgba(0, 0, 0, .08); }
}
@media (max-width: 760px) {
  .ar-main { padding-top: 12px; }
  .ar-hero { padding: 28px 0 18px; }
  .ar-hero h1 { font-size: clamp(30px, 8.8vw, 40px); }
  .ar-search { margin-bottom: 16px; }
  #arcats { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--gut, 18px) * -1) 16px; padding: 2px var(--gut, 18px) 6px; scroll-padding: 0 var(--gut, 18px); }
  #arcats::-webkit-scrollbar { display: none; }
  #arcats > * { flex: none; }
  .ar-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; padding-bottom: 56px; }
  .ar-card { padding: 20px 18px; border-radius: 20px; }
  .ar-card h2, .ar-card h3 { font-size: 20px; }
  .ar-cat { font-size: 13px; }
  .ar-refs i { font-size: 13px; }
  .ar-meta { font-size: 13.5px; }
  .ar-facts { gap: 10px; }
  .ar-facts div { padding: 16px 18px; border-radius: 18px; }

  /* ตัวช่วยเลือกสถานการณ์ / เส้นทาง (หน้าแรก) */
  .pk { margin-bottom: 40px; }
  .pk-head p { font-size: 15.5px; }
  .pk-opt { min-height: 64px; border-radius: 18px; }
  .pk-opt b { font-size: 16px; text-wrap: balance; }
  .pk-opt span { font-size: 13.5px; }
  .pk-card { padding: 20px 16px; border-radius: 22px; gap: 18px; }
  .pk-first li { font-size: 16px; }
  .pk-paths span, .pk-paths i { font-size: 13.5px; }
  .pk-side { padding: 16px; }
  .pk-side .btn-pill { min-height: 48px; }
  .pk-time, .pk-time b { font-size: 14.5px; }
  .pk-row { margin-top: 40px; }
  .rm a { font-size: 15px; display: inline-flex; align-items: center; min-height: 44px; }
  .rm p { font-size: 15px; }
  .hcta { padding: 24px 20px; border-radius: 24px; }
  .hcta p { font-size: 15.5px; }
  .hcta .btn-pill { width: 100%; }

  /* หน้าอ่านบทความ */
  .ar-crumb { margin-top: 4px; }
  .ar-crumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .ar-head { padding: 8px 0 20px; }
  .ar-head h1 { font-size: clamp(26px, 7.6vw, 34px); }
  .ar-sub { font-size: 17px; }
  .ar-toc { padding: 4px 16px; }
  .ar-toc summary { display: flex; align-items: center; min-height: 48px; margin: 0; }
  .ar-toc a { padding: 11px 0 11px 14px; font-size: 15px; }
  .ar-body { font-size: 17px; line-height: 1.8; overflow-wrap: break-word; }
  .ar-summary { font-size: 18px; }
  .ar-key { padding: 16px 18px; border-radius: 18px; }
  .ar-sec { padding-top: 28px; scroll-margin-top: 72px; }
  .ar-callout { font-size: 16px; padding: 14px 16px; }
  .ar-steps li { padding-left: 46px; }
  .ar-check label { min-height: 44px; align-items: center; }
  .ar-check input { width: 24px; height: 24px; margin-top: 0; }
  .ar-rel-card, .ar-prec article { padding: 16px; }
  .ar-rel-card .btn-pill { width: 100%; }
  .ar-faq summary { min-height: 52px; display: flex; align-items: center; padding: 10px 36px 10px 0; }
  .ar-faq summary::after { top: 50%; margin-top: -16px; }
  .ar-sources { font-size: 15px; }
  .ar-disclaimer { padding: 16px 18px; font-size: 15px; }
  .ar-cta { padding: 22px 20px; border-radius: 22px; gap: 14px; }
  .ar-cta .btn-pill { width: 100%; }
  .ar-pn { margin: 24px 0 56px; }
  .ar-pn a { padding: 16px 18px; min-height: 64px; }
  .ar-pn a small { font-size: 13px; }

  /* ตารางเลื่อนในกล่องของตัวเอง + เงาบอกว่ายังเลื่อนต่อได้ */
  .ar-table { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    background: linear-gradient(90deg, var(--bg) 30%, transparent) left center / 28px 100% no-repeat local,
                linear-gradient(270deg, var(--bg) 30%, transparent) right center / 28px 100% no-repeat local,
                radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .16), transparent) left center / 10px 100% no-repeat scroll,
                radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .16), transparent) right center / 10px 100% no-repeat scroll; }
  .ar-table table { font-size: 15px; }
  /* ตารางของหน้านโยบาย (2 คอลัมน์) พอดีจอได้ ไม่ต้องเลื่อน */
  .ar-table.pv-table table { min-width: 0; }
  .ar-table.pv-table td:first-child { white-space: normal; min-width: 7em; }
  .ar-table.pv-table th { white-space: normal; }
  .pv-head { padding-top: 12px; }
  .pv-body h2 { margin-top: 32px; }
}
@media (max-width: 400px) { .pk-opts { gap: 8px; } .pk-opt { padding: 12px; } }

/* ตารางในบทความ: ให้แต่ละคอลัมน์กว้างพออ่านได้ แล้วเลื่อนแนวนอนในกล่องของตัวเอง (แทนการบีบเป็นคอลัมน์แคบสูง ๆ) */
@media (max-width: 760px) {
  .ar-table th, .ar-table td { min-width: 8.5em; padding: 10px 12px; }
  .ar-table.pv-table td:first-child { min-width: 7em; }
}
/* มือถือ (≤700px): ตารางในบทความเป็นการ์ดซ้อนแนวตั้ง ไม่ต้องเลื่อนซ้ายขวา (data-label ใส่ใน articles.js) */
@media (max-width: 700px) {
  .ar-table { overflow: visible; box-shadow: none; border-radius: 0; }
  .ar-table table, .ar-table tbody, .ar-table tr, .ar-table td { display: block; min-width: 0 !important; width: 100%; }
  .ar-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ar-table tbody tr { margin: 0 0 12px; padding: 6px 0; border-radius: 14px; background: var(--card, var(--bg-alt)); box-shadow: 0 0 0 1px var(--line) inset; }
  .ar-table td { padding: 8px 16px !important; border-bottom: 0; white-space: normal !important; }
  .ar-table td + td { border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
  .ar-table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12.5px; font-weight: 650; color: var(--ink-3, var(--muted)); }
  .ar-table td:first-child { font-weight: 600; }
  .ar-table td:first-child[data-label]::before { display: none !important; }
}
/* ความสมูทร่วมทั้งเว็บสาธารณะและหลังบ้าน: ไม่ให้ข้อความ/หน้าโผล่พรึบ */

/* 1) ซ่อนหน้าไว้จนฟอนต์ไทยโหลดเสร็จ แล้วค่อย ๆ ปรากฏ (กันตัวอักษรเปลี่ยนหน้าตาตอนโหลด) — เปิดด้วย smooth.js, ไม่มี JS ก็เห็นปกติ */
html.fw:not(.fr) body { opacity: 0; }
html.fw.fr body { opacity: 1; transition: opacity .38s ease; }

/* 2) เปลี่ยนหน้าระหว่างหน้าเว็บ: จางเข้า-ออกแทนการกะพริบขาว (เบราว์เซอร์ที่รองรับ View Transitions) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease both; }
::view-transition-new(root) { animation: vt-in .3s ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* 3) เลื่อนไปยังหัวข้ออย่างนุ่มนวล */
html { scroll-behavior: smooth; }

/* 4) ปุ่ม/ลิงก์/การ์ด/ช่องกรอก เปลี่ยนสถานะอย่างนุ่ม + กดแล้วยุบเล็กน้อย */
a, button, summary, select, input, textarea, label { transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease, transform .16s ease; }
button:active:not(:disabled):not([aria-disabled=true]), .btn:active, .btn-pill:active, a.card:active, .chip:active { transform: scale(.97); }

/* 5) กล่องที่พับ/ขยาย (details) เนื้อหาค่อย ๆ ลื่นลงมา */
details[open] > :not(summary) { animation: sm-open .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sm-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* 6) หน้าต่างโต้ตอบ/เมนูที่โผล่ขึ้น */
dialog[open] { animation: sm-pop .26s cubic-bezier(.2, .9, .3, 1.15) both; }
dialog::backdrop { animation: vt-in .26s ease both; }
@keyframes sm-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.fw:not(.fr) body { opacity: 1; }
  html.fw.fr body, details[open] > :not(summary), dialog[open], dialog::backdrop { animation: none; transition: none; }
  @view-transition { navigation: none; }
  a, button, summary, select, input, textarea, label { transition: none; }
}

/* ส่วนที่ morph เพิ่มเข้ามาใหม่ (js/morph.js) ค่อย ๆ ปรากฏ */
[data-mi] { animation: mi-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes mi-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { [data-mi] { animation: none; } }

/* เปลี่ยนหน้าในหลังบ้าน (หน้าแรก ↔ พื้นที่ทำงาน ↔ สมุดรายชื่อ ↔ ล็อกอิน): จางเข้า ไม่ใช้ transform เพราะจะทำให้ sticky/fixed ในหน้าเพี้ยน */
#app > .home, #app > .work, #app > .bookpage, #app > .login, #app > .conn-fail { animation: page-fade .36s ease both; }
@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #app > .home, #app > .work, #app > .bookpage, #app > .login, #app > .conn-fail { animation: none; } }
/* .enter animation */
.enter > * { animation: sm-open .32s cubic-bezier(.2, .8, .2, 1) both; }
.enter > *:nth-child(1) { animation-delay: 0s; }
.enter > *:nth-child(2) { animation-delay: 0.04s; }
.enter > *:nth-child(3) { animation-delay: 0.08s; }
.enter > *:nth-child(4) { animation-delay: 0.12s; }
.enter > *:nth-child(5) { animation-delay: 0.16s; }
.enter > *:nth-child(6) { animation-delay: 0.20s; }
.enter > *:nth-child(7) { animation-delay: 0.24s; }
.enter > *:nth-child(n+8) { animation-delay: 0.28s; }
@media (prefers-reduced-motion: reduce) { .enter > * { animation: none; } }

/* หน้าข้อมูลกฎหมายที่สร้างเป็น HTML สถิต (/laws/ /jurisdiction/ /procedure/ /precedents/) + ส่วน "สารบัญข้อมูลกฎหมาย" ท้ายหน้าแรก
   ใช้ตัวแปรสีจาก site.css (โหมดมืดตามเอง) — สร้างโดย scripts/build-seo-pages.js */

.sp { padding: 20px 0 72px; }
.sp .wrap { max-width: 920px; }
.sp h1 { font-size: clamp(27px, 4.4vw, 42px); font-weight: 700; line-height: 1.38; letter-spacing: -.015em; margin: 6px 0 0; text-wrap: balance; }
.sp h2 { font-size: clamp(21px, 2.8vw, 28px); font-weight: 700; line-height: 1.4; margin: 44px 0 14px; letter-spacing: -.01em; }
.sp h3 { font-size: 18px; font-weight: 650; line-height: 1.45; margin: 26px 0 8px; letter-spacing: -.005em; }
.sp p { margin: 0 0 14px; }
.sp ul, .sp ol { margin: 0 0 14px; padding-left: 1.4em; }
.sp li { margin: 0 0 6px; }
.sp a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-eyebrow { margin: 26px 0 0; font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-lead { font-size: clamp(16.5px, 1.9vw, 19px); line-height: 1.7; color: var(--ink-2); margin: 14px 0 0; max-width: 46em; text-wrap: pretty; }
.sp-meta { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }

/* breadcrumb */
.bc { margin: 4px 0 0; font-size: 13.5px; }
.bc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--ink-3); }
.bc li { margin: 0; display: inline-flex; align-items: center; }
.bc li + li::before { content: '›'; margin: 0 8px; color: var(--ink-3); }
.bc a { color: var(--ink-2); }
.bc [aria-current] { color: var(--ink); }

/* กล่องหมายเหตุ / คำเตือน */
.note { background: var(--bg-alt); border-radius: 16px; padding: 14px 18px; font-size: 15px; line-height: 1.65; color: var(--ink-2); margin: 22px 0; }
.note b { color: var(--ink); }
.note.warn { background: color-mix(in srgb, var(--crim) 9%, transparent); color: var(--ink); }
.note p:last-child { margin-bottom: 0; }

/* ตารางข้อเท็จจริง (dl) */
.facts { display: grid; grid-template-columns: minmax(7.5em, 11em) 1fr; gap: 0; margin: 0 0 8px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.facts dt, .facts dd { margin: 0; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.facts dt { color: var(--ink-3); font-size: 14px; padding-right: 14px; padding-top: 11px; }
.facts dd { font-size: 16px; }

/* ตารางข้อมูล */
.tw { overflow-x: auto; margin: 0 0 18px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line) inset; -webkit-overflow-scrolling: touch; }
.tw table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.tw caption { text-align: left; padding: 12px 16px 6px; font-size: 13.5px; color: var(--ink-3); caption-side: top; }
.tw th, .tw td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); line-height: 1.55; }
.tw thead th { background: var(--bg-alt); font-size: 13.5px; font-weight: 650; color: var(--ink-2); border-top: 0; white-space: nowrap; }
.tw tbody th { font-weight: 600; min-width: 7em; }
.tw tbody th.num { white-space: nowrap; min-width: 0; }
.tw td { min-width: 9em; }
.tw td.num { min-width: 0; }
.sp-links a b.w { min-width: 6.2em; }
.tw td ul { list-style: none; padding: 0; margin: 0; }
.tw td li { margin: 0 0 3px; }
.tw .s { display: block; font-size: 12.5px; color: var(--ink-3); }
.tw .num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* การ์ดลิงก์ */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 14px 0 8px; }
.sp-card { display: flex; flex-direction: column; gap: 4px; background: var(--bg-alt); border-radius: 18px; padding: 16px 18px; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s; }
.sp-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.08); text-decoration: none !important; }
.sp-card b { font-size: 17px; font-weight: 650; line-height: 1.4; }
.sp-card span { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.sp-card small { font-size: 12.5px; color: var(--ink-3); }

/* รายการลิงก์แบบแน่น */
.sp-links { list-style: none; padding: 0 !important; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 22px; }
.sp-links li { margin: 0; }
.sp-links a { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); color: var(--ink); line-height: 1.5; font-size: 15.5px; }
.sp-links a b { flex: none; min-width: 3.6em; font-weight: 650; color: var(--link); font-variant-numeric: tabular-nums; }
.sp-links a:hover { color: var(--link); }
.chiplinks { list-style: none; padding: 0 !important; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chiplinks li { margin: 0; }
.chiplinks a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; background: var(--bg-alt); color: var(--ink); font-size: 14.5px; line-height: 1.6; }
.chiplinks a:hover { background: color-mix(in srgb, var(--blue) 12%, var(--bg-alt)); text-decoration: none !important; color: var(--link); }
.chiplinks small { color: var(--ink-3); font-size: 12px; }

/* ตารางกล่องขนาดเท่ากัน: รายชื่อจังหวัด / กฎหมาย (ชื่อบรรทัดแรก จำนวนบรรทัดสองแบบจาง) */
.provgrid { list-style: none; padding: 0 !important; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.provgrid li { margin: 0; display: flex; }
.provgrid a { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; width: 100%; min-height: 58px; padding: 9px 14px; border-radius: 14px; background: var(--bg-alt); color: var(--ink); font-size: 15.5px; font-weight: 550; line-height: 1.4; text-align: left; overflow-wrap: anywhere; transition: background .15s, box-shadow .15s; }
.provgrid a small { font-size: 12.5px; font-weight: 400; line-height: 1.4; color: var(--ink-3); }
.provgrid a:hover { background: color-mix(in srgb, var(--blue) 12%, var(--bg-alt)); text-decoration: none !important; color: var(--link); }
.provgrid a:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 70%, transparent); outline-offset: 2px; }
.dir .provgrid a { background: var(--card); box-shadow: 0 0 0 1px var(--line) inset; }
.dir .provgrid a:hover { background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
@media (max-width: 760px) { .provgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .provgrid a { min-height: 56px; padding: 8px 12px; } }

/* เครื่องมือค้นหาเขตอำนาจศาลบนหน้า SEO (ตัวเดียวกับหน้าแรก: site.css .finder …) */
.jt-mount { margin: 18px 0 20px; min-height: 340px; }
.jt-mount.jt-mounted { min-height: 0; }
.jt-mount noscript p, .jt-mount .jt-nojs { margin: 0; }
.sp .finder { margin: 0; }
.sp .finder p { margin: 0; }
.sp .finder .addr { margin: 2px 0 0; }
.sp .finder .jhint { margin: 0; }
.sp .finder .jwarn { margin-top: 14px; }
.sp .finder .fine { margin: 0; }
.sp .finder .court-list { padding: 0; }
.sel-fixed { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; min-height: 50px; padding: 10px 16px; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--line) inset; font-size: 16px; line-height: 1.4; }
.sel-fixed b { font-weight: 600; }
.sel-fixed a { font-size: 13.5px; color: var(--link); }
.sp-toc { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; font-size: 14.5px; }

/* ถาม-ตอบ */
.qa { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.qa > div { padding: 14px 0 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.qa h3 { margin: 0 0 6px; font-size: 17px; }
.qa p { color: var(--ink-2); font-size: 15.5px; }

/* ขั้นตอน */
.sp-steps { list-style: none; padding: 0 !important; counter-reset: sp; display: grid; gap: 12px; margin: 0 0 16px; }
.sp-steps > li { counter-increment: sp; position: relative; background: var(--bg-alt); border-radius: 18px; padding: 16px 20px 16px 66px; margin: 0; }
.sp-steps > li::before { content: counter(sp); position: absolute; left: 18px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.sp-steps h3 { margin: 0 0 4px; font-size: 17px; }
.sp-steps p { margin: 0 0 6px; font-size: 15.5px; color: var(--ink-2); }
.sp-steps .ref { font-size: 13px; color: var(--ink-3); }

/* CTA */
.sp-cta { margin: 36px 0 0; display: flex; gap: 16px 22px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #000; color: #f5f5f7; border-radius: 24px; padding: 24px 28px; }
.sp-cta h2 { margin: 0 0 4px; font-size: 20px; color: #f5f5f7; }
.sp-cta p { margin: 0; color: #a1a1a6; font-size: 15px; max-width: 34em; }
.sp-cta .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-cta .btn-pill.ghost { background: rgba(255,255,255,.16); color: #f5f5f7; }
.sp-cta .btn-pill.ghost:hover { background: rgba(255,255,255,.26); }
:root[data-theme=dark] .sp-cta, :root:not([data-theme=light]) .sp-cta { box-shadow: 0 0 0 1px #2c2c2e inset; }
.sp-bar { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; font-size: 15px; }
.sp-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.sp-prevnext a { display: block; background: var(--bg-alt); border-radius: 16px; padding: 12px 16px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.sp-prevnext a small { display: block; color: var(--ink-3); font-size: 12.5px; }
.sp-prevnext a:last-child { text-align: right; }
.sp-prevnext a:only-child { grid-column: 1 / -1; }
.sp-src { font-size: 14px; color: var(--ink-3); }
.sp-hl { font-size: clamp(17px, 2vw, 20px); line-height: 1.75; border-left: 3px solid var(--blue); padding: 4px 0 4px 18px; margin: 18px 0; color: var(--ink); }
.sp-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }

/* ส่วน "สารบัญข้อมูลกฎหมาย" บนหน้าแรก */
.dir h3 { font-size: 19px; font-weight: 650; margin: 36px 0 12px; letter-spacing: -.01em; }
.dir .sp-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.dir .sp-card { background: var(--card); }
.dir .chiplinks a { background: var(--card); box-shadow: 0 0 0 1px var(--line) inset; }
.dir .sp-links a { border-color: color-mix(in srgb, var(--line) 80%, transparent); }

@media (max-width: 760px) {
  .sp { padding-top: 12px; }
  .sp h2 { margin-top: 36px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding: 12px 0 0; border-bottom: 0; }
  .facts dd { padding: 2px 0 12px; }
  .sp-links { grid-template-columns: 1fr; }
  .sp-links a { min-height: 44px; align-items: center; }
  .chiplinks a { min-height: 40px; }
  .sp-prevnext { grid-template-columns: 1fr; }
  .sp-prevnext a:last-child { text-align: left; }
  .sp-cta { padding: 20px; border-radius: 20px; }
  .sp-cta .btns { width: 100%; }
  .sp-cta .btn-pill { flex: 1 1 100%; }
  .sp-steps > li { padding: 14px 16px 14px 58px; }
  .sp-steps > li::before { left: 14px; top: 14px; }
  .bc a, .bc [aria-current] { padding: 6px 0; }
  .tw table { min-width: 520px; }
}
@media (prefers-reduced-motion: reduce) { .sp-card, .sp-card:hover { transition: none; transform: none; } }

/* มือถือ (≤700px): ตารางเป็นการ์ดซ้อนแนวตั้ง — ไม่ต้องเลื่อนซ้ายขวา (ชื่อคอลัมน์มาจาก data-label ที่ใส่ตอน build) */
@media (max-width: 700px) {
  .tw { overflow: visible; box-shadow: none; border-radius: 0; margin-bottom: 8px; }
  .tw table { display: block; min-width: 0; width: 100%; font-size: 15.5px; }
  .tw caption { display: block; padding: 0 2px 10px; }
  .tw thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tw tbody, .tw tr, .tw td, .tw th { display: block; min-width: 0; }
  .tw tbody tr { margin: 0 0 12px; padding: 6px 0; border-radius: 14px; background: var(--card, var(--bg-alt)); box-shadow: 0 0 0 1px var(--line) inset; }
  .tw tbody th, .tw td { padding: 8px 16px; border-top: 0; min-width: 0; }
  .tw tbody th { font-size: 16.5px; padding-bottom: 4px; }
  .tw td { border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
  .tw tbody th + td { border-top: 0; }
  .tw td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
  .tw tbody th[data-label]::before { content: none; }
}