@charset "utf-8";
/* =====================================================================
   โหราศาสตร์ยูเรเนียน — horoall.com/uranian
   แนวคิด: ตู้ลายรดน้ำ (รักครามเข้ม + ทองคำเปลว) กับเครื่องมือทองเหลืองของสำนักฮัมบูร์ก
   โหมดมืดเป็นค่าเริ่มต้น  ·  โหมดสว่าง = ครามอรุณ (พื้นครามจาง หมึกคราม ทองเข้ม)
   ===================================================================== */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151935; --bg-top: #252C5C; --bg-deep: #0F1229;
  --lacquer: #151935; --lacquer-2: #1E2448;
  --surface: #1E2448; --surface-2: #191E3E; --surface-3: #2A3263;
  --card-a: rgba(42,50,99,.55); --card-b: rgba(30,36,72,.4);
  --field: #12162F; --wash: rgba(14,17,38,.55); --wash-2: rgba(14,17,38,.35);
  --header-bg: rgba(21,25,53,.88);
  --line: rgba(205,166,90,.28); --line-soft: rgba(205,166,90,.16); --line-dash: rgba(205,166,90,.22); --field-line: rgba(205,166,90,.32);
  --gold: #CDA65A; --gold-hi: #F0DDA6; --link-hover: #FFF3CF;
  --ink: #EDE5CF; --ink-strong: #FBF3DC; --ink-2: #B4AFC6; --ink-sub: #D4CDB9; --placeholder: #6E6A86;
  --on-gold: #1A1630;
  --vermilion: #D8694A; --jade: #7DBBAA;
  --ok-bg: rgba(125,187,170,.14); --ok-line: rgba(125,187,170,.5); --ok-ink: #CFEDE4;
  --bad-bg: rgba(216,105,74,.14); --bad-line: rgba(216,105,74,.5); --bad-ink: #FFD5C7;
  --title-grad: linear-gradient(176deg, #FFF1C9 8%, #CDA65A 52%, #8E6B2C 92%);
  --wheel-face: #1B2147;
  --zs0: #F0B79A; --zs1: #D9CC8E; --zs2: #BFD3E6; --zs3: #9FCFC2;
  --shadow: rgba(0,0,0,.55); --shadow-soft: rgba(0,0,0,.7);
  --brass-hi: #F3DB9C; --brass: #C9A252; --brass-lo: #7A5A26; --engrave: #2B1E0C;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #E9ECF6; --bg-top: #F8F9FD; --bg-deep: #DCE0EE;
  --lacquer: #E6E9F5; --lacquer-2: #FBFBFE;
  --surface: #FFFFFF; --surface-2: #F5F6FB; --surface-3: #E3E6F2;
  --card-a: #FFFFFF; --card-b: #F7F8FC;
  --field: #FFFFFF; --wash: rgba(31,37,80,.045); --wash-2: rgba(31,37,80,.03);
  --header-bg: rgba(248,249,253,.9);
  --line: rgba(138,100,32,.28); --line-soft: rgba(138,100,32,.16); --line-dash: rgba(138,100,32,.26); --field-line: rgba(31,37,80,.22);
  --gold: #A67C2E; --gold-hi: #6E4E12; --link-hover: #3F2A05;
  --ink: #1F2448; --ink-strong: #12163A; --ink-2: #5A5F80; --ink-sub: #353A60; --placeholder: #9AA0BC;
  --on-gold: #FFFFFF;
  --vermilion: #B4462A; --jade: #2C7462;
  --ok-bg: rgba(44,116,98,.09); --ok-line: rgba(44,116,98,.4); --ok-ink: #1C5547;
  --bad-bg: rgba(180,70,42,.08); --bad-line: rgba(180,70,42,.4); --bad-ink: #8A2E18;
  --title-grad: linear-gradient(176deg, #A9802F 8%, #7A5718 52%, #4A3208 95%);
  --wheel-face: #FFFFFF;
  --zs0: #B5532F; --zs1: #8A7420; --zs2: #3F6390; --zs3: #2C7462;
  --shadow: rgba(31,37,80,.22); --shadow-soft: rgba(31,37,80,.2);
}
:root {
  --f-display: "Chonburi", "Noto Sans Thai Looped", serif;
  --f-body: "Noto Sans Thai Looped", "Loma", "Leelawadee UI", "Tahoma", sans-serif;
  --f-sym: "Noto Sans Symbols", "Noto Sans Symbols 2", "Segoe UI Symbol", "DejaVu Sans", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 70ch;
  --hdr: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
[id] { scroll-margin-top: calc(var(--hdr) + 16px); }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(120% 80% at 70% -10%, var(--bg-top) 0%, var(--bg) 55%, var(--bg-deep) 100%) fixed;
  background-color: var(--bg);
  color: var(--ink); font: 400 17px/1.85 var(--f-body);
  overflow-x: hidden;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
a { color: var(--gold-hi); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }
b, strong { font-weight: 600; color: var(--ink-strong); }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.35; margin: 0; }
h2 { font: 400 clamp(24px, 3.2vw, 32px)/1.35 var(--f-display); color: var(--gold-hi); }
h3 { font-size: 20px; font-weight: 600; color: var(--gold-hi); margin: 2.2em 0 .8em; }
code { font-size: .9em; background: var(--surface-3); padding: .1em .4em; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--gold); color: var(--on-gold); font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }

/* ---------- เมนูบนแบบติดตาม ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.tb-in { max-width: 1320px; margin: 0 auto; min-height: var(--hdr); display: flex; align-items: center; gap: 18px; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--gold-hi); font: 400 18px/1.2 var(--f-display); flex: none; }
.brand svg { width: 36px; height: 36px; fill: none; stroke: var(--gold); stroke-width: 1.4; }
.brand svg .thin { stroke-width: .6; opacity: .6; }
.brand small { display: block; font: 300 12px/1.4 var(--f-body); color: var(--ink-2); }
.mainnav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.menu > li > a, .menu summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 15px; cursor: pointer; white-space: nowrap; list-style: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu > li > a:hover, .menu summary:hover { color: var(--gold-hi); background: var(--wash); }
.menu [aria-current="page"] { color: var(--gold-hi); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 10px 10px 4px 4px; }
.menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu summary svg { width: 15px; height: 15px; transition: transform .2s; }
.menu details[open] summary svg { transform: rotate(180deg); }
.menu .nav-home { color: var(--gold-hi); border: 1px solid var(--line); margin-right: 6px; }
.menu .nav-home:hover { border-color: var(--gold); }
.dd { position: relative; }
.dd-menu {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 50px -20px var(--shadow);
}
.dd-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.dd-menu a:hover { background: var(--wash); color: var(--gold-hi); }
.theme-sw { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--wash); flex: none; }
.theme-sw button { display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 34px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 600 13px var(--f-body); cursor: pointer; }
.theme-sw button span { display: none; }
.theme-sw button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-sw button svg .fill { fill: currentColor; stroke: none; }
.theme-sw button:hover { color: var(--gold-hi); }
.theme-sw button[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); cursor: pointer; position: relative; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--gold-hi); transition: transform .2s, opacity .2s; }
.nav-toggle .bars { top: 21px; }
.nav-toggle .bars::before { left: 0; right: 0; top: -6px; }
.nav-toggle .bars::after { left: 0; right: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- โฆษณา ---------- */
.ad { max-width: 1240px; margin: 28px auto; padding: 0 var(--gutter); text-align: center; }
.ad-l { display: block; font-size: 11px; color: var(--ink-2); opacity: .75; margin-bottom: 4px; }
.ad-c { overflow: hidden; }
.ad-c img, .ad-c iframe { max-width: 100%; height: auto; }
.ad-ph { min-height: 100px; display: grid; place-items: center; border: 2px dashed var(--gold); border-radius: 12px; color: var(--gold-hi); background: var(--wash); font-size: 15px; padding: 12px; }
.ad-top { margin-top: 16px; }
.chapters .ad, .about .ad, .index .ad { padding: 0; }
.chapters .ad { margin: 8px 0 36px; max-width: 900px; }
.ad-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 6px 48px 6px 12px; min-height: 60px; background: var(--header-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 -10px 30px -12px var(--shadow);
}
.ad-sticky-in { max-width: 970px; width: 100%; max-height: 120px; overflow: hidden; text-align: center; }
.ad-sticky .ad-ph { min-height: 48px; }
.ad-x { position: absolute; top: 6px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 22px/1 var(--f-body); cursor: pointer; }
.ad-x:hover { border-color: var(--gold); color: var(--gold-hi); }
body.has-sticky { padding-bottom: 96px; }
.ad-closed .ad-sticky { display: none; }

/* ---------- หน้าแรก ---------- */
.index { padding: 0 var(--gutter) 40px; max-width: 1240px; margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(20px, 4vw, 64px); padding: clamp(16px, 4vw, 48px) 0 24px; }
.hero h1, .plate-head h1 {
  background: var(--title-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.hero h1 { font: 400 clamp(52px, 8.6vw, 112px)/1.08 var(--f-display); letter-spacing: -.01em; padding-bottom: .1em; }
.hero-lede { max-width: 34em; font-size: 18px; color: var(--ink); margin: 22px 0 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.hero-cta .btn.primary { width: auto; min-height: 52px; padding: 10px 28px; margin: 0; }
.hero-dial { margin: 0; position: relative; }
.hero-dial figcaption, figure figcaption { text-align: center; font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.hero-dial .dial { filter: drop-shadow(0 30px 50px var(--shadow)); }

.form-plate {
  position: relative; max-width: 760px; margin: 28px auto 0; padding: clamp(22px, 4vw, 44px);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(240, 221, 166, .12), 0 40px 80px -40px var(--shadow-soft);
}
.form-plate::before {            /* ขอบทองเส้นใน แบบตู้ลายรดน้ำ */
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--line-soft); border-radius: 14px; pointer-events: none;
}
.form-plate h2 { margin-bottom: 18px; }
.birth { display: grid; gap: 18px; position: relative; }
.row { display: flex; gap: 14px; flex-wrap: wrap; margin: 0; padding: 0; border: 0; }
.row.three { display: grid; grid-template-columns: 1fr 1.5fr 1.2fr; gap: 12px; }
.row.three.time { grid-template-columns: 1fr 1fr 1.5fr; }
.coords .row.three { grid-template-columns: 1fr 1fr; }
.coords .hint { grid-column: 1 / -1; }
.fld { display: grid; gap: 6px; flex: 1 1 200px; }
.fld.grow { flex-basis: 100%; }
.fld > span, .seg legend { font-size: 14px; color: var(--ink-2); }
input, select {
  font: inherit; font-size: 17px; color: var(--ink); width: 100%;
  background: var(--field); border: 1px solid var(--field-line); border-radius: 10px;
  padding: 11px 14px; min-height: 48px; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus { border-color: var(--gold-hi); outline: none; box-shadow: 0 0 0 3px rgba(205, 166, 90, .2); }
.seg { gap: 0; border: 1px solid var(--field-line); border-radius: 12px; overflow: hidden; display: inline-flex; flex-wrap: nowrap; width: fit-content; position: relative; padding-top: 0; }
.seg legend { position: absolute; top: -26px; left: 0; }
fieldset.seg { margin-top: 22px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 10px 22px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line-soft); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--gold); color: var(--on-gold); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: -3px; }
.check { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 48px; cursor: pointer; flex: 1 1 160px; }
.check input { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 6px; flex: none; }
.check input:checked { background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 6.5' fill='none' stroke='%23ffffff' stroke-width='2.4'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--gold); }
.time.off select { opacity: .4; }
.coords summary { cursor: pointer; color: var(--gold-hi); font-size: 15px; }
.coords .row { margin-top: 14px; }
.hint { font-size: 14px; color: var(--ink-2); margin: 0; align-self: end; }
.err { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px;
  border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold-hi);
  font: 600 16px/1.2 var(--f-body); cursor: pointer; text-decoration: none;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary {
  width: 100%; min-height: 58px; font-size: 18px; margin-top: 6px; border: 0; color: #1A1630;
  background: linear-gradient(180deg, #F6E2A8, #CDA65A 55%, #A8823C);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 30px -10px rgba(205,166,90,.6);
}
.btn.primary:hover { filter: brightness(1.06); color: #1A1630; }
.btn.ghost:hover { background: var(--wash); }

.method { max-width: 760px; margin: 72px auto 0; }
.method h2 { margin-bottom: 14px; }
.method p { margin: 0 0 1em; }
.example { padding: 16px 20px; border-left: 2px solid var(--gold); background: var(--wash); border-radius: 0 12px 12px 0; }

/* ---------- สัญลักษณ์ ---------- */
.g { font-family: var(--f-sym); font-size: 1.15em; line-height: 1; color: var(--gold-hi); display: inline-block; min-width: 1.1em; text-align: center; }
.g-txt { font: 600 .72em/1 var(--f-body); letter-spacing: .02em; color: var(--jade); border: 1px solid currentColor; border-radius: 4px; padding: .18em .3em; min-width: 0; }
.g.k-mc, .g.k-asc, .g.k-aries { color: var(--vermilion); }
.g.k-aries { font-family: var(--f-sym); border: 0; font-size: 1.1em; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.formula { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; padding: 4px 12px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line); }
.formula i { font-style: normal; color: var(--ink-2); font-size: 14px; }
.sg { font-family: var(--f-sym); color: var(--gold); }
.rx { font-style: normal; font-size: 12px; color: var(--vermilion); border: 1px solid var(--bad-line); padding: 0 6px; border-radius: 999px; vertical-align: 2px; }

/* ---------- SVG วงล้อ ---------- */
svg.wheel, svg.dial { width: 100%; height: auto; display: block; overflow: visible; }
.wheel .scallop { fill: rgba(205,166,90,.07); stroke: var(--gold); stroke-width: .8; }
.wheel .ring-outer { fill: var(--wheel-face); stroke: var(--gold); stroke-width: 1.2; }
.wheel .ring { fill: none; stroke: var(--gold); stroke-width: 1; }
.wheel .ring.thin { stroke-width: .5; opacity: .5; }
.wheel .div { stroke: var(--gold); stroke-width: .8; opacity: .7; }
.wheel .tick { stroke: var(--gold); stroke-width: .6; opacity: .6; }
.wheel .zsign { font: 22px var(--f-sym); fill: var(--gold-hi); text-anchor: middle; dominant-baseline: central; }
.wheel .zsign.el0 { fill: var(--zs0); } .wheel .zsign.el1 { fill: var(--zs1); } .wheel .zsign.el2 { fill: var(--zs2); } .wheel .zsign.el3 { fill: var(--zs3); }
.wheel .asp { stroke-width: 1; }
.wheel .asp.a90, .wheel .asp.a180 { stroke: var(--vermilion); }
.wheel .asp.a45, .wheel .asp.a135 { stroke: var(--jade); stroke-dasharray: 4 3; }
.wheel .axis { stroke: var(--gold-hi); stroke-width: 1.4; }
.wheel .axl { font: 600 15px var(--f-body); fill: var(--vermilion); text-anchor: middle; dominant-baseline: central; }
.wheel .ptick { stroke: var(--gold-hi); stroke-width: 1.4; }
.wheel .gl { font: 24px var(--f-sym); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.wheel .gl-t { font: 600 14px var(--f-body); fill: var(--jade); text-anchor: middle; dominant-baseline: central; }
.wheel .pl.k-sun .gl, .wheel .pl.k-moon .gl, .wheel .pl.k-node .gl { fill: var(--gold-hi); }
.wheel .deg { font: 11px var(--f-body); fill: var(--ink-2); text-anchor: middle; dominant-baseline: central; }
.wheel .hub { fill: var(--gold); }

/* ---------- SVG แผ่นหมุน 90° (ทองเหลืองขัดเงา เหมือนกันทั้งสองโหมด) ---------- */
.dial .dial-face { fill: url(#dg); stroke: #5C421A; stroke-width: 2; }
.dial .sector { fill: none; stroke-width: 7; opacity: .55; }
.dial .sector.s0 { stroke: #7B2F1E; } .dial .sector.s1 { stroke: #23315E; } .dial .sector.s2 { stroke: #2F5E52; }
.dial .sect-l { font: 600 13px var(--f-body); fill: var(--engrave); text-anchor: middle; dominant-baseline: central; opacity: .8; }
.dial .tick { stroke: var(--engrave); stroke-width: .7; }
.dial .tick.major { stroke-width: 1.5; }
.dial .dnum { font: 600 13px var(--f-body); fill: var(--engrave); text-anchor: middle; dominant-baseline: central; }
.dial .ring { fill: none; stroke: var(--engrave); stroke-width: 1.2; }
.dial .ring.thin { stroke-width: .6; opacity: .5; }
.dial .ptick { stroke: var(--engrave); stroke-width: 1.1; opacity: .75; }
.dial .gl { font: 25px var(--f-sym); fill: #1C1530; text-anchor: middle; dominant-baseline: central; }
.dial .gl-t { font: 700 14px var(--f-body); fill: #20403A; text-anchor: middle; dominant-baseline: central; }
.dial .pl.k-mc .gl-t, .dial .pl.k-asc .gl-t, .dial .pl.k-aries .gl-t { fill: #8A2A15; }
.dial .pl.k-aries .gl-t { font: 22px var(--f-sym); }
.dial .pl.hit text { fill: #9B1C08; }
.dial .pointer { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.dial .pointer.drag { transition: none; }
.dial .needle { stroke: #1A1630; stroke-width: 2.4; stroke-linecap: round; }
.dial .needle.q { stroke-width: 1; opacity: .5; stroke-dasharray: 3 5; }
.dial .tip { fill: #8A2A15; }
.dial .boss { fill: #2A2140; stroke: var(--brass-hi); stroke-width: 2; }
.dial .boss-c { fill: var(--brass-hi); }
@media (prefers-reduced-motion: reduce) { .dial .pointer { transition: none; } }

/* ---------- หน้ารายงาน ---------- */
.report { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 60px; }
.plate-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 28px 0 32px; border-bottom: 1px solid var(--line); }
.kicker { margin: 0 0 4px; color: var(--gold); font-size: 15px; }
.plate-head h1 { font: 400 clamp(36px, 6vw, 68px)/1.15 var(--f-display); padding-bottom: .08em; }
.birth-meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 16px 0 0; }
.birth-meta div { min-width: 0; }
.birth-meta dt { font-size: 13px; color: var(--ink-2); }
.birth-meta dd { margin: 0; font-weight: 600; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-actions .btn { min-height: 42px; font-size: 14px; padding: 8px 16px; }

.instruments { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 56px); padding: 40px 0 20px; align-items: start; }
.instruments figure { margin: 0; }
.fig-dial { display: grid; gap: 4px; }
.dial-box { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.dial-box:active { cursor: grabbing; }
.readout { grid-column: 1 / -1; margin-top: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--wash); min-height: 120px; }
.readout .ro-pos { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
.readout .ro-pos b { color: var(--gold-hi); font-size: 20px; }
.readout ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 8px 28px; }
.readout li { font-size: 15px; line-height: 1.65; }
.readout li .formula { font-size: 15px; padding: 2px 10px; margin-right: 6px; }
.readout .none { color: var(--ink-2); font-size: 15px; margin: 0; }

.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); margin-top: 32px; }
.toc { position: sticky; top: calc(var(--hdr) + 20px); align-self: start; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); counter-reset: none; }
.toc li a { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.5; }
.toc li a:hover, .toc li a.on { color: var(--gold-hi); }
.toc li a.on { position: relative; }
.toc li a.on::before { content: ""; position: absolute; left: -15px; top: 8px; bottom: 8px; width: 2px; background: var(--gold-hi); }
.chapters { min-width: 0; }
.chapter { max-width: 900px; padding: 12px 0 44px; }
.chapter > p, .chapter > .pics, .chapter > .aspects, .chapter > .timeline, .chapter > .transits, .chapter .tree { max-width: var(--measure); }
.chapter + .chapter, .ad + .chapter { border-top: 1px solid var(--line); padding-top: 44px; }
.chapter h2 { margin-bottom: 18px; }
.chapter p { margin: 0 0 1.05em; }
.lede { font-size: 20px; line-height: 1.75; color: var(--ink-strong); }
.intro { color: var(--ink-2); }
.sub { color: var(--ink-sub); }
.note { font-size: 15px; color: var(--ink-2); border-left: 2px solid var(--vermilion); padding-left: 14px; }
.meta { font-size: 15px; color: var(--ink-sub); margin-bottom: .4em !important; }
.meta span { color: var(--gold); margin-right: 10px; font-size: 13px; }
.end-home { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px !important; }

.tbl-wrap { overflow-x: auto; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td.wrap { white-space: normal; }
thead th { font-weight: 400; color: var(--ink-2); font-size: 13px; background: var(--wash); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 400; }
td.num { font-variant-numeric: tabular-nums; }
table.houses td { text-align: center; font-variant-numeric: tabular-nums; }

.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.fcard { padding: 18px 20px; border-radius: 16px; background: linear-gradient(180deg, var(--card-a), var(--card-b)); border: 1px solid var(--line-soft); font-size: 15.5px; line-height: 1.75; }
.fcard header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.fcard header .g { font-size: 30px; }
.fcard header .g-txt { font-size: 15px; }
.fcard h4 { font-size: 17px; font-weight: 600; color: var(--ink-strong); }
.fcard header p { margin: 0; font-size: 14px; color: var(--ink-2); }
.fcard p { margin: 0 0 .6em; }

.pics { display: grid; gap: 14px; margin-top: 18px; }
.pic { padding: 16px 0 6px; border-top: 1px dashed var(--line-dash); }
.pic:first-child { border-top: 0; }
.pic .formula { margin-bottom: 10px; }
.pic .orb { font-size: 13px; color: var(--ink-2); margin-left: 10px; }
.tree { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; background: var(--wash-2); }
.tree summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::after { content: "+"; color: var(--gold); font-size: 20px; line-height: 1; }
.tree[open] summary::after { content: "–"; }
.tree summary .cnt { margin-left: auto; color: var(--ink-2); font-size: 14px; }
.tree .tbody { padding: 0 18px 10px; }
.aspects .asp-row { padding: 12px 0; border-top: 1px dashed var(--line-dash); }
.aspects .asp-row p { margin: 8px 0 0; }

.timeline { list-style: none; padding: 0; margin: 20px 0 0; position: relative; }
.timeline > li { position: relative; padding: 0 0 20px 28px; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline > li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(205,166,90,.18); }
.timeline h4 { font-size: 18px; font-weight: 600; color: var(--gold-hi); margin-bottom: 6px; }
.timeline ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline ul p { margin: 6px 0 0; }
.transits { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 4px; }
.transits li { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 12px 0; border-top: 1px dashed var(--line-dash); }
.transits time { color: var(--gold-hi); font-weight: 600; font-size: 15px; padding-top: 4px; }
.transits p { margin: 8px 0 0; }

/* ---------- เรียนรู้ / ติดตั้ง / ผู้ดูแล ---------- */
.setup, .about { max-width: 820px; margin: 0 auto; padding: 24px var(--gutter) 60px; }
.setup h1, .about h1 { font: 400 clamp(32px, 5vw, 48px)/1.3 var(--f-display); color: var(--gold-hi); margin-bottom: 18px; }
.about section { padding: 8px 0 12px; }
.about h2 { margin: 1.4em 0 .5em; font-size: 26px; }
.about p { margin: 0 0 1em; }
.about-toc ol { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.about-toc a { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 14px; color: var(--ink-2); }
.about-toc a:hover { color: var(--gold-hi); border-color: var(--gold); }
.about .fgrid { margin-top: 18px; }
.plain { padding-left: 1.2em; }
.plain li { margin-bottom: .4em; }
.about-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 28px; }
.about-cta .btn.primary { width: auto; margin: 0; min-height: 52px; padding: 10px 28px; }
.setup-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.setup-form label { display: grid; gap: 6px; flex: 1 1 240px; font-size: 14px; color: var(--ink-2); }
.log { padding-left: 1.2em; }
.log .good::marker { color: var(--jade); } .log .bad { color: var(--bad-ink); }
.okmsg { color: var(--jade); font-weight: 600; }
.setup-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.page-admin .setup { max-width: 980px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--gold-hi); border-color: var(--gold); }
.ads-form { display: grid; gap: 16px; }
.ad-slot { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px 18px; margin: 0; display: grid; gap: 10px; background: var(--wash-2); }
.ad-slot legend { padding: 0 8px; color: var(--gold-hi); font-weight: 600; }
.ad-slot .check { min-height: 32px; }
.ad-slot .every { max-width: 260px; }
textarea.code { font: 13px/1.5 Consolas, "Courier New", monospace; min-height: 110px; }
.admin-preview a { margin-right: 12px; }
.ads-form .btn.primary { width: auto; padding: 10px 30px; }

/* ---------- ท้ายเว็บ ---------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, var(--wash)); }
.foot-in { max-width: 900px; margin: 0 auto; padding: 40px var(--gutter) 36px; display: grid; justify-items: center; gap: 18px; text-align: center; color: var(--ink-2); font-size: 14px; }
.home-btn { min-height: 52px; padding: 10px 26px; font-size: 16px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.foot-links a:hover { color: var(--gold-hi); }
.foot .fine { margin: 0; max-width: 64ch; font-size: 13px; opacity: .85; }
.foot .by { margin: 4px 0 0; font-size: 15px; color: var(--ink); }
.foot .by a { color: var(--gold-hi); font-weight: 600; }

/* ---------- ปุ่มแชร์ ---------- */
.share { width: 100%; }
.share-l { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.share ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sh {
  --c: var(--gold); display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--wash); color: var(--ink);
  font: 600 14px/1.2 var(--f-body); text-decoration: none; cursor: pointer;
}
.sh::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.sh:hover { border-color: var(--c); color: var(--ink-strong); background: color-mix(in srgb, var(--c) 14%, transparent); }
.sh-facebook { --c: #1877F2; } .sh-line { --c: #06C755; } .sh-messenger { --c: #A334FA; } .sh-x { --c: #8B8F99; }
.sh-whatsapp { --c: #25D366; } .sh-telegram { --c: #29A9EB; } .sh-pinterest { --c: #E60023; } .sh-linkedin { --c: #0A66C2; }
.sh-reddit { --c: #FF4500; } .sh-email { --c: var(--gold-hi); } .sh-copy { --c: var(--jade); } .sh-native { --c: var(--gold); }
.share .mobile-only, .share .native-only { display: none; }
.share.is-mobile .mobile-only, .share.can-native .native-only { display: list-item; }
.plate-head .share { order: 3; margin-top: 4px; }
.end-share { padding-bottom: 10px; }
.social-wrap { max-width: 760px; margin: 64px auto 0; display: grid; gap: 40px; }

/* ---------- ความคิดเห็น ---------- */
.comments { max-width: 760px; }
.comments.chapter { border-top: 1px solid var(--line); padding-top: 44px; }
.c-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.c-head p { margin: 0; color: var(--ink-2); font-size: 15px; }
.c-flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; font-size: 15px; }
.c-flash.good { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); }
.c-flash.bad { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); }
.c-form { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.c-form .fld { position: relative; }
textarea {
  font: inherit; font-size: 16px; color: var(--ink); width: 100%; resize: vertical; min-height: 120px;
  background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; padding: 11px 14px; line-height: 1.7;
}
textarea:focus { border-color: var(--gold-hi); outline: none; box-shadow: 0 0 0 3px rgba(205,166,90,.2); }
.captcha .cap-row { display: flex; align-items: center; gap: 12px; }
.cap-q { flex: none; min-width: 120px; padding: 10px 16px; border-radius: 10px; text-align: center; font: 400 22px/1.2 var(--f-display); letter-spacing: .04em;
  color: #1A1630; background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 65%, var(--brass-lo)); user-select: none; -webkit-user-select: none; }
.captcha input { max-width: 120px; text-align: center; font-size: 20px; }
.c-err { margin: -4px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); }
.c-err[hidden] { display: none; }
.c-count { justify-self: end; font-size: 12px; color: var(--ink-2); }
.c-count.over { color: var(--vermilion); }
.c-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.c-actions .hint { flex: 1 1 260px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.c-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 0; }
.c-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-top: 1px dashed var(--line-dash); }
.c-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 400 20px/1 var(--f-display);
  color: #1A1630; background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); }
.c-meta { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.c-meta time, .c-meta .ip { font-size: 13px; color: var(--ink-2); }
.c-msg { margin: 0; overflow-wrap: anywhere; }
.c-empty { color: var(--ink-2); }
.c-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.c-pages a, .c-pages span { min-width: 40px; min-height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; font-size: 15px; }
.c-pages span { background: var(--gold); color: var(--on-gold); font-weight: 600; border-color: var(--gold); }
.admin-list .hidden-c { opacity: .55; }
.admin-acts { display: flex; gap: 8px; margin-top: 10px; }
.admin-acts form { margin: 0; }
.admin-acts .btn { min-height: 36px; padding: 4px 14px; font-size: 14px; }
.btn.danger { border-color: var(--vermilion); color: var(--vermilion); }

/* ---------- จอกลาง: เมนูแบบลิ้นชัก ---------- */
@media (max-width: 1120px) {
  .nav-toggle { display: block; }
  .mainnav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    flex-direction: column; align-items: stretch; gap: 14px; padding: 14px var(--gutter) 20px;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 30px 50px -20px var(--shadow);
    max-height: calc(100vh - var(--hdr)); overflow-y: auto;
  }
  .mainnav.open { display: flex; }
  .menu { flex-direction: column; align-items: stretch; gap: 2px; }
  .menu > li > a, .menu summary { width: 100%; min-height: 46px; font-size: 16px; color: var(--ink); }
  .menu .nav-home { margin: 0 0 6px; justify-content: flex-start; }
  .menu [aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); border-radius: 4px 10px 10px 4px; }
  .dd-menu { position: static; box-shadow: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; margin: 2px 0 6px 18px; padding: 2px 0 2px 8px; min-width: 0; background: transparent; }
  .theme-sw { align-self: flex-start; }
  .theme-sw button span { display: inline; }
  .theme-sw button { padding: 0 14px; height: 38px; }
}
/* ---------- จอเล็ก ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-dial { max-width: 520px; margin: 0 auto; width: 100%; }
  .instruments { grid-template-columns: 1fr; }
  .instruments figure { max-width: 560px; width: 100%; margin: 0 auto; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { min-width: 0; position: sticky; top: var(--hdr); z-index: 5; margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter); background: var(--header-bg); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .toc ol { display: flex; gap: 6px; overflow-x: auto; border: 0; padding: 0; scrollbar-width: none; }
  .toc ol::-webkit-scrollbar { display: none; }
  .toc li a { white-space: nowrap; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
  .toc li a.on { background: var(--gold); color: var(--on-gold); }
  .toc li a.on::before { display: none; }
  .chapters [id] { scroll-margin-top: calc(var(--hdr) + 64px); }
}
@media (max-width: 600px) {
  :root { --hdr: 58px; }
  body { font-size: 16px; }
  .brand { font-size: 16px; }
  .brand svg { width: 30px; height: 30px; }
  .hero h1 { font-size: 56px; }
  .transits li { grid-template-columns: 1fr; gap: 4px; }
  .seg span { padding: 10px 16px; }
  .lede { font-size: 18px; }
  .fgrid { grid-template-columns: 1fr; }
  .row.three.time { grid-template-columns: 1fr 1fr; }
  .row.three.time .check { grid-column: 1 / -1; min-height: 32px; }
  input, select { padding: 10px 12px; }
  select { padding-right: 30px; background-position: calc(100% - 16px) 21px, calc(100% - 10px) 21px; }
  .ad-sticky { padding-right: 44px; min-height: 54px; }
  body.has-sticky { padding-bottom: 80px; }
}

/* ---------- พิมพ์ ---------- */
@media print {
  #sky, .topbar, .ph-actions, .toc, .readout, .fig-dial figcaption, .ad, .ad-sticky, .foot .home-btn, .foot-links, .share, .comments, .end-share { display: none !important; }
  body { background: #fff; color: #1a1a1a; font-size: 12pt; padding: 0 !important; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .chapter { max-width: none; page-break-inside: auto; }
  h2, h3, .kicker, .plate-head h1, .brand { color: #6b4e18 !important; -webkit-text-fill-color: #6b4e18; background: none; }
  b, strong, .lede { color: #000; }
  .intro, .sub, .meta, .note { color: #333; }
  .fcard, .tree, .tbl-wrap, .formula { background: none; border-color: #bbb; }
  .tree .tbody { display: block !important; }
  .instruments { grid-template-columns: 1fr 1fr; page-break-after: always; }
  a { color: inherit; text-decoration: none; }
}
