:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

  /* Layout: คอลัมน์เดียวบนมือถือ (สูงสุด 44rem) ลำดับ: ฟอร์ม -> สี่เสา -> ธาตุ -> ธาตุที่ควรเสริม -> ดาวเหิน
     Type: Prompt (หัวข้อ) / Sarabun (เนื้อความ) / Noto Serif TC (ตัวอักษรจีนบนผัง)
     Color: เขียวหมึก-เทาเย็น + เขียวหยกเป็นสีหลัก; สีห้าธาตุใช้เฉพาะการเข้ารหัสธาตุ */
  :root {
    --bg: #FBF6EE;
    --surface: #FFFFFF;
    --ink: #2B1513;
    --ink-2: #6E514B;
    --line: #EBD8BF;
    --accent: #A8161D;
    --accent-ink: #FFFFFF;
    --accent-soft: #FCE7E2;
    --gold: #B8860B;
    --gold-soft: #FFF2CC;
    --warn-bg: #FFF2CC;
    --warn-ink: #6B4A00;
    --warn-line: #E2C063;
    --err: #8E1B14;
    --wood: #2C7A4C;
    --fire: #C2410C;
    --earth: #94650F;
    --metal: #5A666E;
    --water: #2A62AE;
    --hero-1: #5E0A0F; --hero-2: #A8161D; --hero-ink: #FFF7E8; --hero-ink-2: #F3D3A6; --hero-line: #C8494E; --hero-accent: #F5C542;
    --f-display: 'Prompt', 'Sarabun', system-ui, sans-serif;
    --f-body: 'Sarabun', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --f-zh: 'Noto Serif TC', 'Songti TC', 'PMingLiU', 'Noto Serif CJK TC', serif;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #170D0C; --surface: #241513; --ink: #F7EADF; --ink-2: #CFAE9F; --line: #4A2B26;
      --accent: #FF8577; --accent-ink: #2A0A08; --accent-soft: #3B1A17; --gold: #F2C14E; --gold-soft: #3A2C12;
      --warn-bg: #3A2C12; --warn-ink: #F5D88E; --warn-line: #7D6228; --err: #FF9C90;
      --wood: #6FCF97; --fire: #FF9466; --earth: #DDA949; --metal: #B6C1C8; --water: #72AAF2;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #170D0C; --surface: #241513; --ink: #F7EADF; --ink-2: #CFAE9F; --line: #4A2B26;
    --accent: #FF8577; --accent-ink: #2A0A08; --accent-soft: #3B1A17; --gold: #F2C14E; --gold-soft: #3A2C12;
    --warn-bg: #3A2C12; --warn-ink: #F5D88E; --warn-line: #7D6228; --err: #FF9C90;
    --wood: #6FCF97; --fire: #FF9466; --earth: #DDA949; --metal: #B6C1C8; --water: #72AAF2;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  .sec-head h2::after { content: ''; display: block; width: 36px; height: 3px; border-radius: 2px; background: var(--gold); margin-top: 6px; }
  .hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hero-accent) 35%, transparent); }
  [hidden] { display: none !important; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.6;
    padding-block: 20px 40px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  main { max-width: 44rem; margin-inline: auto; display: flex; flex-direction: column; gap: 28px; }
  h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.3; margin: 0; text-wrap: balance; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.02rem; }
  p { margin: 0; }
  [data-el] { --c: var(--ink); }
  [data-el="木"] { --c: var(--wood); }
  [data-el="火"] { --c: var(--fire); }
  [data-el="土"] { --c: var(--earth); }
  [data-el="金"] { --c: var(--metal); }
  [data-el="水"] { --c: var(--water); }
  .zh { font-family: var(--f-zh); }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

  /* หัวหน้า */
  .masthead { display: flex; flex-direction: column; gap: 4px; }
  .masthead .name { font-family: var(--f-display); font-weight: 600; font-size: 1.7rem; letter-spacing: .01em; }
  .masthead .sub { color: var(--ink-2); }
  .tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 1px 9px; margin-left: 8px; vertical-align: middle; }

  /* ฟอร์ม */
  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
  .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 14px; }
  .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  label, .label { font-size: .9rem; font-weight: 600; }
  input, select, button { font: inherit; color: inherit; }
  input[type="date"], input[type="time"], input[type="number"], select {
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 44px; width: 100%; min-width: 0;
  }
  input:disabled, select:disabled { opacity: .5; }
  .check { display: flex; align-items: center; gap: 9px; font-weight: 500; min-height: 44px; }
  .check input { width: 20px; height: 20px; accent-color: var(--accent); }
  details > summary { cursor: pointer; font-weight: 600; font-size: .92rem; min-height: 32px; }
  details[open] > summary { margin-bottom: 12px; }
  .hint { font-size: .85rem; color: var(--ink-2); }
  .primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; min-height: 48px; padding: 0 22px; font-family: var(--f-display); font-weight: 600; font-size: 1rem; cursor: pointer; align-self: flex-start; }
  .primary:hover { filter: brightness(1.08); }
  .error { color: var(--err); font-weight: 600; }
  [data-off="true"] { opacity: .5; }
  .privacy { font-size: .85rem; color: var(--ink-2); }

  .example { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: .92rem; }
  .warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: .94rem; }

  #results { display: flex; flex-direction: column; gap: 28px; }
  .yong { display: flex; flex-direction: column; gap: 14px; }
  section { display: flex; flex-direction: column; gap: 14px; }
  .sec-head { display: flex; flex-direction: column; gap: 2px; padding-top: 16px; border-top: 1px solid var(--line); }
  .sec-head p { color: var(--ink-2); font-size: .9rem; }
  .lead { color: var(--ink-2); }
  .fine { font-size: .84rem; color: var(--ink-2); }

  /* ผังสี่เสา: ตารางเดียว 4 คอลัมน์ ยาม-วัน-เดือน-ปี */
  .chart-head { display: flex; flex-direction: column; gap: 2px; }
  .head-dm { display: flex; align-items: baseline; gap: 10px; }
  .head-glyph { font-size: 2.2rem; font-weight: 600; line-height: 1.1; }
  .head-name { font-family: var(--f-display); font-weight: 500; font-size: 1.1rem; }
  .head-name strong { color: var(--c); font-weight: 600; }
  .head-meta { color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .col { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); }
  .col:first-child { border-left: 0; }
  .col.is-day { background: var(--accent-soft); }
  .col-head { text-align: center; padding: 8px 2px; font-weight: 600; font-size: .88rem; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border-bottom: 1px solid var(--line); }
  .col-head .zh { font-size: 1rem; }
  .col-empty { padding: 28px 6px; text-align: center; font-size: .8rem; color: var(--ink-2); }
  .cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 3px 10px; border-bottom: 1px solid var(--line); text-align: center; }
  .god-wrap, .self-pill { min-height: 1.5rem; display: flex; align-items: center; }
  .god { font-size: .72rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
  .self-pill { font-size: .72rem; font-weight: 600; background: var(--bg); border-radius: 99px; padding: 0 9px; white-space: nowrap; }
  .big { font-size: 2.5rem; font-weight: 600; line-height: 1.12; }
  .th { font-size: .8rem; line-height: 1.25; }
  .th-2 { color: var(--ink-2); font-size: .74rem; }
  .chip { display: inline-block; margin-top: 4px; font-size: .74rem; font-weight: 600; border-radius: 99px; padding: 1px 8px; white-space: nowrap; background: color-mix(in srgb, var(--c) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); }
  .chip-zh { color: var(--c); }
  .hidden-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 6px 12px; }
  .hs-item { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 0; }
  .hs-g { font-size: 1.5rem; font-weight: 600; line-height: 1; }
  .hs-th, .hs-el, .hs-god { font-size: .68rem; line-height: 1.25; }
  .hs-el { color: var(--c); font-weight: 600; }
  .hs-god { color: var(--ink-2); white-space: normal; overflow-wrap: break-word; }
  .hs-item.is-main .hs-g { font-size: 1.85rem; }
  .legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 4px 12px; font-size: .88rem; }
  .legend-grid b { font-variant-numeric: tabular-nums; }
  @media (min-width: 560px) {
    .hidden-row { flex-direction: row; justify-content: center; align-items: flex-start; gap: 6px; }
    .hs-item { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 0; }
    .hs-g { grid-row: auto; }
    .big { font-size: 3.1rem; }
  }

  .dm-row, .yong-main { display: flex; gap: 14px; align-items: center; }
  .dm-glyph { font-size: 3.4rem; line-height: 1; font-weight: 600; color: var(--c); min-width: 4.2rem; text-align: center; }
  .dm-title strong { color: var(--c); margin-left: 4px; }
  .dm-meaning { color: var(--ink-2); }
  .also { font-size: .94rem; }
  .also-item { color: var(--c); font-weight: 600; }

  /* สมดุลธาตุ */
  .bars { display: flex; flex-direction: column; gap: 8px; }
  .bar-row { display: grid; grid-template-columns: 6.4rem minmax(0, 1fr) 2.6rem 2.8rem; gap: 8px; align-items: center; font-size: .92rem; }
  .bar-name { font-weight: 600; color: var(--c); white-space: nowrap; }
  .bar-name em { font-style: normal; font-size: .72rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 99px; padding: 0 6px; margin-left: 2px; }
  .bar-track { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; display: block; }
  .bar-fill { display: block; height: 100%; width: var(--w, 0%); background: var(--c); border-radius: 99px; }
  .bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
  .bar-count { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: .82rem; }

  .meter { display: flex; flex-direction: column; gap: 6px; }
  .meter-track { position: relative; display: grid; grid-template-columns: 41.25% 21.25% 37.5%; height: 14px; border-radius: 99px; overflow: hidden; }
  .meter-track span:nth-child(1) { background: var(--water); opacity: .5; }
  .meter-track span:nth-child(2) { background: var(--accent); opacity: .55; }
  .meter-track span:nth-child(3) { background: var(--fire); opacity: .5; }
  .meter-wrap { position: relative; }
  .meter-marker { position: absolute; top: -4px; left: var(--pos, 0%); width: 4px; height: 22px; margin-left: -2px; background: var(--ink); border-radius: 2px; }
  .meter-labels { display: grid; grid-template-columns: 41.25% 21.25% 37.5%; font-size: .78rem; color: var(--ink-2); }
  .meter-labels span:nth-child(2) { text-align: center; }
  .meter-labels span:nth-child(3) { text-align: right; }

  .recs { display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); gap: 8px 14px; margin: 0; }
  .recs dt { font-weight: 600; color: var(--ink-2); font-size: .92rem; }
  .recs dd { margin: 0; }
  .calc dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; font-size: .9rem; }
  .calc dt { color: var(--ink-2); margin-top: 8px; }
  .calc dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }


  /* ฮีโร่ พลังงานวันนี้ */
  .hero { background: linear-gradient(150deg, var(--hero-1), var(--hero-2)); color: var(--hero-ink); border-radius: 18px; padding: 22px 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
  .hero-kicker { font-size: .78rem; letter-spacing: .18em; color: var(--hero-ink-2); font-weight: 600; }
  .hero-time { font-variant-numeric: tabular-nums; font-size: 1.02rem; }
  .hero-pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 26rem; gap: 6px; }
  .hp { display: flex; flex-direction: column; align-items: center; gap: 0; border-top: 1px solid var(--hero-line); padding-top: 8px; }
  .hp-label { font-size: .76rem; color: var(--hero-ink-2); font-weight: 600; margin-bottom: 4px; }
  .hp-zh { font-size: 2.7rem; line-height: 1.15; font-weight: 600; }
  .hp-th { font-size: .74rem; color: var(--hero-ink-2); margin-top: 4px; line-height: 1.3; }
  .hero-note { font-size: .84rem; color: var(--hero-ink-2); max-width: 30rem; }
  .hero .hp-zh.is-day { color: var(--hero-accent); }

  /* ฟอร์มใหม่ */
  .panel h2 { margin-bottom: -4px; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .seg button { min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
  .seg button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); border-width: 2px; color: var(--accent); }
  .date-row { display: grid; grid-template-columns: .8fr 1.4fr 1.3fr; gap: 10px; }
  input[type="text"], textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 44px; width: 100%; min-width: 0; font: inherit; color: inherit; }
  textarea { min-height: 7rem; font-size: .84rem; font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
  .btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 10px; min-height: 48px; padding: 0 18px; font-family: var(--f-display); font-weight: 600; cursor: pointer; }
  .secondary.small { min-height: 40px; padding: 0 14px; font-size: .9rem; }
  .secondary.danger { color: var(--err); border-color: var(--err); }
  .savebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .sum-savebar { margin: 4px 0 14px; }
  .head-person { font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; }

  /* ดวงที่บันทึกไว้ */
  .saved-list { display: flex; flex-direction: column; gap: 10px; }
  .saved-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
  .saved-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .saved-name { font-family: var(--f-display); font-weight: 600; overflow-wrap: anywhere; }
  .saved-meta { font-size: .86rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .saved-pillars { font-size: 1.15rem; letter-spacing: .12em; }
  .saved-actions { display: flex; gap: 8px; flex-wrap: wrap; }


  /* เมนูหน้า */
  .nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px; margin-inline: -2px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); scrollbar-width: thin; }
  .nav button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem; white-space: nowrap; }
  .nav button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .person-strip { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; font-size: .9rem; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
  .person-strip b { font-family: var(--f-display); }
  .person-strip .zh { letter-spacing: .1em; }
  .page { display: flex; flex-direction: column; gap: 28px; }
  .needs-chart { display: flex; flex-direction: column; gap: 28px; }
  #app[data-chart="no"] .needs-chart { display: none; }
  #app[data-chart="yes"] .empty { display: none; }
  .empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

  /* สรุป */
  .sum-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
  .sum-top { display: flex; gap: 14px; align-items: center; }
  .sum-glyph { font-size: 3.6rem; line-height: 1; font-weight: 600; color: var(--c); min-width: 4.2rem; text-align: center; }
  .sum-name { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; }
  .pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: 1px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
  .kua { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
  .kua-num { font-family: var(--f-display); font-size: 3rem; font-weight: 600; line-height: 1; min-width: 2.6rem; text-align: center; }
  .kua-tri { font-size: 2.2rem; line-height: 1; }
  .mansions { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 8px; margin-top: 10px; }
  .mansion { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); display: flex; flex-direction: column; }
  .mansion[data-good="true"] { border-color: var(--accent); }
  .mansion b { font-size: .95rem; }
  .mansion .m-dir { font-weight: 600; color: var(--accent); }
  .mansion[data-good="false"] .m-dir { color: var(--warn-ink); }
  .mansion .fine { font-size: .78rem; }
  .fav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 0; border-top: 1px solid var(--line); }
  .fav-row:first-child { border-top: 0; }
  .fav-label { font-weight: 600; min-width: 7.5rem; }
  .el-chip { display: inline-block; font-weight: 600; border-radius: 99px; padding: 1px 12px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); color: var(--c); }
  .links { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 8px; }
  .link-card { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
  .link-card b { font-family: var(--f-display); }
  .link-card span { font-size: .82rem; color: var(--ink-2); }

  /* ผังดวง: ระยะ 十二長生 */
  .phase-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; text-align: center; padding: 8px 4px 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); border-top: 1px solid var(--line); font-size: .74rem; }
  .ph-label { color: var(--ink-2); margin-top: 4px; }
  .ph-label:first-child { margin-top: 0; }
  .ph-val { font-weight: 600; }
  .void-badge { font-size: .7rem; font-weight: 700; border: 1px solid var(--ink-2); color: var(--ink-2); border-radius: 99px; padding: 0 6px; margin-top: 2px; }

  /* สัดส่วน */
  .radar { display: flex; justify-content: center; }
  .radar-svg { width: 100%; max-width: 22rem; height: auto; }
  .rd-ring { fill: none; stroke: var(--line); stroke-width: 1; }
  .rd-axis { stroke: var(--line); stroke-width: 1; }
  .rd-area { fill: color-mix(in srgb, var(--accent) 28%, transparent); stroke: var(--accent); stroke-width: 2; }
  .rd-dot { fill: var(--accent); }
  .rd-label { fill: var(--ink); font-size: 12px; font-family: var(--f-body); }
  .rd-pct { fill: var(--accent); font-size: 12px; font-weight: 700; font-family: var(--f-body); }
  .struct-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 6px 12px; font-size: .9rem; }
  .struct-list b { font-variant-numeric: tabular-nums; }
  .tg-bars .bar-row { grid-template-columns: 7.8rem minmax(0, 1fr) 3.4rem; }
  .tg-bars .bar-fill { background: var(--ink-2); opacity: .55; }
  .tg-bars .bar-row[data-fav="true"] .bar-fill { background: var(--accent); opacity: 1; }
  .tg-bars .bar-name { color: var(--ink-2); font-weight: 500; font-size: .86rem; }
  .tg-bars .bar-row[data-fav="true"] .bar-name { color: var(--accent); font-weight: 600; }

  /* ดาว */
  .stars-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  @media (min-width: 600px) { .stars-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .star-col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
  .star-col-head { padding: 8px 10px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
  .star-col-head .zh { font-size: 1.25rem; letter-spacing: .08em; }
  .star-list { list-style: none; margin: 0; padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
  .star-item { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
  .star-item .zh { font-weight: 600; }
  .ref { font-size: .72rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; white-space: nowrap; }
  .star-none { padding: 10px; color: var(--ink-2); font-size: .85rem; }
  .stars-legend { display: flex; flex-direction: column; gap: 10px; }
  .legend-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
  .legend-card h3 .zh { margin-right: 6px; }
  .src { font-size: .72rem; color: var(--ink-2); }

  /* ปฏิกิริยา */
  .inter-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 10px; }
  .inter-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
  .inter-card[data-found="false"] { opacity: .6; }
  .inter-card[data-tone="good"][data-found="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .inter-card[data-tone="care"][data-found="true"] { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
  .inter-card h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
  .inter-card h3 .zh { font-weight: 500; }
  .inter-mark { font-weight: 700; }
  .pairs { display: flex; flex-wrap: wrap; gap: 6px; }
  .pair { font-size: .85rem; border: 1px solid currentColor; border-radius: 99px; padding: 0 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }

  /* วัยจร */
  .luck-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .luck-card { flex: 0 0 5.6rem; scroll-snap-align: start; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0; }
  .luck-card[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
  .luck-card[data-current="true"] .lk-age::after { content: " ★"; color: var(--accent); }
  .lk-age { font-size: .78rem; font-weight: 600; }
  .lk-yr { font-size: .7rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .lk-zh { font-size: 1.9rem; line-height: 1.12; font-weight: 600; }
  .lk-tg { font-size: .7rem; color: var(--ink-2); font-weight: 600; }
  .luck-years { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 8px; }
  .yr-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .yr-cell[data-current="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
  .yr-year { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
  .yr-age { font-size: .72rem; color: var(--ink-2); }
  .yr-zh { font-size: 2rem; line-height: 1.15; font-weight: 600; }
  .yr-tg { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
  .yr-phase { font-size: .7rem; color: var(--ink-2); }


  /* เมนูย่อยปาจื้อ */
  [data-tabhide="true"] { display: none !important; }
  .subnav { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin-top: -18px; scrollbar-width: thin; }
  .subnav button { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: .88rem; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
  .qm-tabs { margin-top: 0; margin-bottom: 4px; }
  .qm-layer-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .qm-layer-nav button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
  .qm-layer-pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
  .subnav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

  /* ความแข็ง 4 ระดับ */
  .lvl-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: relative; padding-top: 18px; }
  .lvl { text-align: center; font-size: .82rem; font-weight: 600; padding: 8px 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
  .lvl[data-on="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .lvl-marker { position: absolute; top: 0; left: var(--pos, 0%); transform: translateX(-50%); font-size: .8rem; color: var(--accent); font-weight: 700; }
  .factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 8px; }
  .factor { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
  .factor[data-ok="true"] { border-color: var(--accent); }
  .factor b { font-family: var(--f-display); }

  /* เจ้าวัน */
  .dm-hero { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
  .dm-icon { width: 104px; height: 104px; flex: 0 0 auto; color: var(--c); }
  .dm-icon svg { width: 100%; height: 100%; }
  .kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .kw span { font-size: .82rem; border-radius: 99px; padding: 1px 10px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); font-weight: 600; }
  .dm-grid { display: flex; flex-direction: column; gap: 10px; }

  /* โครงสร้าง / ธาตุประโยชน์ */
  .st-type { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; }
  .steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 6px; }

  /* แดชบอร์ด */
  .mx-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 8px; }
  .mx-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
  .mx-tile span { font-size: .78rem; color: var(--ink-2); }
  .mx-tile b { font-family: var(--f-display); font-size: 1.05rem; }
  .arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 8px; }
  .arch { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
  .arch[data-rank="1"] { border-color: var(--accent); background: var(--accent-soft); }
  .arch .pct { font-family: var(--f-display); font-weight: 600; color: var(--accent); }

  /* เสาจร */
  .transit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tr-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; }
  .tr-label { font-size: .76rem; color: var(--ink-2); font-weight: 600; }
  .tr-zh { font-size: 1.8rem; line-height: 1.15; font-weight: 600; }
  .tr-tg { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
  .tr-rel { font-size: .7rem; margin-top: 4px; line-height: 1.3; }
  .tr-rel[data-tone="good"] { color: var(--accent); }
  .tr-rel[data-tone="care"] { color: var(--warn-ink); }

  /* ปฏิทินมงคล */
  .cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .cal-bar > button:not(.secondary) { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.3rem; }
  .cal-bar output { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; min-width: 9rem; text-align: center; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .cal-wd { text-align: center; font-size: .74rem; color: var(--ink-2); font-weight: 600; padding: 4px 0; }
  .cal-cell { position: relative; min-height: 5rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px 1px; gap: 0; line-height: 1.2; }
  .cal-cell[data-level="good"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
  .cal-cell[data-level="low"] { background: color-mix(in srgb, var(--ink-2) 14%, var(--surface)); }
  .cal-cell[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
  .cal-cell[data-today="true"] .cal-d { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; }
  .cal-d { font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }
  .cal-l { font-size: .62rem; color: var(--ink-2); }
  .cal-gz { font-size: .74rem; }
  .cal-gz-th { font-size: .52rem; white-space: nowrap; letter-spacing: -.02em; color: var(--ink-2); line-height: 1.15; }
  .hr-gz small { font-size: .7rem; font-weight: 400; }
  .belt-dot { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--ink-2); opacity: .45; }
  .belt-dot[data-belt="yellow"] { background: var(--earth); opacity: 1; }
  .cal-cell .belt-dot { position: absolute; top: 4px; right: 4px; }
  .cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--ink-2); align-items: center; }
  .cal-legend span { display: inline-flex; gap: 5px; align-items: center; }
  .lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); }
  .lg-good { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
  .lg-low { background: color-mix(in srgb, var(--ink-2) 14%, var(--surface)); }
  .ts-head { display: flex; flex-direction: column; gap: 4px; }
  .ts-date { font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; }
  .ts-pillars { font-size: 1.15rem; letter-spacing: .06em; }
  .ts-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px; }
  .ts-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
  .ts-card[data-tone="good"] { border-color: var(--accent); }
  .ts-card[data-tone="bad"] { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
  .ts-card .big-n { font-family: var(--f-display); font-size: 2rem; font-weight: 600; line-height: 1.1; }
  .ts-card .zh-l { font-size: 1.4rem; font-weight: 600; }
  .yiji { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 10px; }
  .yj-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
  .yj-box h3 { font-size: .98rem; }
  .yj-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .yj-list span { font-size: .84rem; border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; background: var(--bg); }
  .yj-box[data-kind="yi"] h3 { color: var(--accent); }
  .yj-box[data-kind="ji"] h3 { color: var(--warn-ink); }
  .ts-stars { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 10px; }
  .hours { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.6rem, 1fr)); gap: 6px; }
  .hr-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; gap: 0; font-size: .8rem; }
  .hr-cell[data-luck="good"] { border-color: var(--earth); }
  .hr-cell[data-now="true"] { outline: 2px solid var(--accent); }
  .hr-top { display: flex; justify-content: space-between; align-items: baseline; }
  .hr-gz { font-size: 1.15rem; font-weight: 600; }
  .hr-time { font-variant-numeric: tabular-nums; color: var(--ink-2); }
  .personal { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
  .personal[data-level="care"] { background: var(--warn-bg); color: var(--warn-ink); }
  .personal ul { margin: 0; padding-left: 1.1rem; }

  /* ที่ปรึกษา AI */
  .ai-box { display: flex; flex-direction: column; gap: 12px; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .chips button { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 99px; padding: 4px 12px; font-size: .86rem; cursor: pointer; min-height: 36px; }
  .chat { display: flex; flex-direction: column; gap: 10px; }
  .msg { border-radius: 14px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; }
  .msg[data-role="user"] { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
  .msg[data-role="assistant"] { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
  .msg[data-state="pending"] { color: var(--ink-2); font-style: italic; }
  .ai-form { display: flex; flex-direction: column; gap: 8px; }
  .ai-form textarea { font-family: var(--f-body); font-size: 1rem; min-height: 5rem; }


  /* ฉีเหมิน */
  .qm-picker { display: flex; flex-direction: column; gap: 10px; }
  .qm-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .qm-nav > button:not(.secondary) { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.2rem; }
  .qm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; background: var(--line); border: 3px solid var(--accent); border-radius: 12px; overflow: hidden; }
  .qm-cell { position: relative; background: var(--surface); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto 1fr auto; padding: 6px 4px 14px; min-height: 8.6rem; gap: 2px; }
  .qm-cell[data-destiny="true"] { background: var(--accent-soft); }
  .qm-dir { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: .62rem; color: var(--ink-2); font-weight: 700; letter-spacing: .04em; }
  .qm-i { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.1; padding-top: 10px; }
  .qm-i .zh { font-size: 1.35rem; font-weight: 600; }
  .qm-i small { font-size: .6rem; color: var(--ink-2); line-height: 1.15; }
  .qm-i .sub { font-size: .8rem; color: var(--ink-2); }
  .qm-fly { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; font-family: var(--f-display); font-size: 1.5rem; color: var(--line); font-weight: 600; min-height: 1.4rem; }
  .qm-tags { position: absolute; bottom: 2px; left: 4px; right: 4px; display: flex; gap: 3px; justify-content: space-between; font-size: .62rem; font-weight: 700; }
  .qm-tag { border-radius: 4px; padding: 0 4px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); }
  .qm-tag[data-k="destiny"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .qm-tag[data-k="void"] { color: var(--err); border-color: var(--err); }
  .qm-tag[data-k="horse"] { color: var(--earth); border-color: var(--earth); }
  .qm-center { background: var(--bg); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 2px; padding: 6px 4px; font-size: .74rem; }
  .qm-center b { font-family: var(--f-display); font-size: .95rem; }
  .qm-center .zh { font-size: 1rem; letter-spacing: .06em; }
  .qm-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px; }
  .qm-badge { width: 52px; height: 52px; flex: 0 0 auto; color: var(--accent); }
  .qm-badge svg { width: 100%; height: 100%; }
  .deity-card { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
  .deity-card[data-on="true"] { border-color: var(--accent); background: var(--accent-soft); }
  @media (min-width: 560px) { .qm-i .zh { font-size: 1.7rem; } .qm-cell { min-height: 10rem; } }


  /* คำทำนาย / อ่านง่าย */
  .plain { background: var(--surface); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
  .plain:empty { display: none; }
  .plain h3 { font-size: .95rem; color: var(--accent); }
  .plain ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }
  .tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr)); gap: 6px; }
  .tabs button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; }
  .tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .fc-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .fc-ctrl > button:not(.secondary) { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.3rem; }
  .fc-ctrl output { font-family: var(--f-display); font-weight: 600; font-size: 1.2rem; min-width: 7rem; text-align: center; }
  .fc-ctrl input[type="date"] { width: auto; flex: 1 1 9rem; }
  .fc-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); gap: 6px; }
  .fc-m { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.25; }
  .fc-m[aria-pressed="true"] { outline: 2px solid var(--accent); }
  .fc-m[data-tone="good"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
  .fc-m[data-tone="care"] { background: color-mix(in srgb, var(--warn-line) 28%, var(--surface)); }
  .fc-m b { font-size: .82rem; } .fc-m span { font-size: .72rem; color: var(--ink-2); }
  .reading { display: flex; flex-direction: column; gap: 14px; }
  .rd-head { background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
  .rd-head[data-tone="care"] { background: var(--warn-bg); color: var(--warn-ink); }
  .rd-stars { font-size: 1.25rem; letter-spacing: .1em; color: var(--earth); }
  .rd-title { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; }
  .rd-areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px; }
  .rd-area { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
  .rd-area b { font-family: var(--f-display); }
  .life { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 10px; }
  .life-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
  .life-card h3 { font-size: 1rem; color: var(--accent); }
  .life-card ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }
  .rd-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px; }
  .rd-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
  .rd-list[data-kind="do"] { border-color: var(--accent); }
  .rd-list[data-kind="avoid"] { border-color: var(--warn-line); }
  .rd-list ul { margin: 6px 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }
  .rd-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .rd-days button { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; padding: 4px 10px; cursor: pointer; font-size: .86rem; min-height: 36px; }
  .glossary { border-top: 1px solid var(--line); padding-top: 14px; }
  .glossary dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; }
  .glossary dt { font-weight: 600; margin-top: 8px; }
  .glossary dd { margin: 0; color: var(--ink-2); font-size: .92rem; }
  .howto summary { font-size: .9rem; }
  details.note { margin-top: 6px; }
  details.note > summary { cursor: pointer; font-size: .82rem; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
  details.note > summary::-webkit-details-marker { display: none; }
  details.note > summary::before { content: 'ⓘ'; font-size: .9rem; }
  details.note[open] > summary { color: var(--accent); }
  details.note > .fine, details.note > p, details.note > ol, details.note > div { margin-top: 4px; }
  .sec-head details.intro > summary::before { content: '＋'; }
  .sec-head details.intro[open] > summary::before { content: '－'; }


  .calc-steps { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 10px; }
  .calc-steps li b { display: block; font-family: var(--f-display); }
  .calc-steps li p { font-size: .9rem; overflow-wrap: anywhere; }
  .qm-tag[data-k="po"], .qm-tag[data-k="xing"] { color: var(--warn-ink); border-color: var(--warn-line); background: var(--warn-bg); }


  .deity-list { display: flex; flex-direction: column; gap: 8px; }
  .combo-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 10px; }
  .combo-pick label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
  .combo-out { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
  .combo-out h3 { margin: 0; font-size: 16px; }
  .combo-out .verdict { font-weight: 600; }
  .combo-out .dx-reading { font-size: 17px; font-weight: 600; margin: 0; }
  .combo-out dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; }
  .combo-out dt { color: var(--ink-2); font-size: 13px; }
  .combo-out dd { margin: 0; }
  .combo-out .rel { padding: 6px 10px; border-radius: 8px; background: var(--bg); font-size: 14px; }
  .combo-out .rel[data-kind="a_ke_b"], .combo-out .rel[data-kind="b_ke_a"] { border-left: 3px solid var(--warn-line); }
  .combo-out .rel[data-kind="same"], .combo-out .rel[data-kind="a_gen_b"], .combo-out .rel[data-kind="b_gen_a"] { border-left: 3px solid var(--wood); }
  h3.sub { font-size: 15px; margin: 16px 0 8px; }
  .lp-report { width: 100%; min-height: 160px; font: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); box-sizing: border-box; }
  .lp-dims { display: flex; flex-direction: column; gap: 4px; }
  .lp-dims .row { display: grid; grid-template-columns: 9.5em 1fr 1.2em; gap: 8px; align-items: center; font-size: 13px; }
  .lp-dims .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
  .lp-dims .bar i { display: block; height: 100%; background: var(--accent); }
  .sp-wrap { overflow-x: auto; }
  .sp-grid { border-collapse: collapse; width: 100%; min-width: 330px; font-size: 12px; text-align: center; }
  .sp-grid th, .sp-grid td { border: 1px solid var(--line); padding: 0; }
  .sp-grid th { font-family: var(--f-zh); font-weight: 600; padding: 4px 0; background: var(--surface); }
  .sp-grid td button { width: 100%; min-height: 34px; border: 0; background: transparent; cursor: pointer; font-family: var(--f-zh); font-size: 12px; padding: 0; color: var(--ink); }
  .sp-grid td[data-kind="same"] { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .sp-grid td[data-kind="b_gen_a"], .sp-grid td[data-kind="a_gen_b"] { background: color-mix(in srgb, var(--wood) 12%, transparent); }
  .sp-grid td[data-kind="a_ke_b"], .sp-grid td[data-kind="b_ke_a"] { background: color-mix(in srgb, var(--warn-line) 30%, transparent); }
  .sp-grid td[data-dim="true"] button { opacity: .25; }
  .sp-grid td[data-on="true"] { outline: 2px solid var(--accent); outline-offset: -2px; }
  .time-dirs { display: flex; flex-direction: column; gap: 6px; }
  .time-dir { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
  .time-dir b { font-size: 15px; }
  .time-dir .lv, .slot .lv { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; align-self: start; white-space: nowrap; }
  [data-level="great"] .lv { background: var(--accent); color: var(--accent-ink); }
  [data-level="good"] .lv { background: var(--accent-soft); color: var(--accent); }
  [data-level="ok"] .lv { background: var(--warn-bg); color: var(--warn-ink); }
  [data-level="avoid"] .lv { background: transparent; color: var(--err); border: 1px solid var(--err); }
  .time-dir p { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--ink-2); }
  .slots { display: flex; flex-direction: column; gap: 4px; }
  .slot { display: grid; grid-template-columns: 7.2em 1fr auto; gap: 6px; align-items: center; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
  .slot[data-now="true"] { background: var(--accent-soft); }
  .slot[data-night="true"] { opacity: .6; }
  .slot button { min-height: 30px; }
  .pillar-read { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
  .pillar-read ul { margin: 4px 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }
  .lk-stars, .yr-stars { color: var(--accent); font-size: 11px; letter-spacing: -1px; }
  button.yr-cell { font: inherit; color: inherit; cursor: pointer; }
  .ts-verdict { border-left: 4px solid var(--line); padding-left: 10px; }
  .ts-verdict[data-level="good"] { border-color: var(--accent); }
  .ts-verdict[data-level="mid"] { border-color: var(--warn-line); }
  .ts-verdict[data-level="care"] { border-color: var(--err); }
  .ts-verdict b { font-size: 1.05rem; }
  .ts-dirs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
  .ts-dir { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
  .ts-dir b { font-size: 1.05rem; color: var(--accent); }
  .ts-dir[data-key="sha"] b { color: var(--err); }
  .hr-cell[data-level="good"] { border-color: var(--accent); }
  .hr-cell[data-level="care"] { opacity: .75; }
  .hr-fit { font-size: 12px; color: var(--ink-2); }
  .find-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin-bottom: 8px; }
  .find-day b { font-size: 1.02rem; }
  .find-day ul { grid-column: 1 / -1; margin: 0; padding-left: 1.1rem; font-size: 13px; color: var(--ink-2); }
  .cal-cell .me-mark { position: absolute; top: 2px; right: 4px; font-size: 10px; color: var(--accent); }
  .cal-cell .me-mark[data-k="chong"] { color: var(--err); }
  button.hr-cell { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
  .hr-cell[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
  .hr-detail { margin-top: 10px; }
  .color-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
  .color-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 8px 2px 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
  .color-chip .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
  .ts-colors { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
  .ts-colors p { margin: 4px 0; }
  .find-meta { grid-column: 1 / -1; margin: 2px 0; font-size: 13px; }
  .cal-actions { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
  .cal-save { display: flex; flex-direction: column; gap: 6px; }
  .cal-save:empty { display: none; }
  a.btn-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--accent); font-weight: 600; }
  .saved-ok { color: var(--accent); font-weight: 600; margin: 0; }
  .pat-scope { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
  .pat-alt { color: var(--accent); font-weight: 600; }
  .dm-deep .dm-title { font-family: var(--f-display); font-size: 1.25rem; font-weight: 700; margin: 0; }
  .dm-deep blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink-2); }
  .dm-powers { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .dm-shadow { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
  .fs-summary { display: flex; flex-direction: column; gap: 8px; }
  .fs-summary .inter-card p { margin: 4px 0; }
  details.time-dir { display: block; }
  details.time-dir > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: start; }
  details.time-dir > summary::-webkit-details-marker { display: none; }
  details.time-dir > summary .fine { grid-column: 1 / -1; }
  details.time-dir[open] { border-color: var(--accent); }
  .el4 { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 8px; }
  .el4 > div { display: grid; grid-template-columns: 2.2rem 1fr; gap: 2px 8px; align-items: start; }
  .el4 .zh-b { grid-row: 1 / span 2; font-family: var(--f-zh); font-size: 1.4rem; line-height: 1.1; color: var(--accent); text-align: center; }
  .el4 b { font-size: 14px; }
  .el4 span.m { font-size: 13px; color: var(--ink-2); }
  .mt-score { text-align: center; padding: 14px; }
  .mt-score .big { font-size: 2rem; color: var(--gold); letter-spacing: 2px; display: block; }
  .mt-score b { font-size: 1.15rem; }
  .classic .zh-quote, .zh-quote { font-family: var(--f-display, serif); color: var(--accent); font-size: 1.02rem; line-height: 1.7; margin: 4px 0 8px; }
  .subnav-sep { flex: 0 0 auto; align-self: center; font-size: .72rem; color: var(--ink-2); padding: 0 4px 0 10px; border-left: 1px solid var(--line); white-space: nowrap; }
  .warn-soft { border: 1px solid var(--line); border-left: 4px solid var(--err); background: var(--surface); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
  .warn-soft ul { margin: 6px 0 0; padding-left: 1.2rem; }
  .fs-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
  .fs-tabs button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
  .fs-tabs button[aria-pressed="true"], .fs-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  .hm-form { display: grid; gap: 10px; margin: 12px 0; }
  .hm-form label { display: grid; gap: 4px; font-weight: 600; }
  .hm-form select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; font: inherit; background: var(--surface); color: var(--ink); }
  .hm-rooms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hm-rooms label { font-weight: 500; font-size: .92rem; }
  .hm-issues { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
  .hm-issues label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; padding: 4px 0; }
  .hm-issues input { margin-top: 2px; width: 22px; height: 22px; flex: 0 0 auto; }
  .hm-issues label { min-height: 36px; }
  .src-tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); margin-right: 6px; color: var(--ink-2); }
  .src-tag[data-src="จริง"] { border-color: #2e7d32; color: #2e7d32; }
  .src-tag[data-src="ไทย"] { border-color: var(--gold); color: var(--gold); }
  .hm-room > summary { font-weight: 700; padding: 12px 14px; cursor: pointer; }
  .hm-room { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--surface); }
  .hm-room .body { padding: 0 14px 12px; }
  .hm-room h4 { margin: 12px 0 4px; color: var(--accent); }
  .dir-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .dir-chip { border-radius: 10px; padding: 6px 10px; border: 1px solid var(--line); background: var(--bg); font-size: .9rem; }
  .dir-chip[data-good="true"] { border-color: var(--gold); background: var(--gold-soft, rgba(184,134,11,.1)); }
  .pt-level { text-align: center; padding: 14px; }
  .pt-level b { font-size: 1.2rem; display: block; }
  .pt-level[data-level="good"] { border-color: var(--gold); }
  .pt-level[data-level="hard"] { border-color: var(--accent); }
  .pt-now-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 10px 0; background: var(--surface); }
  .pt-now-card header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
  .pt-now-card header b { font-size: 1.05rem; }
  .pt-top { border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 8px 10px; margin: 8px 0; }
  .pt-top b { color: var(--accent); }
  .pt-best { border-left: 4px solid var(--gold); background: var(--gold-soft, rgba(184,134,11,.1)); border-radius: 0 10px 10px 0; padding: 8px 10px; margin: 8px 0; }
  .pt-best b { color: var(--ink); }
  .pt-more-good > b { color: var(--gold); } .pt-more-bad > b { color: var(--accent); }
  .sum-today .row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
  .sum-today .go { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
  .fold-more > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0; }
  .fold-more[open] > summary { margin-bottom: 4px; }
  .mt-brief { padding-left: 1.1rem; display: grid; gap: 6px; }
  .mt-brief li[data-tone="care"] b { color: var(--accent); }
  .mt-factor[data-tone="good"] > summary { color: var(--ink); }
  .mt-factor[data-tone="care"] > summary { color: var(--accent); }
  .pt-years { display: grid; gap: 6px; }
  .pt-custom { display: grid; gap: 10px; }
  .ln-progress { display: grid; gap: 6px; }
  .ln-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
  .ln-bar > span { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--accent), var(--gold)); }
  .ln-search-wrap { display: grid; gap: 4px; margin: 12px 0; }
  .ln-search-wrap input { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; font: inherit; background: var(--surface); color: var(--ink); }
  .ln-ch { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--surface); }
  .ln-ch > summary { padding: 12px 14px; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
  .ln-ch > summary .fine { font-weight: 400; white-space: nowrap; }
  .ln-list { display: grid; gap: 6px; padding: 0 10px 12px; }
  .ln-item { text-align: left; display: grid; grid-template-columns: 1.4rem 1fr; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
  .ln-item b { color: var(--accent); }
  .ln-item .fine { display: block; }
  .ln-item[data-read="true"] .ln-dot { color: var(--gold); }
  .ln-lesson-head h3 { margin: 6px 0 2px; font-size: 1.35rem; color: var(--accent); }
  .ln-body { line-height: 1.75; overflow-wrap: anywhere; }
  .ln-body h4 { margin: 18px 0 6px; color: var(--accent); }
  .ln-body blockquote { margin: 6px 0 12px; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft, rgba(184,134,11,.08)); border-radius: 0 10px 10px 0; }
  .ln-body .zt { font-size: 1.12rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; letter-spacing: .5px; }
  .ln-body .zh { color: var(--accent); font-weight: 600; }
  .ln-body .tbl { overflow-x: auto; margin: 8px 0; }
  .ln-body table { border-collapse: collapse; min-width: 100%; font-size: .92rem; }
  .ln-body th, .ln-body td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
  .ln-body hr { border: 0; border-top: 1px dashed var(--line); margin: 18px 0; }
  .ln-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
  .ln-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; background: var(--surface); }
  .ln-q .opts { display: grid; gap: 6px; margin-top: 8px; }
  .ln-q .opts button { text-align: left; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; padding: 6px 10px; cursor: pointer; }
  .ln-q .opts button[data-state="right"] { border-color: #2e7d32; background: rgba(46,125,50,.12); }
  .ln-q .opts button[data-state="wrong"] { border-color: var(--accent); background: var(--accent-soft); }
  .love-years { display: flex; flex-direction: column; gap: 6px; }
  .love-year { display: grid; grid-template-columns: 5.6rem 1fr; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
  .love-year[data-tone="good"] { border-color: var(--accent); background: var(--accent-soft); }
  .love-year[data-tone="care"] { border-color: var(--warn-line); background: var(--warn-bg); }
  .love-year b { font-family: var(--f-display); white-space: nowrap; }
  .steps-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
  @media (max-width: 420px) { .combo-out dl { grid-template-columns: 1fr; } }
  .deity { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .deity[data-on="true"] { border-color: var(--accent); background: var(--accent-soft); }
  .deity > summary { display: flex; gap: 10px; align-items: center; padding: 10px 12px; list-style: none; min-height: 64px; }
  .deity > summary::-webkit-details-marker { display: none; }
  .deity > summary .meta { display: flex; flex-direction: column; gap: 1px; }
  .deity > summary .meta span { font-size: .8rem; color: var(--ink-2); }
  .deity-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
  .deity-body dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .deity-body dt { font-weight: 600; margin-top: 6px; color: var(--accent); font-size: .9rem; }
  .deity-body dd { margin: 0; }
  .deity-body blockquote { margin: 4px 0 0; padding: 8px 12px; border-left: 3px solid var(--earth); background: var(--bg); border-radius: 6px; font-style: italic; }
  .survey { display: flex; flex-direction: column; gap: 12px; }
  .survey-q b { display: block; margin-bottom: 6px; }
  .survey-q .chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }


  .layers { display: flex; flex-direction: column; gap: 10px; }
  .layer { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 4px 10px; }
  .layer .ln { grid-row: 1 / span 2; width: 2rem; height: 2rem; border-radius: 99px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--f-display); }
  .layer h3 { font-size: .98rem; }
  .layer ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }

  /* ดาวเหิน */
  .stepper { display: flex; align-items: center; gap: 10px; }
  .stepper button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.2rem; }
  .stepper button:disabled { opacity: .4; cursor: default; }
  .stepper output { font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; min-width: 4.5rem; text-align: center; font-variant-numeric: tabular-nums; }
  .compass { font-size: .78rem; color: var(--ink-2); text-align: center; font-weight: 600; letter-spacing: .08em; }
  .fs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fs-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 6.6rem; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; line-height: 1.25; }
  .fs-cell[data-tone="caution"] { border-style: dashed; border-color: var(--warn-line); }
  .fs-cell[data-tone="supportive"] { border-color: var(--accent); }
  .fs-cell[aria-pressed="true"] { background: var(--accent-soft); border-width: 2px; border-style: solid; border-color: var(--accent); }
  .fs-dir { font-size: .72rem; color: var(--ink-2); text-align: center; }
  .fs-num { font-family: var(--f-display); font-weight: 600; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .fs-star { font-size: .74rem; color: var(--ink-2); }
  .fs-detail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
  .tone { font-size: .84rem; font-weight: 600; color: var(--accent); }
  .tone[data-tone="caution"] { color: var(--warn-ink); }

  footer { border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-2); font-size: .86rem; display: flex; flex-direction: column; gap: 6px; }

  @media (max-width: 420px) {
    .glyph .zh { font-size: 2rem; }
    .bar-row { grid-template-columns: 5.4rem minmax(0, 1fr) 2.4rem; }
    .bar-count { display: none; }
    .recs { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .recs dd { margin-bottom: 8px; }
  }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

  /* ===== โฉมใหม่: ตระกูลเดียวกับ Nora Yam (อุ่น น่ารัก อ่านง่าย) ไม่แตะตรรกะการคำนวณ ===== */
  :root {
    --bg: #f6f3ef; --surface: #ffffff; --ink: #2a2833; --ink-2: #6b6776; --line: #ece7e1;
    --accent: #d94a1f; --accent-ink: #ffffff; --accent-soft: #ffefe8;
    --hero-1: #8a2b12; --hero-2: #e5532a; --hero-ink: #fff7e8; --hero-ink-2: #ffe0b8; --hero-line: #f2815c; --hero-accent: #ffd166;
    --f-display: 'Mali', 'Sarabun', system-ui, sans-serif;
    --shadow: 0 1px 3px rgba(60,40,20,.07);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #17151c; --surface: #221f2a; --ink: #f2eff6; --ink-2: #b3aebf; --line: #34303e;
      --accent: #ff8a5c; --accent-ink: #1b120d; --accent-soft: #3a2a26; --shadow: none;
      --hero-1: #5a1c0b; --hero-2: #b24521; color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #17151c; --surface: #221f2a; --ink: #f2eff6; --ink-2: #b3aebf; --line: #34303e;
    --accent: #ff8a5c; --accent-ink: #1b120d; --accent-soft: #3a2a26; --shadow: none;
    --hero-1: #5a1c0b; --hero-2: #b24521; color-scheme: dark;
  }
  body { font-size: 17px; }
  main { gap: 20px; }
  .sec-head h2::after { display: none; }
  h1, h2, h3 { font-weight: 700; }
  .masthead { position: relative; padding-right: 56px; }
  .masthead .name { font-size: 1.7rem; font-weight: 700; }
  .tag { border: 0; background: var(--accent-soft); color: var(--accent); }
  .theme-btn { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0; }
  .theme-btn svg { width: 22px; height: 22px; }

  /* เมนูโมดูล: แถบไอคอนสีกลม */
  .nav { gap: 10px; padding: 8px 2px 12px; }
  .nav button { width: 70px; min-height: 0; padding: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; border-radius: 0; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
  .nav button[aria-current="page"] { background: transparent; border: 0; color: var(--ink); }
  .nav .sq { width: 54px; height: 54px; border-radius: 18px; background: var(--c); color: #fff; display: grid; place-items: center; opacity: .5; transition: opacity .2s; }
  .nav .sq svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .nav button[aria-current="page"] .sq { opacity: 1; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
  .nav .lb { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .subnav button { border: 0; background: var(--surface); border-radius: 999px; min-height: 38px; padding: 0 14px; box-shadow: var(--shadow); }
  .subnav button[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

  /* การ์ดขาวมุมโค้ง */
  .panel, #app section:not(.hero):not(section section) { background: var(--surface); border: 0; border-radius: 26px; padding: 20px; box-shadow: var(--shadow); }
  #app section:not(.hero):not(section section) .sec-head { border-top: 0; padding-top: 0; }
  .hero { border-radius: 26px; }
  input[type="date"], input[type="time"], input[type="number"], input[type="text"], select, textarea { border: 0; border-radius: 14px; background: var(--bg); }
  .seg button { border: 0; border-radius: 14px; background: var(--bg); }
  .seg button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
  .primary { border-radius: 999px; padding: 0 26px; }
  .example, .warn, .person-strip { border-radius: 16px; }
  .secondary { border-radius: 999px; }
  button.small:not(.secondary):not(.primary) { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 700; cursor: pointer; }

/* ฝังในเว็บ PreciousGate */
html.embed .masthead{display:none}
html.embed body{padding-block:6px 28px}
.ln-easy{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:14px;padding:14px 16px;margin-bottom:14px;line-height:1.8;font-size:1.02rem}
.ln-easy .ln-easytag{margin:0 0 8px}
.ln-easy h4{margin:16px 0 6px;color:var(--accent)}
.ln-easy p{margin:8px 0}
.ln-easy ul{padding-left:1.2rem;margin:6px 0;display:flex;flex-direction:column;gap:4px}
.ln-easy table{width:100%;border-collapse:collapse;margin:8px 0;font-size:.92rem}
.ln-easy th,.ln-easy td{border:1px solid var(--line);padding:5px 8px;text-align:left}
.ln-easy th{background:var(--accent-soft)}
.ln-easy .zh{font-family:var(--f-zh)}
.ln-easy .ln-try{background:var(--accent-soft);border-radius:10px;padding:8px 12px}
details.ln-orig{margin-top:6px;border:1px dashed var(--line);border-radius:12px;padding:8px 12px}
details.ln-orig>summary{cursor:pointer;font-weight:600;color:var(--ink-2)}
details.ln-orig[open]>summary{margin-bottom:10px}
