/* FK xboard — กระดานสนทนา farmkaset.org
   Look: same family as FK WebApp (farmkaset.one/studio) — near-black ground, graphite cards,
   one loud colour: FK orange (#FF6A00, the logo). Dark by default, light theme on the toggle. */
:root {
  --bg: #0a0a0b;
  --surface: #121214;
  --raised: #1b1b1e;
  --line: #26262a;
  --line-2: #34343a;
  --text: #f2f2f3;
  --sub: #a0a0a8;
  --acc: #ff6a00;          /* FK orange: buttons, marks */
  --acc-text: #ff8a3d;     /* orange for links/text on dark (readable) */
  --acc-ink: #111111;      /* text on an orange button */
  --acc-soft: rgba(255, 106, 0, .12);
  --acc-line: rgba(255, 106, 0, .45);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .1);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .12);
  --info: #7cb4ff;
  --info-soft: rgba(124, 180, 255, .12);
  --r: 14px;
  --r-sm: 10px;
  --glow: radial-gradient(900px 380px at 15% -120px, rgba(255, 106, 0, .16), transparent 70%);
  --font: "Anuphan", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f6f7;
  --surface: #ffffff;
  --raised: #efeff1;
  --line: #e2e2e6;
  --line-2: #cfcfd5;
  --text: #121214;
  --sub: #5d5d66;
  --acc-text: #c2410c;
  --acc-soft: rgba(255, 106, 0, .1);
  --acc-line: rgba(255, 106, 0, .55);
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info: #1d5fb8;
  --info-soft: #e8f0fb;
  --glow: radial-gradient(900px 380px at 15% -120px, rgba(255, 106, 0, .10), transparent 70%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg) var(--glow) no-repeat; color: var(--text); font: 17px/1.7 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--acc-text); text-underline-offset: 3px; }
a:hover { color: var(--acc); }
h1, h2, h3 { line-height: 1.3; color: var(--text); margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--sub); }
.small { font-size: .875rem; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid transparent; font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--acc); color: var(--acc-ink); }
.btn-primary:hover { background: #ff7d1f; color: var(--acc-ink); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: var(--raised); }
.btn-ghost:hover { border-color: var(--acc); color: var(--text); }
.btn-danger { background: var(--danger); color: #111; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: default; }

/* header */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 11, .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
:root[data-theme="light"] .site-head { background: rgba(255, 255, 255, .85); }
.head-row { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 9px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.brand-sub { font-size: .78rem; color: var(--sub); }
.head-search { display: flex; flex: 1 1 260px; max-width: 400px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.head-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 16px; font: inherit; font-size: .95rem; color: var(--text); }
.head-search input::placeholder { color: var(--sub); }
.head-search input:focus { outline: none; }
.head-search:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.head-search button { border: 0; background: transparent; width: 44px; cursor: pointer; color: var(--sub); }
.head-search svg, .theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.theme-btn:hover { border-color: var(--acc); }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
.head-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.head-nav::-webkit-scrollbar { display: none; }
.head-nav a { padding: 6px 14px; text-decoration: none; color: var(--sub); font-weight: 500; font-size: .95rem; white-space: nowrap; border-radius: 999px; border: 1px solid transparent; }
.head-nav a:hover { color: var(--text); background: var(--surface); }
.head-nav a[aria-current="page"] { color: var(--text); background: var(--raised); border-color: var(--line-2); }
@media (max-width: 640px) {
  .head-search { order: 3; max-width: none; flex-basis: 100%; }
  .brand-sub { display: none; }
  .head-new { padding: 8px 14px; }
  .site-head { position: static; }
}

main.wrap { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }

.lead { font-size: 1.08rem; color: var(--sub); }
/* big search box (search, not-found and gone pages) */
.hero-search { display: flex; gap: 8px; max-width: 620px; }
.hero-search input { flex: 1; min-width: 0; min-height: 52px; padding: 10px 20px; border: 1px solid var(--line-2); border-radius: 999px; font: inherit; background: var(--surface); color: var(--text); }
.hero-search input::placeholder { color: var(--sub); }
.hero-search input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.hero-search .btn { min-height: 52px; padding: 8px 26px; }

/* blocks */
.block { margin-bottom: 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.block-head h2 { margin: 0; }
.more { font-weight: 600; font-size: .92rem; white-space: nowrap; text-decoration: none; }
.more::after { content: " →"; }

/* rooms (front page): whole card opens the room; the latest-topic line opens that topic */
.rooms-head { margin-bottom: 18px; }
.rooms-head .lead { font-size: 1rem; }
.rooms { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.room-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, transform .15s, background .15s; }
.room-card:hover { border-color: var(--acc-line); background: var(--raised); transform: translateY(-2px); }
.room-card.is-fresh { background: linear-gradient(180deg, var(--acc-soft), transparent 55%), var(--surface); }
.rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.room-name { margin: 0; font-weight: 700; font-size: 1.1rem; line-height: 1.35; }
.rc-link { color: var(--text); text-decoration: none; }
.rc-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rc-link:focus-visible { outline: none; }
.room-card:focus-within { border-color: var(--acc); }
.rc-new { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--acc); color: var(--acc-ink); font-size: .75rem; font-weight: 700; line-height: 1.6; }
.room-desc { margin: 0; font-size: .86rem; color: var(--sub); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-latest { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--text); flex: 1; }
.rc-latest:hover { border-color: var(--acc-line); }
.rc-latest:hover .rc-latest-title { color: var(--acc-text); }
.rc-latest-title { font-size: .92rem; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-latest-meta { font-size: .76rem; color: var(--sub); }
.room-count { margin: 4px 0 0; font-size: .8rem; color: var(--sub); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .rooms { gap: 10px; }
  .room-card { padding: 14px 14px 12px; gap: 4px; }
  .room-desc { display: none; }
  .rc-latest { padding: 8px 10px; }
  .rc-latest-title { -webkit-line-clamp: 1; }
}

.cols { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; }
.col-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* topic list */
.tlist { list-style: none; padding: 0; margin: 0; }
.tl { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.tl-main { flex: 1; min-width: 0; }
.tl-title { font-weight: 600; font-size: 1.06rem; line-height: 1.45; color: var(--text); text-decoration: none; display: block; }
.tl-title:hover { color: var(--acc-text); }
.tl-ex { margin: 4px 0 6px; color: var(--sub); font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--sub); align-items: center; }
.tl-count { flex: none; width: 74px; align-self: center; text-align: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 4px; background: var(--surface); line-height: 1.2; text-decoration: none; color: var(--text); }
.tl-count strong { display: block; font-weight: 700; font-size: 1.2rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tl-count span { font-size: .72rem; color: var(--sub); }
.tl-count.is-waiting { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-text); }
.tl-count.is-waiting span { color: var(--acc-text); font-weight: 600; }
.tl-count.is-waiting:hover { border-color: var(--acc); }
.pin { font-size: .72rem; background: var(--acc); color: var(--acc-ink); padding: 1px 8px; border-radius: 999px; vertical-align: 2px; font-weight: 700; }
.chip { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); color: var(--sub); text-decoration: none; font-weight: 500; }
.chip:hover { border-color: var(--acc); color: var(--text); }
@media (max-width: 520px) { .tl-count { width: 60px; } .tl-ex { display: none; } }

/* side */
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.side-box h2 { font-size: 1.05rem; margin-bottom: .4em; }
.side-waiting { border-color: var(--acc-line); background: linear-gradient(180deg, var(--acc-soft), transparent 60%), var(--surface); }
.side-list { list-style: none; padding: 0; margin: 0 0 10px; }
.side-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-list li:last-child { border-bottom: 0; }
.side-list a { font-weight: 500; line-height: 1.45; text-decoration: none; color: var(--text); }
.side-list a:hover { color: var(--acc-text); }
.side-list.ranked { counter-reset: rank; }
.side-list.ranked li { counter-increment: rank; padding-left: 36px; position: relative; }
.side-list.ranked li::before { content: counter(rank); position: absolute; left: 0; top: 11px; width: 24px; height: 24px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line); color: var(--acc-text); font: 700 .78rem/22px var(--font); text-align: center; }
.tips { margin: 0; padding-left: 1.2em; }

/* page heads, tabs, crumbs */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin-bottom: .15em; }
.page-head .lead { margin: 0; }
.crumbs { font-size: .86rem; color: var(--sub); margin-bottom: 14px; }
.crumbs a { color: var(--sub); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--sub); font-weight: 500; font-size: .93rem; border: 1px solid var(--line); background: var(--surface); }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 28px 0 0; }
.pager a, .pager span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); font-variant-numeric: tabular-nums; }
.pager a:hover { border-color: var(--acc); }
.pager .cur { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 700; }
.pager .gap { border: 0; background: none; }
.empty { padding: 32px 0; color: var(--sub); text-align: center; }
.empty.big { padding: 48px 0; max-width: 640px; margin: 0 auto; }
.empty.big .search-again { margin: 20px auto; }
.search-again { margin-bottom: 20px; }

/* notices */
.notice { padding: 12px 16px; border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok); border: 1px solid currentColor; }
.notice-info { background: var(--info-soft); color: var(--info); }
.notice-error { background: var(--danger-soft); color: var(--danger); }

/* topic */
.topic-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.topic-meta { display: flex; gap: 12px; align-items: center; margin: 0; line-height: 1.4; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem; }
.prose { font-size: 1.04rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose img { border-radius: var(--r-sm); display: block; margin: 12px 0; }
.prose h2 { font-size: 1.22rem; margin-top: 1.3em; }
.prose h3, .prose h4 { font-size: 1.08rem; margin-top: 1.2em; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; margin: 12px 0; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--acc); color: var(--sub); background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.prose.narrow { max-width: 760px; }
.yt { margin: 14px 0; max-width: 640px; }
.yt-play { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.yt-play img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; opacity: .8; }
.yt-btn { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border-radius: 14px; background: var(--acc); }
.yt-btn::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #111; }
.yt iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-sm); }
.post-img { margin: 12px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.origin { margin-top: 20px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px dashed var(--line-2); }

.replies { margin-top: 40px; }
.replies > h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.first-answer { background: var(--acc-soft); color: var(--text); border: 1px solid var(--acc-line); border-radius: var(--r-sm); padding: 14px 16px; font-weight: 500; }
.rlist { list-style: none; padding: 0; margin: 0; }
.reply { padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 130px; }
.reply:target { background: var(--acc-soft); border-radius: var(--r-sm); padding-left: 12px; padding-right: 12px; }
.reply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.reply-head .avatar { width: 34px; height: 34px; font-size: .95rem; border-radius: 10px; }
.reply-no { margin-left: auto; text-decoration: none; }
.reply-body { padding-left: 44px; }
@media (max-width: 520px) { .reply-body { padding-left: 0; } }

/* forms */
.reply-form, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.reply-form { margin-top: 28px; scroll-margin-top: 130px; }
.form .field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; font-size: .94rem; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea { font: inherit; font-size: 1rem; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg); color: var(--text); width: 100%; min-height: 44px; }
.form textarea { resize: vertical; line-height: 1.6; }
.form input::placeholder, .form textarea::placeholder { color: var(--sub); opacity: .8; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.form input[type=file] { font: inherit; font-size: .9rem; color: var(--sub); }
.form input[type=file]::file-selector-button { font: 600 .88rem var(--font); margin-right: 10px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); cursor: pointer; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.field-row .field { flex: 1 1 240px; }
.hint { font-size: .85rem; color: var(--sub); margin: 0; }
.counter { font-size: .8rem; color: var(--sub); margin: -2px 0 0; text-align: right; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--acc-text); }
.counter.full { color: var(--danger); font-weight: 600; }
.file-note { font-size: .82rem; color: var(--danger); margin: 0; min-height: 1em; }

/* rooms page */

/* footer */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0; font-size: .9rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; margin-bottom: 6px; }
.foot-brand img { width: 28px; height: 28px; border-radius: 7px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: flex-start; }
.foot-links a { color: var(--sub); text-decoration: none; }
.foot-links a:hover { color: var(--text); }

/* admin */
.admin-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; align-items: center; }
.admin-bar a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); font-weight: 500; }
.admin-bar a[aria-current="page"] { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.admin-bar .badge { background: var(--acc); color: var(--acc-ink); border-radius: 999px; padding: 0 8px; font-size: .78rem; margin-left: 4px; font-weight: 700; }
.admin-bar a[aria-current="page"] .badge { background: var(--acc-ink); color: var(--acc); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-weight: 700; font-size: 1.6rem; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--sub); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; color: var(--sub); font-weight: 600; background: var(--raised); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table .actions form { margin: 0; }
.status { font-size: .76rem; padding: 1px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.status-visible { background: var(--ok-soft); color: var(--ok); }
.status-pending { background: var(--acc-soft); color: var(--acc-text); }
.status-hidden { background: var(--danger-soft); color: var(--danger); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: flex-end; }
.filters input, .filters select { font: inherit; font-size: .95rem; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); min-height: 40px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--acc); }
.preview { max-height: 120px; overflow: hidden; color: var(--sub); font-size: .88rem; }

/* picture picker (shrinks in the browser before upload) */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.pick-grid:empty { display: none; }
.pick-item { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--raised); }
.pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-btn { position: absolute; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(10, 10, 11, .75); color: #fff; font: 700 15px/30px var(--font); cursor: pointer; padding: 0; }
.pick-btn { left: 6px; }
.pick-btn.is-del { left: auto; right: 6px; }
.pick-btn:hover { background: var(--acc); color: var(--acc-ink); }
.pick-note { font-size: .82rem; color: var(--sub); margin: 6px 0 0; min-height: 1em; }

/* owner / report tools */
.post-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-top: 18px; }
.reply-tools { padding-left: 44px; margin-top: 4px; }
@media (max-width: 520px) { .reply-tools { padding-left: 0; } }
.report summary { cursor: pointer; font-size: .8rem; color: var(--sub); list-style: none; padding: 6px 0; }
.report summary::-webkit-details-marker { display: none; }
.report summary:hover { color: var(--text); }
.report-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.report-form select { font: inherit; font-size: .88rem; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); min-height: 34px; }
.narrow-form { max-width: 760px; }

/* admin pictures */
.admin-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.admin-pics figure { margin: 0; }
.admin-pics img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }
.admin-pics figcaption { margin-top: 4px; }

/* lightbox (assets/app.js) */
.lb-open, .lb-open body { overflow: hidden; }
.lb-zoom { cursor: zoom-in; }
[data-lightbox] a { cursor: zoom-in; }
.lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 6, 8, .97); color: #fff; overscroll-behavior: contain; }
.lb::backdrop { background: rgba(0, 0, 0, .6); }
.lb[open] { display: flex; align-items: center; justify-content: center; animation: lb-in .16s ease-out; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-fig { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 64px 44px; box-sizing: border-box; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 8px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lb-cap { font-size: .9rem; color: #c8c8cf; text-align: center; max-width: 70ch; }
.lb-cap:empty { display: none; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(20, 20, 22, .7); color: #fff; font: 400 1.6rem/1 var(--font); cursor: pointer; }
.lb-btn:hover, .lb-btn:focus-visible { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); outline: none; }
.lb-close { top: 12px; right: 12px; font-size: 1.15rem; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-single .lb-prev, .lb-single .lb-next { display: none; }
.lb-count { position: absolute; top: 22px; left: 0; right: 0; margin: 0; text-align: center; font-size: .85rem; color: #c8c8cf; pointer-events: none; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .lb-fig { padding: 56px 8px 24px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; width: 44px; height: 44px; }
  .lb-img { max-height: calc(100dvh - 150px); }
}

/* ===================== rice page (front page: นาข้าว) ===================== */
.rice-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 8px 0 36px; border-bottom: 1px solid var(--line); }
.rice-kicker { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px; background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc-text); font-size: .85rem; font-weight: 600; }
.rice-hero h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); line-height: 1.22; letter-spacing: -.02em; }
.rice-hero h1 em { font-style: normal; color: var(--acc); }
.rice-hero .lead { max-width: 60ch; }
.rice-hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.rice-trio { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rice-trio a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.rice-trio a:hover { border-color: var(--acc-line); transform: translateY(-2px); }
.rice-trio img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); background: #fff; margin-bottom: 6px; }
.rt-job { font-size: .75rem; color: var(--acc-text); font-weight: 600; }
.rice-trio strong { font-size: 1.05rem; line-height: 1.25; }
.rt-when { font-size: .78rem; color: var(--sub); }
@media (max-width: 860px) { .rice-hero { grid-template-columns: 1fr; } }

.rice-sec { padding: 40px 0 8px; border-bottom: 1px solid var(--line); }
.rice-sec:last-child { border-bottom: 0; }
.rice-sec > h2 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); max-width: 34ch; }
.rice-sec > p { max-width: 72ch; }
.rice-num { margin: 0 0 4px; font: 700 .85rem/1 var(--font); color: var(--acc); letter-spacing: .12em; }

.yield-eq { display: flex; align-items: stretch; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
.yield-eq > div { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.yield-eq b { font-size: 1.1rem; }
.yield-eq span { font-size: .85rem; color: var(--sub); line-height: 1.45; flex: 1; }
.yield-eq i { font-style: normal; font-size: .8rem; font-weight: 600; color: var(--acc-text); }
.yield-eq > p { margin: 0; align-self: center; font-size: 1.4rem; color: var(--sub); }
@media (max-width: 720px) { .yield-eq > p { display: none; } .yield-eq > div { flex-basis: calc(50% - 4px); } }
.rice-callout { margin: 8px 0 24px; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--acc-line); background: linear-gradient(180deg, var(--acc-soft), transparent 70%), var(--surface); }
.rice-callout h3 { font-size: 1.05rem; }
.rice-callout p { margin: .4em 0; }

.stages { list-style: none; margin: 22px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.stages li { display: flex; flex-direction: column; padding: 16px 16px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--line-2); }
.stages h3 { font-size: 1.05rem; margin-bottom: .3em; }
.stages p { margin: 0 0 .5em; font-size: .9rem; line-height: 1.55; }
.stages .st-day { font-size: .78rem; font-weight: 700; color: var(--sub); letter-spacing: .02em; }
.stages .st-use { margin: auto 0 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--raised); font-size: .86rem; }
.st-use b { color: var(--acc-text); }
.stages .st-none { color: var(--sub); }
.stages .st-soil { border-top-color: #b07a4a; }
.stages .st-leaf { border-top-color: var(--ok); }
.stages .st-pi, .stages .st-boot, .stages .st-milk { border-top-color: var(--acc); }
.stages .st-flower { border-top-color: #facc15; }
.stages .st-harvest { border-top-color: #d6b25e; }

.prod { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 28px; margin: 28px 0 36px; padding-top: 28px; border-top: 1px dashed var(--line-2); scroll-margin-top: 16px; }
.prod-media { position: sticky; top: 16px; align-self: start; }
.rice-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rice-gallery a:first-child { grid-column: 1 / -1; }
.rice-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; }
.prod-tag { margin: 0 0 6px; font-size: .8rem; font-weight: 700; color: var(--acc-text); }
.prod h3 { font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); }
.prod h4 { margin: 18px 0 6px; font-size: 1rem; color: var(--text); }
.prod-spec { color: var(--sub); font-size: .9rem; }
.prod ul { margin: 0; padding-left: 1.1em; }
.prod li { margin-bottom: .55em; line-height: 1.65; }
.prod-rate { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prod-rate th, .prod-rate td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prod-rate th { width: 9.5em; color: var(--sub); font-weight: 600; }
.prod-note { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--acc); background: var(--raised); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: .9rem; }
.rice-buy { white-space: normal; text-align: center; }
@media (max-width: 860px) { .prod { grid-template-columns: 1fr; gap: 16px; } .prod-media { position: static; } }

.nut-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--r); }
.nut { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .9rem; }
.nut th, .nut td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.nut thead th { background: var(--raised); font-size: .82rem; color: var(--sub); }
.nut tbody th { white-space: nowrap; }
.nut tbody tr:last-child > * { border-bottom: 0; }

.calc { margin: 16px 0 24px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.calc-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.calc-in label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--sub); }
.calc-in input { font: 600 1.1rem var(--font); padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); min-height: 46px; }
.calc-in input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.calc-pick { margin: 14px 0; padding: 0; border: 0; display: grid; gap: 6px; }
.calc-pick legend { padding: 0; margin-bottom: 6px; font-size: .9rem; color: var(--sub); }
.calc-pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--raised); cursor: pointer; }
.calc-pick input { width: 18px; height: 18px; accent-color: var(--acc); flex: none; }
.calc-pick span { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.calc-out div { padding: 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--line); }
.calc-out span { display: block; font-size: .78rem; color: var(--sub); }
.calc-out b { font-size: clamp(1.05rem, .9rem + .8vw, 1.45rem); font-variant-numeric: tabular-nums; }
.calc-out div:nth-child(2) b { color: var(--acc-text); }
@media (max-width: 520px) { .calc-out { grid-template-columns: 1fr; } }

.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 16px 0 24px; }
.tips > div { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.tips h3 { font-size: 1rem; color: var(--acc-text); }
.tips p { margin: 0; font-size: .9rem; line-height: 1.65; }
.faq { margin: 16px 0; display: grid; gap: 8px; }
.faq details { border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--acc-text); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 16px 16px; line-height: 1.7; color: var(--sub); }
.rice-ask { margin: 16px 0 28px; }
.h1-key { color: var(--acc); }
.rice-side { container-type: inline-size; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* narrow column (tablets, small laptops): one big button per row */
@container (max-width: 470px) { .rice-side .shop-contact { grid-template-columns: 1fr; } .rice-side .sc-btn { justify-content: center; } }
.shop-contact { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; padding: 14px; border-radius: var(--r); border: 1px solid var(--acc-line); background: linear-gradient(180deg, var(--acc-soft), transparent 80%), var(--surface); }
.sc-title { grid-column: 1 / -1; margin: 0 0 2px; text-align: center; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.sc-btn { container-type: inline-size; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 64px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: #fff; transition: transform .15s, filter .15s; }
.sc-btn:hover { transform: translateY(-1px); filter: brightness(1.08); color: #fff; }
.sc-btn > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.sc-btn small { font-size: .78rem; opacity: .9; }
/* number size follows the button's own width (container units), so it never runs past the edge */
.sc-btn b { font-size: clamp(.95rem, 10cqi, 1.45rem); line-height: 1.15; letter-spacing: .01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .2); font-size: 1.2rem; font-weight: 800; }
.sc-tel { background: var(--acc); color: var(--acc-ink); }
.sc-tel:hover { color: var(--acc-ink); }
.sc-tel .sc-ico { background: rgba(0, 0, 0, .12); }
.sc-line { background: #06c755; }
.sc-line .sc-ico { font-size: .62rem; letter-spacing: .02em; }
/* phones: one big button per row so the number never gets cut */
@media (max-width: 520px) { .shop-contact { grid-template-columns: 1fr; } .sc-btn { justify-content: center; } }

/* call bar pinned to the bottom on phones (guide pages) */
.call-bar { display: none; }
@media (max-width: 720px) {
  .call-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(10, 10, 11, .94); border-top: 1px solid var(--line);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .2s ease; }
  .call-bar.is-hidden { transform: translateY(110%); }
  .call-bar a { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 48px; padding: 6px 6px; border-radius: 999px;
    font-weight: 700; font-size: clamp(.82rem, 3.9vw, 1.02rem); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-variant-numeric: tabular-nums; }
  .cb-tel { background: var(--acc); color: var(--acc-ink); }
  .cb-line { background: #06c755; color: #fff; }
  body:has(.call-bar) .site-foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
:root[data-theme="light"] .call-bar { background: rgba(255, 255, 255, .94); }
@media (max-width: 520px) { .rice-hero h1 br { display: none; } }
.rice-updated { margin: 10px 0 0; }
.share-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0 0; font-size: .82rem; color: var(--sub); }
.share-line a { color: var(--sub); text-decoration: none; border-bottom: 1px dashed var(--line-2); }
.share-line a:hover { color: var(--text); }
.share-copy { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--sub); font: inherit; font-size: .78rem; cursor: pointer; }
.share-copy:hover { color: var(--text); border-color: var(--acc-line); }
.share-copy.done { color: var(--ok); border-color: var(--ok); }
.faq summary h3 { display: inline; margin: 0; font-size: 1rem; font-weight: 600; }
.rice-rel { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.rice-rel li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.rice-rel a { color: var(--text); text-decoration: none; font-weight: 500; line-height: 1.45; }
.rice-rel a:hover { color: var(--acc-text); }
.guide-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); border-color: var(--acc-line); background: linear-gradient(180deg, var(--acc-soft), transparent 70%), var(--surface); }
.guide-card:hover { border-color: var(--acc); }
.guide-kicker { font-size: .75rem; font-weight: 700; color: var(--acc-text); }
.guide-strip { flex-basis: 100%; display: block; padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid var(--acc-line); background: var(--acc-soft); color: var(--text); text-decoration: none; font-size: .95rem; }
.guide-strip b { color: var(--acc-text); }
.guide-strip:hover { border-color: var(--acc); }
/* vegetables guide */
.rice-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.steps3 { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.steps3 li { position: relative; padding: 18px 18px 16px 64px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.steps3 b { position: absolute; left: 16px; top: 16px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--acc); color: var(--acc-ink); font-size: 1.1rem; }
.steps3 h3 { font-size: 1.05rem; margin-bottom: .3em; }
.steps3 p { margin: 0; font-size: .92rem; line-height: 1.6; }
.veg-find { margin: 16px 0 10px; }
.veg-find label { display: block; font-weight: 600; margin-bottom: 6px; }
.veg-find input { width: 100%; box-sizing: border-box; min-height: 50px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem; }
.veg-find input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.vf-msg { margin: 6px 4px 0; min-height: 1.2em; }
.veg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: .8rem; color: var(--sub); }
.veg-legend .lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--ph); }
.veg-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; margin-bottom: 14px; }
.vg-card { padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 90px; min-width: 0; }
.vg-card[hidden] { display: none; }
.vg-head h3 { margin: 0; font-size: 1.15rem; }
.vg-head p { margin: 2px 0 10px; }
.vg-names { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vg-names li { padding: 3px 10px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: .86rem; line-height: 1.5; }
.vg-names li.hit { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }
.vg-bar { list-style: none; margin: 0 0 12px; padding: 0; display: flex; gap: 3px; border-radius: var(--r-sm); overflow: hidden; }
.vg-bar .ph { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 9px; background: color-mix(in srgb, var(--ph) 16%, var(--surface)); border-top: 4px solid var(--ph); }
.ph-ico { font-weight: 800; color: var(--ph); font-size: .9rem; line-height: 1; }
.ph-when { font-size: .74rem; color: var(--sub); line-height: 1.35; }
.ph-use { font-size: .8rem; font-weight: 600; line-height: 1.35; color: var(--text); }
.ph.soil, .lg.soil { --ph: #c8894f; }
.ph.grow, .lg.grow { --ph: var(--acc); }
.ph.care, .lg.care { --ph: #e0b23a; }
.ph.stop, .lg.stop { --ph: #8a8a94; }
.ph.harvest, .lg.harvest { --ph: var(--ok); }
@media (max-width: 560px) {
  .vg-bar { flex-direction: column; }
  .vg-bar .ph { flex-grow: 1 !important; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; border-top: 0; border-left: 4px solid var(--ph); }
  .ph-use { flex-basis: 100%; }
}
.vg-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: .88rem; color: var(--sub); }
.vg-meta b { color: var(--text); }
.vg-tips { margin: 0; padding-left: 1.1em; font-size: .88rem; line-height: 1.6; color: var(--sub); }
.nut.mix small { font-weight: 400; color: var(--sub); }
.rice-refs h2 { font-size: 1rem; color: var(--sub); }
.rice-refs ol { margin: 0 0 16px; padding-left: 1.3em; font-size: .82rem; color: var(--sub); line-height: 1.6; }

/* ===================== กลุ่มธุรกิจFK (/fk) ===================== */
.fk-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 6px 0 34px; border-bottom: 1px solid var(--line); }
.fk-hero h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem); line-height: 1.12; letter-spacing: -.03em; }
.fk-hero h1 em { font-style: normal; color: var(--acc); }
.fk-jump { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; max-width: 420px; }
.fk-jump a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; transition: border-color .15s, transform .15s; }
.fk-jump a:hover { border-color: var(--acc-line); transform: translateX(3px); }
.fk-jump b { color: var(--acc); font-size: .85rem; letter-spacing: .08em; }
.fk-orbit { margin: 0; color: var(--text); }
.fk-orbit svg { width: 100%; height: auto; display: block; overflow: visible; }
.fk-link { fill: none; stroke-width: 2; }
.fk-mark { font: 800 34px/1 var(--font); fill: #111; letter-spacing: -.02em; }
.node-bg { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.node-label { font: 600 15px/1 var(--font); fill: var(--sub); }
.fk-node { animation: fk-float 6s ease-in-out infinite; }
.fk-node:nth-of-type(2) { animation-delay: -2s; }
.fk-node:nth-of-type(3) { animation-delay: -4s; }
@keyframes fk-float { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .fk-node { animation: none; } .fk-dot { display: none; } }
@media (max-width: 860px) { .fk-hero { grid-template-columns: 1fr; } .fk-orbit { max-width: 420px; margin: 0 auto; } }

.fk-sec { padding: 46px 0 14px; border-bottom: 1px solid var(--line); scroll-margin-top: 130px; }
@media (max-width: 640px) { .fk-sec { scroll-margin-top: 8px; } }
.fk-sec h2 { font-size: clamp(1.4rem, 1.05rem + 1.4vw, 2.1rem); line-height: 1.25; letter-spacing: -.015em; max-width: 28ch; }
.fk-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.fk-split-rev { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
@media (max-width: 860px) { .fk-split, .fk-split-rev { grid-template-columns: 1fr; } }
.fk-stats { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fk-stats li { padding: 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.fk-stats b { display: block; font-size: clamp(1.05rem, .9rem + .9vw, 1.5rem); color: #7fe7dc; line-height: 1.2; }
.fk-stats span { font-size: .8rem; color: var(--sub); }
@media (max-width: 420px) { .fk-stats { grid-template-columns: 1fr; } }
.fk-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.fk-tags span { padding: 3px 11px; border-radius: 999px; border: 1px solid rgba(127, 231, 220, .35); background: rgba(127, 231, 220, .08); color: var(--text); font-size: .85rem; }
.fk-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.fk-steps li { display: flex; gap: 12px; align-items: flex-start; }
.fk-steps b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(127, 231, 220, .15); color: #7fe7dc; font-size: .85rem; }
.fk-steps span { padding-top: 2px; line-height: 1.55; }
.fk-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 12px; }
.fk-photo { position: relative; margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.fk-photo img { display: block; width: 100%; height: auto; }
.fk-photo figcaption { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(6, 21, 40, .78); color: #cfe3ef; font-size: .85rem; backdrop-filter: blur(6px); }
.fk-photo .dot { width: 8px; height: 8px; border-radius: 50%; background: #7fe7dc; box-shadow: 0 0 10px #7fe7dc; }

.fk-feats { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.fk-feats li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid #7bdc6b; }
.fk-feats span { font-size: .86rem; color: var(--sub); }
.fk-phone { display: flex; justify-content: center; }
.phone { position: relative; width: min(100%, 270px); aspect-ratio: 9 / 18.5; padding: 34px 14px 16px; border-radius: 38px; background: linear-gradient(160deg, #1d1d21, #0d0d0f); border: 8px solid #26262b; box-shadow: 0 30px 70px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .05); display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
.ph-notch { position: absolute; top: 10px; left: 50%; translate: -50% 0; width: 70px; height: 16px; border-radius: 999px; background: #000; }
.ph-top { display: flex; align-items: center; gap: 10px; }
.ph-top img { width: 40px; height: 40px; border-radius: 10px; }
.ph-top span { display: flex; flex-direction: column; line-height: 1.2; color: #f2f2f3; }
.ph-top small { color: #a0a0a8; font-size: .7rem; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph-grid span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; font-size: .72rem; font-weight: 700; color: #111; }
.ph-grid .t1 { background: #ff8a3d; } .ph-grid .t2 { background: #7bdc6b; } .ph-grid .t3 { background: #ffd166; }
.ph-grid .t4 { background: #7cb4ff; } .ph-grid .t5 { background: #f78fb3; } .ph-grid .t6 { background: #c3a6ff; }
.ph-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: #1b1b1e; border: 1px solid #2a2a2f; }
.ph-card i { display: block; height: 8px; border-radius: 4px; background: #34343a; }
.ph-card i.s { width: 60%; }
.ph-card:first-of-type i:first-child { background: #ff6a00; width: 40%; }

.play-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px 6px 12px; border-radius: 12px; background: #000; border: 1px solid #3a3a40; color: #fff; text-decoration: none; transition: border-color .15s; }
.play-btn:hover { border-color: var(--acc); color: #fff; }
.play-btn svg { width: 22px; height: 22px; fill: #7bdc6b; }
.play-btn span { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: 1.02rem; }
.play-btn small { font-weight: 400; font-size: .68rem; opacity: .8; }

.fk-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin: 22px 0 18px; }
.app-card { --tone: #ff6a00; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r); border: 1px solid var(--line);
  background: radial-gradient(420px 220px at 0% 0%, color-mix(in srgb, var(--tone) 20%, transparent), transparent 70%), var(--surface); }
.app-card.tone-sepia { --tone: #c9a879; } .app-card.tone-amber { --tone: #e8892f; } .app-card.tone-cyan { --tone: #2fc6ff; }
.app-card header { display: flex; align-items: center; gap: 14px; }
.app-card header img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.app-card h3 { margin: 0; font-size: 1.3rem; }
.app-card header p { margin: 0; color: var(--tone); font-weight: 600; font-size: .9rem; }
.app-line { margin: 0; font-weight: 600; font-size: 1.02rem; }
.app-card ul { margin: 0; padding-left: 1.1em; color: var(--sub); font-size: .9rem; line-height: 1.6; }
.app-price { margin: auto 0 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--raised); font-size: .86rem; }
.app-card footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.app-more { font-size: .9rem; color: var(--sub); }
.fk-more { color: var(--sub); max-width: 80ch; }
.fk-end { border-bottom: 0; }
.fk-end .shop-contact { max-width: 640px; }
