/* ============================================================
   PORTAL — header, footer, article list, article detail
   Uses tokens from themes.css only (no hard-coded theme colors).
============================================================ */

/* ── Base (replaces the old v2.css globals) ───────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }
html.lang-th [data-lang="en"], body.lang-th [data-lang="en"],
html.lang-en [data-lang="th"], body.lang-en [data-lang="th"] { display: none !important; }
.flash-alert { max-width: 1140px; margin: 12px auto 0; padding: 10px 16px; border-radius: 4px; display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border: 1px solid currentColor; }
.flash-success { color: var(--ok); }
.flash-error { color: var(--danger); }
.flash-close { background: none; border: 0; cursor: pointer; color: inherit; }

.pt-body {
    background: var(--ground);
    color: var(--ink);
    font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.65;
}
.pt-body a { color: inherit; text-decoration: none; }
.pt-body h1, .pt-body h2, .pt-body h3 {
    font-family: 'Anuphan', 'IBM Plex Sans Thai', system-ui, sans-serif;
    text-wrap: balance;
    letter-spacing: 0;
}
.pt-body :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-wrap { max-width: 1140px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 480px) { .pt-wrap { padding-inline: 16px; } }
.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Site bar (header) ─────────────────────────────── */
.sb { background: var(--bar); color: var(--ink); border-bottom: 1px solid var(--line); font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, sans-serif; position: relative; z-index: 50; }
.sb a { color: var(--link); text-decoration: none; }
.sb__top { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.sb__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sb__brand img { height: 28px; width: auto; display: block; }
.sb__tagline { color: var(--bar-sub); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb__lang { margin-left: auto; display: flex; border: 1px solid var(--field-line); border-radius: 999px; overflow: hidden; font: 500 12px 'JetBrains Mono', ui-monospace, monospace; flex-shrink: 0; }
.sb__lang button { border: 0; background: var(--field); color: var(--ink3); padding: 7px 10px; cursor: pointer; font: inherit; }
.sb__lang button.is-on { background: var(--accent); color: var(--accent-ink); }
.sb__theme { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--field-line); background: var(--field); color: var(--link); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.sb__theme:hover { border-color: var(--link); }
.sb__search { display: flex; background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; overflow: hidden; width: 260px; max-width: 100%; }
.sb__search input { border: 0; outline: 0; padding: 6px 10px; font: 400 13.5px 'IBM Plex Sans Thai', system-ui, sans-serif; flex: 1; min-width: 0; color: var(--ink); background: transparent; }
.sb__search button { border: 0; background: var(--accent); color: var(--accent-ink); width: 36px; cursor: pointer; }
.sb__nav { display: flex; gap: 22px; font-size: 13.5px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.sb__nav::-webkit-scrollbar { display: none; }
.sb__nav a { opacity: .78; white-space: nowrap; padding-bottom: 2px; }
.sb__nav a:hover { opacity: 1; }
.sb__nav a.is-on { opacity: 1; font-weight: 600; }
@media (max-width: 860px) {
    .sb__tagline { display: none; }
    .sb__search { width: 100%; order: 5; }
}

/* ── Site footer ───────────────────────────────────── */
.sf { background: var(--bar); color: var(--bar-sub); font-size: 12.5px; padding-block: 24px; border-top: 1px solid var(--line); font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, sans-serif; }
.sf a { color: var(--link); text-decoration: none; }
.sf a:hover { opacity: .75; }
.sf__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sf__links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── Category chips ────────────────────────────────── */
.pt-cats { background: var(--ground); border-bottom: 1px solid var(--line); }
.pt-cats__row { display: flex; gap: 4px; overflow-x: auto; padding-block: 8px; justify-content: center; scrollbar-width: none; }
.pt-cats__row::-webkit-scrollbar { display: none; }
.pt-chip { color: var(--ink2); font-size: 13px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pt-chip:hover { color: var(--link); }
.pt-chip.is-on { background: var(--link-soft); color: var(--link); font-weight: 600; }
@media (max-width: 860px) { .pt-cats__row { justify-content: flex-start; } }

/* ── Ranking band ──────────────────────────────────── */
.pt-rank { background: var(--band); padding-block: 22px 28px; border-bottom: 1px solid var(--line); }
.pt-tabs { display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.pt-tabs__all { margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 7px 16px; font-size: 13px; color: var(--link); }
@media (max-width: 860px) {
    .pt-tabs { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
    .pt-tabs::-webkit-scrollbar { display: none; }
    .pt-tabs__all { display: none; }
}

/* iOS-style segmented control with a sliding pill */
.pt-seg { position: relative; display: inline-flex; padding: 3px; border-radius: 10px; background: var(--seg-track); flex-shrink: 0; isolation: isolate; }
.pt-seg__pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 8px; background: var(--seg-pill); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 3px 8px rgba(0, 0, 0, .10); z-index: -1; opacity: 0; }
.pt-seg__pill.is-ready { opacity: 1; transition: transform .32s cubic-bezier(.32, .72, 0, 1), width .32s cubic-bezier(.32, .72, 0, 1), opacity .15s; }
.pt-seg__btn { position: relative; border: 0; background: transparent; color: var(--ink2); font: 500 13.5px 'IBM Plex Sans Thai', system-ui, sans-serif; padding: 7px 18px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: color .2s; }
.pt-seg__btn:hover { color: var(--ink); }
.pt-seg__btn.is-on { color: var(--ink); font-weight: 600; }
.pt-seg__btn:active { transform: scale(.97); }
.pt-seg__btn + .pt-seg__btn::before { content: ""; position: absolute; left: 0; top: 25%; bottom: 25%; width: 1px; background: var(--line); transition: opacity .2s; }
.pt-seg__btn.is-on::before, .pt-seg__btn.is-on + .pt-seg__btn::before { opacity: 0; }
.pt-fade-enter { transition: opacity .25s ease, transform .25s ease; }
.pt-fade-from { opacity: 0; transform: translateY(6px); }
.pt-fade-to { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .pt-seg__pill.is-ready, .pt-fade-enter { transition: none; } }
.pt-rank__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .pt-rank__row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .pt-rank__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-rk { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; position: relative; transition: border-color .15s, box-shadow .15s; }
.pt-rk:hover { border-color: var(--hover-line); box-shadow: var(--shadow); }
.pt-rk:hover .pt-rk__title { opacity: .7; }
.pt-rk__n { position: absolute; top: 0; left: 0; z-index: 1; min-width: 22px; height: 24px; display: grid; place-items: center; background: rgba(0, 0, 0, .85); color: #fff; font: 500 13px 'JetBrains Mono', ui-monospace, monospace; padding-inline: 6px; }
.pt-rk:nth-child(-n+3) .pt-rk__n { background: var(--accent); color: var(--accent-ink); }
.pt-rk .pt-thumb { aspect-ratio: 4 / 3; }
.pt-rk__body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pt-rk__title { font-weight: 400; color: var(--ink); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.pt-rk__meta { margin-top: auto; font-size: 11.5px; color: var(--ink3); display: grid; gap: 1px; }
.pt-rk__meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-rank__empty { text-align: center; color: var(--ink3); padding-block: 24px; }

/* ── Thumbnails ────────────────────────────────────── */
.pt-thumb { background: var(--thumb); position: relative; overflow: hidden; display: block; max-width: 100%; }
.pt-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-thumb--gen { display: grid; place-items: center; text-align: center; padding: 8px; background: repeating-linear-gradient(135deg, var(--stripe-1) 0 10px, var(--stripe-2) 10px 20px); color: var(--ink3); font-size: 22px; }

/* ── Main grid ─────────────────────────────────────── */
.pt-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-block: 32px 56px; }
@media (max-width: 960px) { .pt-main { grid-template-columns: minmax(0, 1fr); } }
.pt-h { font-size: 20px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pt-h small { font: 400 13px 'IBM Plex Sans Thai', system-ui, sans-serif; color: var(--ink3); }

.pt-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .pt-list { grid-template-columns: minmax(0, 1fr); } }
.pt-it { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.pt-it:hover .pt-it__title { opacity: .7; }
.pt-it__title { font-weight: 400; color: var(--ink); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.pt-it .pt-thumb { aspect-ratio: 16 / 10; border-radius: 3px; align-self: start; }
.pt-it__meta { font-size: 11.5px; color: var(--ink3); margin-top: 6px; display: flex; gap: 4px 8px; flex-wrap: wrap; }
.pt-it__meta span { white-space: nowrap; }
.pt-it__meta i { margin-right: 3px; }
.pt-it__cat { color: var(--link); }
.pt-empty { grid-column: 1 / -1; color: var(--ink3); padding-block: 32px; text-align: center; }

.pt-pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pt-pager a, .pt-pager span { min-width: 38px; height: 38px; padding-inline: 10px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--link); font: 500 13px 'JetBrains Mono', ui-monospace, monospace; }
.pt-pager a:hover { border-color: var(--hover-line); }
.pt-pager .is-on { background: var(--link-soft); border-color: var(--link); }
.pt-pager .is-gap { border-color: transparent; color: var(--ink3); }

.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--link); border-radius: 6px; padding: 9px 28px; font: 600 13.5px 'IBM Plex Sans Thai', system-ui, sans-serif; cursor: pointer; background: transparent; color: var(--link); }
.pt-btn:hover { opacity: .8; }
.pt-btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) !important; }
.pt-center { display: flex; justify-content: center; margin-top: 24px; }

/* ── Sidebar ───────────────────────────────────────── */
.pt-side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.pt-side h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.pt-promo { background: radial-gradient(ellipse 90% 60% at 50% 0%, var(--accent-soft), transparent 70%), var(--panel); border: 1px solid var(--line); padding: 16px; border-radius: 4px; position: relative; overflow: hidden; }
.pt-promo canvas { position: absolute; inset: 0 0 auto; width: 100%; height: 120px; }
.pt-promo__head { position: relative; text-align: center; padding-block: 8px 18px; }
.pt-promo__head small { display: block; font-size: 12px; color: var(--ink2); }
.pt-promo__head b { font: 700 22px 'Anuphan', system-ui, sans-serif; letter-spacing: .01em; }
.pt-stat { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--ground); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; margin-top: 6px; }
.pt-stat i { font-size: 18px; color: var(--link); text-align: center; }
.pt-stat small { display: block; font-size: 11px; color: var(--ink2); line-height: 1.3; }
.pt-stat b { font: 500 16px 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.pt-stat b.is-text { font: 600 13px 'IBM Plex Sans Thai', system-ui, sans-serif; }
.pt-promo__ask { position: relative; text-align: center; font-size: 12.5px; margin-top: 14px; font-weight: 600; color: var(--ink2); }
.pt-promo__big { position: relative; display: block; font: 700 17px 'Anuphan', system-ui, sans-serif; text-align: center; margin-top: 2px; }
.pt-promo .pt-btn { position: relative; display: flex; margin: 12px auto 0; width: 70%; }

.pt-kw { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-kw a { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; color: var(--link); }
.pt-kw a:hover { border-color: var(--hover-line); }

.pt-acc { border-top: 1px solid var(--line); }
.pt-acc details { border-bottom: 1px solid var(--line); }
.pt-acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; padding: 10px 2px; font-size: 13.5px; color: var(--ink2); }
.pt-acc summary::-webkit-details-marker { display: none; }
.pt-acc summary i { transition: transform .2s; font-size: 11px; margin-top: 5px; }
.pt-acc details[open] summary i { transform: rotate(180deg); }
.pt-acc ul { list-style: none; margin: 0 0 10px; padding: 0 0 0 8px; display: grid; gap: 4px; font-size: 13px; }
.pt-acc li a { display: flex; justify-content: space-between; gap: 8px; color: var(--link); }
.pt-acc li b { font: 500 12px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink3); }

.pt-box { text-align: center; }
.pt-box__h { font: 700 16px 'Anuphan', system-ui, sans-serif; letter-spacing: .04em; margin-bottom: 10px; text-transform: uppercase; }
.pt-box__h em { font-style: normal; color: var(--accent-text); }
.pt-box p { text-align: left; font-size: 13px; font-weight: 600; margin: 8px 0 0; line-height: 1.55; }
.pt-box .pt-btn { margin-top: 12px; padding-inline: 36px; }
.pt-labs { aspect-ratio: 16 / 10; border-radius: 3px; display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--stripe-1) 0 10px, var(--stripe-2) 10px 20px); border: 1px solid var(--line); color: var(--link); font: 500 13px 'JetBrains Mono', ui-monospace, monospace; padding: 12px; }
.pt-prod { display: grid; gap: 8px; text-align: left; }
.pt-prod a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; }
.pt-prod a:hover { border-color: var(--hover-line); }
.pt-prod__icon { width: 36px; height: 36px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: var(--field); color: var(--link); position: relative; }
.pt-prod__icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pt-prod span { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-prod b { font: 500 12px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* ── Article ───────────────────────────────────────── */
.pt-crumb { border-bottom: 1px solid var(--line); padding-block: 14px; font-size: 12.5px; color: var(--ink3); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-crumb a { color: var(--link); }
.pt-crumb i { font-size: 9px; }
.pt-art h1 { font-size: clamp(22px, 3vw, 28px); line-height: 1.5; font-weight: 700; margin: 12px 0 0; }
.pt-art__meta { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--ink2); margin-top: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pt-art__meta i { margin-right: 4px; }
.pt-tag { background: var(--link-soft); color: var(--link); padding: 1px 10px; border-radius: 3px; font-weight: 600; }
.pt-share { margin-left: auto; display: flex; gap: 6px; }
.pt-share a, .pt-share button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 4px; color: #fff; font-size: 13px; border: 0; cursor: pointer; }
.pt-share .is-fb { background: #1877F2; }
.pt-share .is-line { background: #06C755; }
.pt-share .is-x { background: #000; box-shadow: inset 0 0 0 1px var(--hover-line); }
.pt-share .is-copy { background: var(--field); color: var(--link); box-shadow: inset 0 0 0 1px var(--field-line); }
@media (max-width: 600px) { .pt-share { margin-left: 0; width: 100%; } }
.pt-art__cover { margin-top: 20px; aspect-ratio: 16 / 9; border-radius: 4px; }
.pt-art__cover.pt-thumb--gen { font-size: 48px; }

.pt-prose { font-size: 16.5px; line-height: 1.95; max-width: 700px; margin-top: 24px; overflow-wrap: anywhere; }
.pt-prose > * + * { margin-top: 1em; }
.pt-prose p, .pt-prose ul, .pt-prose ol, .pt-prose blockquote, .pt-prose pre, .pt-prose figure, .pt-prose table { margin-bottom: 0; }
.pt-prose .pt-lead { font-size: 17px; font-weight: 600; padding: 14px 16px; background: var(--band); border-left: 3px solid var(--accent); }
.pt-prose h2 { font-size: 19px; font-weight: 700; margin-top: 2em; padding-bottom: 6px; border-bottom: 2px solid var(--line); position: relative; line-height: 1.5; }
.pt-prose h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 64px; height: 2px; background: var(--accent); }
.pt-prose h3 { font-size: 17px; font-weight: 700; margin-top: 1.6em; }
.pt-prose a { color: var(--link); text-decoration: none; border-bottom: 1px solid var(--hover-line); }
.pt-prose strong { font-weight: 600; }
.pt-prose ul, .pt-prose ol { padding-left: 1.4em; }
.pt-prose li + li { margin-top: .3em; }
.pt-prose img { max-width: 100%; height: auto; border-radius: 4px; }
.pt-prose blockquote { border-left: 3px solid var(--line); padding: 4px 0 4px 16px; color: var(--ink2); margin-left: 0; }
.pt-prose code { font-family: 'JetBrains Mono', 'IBM Plex Sans Thai', ui-monospace, monospace; font-size: 14px; background: var(--code-bg); padding: 1px 6px; border-radius: 3px; }
.pt-prose pre { background: var(--code-bg); border: 1px solid var(--line); padding: 14px 16px; border-radius: 4px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; }
.pt-prose pre code { background: none; padding: 0; }
.pt-prose table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; }
.pt-prose th, .pt-prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.pt-source { font-size: 13px; color: var(--ink3); }
.pt-source a { color: var(--link); }

.pt-company { margin-top: 36px; border: 1px solid var(--line); border-radius: 4px; }
.pt-company h3 { font-size: 14px; background: var(--band); padding: 8px 14px; border-bottom: 1px solid var(--line); margin: 0; }
.pt-company dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); margin: 0; font-size: 13.5px; }
.pt-company dt, .pt-company dd { padding: 8px 14px; border-bottom: 1px solid var(--line); margin: 0; }
.pt-company dt { color: var(--ink2); }
.pt-company dl > *:nth-last-child(-n+2) { border-bottom: 0; }
.pt-company a { color: var(--link); }
.pt-art .pt-h { margin-top: 36px; }
.pt-art__tags { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
    .pt-body *, .sb *, .sf * { transition: none !important; }
}

/* ============================================================
   INNER PAGES — about, services, store, AI labs, contact, error
============================================================ */
.pt-head { background: var(--band); border-bottom: 1px solid var(--line); padding-block: 36px 32px; }
.pt-eyebrow { display: block; font: 500 12px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); }
.pt-head__title { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.35; font-weight: 700; margin: 8px 0 0; color: var(--ink); }
.pt-head__lead { color: var(--ink2); font-size: 15.5px; line-height: 1.8; max-width: 62ch; margin: 10px 0 0; }
.pt-head__stats { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 20px; }
.pt-head__stats div { display: grid; }
.pt-head__stats b { font: 500 22px 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.pt-head__stats small { font-size: 12px; color: var(--ink3); }

.pt-page { padding-block: 8px 56px; }
.pt-sec { padding-block: 36px; }
.pt-sec + .pt-sec { border-top: 1px solid var(--line); }
.pt-sec__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pt-sec__head h2 { font-size: 20px; font-weight: 700; margin: 0; color: var(--ink); }
.pt-sec__head p { color: var(--ink2); font-size: 14px; margin: 0; max-width: 60ch; }
.pt-text { color: var(--ink2); font-size: 15.5px; line-height: 1.9; max-width: 68ch; }
.pt-text p { margin: 0; }
.pt-text p + p { margin-top: 1em; }

.pt-grid { display: grid; gap: 14px; }
.pt-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pt-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .pt-grid--3, .pt-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pt-grid--2, .pt-grid--3, .pt-grid--4 { grid-template-columns: minmax(0, 1fr); } }

.pt-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 18px; min-width: 0; }
.pt-card h3 { font-size: 15.5px; font-weight: 600; margin: 0; color: var(--ink); }
.pt-card p { color: var(--ink2); font-size: 14px; line-height: 1.75; margin: 6px 0 0; }
.pt-icon { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; background: var(--field); border: 1px solid var(--field-line); color: var(--ink); font-size: 15px; margin-bottom: 12px; }

/* Services list with hairline dividers */
.pt-svc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.pt-svc article { padding: 22px 22px 24px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.pt-svc article:not(:nth-child(3n+1)) { padding-left: 22px; border-left: 1px solid var(--line); }
.pt-svc h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.pt-svc p { color: var(--ink2); font-size: 14px; line-height: 1.75; margin: 0; }
@media (max-width: 860px) { .pt-svc { grid-template-columns: minmax(0, 1fr); } .pt-svc article, .pt-svc article:not(:nth-child(3n+1)) { padding: 20px 0; border-left: 0; } }

.pt-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pt-pills span { font: 500 11.5px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink2); background: var(--field); border: 1px solid var(--field-line); padding: 1px 8px; border-radius: 3px; }

/* Process steps — a real sequence, so numbered */
.pt-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.pt-steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.pt-steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 500 13px 'JetBrains Mono', ui-monospace, monospace; color: var(--accent-text); margin-bottom: 8px; }
.pt-steps h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.pt-steps p { color: var(--ink2); font-size: 13.5px; line-height: 1.7; margin: 0; }
@media (max-width: 860px) { .pt-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .pt-steps { grid-template-columns: minmax(0, 1fr); } }

/* Product / lab cards */
.pt-pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; overflow: hidden; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.pt-pcard:hover { border-color: var(--hover-line); box-shadow: var(--shadow); }
.pt-pcard .pt-thumb { aspect-ratio: 16 / 9; }
.pt-pcard__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pt-pcard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-pcard h2 { font-size: 16px; font-weight: 600; margin: 0; color: var(--ink); line-height: 1.45; }
.pt-pcard__desc { color: var(--ink2); font-size: 13.5px; line-height: 1.7; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pt-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink2); }
.pt-checks li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; }
.pt-checks i { color: var(--ok); font-size: 11px; margin-top: 5px; }
.pt-pcard__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pt-price small { display: block; font-size: 11px; color: var(--ink3); }
.pt-price b { font: 500 18px 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.pt-btn--sm { padding: 6px 14px; font-size: 13px; }

.pt-badge { display: inline-flex; align-items: center; gap: 5px; font: 600 11px 'IBM Plex Sans Thai', system-ui, sans-serif; letter-spacing: .02em; padding: 1px 8px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; }
.pt-badge--accent { color: var(--accent-text); }
.pt-badge--ok     { color: var(--ok); }
.pt-badge--info   { color: var(--info); }
.pt-badge--warn   { color: var(--warn); }
.pt-badge--violet { color: var(--violet); }
.pt-thumb .pt-badge { position: absolute; top: 8px; right: 8px; background: var(--panel); z-index: 1; }

.pt-filter { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.pt-filter button { border: 0; background: transparent; cursor: pointer; font: inherit; }
.pt-empty-box { border: 1px dashed var(--line); border-radius: 4px; padding: 40px 16px; text-align: center; color: var(--ink3); }

/* Stats row */
.pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.pt-stats div { padding: 18px; display: grid; gap: 2px; }
.pt-stats div + div { border-left: 1px solid var(--line); }
.pt-stats b { font: 500 26px 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--ink); }
.pt-stats small { font-size: 12.5px; color: var(--ink3); }
@media (max-width: 700px) { .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pt-stats div:nth-child(3) { border-left: 0; } .pt-stats div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* Team */
.pt-person { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
.pt-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 18px 'Anuphan', system-ui, sans-serif; }
.pt-person small { display: block; font-size: 12.5px; color: var(--ink3); }

/* CTA band */
.pt-cta { background: radial-gradient(ellipse 60% 120% at 100% 0%, var(--accent-soft), transparent 70%), var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pt-cta h2 { font-size: 20px; font-weight: 700; margin: 0; color: var(--ink); }
.pt-cta p { color: var(--ink2); font-size: 14px; margin: 4px 0 0; }

/* Contact */
.pt-contact { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .pt-contact { grid-template-columns: minmax(0, 1fr); } }
.pt-form { display: grid; gap: 14px; }
.pt-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .pt-form__row { grid-template-columns: minmax(0, 1fr); } }
.pt-field { display: grid; gap: 5px; min-width: 0; }
.pt-field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.pt-field label em { font-style: normal; color: var(--accent-text); }
.pt-field input, .pt-field select, .pt-field textarea { width: 100%; font: 400 14.5px 'IBM Plex Sans Thai', system-ui, sans-serif; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 4px; padding: 9px 12px; }
.pt-field textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.pt-field input:focus, .pt-field select:focus, .pt-field textarea:focus { outline: none; border-color: var(--ink2); }
.pt-note { font-size: 12.5px; color: var(--ink3); margin: 0; }
.pt-note a { color: var(--link); border-bottom: 1px solid var(--hover-line); }
.pt-alert { border-radius: 4px; padding: 10px 14px; font-size: 14px; border: 1px solid currentColor; }
.pt-alert--err { color: var(--danger); }
.pt-alert--ok  { color: var(--ok); }
.pt-info { margin: 0; display: grid; gap: 14px; }
.pt-info div { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.pt-info dt { grid-row: span 2; }
.pt-info dt .pt-icon { margin: 0; }
.pt-info dd { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.6; }
.pt-info dd small { display: block; font-size: 12px; color: var(--ink3); }
.pt-info a { color: var(--link); }
.pt-social { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-social a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; font-size: 13px; color: var(--link); }
.pt-social a:hover { border-color: var(--hover-line); }
.pt-map { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--thumb); }
.pt-map iframe { display: block; width: 100%; height: 380px; border: 0; }
.pt-map__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink2); }

/* Error */
.pt-error { min-height: 55vh; display: grid; place-items: center; text-align: center; padding-block: 48px; }
.pt-error b { display: block; font: 500 64px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink); line-height: 1; }
.pt-error p { color: var(--ink2); margin: 12px 0 20px; }
.pt-contact__resp { margin-top: 14px; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Thai script breaks apart with tracking — keep eyebrow/price text untracked in Thai */
.pt-eyebrow [data-lang="th"], .pt-price [data-lang] { letter-spacing: 0; font-family: 'IBM Plex Sans Thai', system-ui, sans-serif; }
.pt-price b [data-lang] { font-size: 15px; font-weight: 600; }

/* ── Banners ───────────────────────────────────────── */
.pt-bn-list { display: grid; gap: 12px; }
.pt-bn-list--top { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin-bottom: 28px; }
.pt-bn-list--bottom { margin-top: 32px; }
.pt-bn { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: center; background: radial-gradient(ellipse 70% 120% at 100% 0%, var(--accent-soft), transparent 70%), var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px; }
.pt-bn__img { width: 88px; height: 88px; border-radius: 18px; overflow: hidden; background: var(--thumb); display: block; }
.pt-bn__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-bn__title { font: 700 16px 'Anuphan', system-ui, sans-serif; margin: 0; color: var(--ink); line-height: 1.4; }
.pt-bn__sub { font-size: 13px; color: var(--ink2); margin: 3px 0 0; line-height: 1.6; }
.pt-bn__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.pt-store { display: inline-flex; align-items: center; gap: 8px; background: #000; color: #fff !important; border: 1px solid #3A3F49; border-radius: 6px; padding: 4px 10px; line-height: 1.1; }
.pt-store i { font-size: 18px; }
.pt-store span { display: grid; font-size: 13px; font-weight: 600; }
.pt-store small { font-size: 9px; font-weight: 400; letter-spacing: .02em; opacity: .85; }
.pt-store:hover { border-color: #8C929C; }
.pt-bn-list--side .pt-bn { grid-template-columns: 64px minmax(0, 1fr); padding: 12px; }
.pt-bn-list--side .pt-bn__img { width: 64px; height: 64px; border-radius: 14px; }
.pt-bn-list--side .pt-bn__title { font-size: 14.5px; }
@media (max-width: 480px) { .pt-bn { grid-template-columns: 64px minmax(0, 1fr); } .pt-bn__img { width: 64px; height: 64px; border-radius: 14px; } }
.pt-bn.pt-bn--noimg { grid-template-columns: minmax(0, 1fr); }
.pt-it__pin { color: var(--accent-text); font-weight: 600; }
.pt-it__pin i { transform: rotate(35deg); }

/* Image banners — any rectangular artwork (recommended 1024×500) */
.pt-bnimg { margin: 0; display: grid; gap: 8px; }
.pt-bnimg > a, .pt-bnimg > img { display: block; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--thumb); }
.pt-bnimg img { display: block; width: 100%; height: auto; transition: transform .25s; }
.pt-bnimg > a:hover img { transform: scale(1.02); }
.pt-bnimg > a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pt-bnimg .pt-bn__actions { margin: 0; }
.pt-bn-list--side { gap: 18px; }
@media (prefers-reduced-motion: reduce) { .pt-bnimg img { transition: none; } }

/* ── Git Analytics ─────────────────────────────────── */
.pt-chip__n { font: 500 11px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink3); margin-left: 2px; }
.pt-git__bar { align-items: center; }
.pt-git__bar .pt-h { margin: 0; }
.pt-git__bar .pt-filter { margin: 0; }
.pt-git .pt-git__og { aspect-ratio: 2 / 1; }
.pt-git:hover .pt-git__title { opacity: .7; }
.pt-git__name { font: 500 12.5px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink2); overflow-wrap: anywhere; }
.pt-git__title { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-art .pt-git__name { display: block; margin-top: 4px; }
.pt-git__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pt-git__cover { aspect-ratio: 2 / 1; }
.pt-git__topic { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; color: var(--ink2); }

/* ── Events ────────────────────────────────────────── */
.pt-evs { margin-bottom: 32px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pt-evs .pt-sec__head { align-items: center; margin-bottom: 8px; }
.pt-evs .pt-h { margin: 0; }
.pt-evs__label { font-size: 12.5px; font-weight: 600; color: var(--ink3); margin: 12px 0 8px; }
.pt-evs__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
@media (max-width: 640px) { .pt-evs__grid { grid-template-columns: minmax(0, 1fr); } }
.pt-ev { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px; }
.pt-ev:hover { border-color: var(--hover-line); }
.pt-ev:hover .pt-ev__title { opacity: .7; }
.pt-ev__date { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; padding: 4px 0; background: var(--ground); }
.pt-ev__date b { font: 600 20px 'JetBrains Mono', ui-monospace, monospace; line-height: 1.1; color: var(--ink); }
.pt-ev__date small { font-size: 11px; color: var(--ink3); }
.pt-ev__body { display: grid; gap: 4px; min-width: 0; }
.pt-ev__title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pt-ev__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink3); align-items: center; }
.pt-ev__meta i { margin-right: 4px; }
.pt-evfilter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.pt-evfilter select { background: var(--field); color: var(--ink); border: 1px solid var(--field-line); border-radius: 6px; padding: 6px 10px; font-size: 13.5px; max-width: 100%; }
.pt-evmonth { margin-top: 24px; }
.pt-evs__grid--list { margin-bottom: 0; }
.pt-evsrc { margin-top: 24px; }
.pt-evs-after { margin-top: 36px; }
.pt-evs-after .pt-evs { border-bottom: 0; margin-bottom: 0; }

/* ── Content-type filter + labels ─────────────────── */
.pt-hbar { display: flex; align-items: baseline; gap: 12px; }
.pt-hbar .pt-h { flex: 1; min-width: 0; }
.pt-type select { font: 400 13px 'IBM Plex Sans Thai', system-ui, sans-serif; color: var(--ink2); background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 5px 8px; cursor: pointer; }
.pt-it__type { color: var(--ink2); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; font-size: 11.5px; }
.pt-tag--type { background: transparent; border: 1px solid var(--line); color: var(--ink2); }

/* ── Products showcase (/store) ────────────────────── */
.pt-pmark { display: grid; place-items: center; flex-shrink: 0; border-radius: 22%; background: var(--brand); color: #fff; font: 700 16px 'Anuphan', system-ui, sans-serif; overflow: hidden; }
.pt-pmark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-pmark--sm { width: 36px; height: 36px; font-size: 17px; }
.pt-pmark--lg { width: 56px; height: 56px; font-size: 26px; }
.pt-pmark:has(img) { background: transparent; }
.pt-pnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
@media (max-width: 860px) { .pt-pnav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-pnav__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; transition: border-color .15s, transform .15s; }
.pt-pnav__item:hover { border-color: var(--brand); transform: translateY(-1px); }
.pt-pnav__item b { display: block; font-size: 14px; color: var(--ink); }
.pt-pnav__item small { display: block; font-size: 11.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-pnav__item > span:last-child { min-width: 0; }

.pt-prodx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: start; padding-block: 48px; scroll-margin-top: 16px; }
.pt-prodx + .pt-prodx { border-top: 1px solid var(--line); }
.pt-prodx.is-rev .pt-prodx__info { order: 2; }
@media (max-width: 960px) { .pt-prodx { grid-template-columns: minmax(0, 1fr); gap: 24px; } .pt-prodx.is-rev .pt-prodx__info { order: 0; } }
.pt-prodx__brand { display: flex; align-items: center; gap: 14px; }
.pt-prodx__brand h2 { font-size: 26px; font-weight: 700; margin: 0; color: var(--ink); line-height: 1.2; }
.pt-prodx__sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink3); }
.pt-prodx__tag { font: 700 20px/1.5 'Anuphan', system-ui, sans-serif; color: var(--ink); margin: 18px 0 0; text-wrap: balance; }
.pt-prodx__desc { color: var(--ink2); font-size: 15px; line-height: 1.8; margin: 8px 0 0; }
.pt-prodx__feats { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
@media (max-width: 520px) { .pt-prodx__feats { grid-template-columns: minmax(0, 1fr); } }
.pt-prodx__feats li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 14px; color: var(--ink); line-height: 1.5; }
.pt-prodx__feats i { color: var(--brand); margin-top: 3px; text-align: center; }
.pt-prodx__for { font-size: 13.5px; color: var(--ink2); margin: 16px 0 0; }
.pt-prodx__for i { color: var(--ink3); margin-right: 4px; }
.pt-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
@media (max-width: 520px) { .pt-plans { grid-template-columns: minmax(0, 1fr); } }
.pt-plan { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; background: var(--panel); }
.pt-plan.is-hi { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pt-plan small { font-size: 11.5px; color: var(--ink3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pt-plan b { font: 600 15px 'IBM Plex Sans Thai', system-ui, sans-serif; color: var(--ink); }
.pt-plan span { font-size: 12px; color: var(--ink2); }
.pt-prodx__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pt-btn--brand { background: var(--brand); border-color: var(--brand); color: #fff !important; }
.pt-prodx__cta + .pt-note { margin-top: 8px; }

.pt-shot { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); box-shadow: 0 24px 50px -28px rgba(0, 0, 0, .45); }
.pt-shot__bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--band); }
.pt-shot__bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--hover-line); }
.pt-shot__bar em { font: normal 500 11.5px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink3); margin-left: 8px; }
.pt-shot__stage { position: relative; aspect-ratio: 16 / 10; background: var(--thumb); }
.pt-shot__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.pt-shot__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pt-shot__tabs button { border: 1px solid var(--line); background: var(--panel); color: var(--ink2); font-size: 12.5px; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.pt-shot__tabs button.is-on { border-color: var(--brand); color: var(--ink); font-weight: 600; }
.pt-prodx__stack { margin-top: 12px; }
/* 11 category chips: never clip the first chip when the row overflows */
.pt-cats__row { justify-content: safe center; }


/* ── AI on articles: summary, challenge, ask ───────── */
.pt-ai { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 16px 18px; margin-top: 24px; max-width: 700px; }
.pt-ai__h { font: 600 15px 'Anuphan', system-ui, sans-serif; color: var(--ink); margin: 0 0 10px; }
.pt-ai__h i { color: var(--accent-text); margin-right: 4px; }
.pt-ai--tldr { background: radial-gradient(ellipse 60% 120% at 100% 0%, var(--accent-soft), transparent 70%), var(--panel); }
.pt-ai--tldr ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.pt-quiz__q { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.pt-quiz__q legend { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px; line-height: 1.6; }
.pt-quiz__choices { display: grid; gap: 6px; }
.pt-quiz__c { text-align: left; border: 1px solid var(--field-line); background: var(--field); color: var(--ink); border-radius: 6px; padding: 8px 12px; font-size: 14px; line-height: 1.5; cursor: pointer; transition: border-color .15s, background .15s; }
.pt-quiz__c:hover:not(:disabled) { border-color: var(--hover-line); }
.pt-quiz__c.is-picked { border-color: var(--ink2); box-shadow: inset 0 0 0 1px var(--ink2); }
.pt-quiz__c.is-right { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); color: var(--ok); }
.pt-quiz__c.is-wrong { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); color: var(--danger); }
.pt-quiz__c:disabled { cursor: default; }
.pt-quiz__why { font-size: 13.5px; color: var(--ink2); margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--line); }
.pt-quiz__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pt-quiz__score { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.pt-quiz__score b { font: 600 22px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink); }
.pt-quiz__score span { font-size: 14px; color: var(--ink2); }
.pt-btn:disabled { opacity: .5; cursor: not-allowed; }
.pt-ask__form { display: flex; gap: 8px; }
.pt-ask__form input { flex: 1; min-width: 0; background: var(--field); border: 1px solid var(--field-line); border-radius: 6px; padding: 9px 12px; color: var(--ink); font-size: 14.5px; }
.pt-ask__a { margin: 12px 0 0; padding: 12px 14px; background: var(--band); border-radius: 6px; font-size: 14.5px; line-height: 1.8; color: var(--ink); white-space: pre-line; }
.pt-ask .pt-note { margin-top: 8px; }

/* ── AI benchmarks: ranked bars ────────────────────── */
.pt-bench__asof { margin-top: 10px; }
.pt-bench__tabs { overflow-x: auto; scrollbar-width: none; padding-block: 24px 8px; }
.pt-bench__tabs::-webkit-scrollbar { display: none; }
.pt-bench { padding-block: 16px 32px; }
.pt-bench__second { margin-top: 32px; }
.pt-rbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pt-rbar { display: grid; grid-template-columns: 28px minmax(0, 2.2fr) minmax(0, 3fr) 64px; gap: 12px; align-items: center; padding: 7px 8px; border-radius: 6px; }
.pt-rbar:hover { background: var(--band); }
.pt-rbar__rank { font: 500 12px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink3); text-align: right; }
.pt-rbar__label { min-width: 0; display: grid; }
.pt-rbar__name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-rbar__sub { font: 400 11.5px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-rbar__track { height: 12px; background: var(--band); border-radius: 0 4px 4px 0; overflow: hidden; }
.pt-rbar__fill { display: block; height: 100%; background: var(--chart-bar); border-radius: 0 4px 4px 0; transform-origin: left; animation: pt-bar-in .6s cubic-bezier(.32, .72, 0, 1) both; }
.pt-rbar:nth-child(-n+3) .pt-rbar__fill { background: var(--chart-bar-top); }
.pt-rbar__val { font: 600 13.5px 'JetBrains Mono', ui-monospace, monospace; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
@keyframes pt-bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .pt-rbar__fill { animation: none; } }
@media (max-width: 640px) {
  .pt-rbar { grid-template-columns: 22px minmax(0, 1fr) 56px; row-gap: 4px; }
  .pt-rbar__track { grid-column: 2 / 3; grid-row: 2; }
  .pt-rbar__val { grid-row: 1 / span 2; grid-column: 3; }
}
.pt-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pt-table th, .pt-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.pt-table th { font-size: 12px; color: var(--ink3); font-weight: 600; background: var(--band); }
.pt-table td b { display: block; color: var(--ink); font-weight: 600; }
.pt-table td small { color: var(--ink3); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; }
.pt-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.pt-table tr:last-child td { border-bottom: 0; }

.pt-bench-src h3 a { color: var(--link); }
.pt-bench-src h3 i { font-size: 11px; color: var(--ink3); margin-left: 4px; }
.pt-bench-src .pt-sec__head h2 i { color: var(--accent-text); margin-right: 6px; }
.pt-bench-src__meta { font: 400 12px 'JetBrains Mono', ui-monospace, monospace !important; color: var(--ink3) !important; margin-top: 10px !important; }
.pt-bench-src__note { margin-top: 14px; }

/* ── Footer (always on the black bar) ─────────────── */
.sf { padding-block: 36px 0; }
.sf__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px; padding-bottom: 28px; }
.sf__brand p { color: var(--bar-sub); font-size: 13px; line-height: 1.7; margin: 12px 0 14px; max-width: 320px; }
.sf__logo img { display: block; height: 28px; width: auto; }
.sf__social { display: flex; gap: 8px; }
.sf__social a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #2A2F38; display: grid; place-items: center; color: #fff; font-size: 15px; }
.sf__social a:hover { border-color: #fff; opacity: 1; }
.sf__col { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.sf__col h2 { color: #fff; font-size: 13px; font-weight: 600; margin: 0 0 4px; letter-spacing: .02em; }
.sf__col a { color: var(--bar-sub); }
.sf__col a:hover { color: #fff; opacity: 1; }
.sf__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; border-top: 1px solid #1F232A; padding-block: 16px; font-size: 12.5px; }
.sf__legal { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.sf__legal a, .sf__cookie { color: var(--bar-sub); }
.sf__cookie { border: 0; background: none; font: inherit; cursor: pointer; padding: 0; }
.sf__legal a:hover, .sf__cookie:hover { color: #fff; opacity: 1; }
@media (max-width: 860px) { .sf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sf__brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .sf__grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Cookie consent ───────────────────────────────── */
.ck { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; display: flex; justify-content: center; pointer-events: none; }
.ck__box { pointer-events: auto; width: 100%; max-width: 760px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .35); padding: 16px 18px; }
.ck__main { display: flex; gap: 12px; }
.ck__icon { font-size: 22px; color: var(--accent-text, var(--accent)); margin-top: 2px; }
.ck__title { font-weight: 700; font-size: 14.5px; margin: 0 0 2px; }
.ck__text { font-size: 13px; color: var(--ink2); line-height: 1.6; margin: 0; }
.ck__text a { color: var(--ink); text-decoration: underline; }
.ck__detail { margin: 12px 0 0; border-top: 1px solid var(--line); }
.ck__opt { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ck__opt b { display: block; font-size: 13.5px; }
.ck__opt small { color: var(--ink3); font-size: 12px; }
.ck__opt input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.ck__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.ck__btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 7px 14px; font: 600 13px 'IBM Plex Sans Thai', system-ui, sans-serif; cursor: pointer; }
.ck__btn:hover { border-color: var(--hover-line); }
.ck__btn--accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 520px) { .ck { left: 8px; right: 8px; bottom: 8px; } .ck__actions .ck__btn { flex: 1; } }

/* header: member sign-in */
.sb__me { text-decoration: none; font: 700 13px 'Outfit', system-ui, sans-serif; }
.sb__me.has-member { color: #fff; border-color: transparent; }
