/* หน้าลูกค้า /my/ — ธีมเว็บ (navy #0A3F8F, brand #0F5FC8, sky #2F80ED) บนพื้นฟ้าอ่อนแบบกระจก ตามตัวอย่าง dashboard-v7 */
@font-face { font-family: "Anuphan"; src: url("../assets/fonts/Anuphan-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Anuphan"; src: url("../assets/fonts/Anuphan-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Anuphan"; src: url("../assets/fonts/Anuphan-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Anuphan"; src: url("../assets/fonts/Anuphan-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root { --navy: #0A3F8F; --blue: #0F5FC8; --sky: #2F80ED; --ink: #0E1B2E; --muted: #55657A; --line: #DCE6F2; --red: #A93226; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 400 16px/1.6 "Anuphan", sans-serif; color: var(--ink); min-height: 100vh;
  background: radial-gradient(900px 500px at 0% -10%, rgba(59,130,246,.30), transparent 60%), radial-gradient(800px 600px at 100% 10%, rgba(56,189,248,.22), transparent 60%), linear-gradient(180deg, #EAF2FF, #F4F8FF 60%, #E9F1FC); }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; padding: 8px 12px; background: #fff; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* แถบบน: กระจกฝ้าแบบแถบเมนูของเว็บหลัก (nav-glass.css) พร้อมโลโก้และชื่อเต็มของแบรนด์ */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid rgba(15,95,200,.08); box-shadow: 0 8px 24px -20px rgba(11,27,51,.4); }
.bar-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; min-width: 0; }
.brand img { width: auto; height: 40px; flex: none; }
.brand strong { display: block; font-size: 17px; line-height: 1.2; }
.brand .brand-th { font-weight: 600; }
.brand small { display: block; font-size: 12.5px; color: var(--muted); }
.bar-home { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border-radius: 999px; color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: none;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.5)); border: 1px solid rgba(15,95,200,.18); box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(15,95,200,.08); }
.bar-home:hover { border-color: var(--blue); }
.bar-home:focus-visible, .brand:focus-visible { outline: 3px solid rgba(47,128,237,.45); outline-offset: 2px; border-radius: 12px; }
@media (max-width: 480px) { .brand .brand-th { display: none; } }
/* หัวข้อแผง: ไอคอน 3D ชุดเดียวกับเครื่องมือบนเว็บหลัก (assets/icons3d) */
h2.sec { display: flex; align-items: center; gap: 10px; }
h2.sec img { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 4px 6px rgba(15,60,140,.18)); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; }
.foot { max-width: 1240px; margin: 0 auto; padding: 8px 16px 32px; font-size: 14px; color: var(--muted); }

.glass { background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(255,255,255,.78)); border: 1px solid #fff; border-radius: 20px; box-shadow: 0 18px 40px -24px rgba(15,60,140,.5); }
.panel { padding: 20px 24px; margin: 16px 0 0; }
h1, h2, h3, h4 { line-height: 1.3; }
h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--navy); }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.msg { margin: 10px 0 0; font-size: 14px; color: var(--red); min-height: 1em; }
.msg:empty { display: none; }
.fine { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.btn { border: 0; border-radius: 10px; padding: 10px 16px; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.main { background: linear-gradient(180deg, var(--sky), var(--blue)); color: #fff; }
.btn.ghost { background: #EEF4FF; color: var(--blue); }
.btn.danger { background: #FDF1EF; color: var(--red); }
.btn:disabled { cursor: default; background: #EEF1F5; color: var(--muted); }
.link { border: 0; background: none; padding: 10px 4px; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.field input { font: inherit; font-size: 16px; color: var(--ink); padding: 10px 12px; min-height: 44px; border: 2px solid #9FB3CE; border-radius: 12px; background: #fff; }
.field input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(47,128,237,.3); }

/* ---------- เข้าระบบ ---------- */
.login { max-width: 460px; margin: 24px auto; padding: 24px; }
.login h1 { margin: 0; font-size: 24px; color: var(--navy); }
.login form { margin-top: 16px; display: grid; gap: 14px; }
.login form > p { margin: 0; font-size: 14px; }
#registerOnly { display: grid; gap: 14px; }
#registerOnly[hidden] { display: none; }
#registerOnly .fine { margin: 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.consent input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--blue); }

/* ---------- แถวบน: โปรไฟล์ + ตัวเลขสรุป ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 20px 24px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(160deg, #3B7FD6, var(--blue)); display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700; position: relative; flex: none;
  box-shadow: 0 0 0 4px #fff, 0 10px 20px -10px rgba(15,60,140,.8); }
.avatar img { width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.avatar-edit { position: absolute; right: -4px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--blue); display: grid; place-items: center; font-size: 15px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.avatar-edit input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.avatar-edit:focus-within { outline: 3px solid var(--sky); outline-offset: 2px; }
.who { min-width: 0; flex: 1 1 260px; }
.who h1 { margin: 0; font-size: 26px; color: var(--ink); overflow-wrap: anywhere; }
.who p { margin: 2px 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; background: #FFF4DD; color: #7A4E00; font-size: 12.5px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.kpi { padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); min-width: 130px; }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); }
.kpi b { font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi b small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.row2 { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
.fam { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 14px; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.edit { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.emma { font-size: 12.5px; color: var(--muted); max-width: 330px; }
.top .msg { width: 100%; margin: 0; color: var(--muted); }

/* ---------- ชั้นกรมธรรม์ C4: ช่องกระจกชั้นละ 3 ช่อง ป้ายสถานะใต้ช่อง ---------- */
.shelfzone { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 24px; margin-top: 14px; align-items: start; }
.gx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; padding: 22px 16px; border-radius: 18px;
  background: radial-gradient(400px 260px at 0% 0%, rgba(59,130,246,.22), transparent 60%), linear-gradient(180deg, #EAF2FF, #F4F8FF); }
.gx .cell { position: relative; height: 176px; border-radius: 16px 16px 0 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.72), rgba(226,237,252,.42)); border: 1px solid rgba(255,255,255,.95); border-bottom: 0; box-shadow: inset 0 1px 0 #fff, inset 0 -10px 16px -12px rgba(15,60,140,.25); }
.gx .cell:before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 9px; width: 8px; border-radius: 6px; background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,0)); opacity: .8; }
.gx .cell:after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 8px; height: 6px; border-radius: 3px; background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(196,215,242,.8)); }
.gx .cell.empty { background: rgba(255,255,255,.3); border: 1.5px dashed #9CC3FF; border-bottom: 0; text-decoration: none; }
.gx .cell.empty:after { display: none; }
.gx .add { margin: auto; text-align: center; font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.45; }
.gx .add b { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%; background: #fff; color: var(--blue); font-size: 20px; box-shadow: 0 6px 12px -6px rgba(15,60,140,.6); }
.gx .plate { display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px; border-radius: 0 0 12px 12px; font-size: 12.5px; font-weight: 600; color: var(--navy);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(236,243,253,.88)); border: 1px solid rgba(255,255,255,.95); border-top: 1px solid #D5E3F7; box-shadow: 0 10px 18px -12px rgba(15,60,140,.45); }
.gx .plate i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.gx .plate i.w { background: #D97706; box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.gx .plate i.r { background: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.gx .plate i.off { background: #8A97A8; box-shadow: none; }
.gx .plate { white-space: nowrap; }
.gx .plate b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gx .plate span { flex: none; margin-left: auto; font-weight: 500; color: var(--muted); }

/* เล่มกรมธรรม์ตั้งตรง ปกสีตามประเภท ตัวหนังสือผ่าน 4.5:1 ทุกสี (อุบัติเหตุใช้ตัวหนังสือเข้มบนปกอำพัน) */
.gbook { position: relative; z-index: 1; width: 100px; height: 136px; border: 0; border-radius: 2px 8px 8px 2px; padding: 9px 8px 8px 13px; color: #fff; display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; cursor: pointer;
  box-shadow: inset 5px 0 0 rgba(0,0,0,.2), inset 6px 0 0 rgba(255,255,255,.22), inset 0 2px 0 rgba(255,255,255,.22), 0 10px 14px -10px rgba(10,40,100,.75); transition: transform .35s cubic-bezier(.3,1.4,.5,1), box-shadow .35s; }
.gbook:after { content: ""; position: absolute; left: 6px; right: 4px; top: -4px; height: 4px; border-radius: 2px 3px 0 0; background: repeating-linear-gradient(90deg, #fff 0 2px, #E4ECF7 2px 3px); }
.gbook:hover, .gbook.on { transform: translateY(-12px); box-shadow: inset 5px 0 0 rgba(0,0,0,.2), inset 6px 0 0 rgba(255,255,255,.22), inset 0 2px 0 rgba(255,255,255,.22), 0 22px 20px -14px rgba(10,40,100,.6); }
.gbook.on { outline: 2px solid #fff; outline-offset: -5px; }
.gbook:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.gbook small { font-size: 11px; font-weight: 600; }
.gbook strong { font-size: 12.5px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.gbook em { font-style: normal; font-size: 13px; font-weight: 700; margin-top: auto; font-variant-numeric: tabular-nums; }
/* ---------- ความคุ้มครองที่มีตอนนี้: แท่งเดียว ทุนประกันเรียงต่อกันตามหมวด ---------- */
.cov-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.cov-head p { margin: 0; color: var(--muted); font-size: 14px; }
.cov-head h2, .life-head h2 { font-size: 22px; }
.cov .fine { margin-top: 12px; }
#covGoal { margin-top: 14px; }
.cov-head p { margin-right: auto; }
.cov-sound { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; color: var(--navy); cursor: pointer; }
.cov-sound .mute { display: none; }
.cov-sound[aria-pressed="false"] { color: var(--muted); background: #F4F6F9; }
.cov-sound[aria-pressed="false"] .wave { display: none; }
.cov-sound[aria-pressed="false"] .mute { display: inline; }
.cov-sound:focus-visible, .jar-glass:focus-visible { outline: 3px solid rgba(47,128,237,.45); outline-offset: 3px; }
.jar-glass { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 16px; }
.jar-glass:hover svg { filter: brightness(1.04); }
/* โหลเหรียญทอง: หัวข้อใช้สีประจำเส้นในกราฟตลอดชีวิต (ผ่าน 4.5:1 บนพื้นขาว) ส่วนที่ยังขาดเน้นแดง */
.jars { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
/* ลำดับการอ่าน: หัวข้อพาดเต็มความกว้าง > โหลคู่ตัวเลข > ถาดรายชื่อเล่ม (ชิดล่างทุกการ์ด ให้สามใบเรียงตรงกัน) */
.jar { border-radius: 20px; border: 1px solid var(--line); padding: 18px 16px 16px; display: grid; grid-template-columns: 124px minmax(0, 1fr);
  grid-template-areas: "title title" "glass body" "tray tray"; grid-template-rows: auto 1fr auto; gap: 12px 16px; background: #FBFCFE; }
.jar.short { border-color: #EBC6C0; background: linear-gradient(180deg, #FFFFFF, #FFF8F7); }
.jar h3 { grid-area: title; margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--c); padding-bottom: 10px; border-bottom: 1px solid var(--line); position: relative; }
.jar h3 span { white-space: nowrap; }
.jar h3::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 48px; height: 4px; border-radius: 2px; background: var(--c); }
.jar-glass { grid-area: glass; align-self: start; }
.jar-glass svg { display: block; width: 124px; height: 300px; overflow: visible; }
.jar-body { grid-area: body; min-width: 0; padding-top: 6px; }
/* ขั้นตัวอักษรในการ์ด: หัวข้อ 21 > ส่วนที่ขาด 26 (ตัวเลขสำคัญที่สุด) > ที่มี 28 สีกรมท่า > ป้าย 13 สีเทา; ตัวเลขทุกตัวเป็น tabular */
.jar-have { font-size: 13px; font-weight: 600; color: var(--muted); }
.jar-have b { display: block; margin-top: 2px; font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jar-have b small { font-size: 14px; font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.jar-verdict { margin-top: 12px; padding: 10px 12px 11px; border-radius: 12px; font-weight: 700; font-size: 14px; line-height: 1.35; }
.jar-verdict.short { background: #FCEDEB; color: var(--red); box-shadow: inset 0 0 0 1px rgba(169,50,38,.12); }
.jar-verdict.short big { display: block; margin: 1px 0 3px; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jar-verdict.ok { background: #E7F5EC; color: #1E7A46; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(30,122,70,.12); }
.jar-verdict.none { background: #F2F5F9; color: var(--muted); }
.jar-verdict small { display: block; font-weight: 600; font-size: 13px; opacity: .92; font-variant-numeric: tabular-nums; }
.jar-verdict big small.u { display: inline; font-size: 14px; opacity: 1; letter-spacing: 0; }
.jar-how { margin: 10px 0 0; font-size: 13.5px; line-height: 1.5; }
/* ถาดยุบลง (เงาด้านใน) วางแถบรายชื่อเล่มที่ยกขึ้น: มิติจากแสงเดียวกับโหล ไม่ใช่การ์ดซ้อนการ์ด */
.jar-tray { grid-area: tray; border-radius: 14px; padding: 10px; background: #EEF3F9; box-shadow: inset 0 2px 5px rgba(10,42,85,.10), inset 0 -1px 0 rgba(255,255,255,.9); }
.jar.short .jar-tray { background: #F8EDEA; }
.jar-tray-title { margin: 0 2px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.jar-from { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jar-from li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 0 rgba(10,42,85,.06), 0 3px 8px -5px rgba(10,42,85,.35); font-size: 14px; }
.jar-from i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFF2C2, #E9B84A 55%, #A9741A); box-shadow: inset 0 0 0 1.5px rgba(178,122,28,.55); }
.jar-from .nm { min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; white-space: nowrap; }
.jar-from .nm b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.jar-from .nm small { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.jar-from em { font-style: normal; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.jar-more { margin-top: 6px; }
.jar-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--blue); }
.jar-more > summary::-webkit-details-marker { display: none; }
.jar-more > summary::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .25s; }
.jar-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.jar-more > summary:hover { background: rgba(255,255,255,.6); }
.jar-more > summary:focus-visible { outline: 3px solid rgba(47,128,237,.45); outline-offset: 2px; }
.jar-more[open] > summary { margin-bottom: 6px; }
/* เหรียญหล่นลงโหล: ตกแบบมีแรงโน้มถ่วง แล้วเด้งเล็กน้อย (ครั้งเดียวต่อการวาด) */
.jar .coin { animation: coin-drop .55s cubic-bezier(.55,0,1,.45) both, coin-settle .22s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d), calc(var(--d) + .55s); }
@keyframes coin-drop { from { transform: translateY(-260px); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(0); } }
@keyframes coin-settle { 50% { transform: translateY(-3px); } }
.jar .gapzone { animation: coin-fade .6s ease-out both; }
@keyframes coin-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .jar .coin, .jar .gapzone { animation: none !important; } }
@media (max-width: 380px) { .jar { grid-template-columns: 100px minmax(0, 1fr); } .jar-glass svg { width: 100px; height: 242px; } }
.jar-how { color: var(--muted); }

/* ---------- ความคุ้มครองตลอดชีวิต: เส้นขั้นบันไดตามอายุ 0-99, เส้นประ = เป้าหมาย ---------- */
.life-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.life-keys { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.life-keys .key { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.life-keys .key i { width: 18px; height: 4px; border-radius: 2px; }
.life-keys .key[aria-pressed="false"] { color: var(--muted); background: #F4F6F9; }
.life-keys .key[aria-pressed="false"] i { opacity: .3; }
.life-keys .key:focus-visible, .life-chart:focus-visible { outline: 3px solid rgba(47,128,237,.45); outline-offset: 2px; }
.life-chart { position: relative; width: 100%; touch-action: pan-y; padding: 6px 0 0; }
.life-chart .past { fill: #EEF3FA; }
.life-chart .tick.soft { fill: #8A99AD; }
.life-chart .area { stroke: none; }
.life-chart .stopdrop { stroke-width: 1.5; stroke-dasharray: 2 3; opacity: .7; }
.life-chart .mark { cursor: pointer; }
.life-chart .mark circle:last-child { transition: r .2s cubic-bezier(.2,.8,.2,1); }
.life-chart .mark:hover circle:last-child { r: 6.5; }
.life-chart svg.enter .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: life-draw 1.1s cubic-bezier(.16,1,.3,1) forwards; }
.life-chart svg.enter .area, .life-chart svg.enter .mark, .life-chart svg.enter .target { opacity: 0; animation: life-fade .6s ease-out .55s forwards; }
@keyframes life-draw { to { stroke-dashoffset: 0; } }
@keyframes life-fade { to { opacity: 1; } }
.life-chart svg.enter .target { animation-name: life-fade-target; }
@keyframes life-fade-target { to { opacity: .75; } }
.life-card { position: absolute; top: 14px; z-index: 2; width: 250px; max-width: calc(100% - 8px); padding: 10px 12px 11px; border-radius: 14px; pointer-events: none;
  /* การ์ดลอยเหนือกราฟชิ้นเดียวที่ยกเงา: พื้นทึบ ไม่เบลอซ้อนกระจกของแผงหลัก */
  background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 26px -12px rgba(10,42,85,.35); font-size: 13px; color: var(--ink); }
.life-card .lc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.life-card .lc-head b { color: var(--navy); font-size: 15px; }
.life-card .lc-head span { color: var(--muted); font-size: 12px; }
.life-card .lc-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; margin-top: 6px; }
.life-card .lc-row i { width: 14px; height: 3px; border-radius: 2px; }
.life-card .lc-row strong { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.life-card .lc-row span { color: var(--muted); font-size: 12px; text-align: right; }
.life-card p { margin: 1px 0 0 22px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.life-card .lc-gap { color: var(--red); font-weight: 600; }
.life-table { margin-top: 10px; font-size: 14px; }
.life-table summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.life-scroll { overflow-x: auto; }
.life-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.life-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.life-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid #EEF2F7; vertical-align: top; }
.life-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .life-chart svg.enter * { animation: none !important; opacity: 1; stroke-dashoffset: 0; } }
.life-chart svg { display: block; width: 100%; height: auto; font-family: "Anuphan", sans-serif; }
.life-chart .grid { stroke: #E6ECF4; }
.life-chart .axis { stroke: #B9C6D8; }
.life-chart .tick { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.life-chart .tick.strong { fill: var(--navy); font-weight: 700; }
.life-chart .today { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 3 4; }
.life-chart .cross { stroke: rgba(14,27,46,.35); stroke-width: 1; }
.life-chart .line { fill: none; stroke-width: 2.75; stroke-linejoin: round; }
.life-chart .target { stroke-width: 2; stroke-dasharray: 7 6; opacity: .75; }
.life-chart .stop { stroke-width: 2.5; }
.life-read { margin: 8px 0 0; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; min-height: 1.6em; }
#goalsDialog { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
#goalsDialog .actions { position: sticky; bottom: 0; background: #fff; padding: 12px 0 2px; }
#goalsDialog fieldset { border: 0; border-top: 1px solid var(--line); margin: 14px 0 0; padding: 12px 0 0; }
#goalsDialog legend { font-weight: 700; color: var(--navy); padding: 0 6px 0 0; }

.c-health { background: linear-gradient(165deg, #0F5FC8, #0A3F8F); }
.c-life { background: linear-gradient(165deg, #0B7F89, #065058); }
.c-accident { background: linear-gradient(165deg, #E3A12C, #C98512); color: #1A1206; }
.c-pension { background: linear-gradient(165deg, #3B52C4, #26318A); }
.c-ci { background: linear-gradient(165deg, #2B66BA, #1A4688); }
.c-savings { background: linear-gradient(165deg, #0E7C86, #065058); }
.c-unit { background: linear-gradient(165deg, #26318A, #1B2366); }

/* ---------- หนังสือที่เลือก: ปกจริงก่อน แล้วเปิดออก ด้านในปก = มูลค่าเวนคืน หน้าขวา = คุ้มครองอะไร ---------- */
.detail { padding: 18px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); min-width: 0; }
.spread { position: relative; width: min(100%, 400px); height: 320px; margin: 0 auto 16px; perspective: 1400px; }
.tome { position: absolute; left: 50%; top: 0; width: min(50%, 200px); height: 100%; transform-style: preserve-3d; }
.tome-page { position: absolute; inset: 0; padding: 18px 16px; border-radius: 3px 10px 10px 3px; background: linear-gradient(90deg, #EFE9DC, #FFFDF8 12%); box-shadow: 0 18px 30px -18px rgba(15,40,80,.6), inset -3px 0 0 #E6DECB; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tome-page b { font-size: 15px; color: var(--navy); }
.tome-page span { color: var(--muted); margin-top: 8px; }
.tome-page em { font-style: normal; font-size: 18px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tome-cover { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.3,.7,0,1); }
.tome-cover .face, .tome-cover .inside { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 3px 10px 10px 3px; backface-visibility: hidden; }
.tome-cover img.face { object-fit: cover; box-shadow: 0 18px 30px -16px rgba(15,40,80,.7), inset 6px 0 0 rgba(0,0,0,.15); }
.tome-cover .plain { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px 16px 18px 22px; box-shadow: 0 18px 30px -16px rgba(15,40,80,.7), inset 6px 0 0 rgba(0,0,0,.18); }
.tome-cover .plain small { font-size: 13px; font-weight: 600; }
.tome-cover .plain strong { font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.tome-cover .inside { transform: rotateY(180deg); border-radius: 10px 3px 3px 10px; padding: 12px 14px; background: linear-gradient(160deg, #0F5FC8, #0A3F8F); color: #fff; font-size: 13px; display: flex; flex-direction: column; }
.tome-cover .inside img.mini { display: block; width: 100%; height: 92px; flex: none; object-fit: cover; object-position: top; border-radius: 6px; margin-bottom: 6px; box-shadow: 0 4px 10px -4px rgba(0,0,0,.5); }
#cvList { display: flex; flex-direction: column; }
#cvList span { color: #DCE8FA; margin-top: 4px; }
#cvList em { font-style: normal; font-size: 18px; font-weight: 800; color: #FFE07A; font-variant-numeric: tabular-nums; }
.spread.open .tome-cover { transform: rotateY(-178deg); }

.detail h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.tag { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: #EEF4FF; color: var(--blue); font-size: 13px; font-weight: 600; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.facts div { padding: 8px 10px; border-radius: 10px; background: #F6F9FD; min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.detail .note { margin: 0 0 8px; font-size: 14px; white-space: pre-line; }
.detail h4 { margin: 14px 0 6px; font-size: 15px; }
.detail h4 + .fine { margin: 0; }
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; height: 150px; margin-top: 26px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.bars div { position: relative; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #9CC3FF, #5B9BEA); }
.bars div.hi { background: linear-gradient(180deg, var(--sky), var(--blue)); }
.bars div b { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.barx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 12.5px; color: var(--muted); text-align: center; padding: 4px 4px 0; }

.account { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.account .fine { margin: 0; flex: 1 1 260px; }
.pw { flex: 1 1 100%; }
.pw summary { cursor: pointer; color: var(--navy); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.pw form { display: grid; gap: 12px; max-width: 360px; margin-top: 8px; }

.privacy { max-width: 760px; margin: 16px auto 0; }
.privacy h1 { margin: 0; font-size: 24px; color: var(--navy); }
.privacy h2 { margin: 20px 0 6px; font-size: 18px; }
.privacy ul { margin: 0; padding-left: 22px; }

dialog { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 60px -20px rgba(15,60,140,.6); }
dialog::backdrop { background: rgba(10,30,70,.45); }
dialog form { padding: 22px 24px; }
dialog .emma { max-width: none; margin: 4px 0 14px; }
dialog .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog .wide { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) {
  .tome-cover, .gbook { transition: none; }
}
@media (max-width: 1000px) {
  .shelfzone { grid-template-columns: 1fr; }
  .kpis { margin-left: 0; }
}
@media (max-width: 560px) {
  .gx { grid-template-columns: repeat(2, 1fr); padding: 18px 12px; }
  .top, .panel { padding: 16px; }
  .top { flex-direction: column; align-items: flex-start; }
  .who { flex: none; width: 100%; } /* flex-basis 260px became a 260px-tall gap in the column layout */
  .gx .plate { gap: 5px; padding: 0 8px; font-size: 11.5px; }
  .gx .plate.long span { display: none; } /* "เลยกำหนด N วัน" needs the whole plate on a 2-up cell */
  .kpis, .edit { width: 100%; margin-left: 0; }
  .kpi { flex: 1 1 130px; }
  .edit { flex-direction: column; align-items: stretch; }
  .facts, dialog .grid { grid-template-columns: 1fr; }
}

/* ค่าห้องโรงพยาบาลเทียบกับเล่ม */
.room .btn { margin-top: 12px; }
#printBtn { margin: 10px 0 0; }
.room-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.field select { font: inherit; font-size: 16px; color: var(--ink); padding: 10px 12px; min-height: 44px; border: 2px solid #9FB3CE; border-radius: 12px; background: #fff; max-width: 100%; }
.field select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(47,128,237,.3); }
.room-list { display: grid; gap: 8px; margin-top: 14px; }
.room-list:empty { display: none; }
.room-row { display: grid; grid-template-columns: 1fr auto minmax(150px, auto); gap: 4px 16px; align-items: baseline; padding: 12px 14px; border: 1px solid #d5e0ef; border-radius: 12px; background: #fff; }
.room-row b { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.room-row span { font-variant-numeric: tabular-nums; }
.room-row em { font-style: normal; font-weight: 600; text-align: right; }
.room-row .ok { color: #0a6b3d; }
.room-row .short { color: #a3261c; }
.room-row .na { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) {
  .room-pick { grid-template-columns: 1fr; }
  .room-row { grid-template-columns: 1fr auto; }
  .room-row em { grid-column: 1 / -1; text-align: left; }
}

/* พิมพ์สรุปความคุ้มครอง: แสดงเฉพาะตารางสรุป */
.print-only { display: none; }
@media print {
  body { background: #fff !important; }
  .bar, .skip, #loading, #login, dialog, #wallet > :not(#printSheet) { display: none !important; }
  #printSheet { display: block; color: #000; font-size: 12pt; }
  #printSheet h1 { margin: 0 0 4pt; font-size: 18pt; }
  #printSheet table { width: 100%; border-collapse: collapse; margin: 10pt 0; }
  #printSheet th, #printSheet td { border: 1px solid #888; padding: 5pt 6pt; text-align: left; vertical-align: top; }
  #printSheet td:nth-child(4) { text-align: right; white-space: nowrap; }
  #printSheet small { font-weight: 400; }
  #printSheet tr { break-inside: avoid; }
  .ps-fine { font-size: 9.5pt; }
}

/* Premium layer (29 Nov 2569): same paper, flat blue, 8px controls and 12px cards as the main site (premium.css).
   The bookshelf, policy books and jars keep their drawn depth: they are pictures, not chrome. */
:root { --line: #DDE3EC; --line-strong: #C4CEDC; --elev-1: 0 1px 2px rgba(11,27,51,.06), 0 10px 24px -16px rgba(11,27,51,.18); --elev-2: 0 2px 4px rgba(11,27,51,.06), 0 20px 36px -20px rgba(11,27,51,.28); }
body { background: #F5F7FA; }
.bar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--line); box-shadow: none; }
.bar-home { background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: none; }
.glass { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--elev-1); }
.btn { border-radius: 8px; }
.btn.main:not(:disabled) { background: var(--blue); }
.btn.main:not(:disabled):hover { background: #0B4FAA; }
.btn.ghost:not(:disabled) { background: #fff; border: 1px solid var(--line-strong); }
.btn.ghost:not(:disabled):hover { border-color: var(--blue); background: #F5F7FA; }
.field input, .field select { border-radius: 8px; }
.field input:focus-visible, .field select:focus-visible { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: none; }
dialog { border-radius: 12px; box-shadow: var(--elev-2); }
h1, h2, h3 { text-wrap: balance; }
