/* =========================================================
   MTL Life — ตารางอ่านง่าย (มือถือ) · ตัวเช็คเบี้ย · หน้าเว็บกว้างเต็มจอ
   โหลดต่อจาก app.css
   ========================================================= */

/* ---------- หน้าเว็บกว้างเต็มจอขึ้น ---------- */
:root { --container: 1440px; }
.container { padding-left: clamp(16px, 3vw, 40px); padding-right: clamp(16px, 3vw, 40px); }
@media (min-width: 1700px) { :root { --container: 1640px; } body { font-size: 17px; } }
.hero { min-height: min(86vh, 820px); display: flex; align-items: center; padding: clamp(36px, 5vw, 80px) 0; }
.hero > .container { width: 100%; }
.hero__grid { grid-template-columns: 1.25fr .75fr; gap: clamp(28px, 5vw, 96px); }
.hero h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 4.2rem); line-height: 1.22; }
.hero__lead { font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); max-width: 680px; }
.quick-calc { padding: clamp(24px, 2.4vw, 40px); }
.section { padding: clamp(56px, 6vw, 112px) 0; }
.section--tight { padding: clamp(28px, 4vw, 48px) 0 clamp(48px, 6vw, 80px); }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: clamp(16px, 1.6vw, 28px); }
.product-grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.goal-grid { gap: clamp(14px, 1.6vw, 26px); }
@media (min-width: 1280px) { .steps { gap: 28px; } }
.section-head h2 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.5rem); }
.product-body { grid-template-columns: 210px minmax(0, 1fr) 320px; gap: clamp(24px, 2.6vw, 48px); }
@media (max-width: 1180px) { .product-body { grid-template-columns: minmax(0, 1fr) 280px; } .hero__grid { grid-template-columns: 1fr; } }
@media (max-width: 960px) { .hero { min-height: 0; } .product-body { grid-template-columns: 1fr; } }

/* ---------- ตารางในเนื้อหา ---------- */
.prose table { min-width: 0; }
.prose td, .prose th { overflow-wrap: anywhere; }
.table-scroll[data-mode="matrix"] table { min-width: max-content; font-size: .86rem; }
.table-scroll[data-mode="matrix"] tr > :first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line); }
.table-scroll[data-mode="matrix"] thead tr > :first-child, .table-scroll[data-mode="matrix"] tr:first-child > :first-child { background: #f7f2f6; }
.prose .ptable__title { font-size: 1.05rem; margin: 1.2em 0 .6em; }
.ptable__note { font-size: .86rem; color: var(--muted); margin-top: -.4em; }
.ptables { margin-top: 18px; }
.more { margin-top: 16px; border: 1px dashed var(--line); border-radius: 12px; padding: 0 16px; }
.more > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--ink); }
.more[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }

/* การ์ด (แทนตารางบนมือถือ) */
.tcards { display: none; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tcard__label { font-weight: 600; color: var(--ink); line-height: 1.55; }
.tcard__value { display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; line-height: 1.5; }
.tcard__vals { margin: 8px 0 0; display: grid; }
.tcard__vals > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); }
.tcard__vals dt { color: var(--muted); font-size: .88rem; }
.tcard__vals dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
.tcards__section { margin-top: 10px; padding: 9px 14px; border-radius: 10px; background: var(--ink); color: #fff; font: 600 .95rem/1.5 var(--font-head); }
.tcards__group { margin-top: 8px; padding: 6px 12px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: .92rem; }

/* ---------- ตัวเช็คเบี้ยในหน้าแบบประกัน ---------- */
.rx { background: linear-gradient(135deg, #fff5fa, #f3f6ff); border: 1px solid var(--brand-100); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.rx-base { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: #6d3800; font-size: .92rem; }
.rx-base .icon { margin-top: 3px; }
.rx-controls { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; }
.rx-seg { display: flex; gap: 4px; padding: 4px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; }
.rx-seg button { min-height: 42px; padding: 0 26px; border: 0; border-radius: 8px; background: transparent; font: 600 1rem var(--font-head); color: var(--muted); cursor: pointer; }
.rx-seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.rx-field label { display: block; margin-bottom: 4px; font-weight: 600; font-size: .88rem; color: var(--ink); }
.rx-field small { font-weight: 400; color: var(--muted); }
.rx-stepper { display: flex; overflow: hidden; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; }
.rx-stepper button { width: 46px; border: 0; background: var(--bg-soft); font-size: 1.4rem; line-height: 1; color: var(--ink); cursor: pointer; }
.rx-stepper button:hover { background: var(--brand-50); color: var(--brand); }
.rx-stepper input { width: 72px; min-height: 44px; border: 0; text-align: center; font: 600 1.15rem var(--font); color: var(--ink); -moz-appearance: textfield; }
.rx-stepper input::-webkit-outer-spin-button, .rx-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rx-field--sum { flex: 1 1 220px; }
.rx-field--sum input { width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; font: 600 1.1rem var(--font); color: var(--ink); background: #fff; }
.rx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rx-chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font: 500 .82rem var(--font); cursor: pointer; }
.rx-chips button:hover { border-color: var(--brand); color: var(--brand); }
.rx-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.rx-mode { padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.rx-mode span { display: block; font-size: .82rem; color: var(--muted); }
.rx-mode strong { display: block; font: 700 1.5rem/1.25 var(--font-head); color: var(--ink); }
.rx-mode small { color: var(--muted); font-size: .74rem; }
.rx-none, .rx-warn { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px dashed var(--warn-line); color: #6d3800; }
.rx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rx-full { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.rx-full > summary { padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--ink); }
.rx-full > summary small { font-weight: 400; color: var(--muted); }
.rx-scroll { max-height: 380px; overflow: auto; border-top: 1px solid var(--line); position: relative; -webkit-overflow-scrolling: touch; }
.rx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; font-variant-numeric: tabular-nums; }
.rx-table th, .rx-table td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.rx-table thead th { position: sticky; top: 0; z-index: 2; background: #f4f1f5; font: 600 .8rem var(--font-head); color: var(--ink); }
.rx-table thead tr:nth-child(2) th { top: 35px; }
.rx-table .rx-age { position: sticky; left: 0; z-index: 1; text-align: left; background: #fff; font-weight: 600; color: var(--ink); }
.rx-table thead .rx-age { z-index: 3; background: #f4f1f5; }
.rx-table .rx-grp { color: #fff; text-align: center; }
.rx-grp--male { background: #2f6fd0 !important; }
.rx-grp--female { background: #d6407f !important; }
.rx-table[data-view="male"] [data-gender="female"], .rx-table[data-view="female"] [data-gender="male"] { display: none; }
.rx-table tbody tr { cursor: pointer; }
.rx-table tbody tr:hover td, .rx-table tbody tr:hover th { background: #faf6fa; }
.rx-table tr.is-hit td, .rx-table tr.is-hit th { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.rx-note { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: .82rem; color: var(--muted); }
.rx-note .icon { margin-top: 3px; }

/* ---------- มือถือ: ให้เนื้อหากว้างขึ้น อ่านง่ายขึ้น ---------- */
@media (max-width: 760px) {
  .table-scroll[data-mode="cards"] { display: none; }
  .tcards { display: grid; gap: 8px; margin: 0 0 1.2em; }
  .section--tight > .container.product-body { padding-left: 10px; padding-right: 10px; }
  .collapsible > .prose, .collapsible > .rate-hint, .collapsible > .rx, .collapsible > .ptables, .collapsible > .more { margin-left: 12px; margin-right: 12px; }
  .collapsible > summary { padding: 14px; }
  .content-block--highlight { padding: 18px 14px; }
  .rx { padding: 14px 12px; }
  .rx-seg { width: 100%; }
  .rx-seg button { flex: 1; }
  .rx-field { flex: 1 1 100%; }
  .rx-stepper { width: 100%; }
  .rx-stepper input { flex: 1; width: auto; }
  .rx-out { grid-template-columns: 1fr 1fr; }
  .rx-mode strong { font-size: 1.3rem; }
  .rx-actions .btn { flex: 1 1 100%; }
  .rx-scroll { max-height: 340px; }
  .rx-table th, .rx-table td { padding: 9px 8px; }
  .prose table { font-size: .86rem; }
  .prose th, .prose td { padding: 8px 9px; }
  .more { padding: 0 12px; }
}

.tcards__section.is-long { background: #eef1f8; color: var(--ink); font-weight: 600; font-size: .94rem; border-left: 4px solid var(--brand); }
.rx-mode small { display: block; }
.rx-mode .rx-rate { margin-top: 2px; }

/* ช่องดูเบี้ยตามอายุ (ตารางตัวเลขกว้าง) */
.tfind { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.tfind__label { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.tfind__label input { width: 96px; min-height: 42px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; font: 600 1.05rem var(--font); text-align: center; background: #fff; }
.tfind__label input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 0, 106, .12); }
.tfind__out { display: grid; gap: 8px; margin-top: 10px; }
.tfind__out:empty { display: none; }
.tfind__none { margin: 0; color: #6d3800; font-size: .92rem; }
.tcard--find { border-color: var(--brand-100); }
@media (min-width: 761px) { .tfind__out { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }

.tcard__text { margin-top: 6px; color: var(--ink-2); line-height: 1.65; }

.rx-disc { grid-column: 1 / -1; margin: 0; padding: 8px 12px; border-radius: 10px; background: #e9f8f0; color: #075e40; font-size: .88rem; }
