/* Phần Thần số học, Cung hoàng đạo, Hợp cung, Bản đồ sao. Chỉ được nạp khi bật ASTRO_ENABLED=1.
   Dùng lại các biến màu và kiểu chữ của style.css; không đổi kiểu của phần Tarot. */

/* ---- thanh điều hướng có thêm mục: gọn lại khi hẹp. Điều khoản luôn có ở chân trang nên được ẩn khỏi thanh trên ở màn vừa và thanh dưới trên điện thoại ---- */
@media (max-width: 1240px) {
  .brand-sub { display: none; }
  .nav a { padding: 8px 10px; letter-spacing: .1em; }
  .nav a[aria-current="page"]::after { left: 10px; right: 10px; }
}
@media (max-width: 1100px) { .nav a[data-nav="terms"] { display: none; } }
@media (max-width: 640px) { .bnav a[data-nav="terms"] { display: none; } }
@media (min-width: 641px) and (max-width: 700px) {
  .brand-main { letter-spacing: .08em !important; font-size: 1.05rem !important; }
  .nav a { padding: 8px 5px !important; font-size: .63rem !important; letter-spacing: .02em !important; }
  .nav a[aria-current="page"]::after { left: 5px !important; right: 5px !important; }
}
@media (max-width: 900px) {
  .brand-sub { display: none; }
  .brand-main { letter-spacing: .24em; }
  .nav { gap: 0; }
  .nav a { padding: 8px 9px; letter-spacing: .08em; font-size: .7rem; }
  .nav a[aria-current="page"]::after { left: 9px; right: 9px; }
}
@media (min-width: 641px) and (max-width: 760px) {
  .brand-main { letter-spacing: .18em; font-size: 1.15rem; }
  .nav a { padding: 8px 6px; letter-spacing: .04em; font-size: .66rem; }
  .nav a[aria-current="page"]::after { left: 6px; right: 6px; }
  .topbar-right { gap: 6px; }
}

/* ---- dải mục con ---- */
.a-tabs { display: flex; gap: 6px; margin: 4px 0 24px; padding: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tabs a { flex: none; position: relative; padding: 12px 16px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 500; letter-spacing: .04em; white-space: nowrap; transition: color .2s; }
.a-tabs a:hover { color: var(--ink); }
.a-tabs a[aria-current="page"] { color: var(--ink); }
.a-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: var(--accent); }
.tarot-sub { margin-top: 14px; margin-bottom: 0; }
.astro .page-head .lead { margin-top: 12px; max-width: 62ch; color: var(--ink-soft); }
.astro .page-head { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 0; }

/* ---- biểu mẫu ---- */
.a-form { padding: 24px 24px 22px; max-width: 640px; }
.a-form h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 16px; }
.a-date { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 12px; }
.a-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.a-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 140px; }
.a-field.wide { flex: 2 1 220px; }
.a-field > span { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.a-field > span em { font-style: normal; font-weight: 400; letter-spacing: .02em; text-transform: none; color: var(--dim); }
.a-field input, .a-field select {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s;
}
.a-field select { font-size: .95rem; }
.a-field input::placeholder { color: var(--dim); }
.a-field input:focus, .a-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
.a-help, .a-privacy { margin-top: 12px; font-size: .8rem; line-height: 1.6; color: var(--muted); }
.a-privacy { margin-top: 14px; }
.a-form .btn.big { margin-top: 18px; width: 100%; }
.a-error-line { margin-top: 12px; padding: 9px 12px; border-radius: var(--radius); border: 1px solid rgba(221, 146, 133, .5); background: rgba(221, 146, 133, .08); color: var(--bad); font-size: .9rem; }
.a-loading { color: var(--muted); font-size: .92rem; padding: 18px 2px; }

/* ---- kết quả ---- */
.a-result { margin-top: 22px; padding: 24px; max-width: 760px; animation: fadeIn .4s ease both; }
.a-hero { display: flex; align-items: center; gap: 22px; }
.a-big { flex: none; width: 112px; height: 112px; display: grid; place-items: center; font-family: var(--f-display); font-size: 4.6rem; font-weight: 500; line-height: 1; color: var(--accent-lt); border: 1px solid var(--accent-dk); border-radius: 50%; background: rgba(185, 138, 74, .06); }
.a-glyph { flex: none; font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", var(--f-body); font-size: 3.4rem; line-height: 1; color: var(--accent-lt); width: 96px; height: 96px; display: grid; place-items: center; border: 1px solid var(--accent-dk); border-radius: 50%; background: rgba(185, 138, 74, .06); font-variant-emoji: text; }
.a-label { font-size: .7rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.a-name { font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 500; margin-top: 4px; }
.a-name.sm { font-size: 1.4rem; text-align: center; margin-top: 8px; }
.a-sub { margin-top: 6px; font-size: .92rem; color: var(--muted); }
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.a-stats li { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 2px; }
.a-stats span { font-size: .78rem; color: var(--muted); }
.a-stats b { font-family: var(--f-display); font-size: 2rem; font-weight: 500; color: var(--ink); line-height: 1.1; }
.a-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.a-tags li { padding: 3px 12px; font-size: .82rem; color: var(--accent-lt); border: 1px solid rgba(185, 138, 74, .4); border-radius: var(--radius); }
.a-note { margin-top: 16px; font-size: .95rem; line-height: 1.7; color: var(--ink-soft); }
.a-more { margin-top: 12px; font-size: .9rem; }
.a-cusp { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--accent-dk); border-radius: var(--radius); background: rgba(185, 138, 74, .05); font-size: .92rem; line-height: 1.7; color: var(--ink-soft); }
.a-cusp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.a-pair { display: flex; align-items: center; justify-content: center; gap: 22px; }
.a-pair > div { display: flex; flex-direction: column; align-items: center; }
.a-amp { font-family: var(--f-display); font-size: 2rem; font-style: italic; color: var(--accent); }

/* lưới ngày sinh 3x3 */
.a-grid-wrap { display: flex; align-items: center; gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.a-grid3 { flex: none; display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; }
.g-cell { height: 56px; display: grid; place-items: center; border: 1px solid var(--accent-dk); border-radius: var(--radius); background: rgba(185, 138, 74, .08); font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; color: var(--accent-lt); letter-spacing: .04em; }
.g-cell.miss { border-color: var(--line); background: transparent; color: var(--dim); font-weight: 400; }
.a-arrows { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--ink-soft); }
.a-arrows b { color: var(--ink); font-weight: 600; }
.a-arrows span { color: var(--muted); font-size: .8rem; }
.a-how { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }
.a-how summary { cursor: pointer; color: var(--accent-lt); }
.a-how ul { margin: 10px 0 0; padding-left: 1.2em; line-height: 1.75; }

/* ---- gợi ý, tấm màn, diễn giải ---- */
.a-read { max-width: 760px; margin-top: 18px; }
.a-hint-card { padding: 4px 0 4px 18px; border-left: 2px solid rgba(185, 138, 74, .55); }
.a-hint-card h3 { font-size: 1.4rem; font-weight: 600; margin-bottom: 8px; }
.a-hint-card p { font-size: 1rem; line-height: 1.8; color: var(--ink-soft); }
.a-hint-card p + p { margin-top: 10px; }
.a-unlock { margin-top: 18px; }
.a-article { padding: 26px 26px 18px; animation: fadeIn .5s ease both; }
.a-article-title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.a-article section { padding: 16px 0 4px; }
.a-article h4 { font-family: var(--f-body); font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.a-article p { font-size: 1rem; line-height: 1.85; color: var(--ink-soft); margin: 0 0 12px; max-width: 68ch; }
.a-error { margin-top: 14px; padding: 14px 16px; border: 1px solid rgba(221, 146, 133, .45); border-radius: var(--radius); background: rgba(221, 146, 133, .07); color: var(--ink-soft); line-height: 1.7; }
.a-error.paywall { border-color: var(--accent-dk); background: rgba(185, 138, 74, .06); }
.a-error-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* ---- Bản đồ sao (đang hoàn thiện) ---- */
.a-soon { max-width: 640px; padding: 26px; }
.a-soon h2 { font-size: 1.6rem; margin-bottom: 10px; }
.a-soon p { color: var(--ink-soft); line-height: 1.75; margin-bottom: 14px; }
.a-soon .btn { margin: 0 10px 8px 0; text-decoration: none; }

/* ---- trang tĩnh của từng cung / từng số ---- */
.astro-page .page-head h1 { display: flex; align-items: center; gap: 14px; }
.ap-glyph { font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", var(--f-body); color: var(--accent-lt); font-size: .9em; font-variant-emoji: text; }
.ap-num { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; font-size: .8em; border: 1px solid var(--accent-dk); border-radius: 50%; color: var(--accent-lt); }
.astro-page .lead { margin-top: 14px; max-width: 62ch; color: var(--ink-soft); }
.a-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.a-links a { display: inline-block; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); text-decoration: none; color: var(--ink-soft); font-size: .92rem; }
.a-links a:hover { border-color: var(--accent); color: var(--accent-lt); }
.a-signgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 8px 0 26px; }
.a-signcard { display: flex; flex-direction: column; gap: 3px; padding: 16px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); text-decoration: none; color: var(--ink-soft); transition: border-color .2s; }
.a-signcard:hover { border-color: var(--accent); }
.a-signcard .g { font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", var(--f-display); font-size: 2rem; line-height: 1.1; color: var(--accent-lt); font-variant-emoji: text; }
.a-signcard b { font-family: var(--f-display); font-size: 1.35rem; color: var(--ink); font-weight: 600; }
.a-signcard .dim { font-size: .82rem; }
.a-signgrid.nums .g { font-size: 2.4rem; }
.a-signcard { padding: 0 0 14px; overflow: hidden; }
.a-signcard > :not(.th) { margin-left: 14px; margin-right: 14px; }
.a-signcard .th { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #0d0a14; margin-bottom: 10px; }
.a-signcard .th img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform .5s ease; }
.a-signcard:hover .th img { transform: scale(1.05); }
.a-signcard .th.sym { aspect-ratio: 1; display: grid; place-items: center; padding: 12px; background: transparent; }
.a-signcard .th.sym svg { width: 100%; height: auto; max-width: 150px; }
.a-signcard:hover .th.sym svg .fig { stroke: #f3d9a4; }

@media (max-width: 560px) {
  .a-form { padding: 18px 16px 18px; }
  .a-result { padding: 18px 16px; }
  .a-hero { gap: 16px; }
  .a-big { width: 84px; height: 84px; font-size: 3.4rem; }
  .a-glyph { width: 76px; height: 76px; font-size: 2.6rem; }
  .a-grid-wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .a-article { padding: 20px 16px 12px; }
  .a-tabs a { padding: 12px 12px; }
  .a-tabs a[aria-current="page"]::after { left: 12px; right: 12px; }
  .a-pair { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { .a-result, .a-article { animation: none; } }

/* chữ số dạng đứng hàng (lining) cho các con số: kiểu chữ tiêu đề mặc định dùng số "cổ điển" làm số 1 giống chữ I */
.a-big, .a-stats b, .a-name, .ap-num, .a-signgrid .g { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.g-cell { font-family: var(--f-body); font-size: 1.2rem; font-weight: 600; font-variant-numeric: lining-nums; letter-spacing: .02em; }
.g-cell.miss { font-weight: 400; }

/* ---- Bản đồ sao: ô giờ sinh, bộ ba lớn, bánh xe, bảng vị trí, góc chiếu ---- */
.a-check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .92rem; color: var(--ink-soft); cursor: pointer; }
.a-check input { width: 20px; height: 20px; accent-color: #b98a4a; }
.a-field input:disabled { opacity: .45; }
.a-big3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.a-big3 li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; text-align: center; border: 1px solid var(--accent-dk); border-radius: var(--radius); background: rgba(185, 138, 74, .06); }
.a-big3 li.miss { border-color: var(--line); background: transparent; }
.a-big3 .k { font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.a-big3 .g { font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", var(--f-body); font-size: 2.1rem; line-height: 1.2; font-weight: 400; color: var(--accent-lt); font-variant-emoji: text; }
.a-big3 li.miss .g { color: var(--dim); }
.a-big3 .n { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.a-big3 .d { font-size: .8rem; color: var(--muted); min-height: 1.2em; }
.a-wheel-wrap { display: grid; place-items: center; margin: 22px 0 6px; }
.a-wheel { width: 100%; max-width: 480px; height: auto; font-family: "Segoe UI Symbol", "Noto Sans Symbols", "Apple Symbols", var(--f-body); }
.w-ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.w-sign-line, .w-house-line { stroke: var(--line-2); stroke-width: .8; }
.w-house-line { stroke-dasharray: 2 3; stroke: var(--line); }
.w-axis { stroke: var(--accent); stroke-width: 1.3; }
.w-mc { stroke-dasharray: 5 3; stroke-width: 1; }
.w-sign { font-size: 16px; fill: var(--muted); }
.w-el-fire { fill: #d9a066; } .w-el-earth { fill: #a8b98a; } .w-el-air { fill: #9fbcd0; } .w-el-water { fill: #8fa8d8; }
.w-body { font-size: 17px; fill: var(--ink); }
.w-house { font-size: 9px; fill: var(--dim); font-family: var(--f-body); }
.w-angle { font-size: 10px; fill: var(--accent); font-family: var(--f-body); font-weight: 600; }
.w-retro { font-size: 8px; fill: var(--bad); font-family: var(--f-body); }
.w-tick { stroke: var(--ink); stroke-width: 1.2; }
.w-asp { stroke-width: .9; opacity: .75; }
.w-asp-h { stroke: #94bd9b; } .w-asp-t { stroke: #dd9285; } .w-asp-n { stroke: var(--muted); stroke-dasharray: 2 2; }
.a-sub-h { font-family: var(--f-body); font-size: .74rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 22px 0 10px; }
.a-table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.a-table th, .a-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-soft); }
.a-table thead th { font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.a-table tbody th { font-weight: 500; color: var(--ink); }
.a-table .gl { display: inline-block; width: 1.4em; text-align: center; color: var(--accent-lt); font-variant-emoji: text; }
.a-table abbr { text-decoration: none; color: var(--bad); cursor: help; }
.a-asp-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.a-asp-list li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: .86rem; color: var(--ink-soft); border: 1px solid var(--line-2); border-radius: var(--radius); }
.a-asp-list b { font-weight: 400; font-size: 1rem; }
.a-asp-list em { font-style: normal; color: var(--muted); font-size: .8rem; }
.a-asp-list .t-h b { color: #94bd9b; } .a-asp-list .t-t b { color: #dd9285; } .a-asp-list .t-n b { color: var(--accent-lt); }
.a-result:has(.a-wheel) { max-width: 820px; }
@media (max-width: 560px) {
  .a-big3 { gap: 8px; }
  .a-big3 li { padding: 12px 4px; }
  .a-big3 .g { font-size: 1.7rem; }
  .a-big3 .n { font-size: 1.1rem; }
  .a-table th, .a-table td { padding: 7px 7px; font-size: .88rem; }
}
@media (max-width: 560px) {
  .a-table th, .a-table td { padding: 6px 4px; font-size: .82rem; }
  .a-table tbody th { white-space: normal; min-width: 4.5em; }
  .a-table thead th { letter-spacing: .06em; font-size: .64rem; }
  .a-table .gl { width: 1.1em; }
}

/* ---- chọn bản đọc rút gọn / đầy đủ ---- */
.a-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; max-width: 1020px; margin-top: 18px; }
.a-choice-btn { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-align: left; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-soft); transition: border-color .2s, background .2s; }
.a-choice-btn b { font-family: var(--f-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.a-choice-btn span { font-size: .84rem; line-height: 1.55; color: var(--muted); }
.a-choice-btn:hover { border-color: var(--accent); }
.a-choice-btn[aria-pressed="true"] { border-color: var(--accent); background: rgba(185, 138, 74, .1); }
@media (max-width: 560px) { .a-choice { grid-template-columns: 1fr; } }

/* gợi mở miễn phí: câu đầu của từng mục trong bản chi tiết, phần sau bị che mờ */
.a-peek { display: grid; gap: 14px; margin-top: 18px; max-width: 760px; }
.a-peek-item { padding: 12px 16px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.a-peek-item h4 { font-family: var(--f-body); font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.a-peek-item p { font-size: .98rem; line-height: 1.75; color: var(--ink-soft); }
.a-more-dots { color: var(--dim); }
.c-veil.sm { max-width: none; margin: 8px 0 0; gap: 7px; }
.c-veil.sm i { height: 9px; }
.c-veil.sm i:nth-child(1) { width: 94%; } .c-veil.sm i:nth-child(2) { width: 62%; }

/* ======== Hình ảnh: tranh khắc màu 12 cung, lá bài đồng hành, bầu trời lúc này ======== */
.a-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; margin: 4px 0 26px; }
.a-top .hero-intro { margin: 0; max-width: none; }
.a-fan { position: relative; height: 250px; max-width: 440px; width: 100%; justify-self: center; }
.a-fan .f { position: absolute; display: block; width: 56%; border-radius: 3px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55), 0 0 0 1px rgba(185, 138, 74, .45); overflow: hidden; background: #efe4cd; transition: transform .5s ease; }
.a-fan .f img { display: block; width: 100%; height: auto; }
.a-fan .f0 { left: 0; top: 46px; transform: rotate(-6deg); z-index: 1; }
.a-fan .f1 { left: 22%; top: 0; z-index: 3; transform: rotate(1deg); }
.a-fan .f2 { right: 0; top: 64px; transform: rotate(7deg); z-index: 2; }
.a-fan:hover .f0 { transform: rotate(-9deg) translateX(-6px); } .a-fan:hover .f2 { transform: rotate(10deg) translateX(6px); }
.a-fan.art { height: 290px; max-width: 430px; }
.a-fan.art .f { width: 42%; background: #14110d; }
.a-fan.art .f0 { left: 0; top: 44px; } .a-fan.art .f1 { left: 29%; top: 0; } .a-fan.art .f2 { right: 0; top: 58px; }
.a-sky { margin: 0; justify-self: center; width: 100%; max-width: 380px; text-align: center; min-height: 120px; }
.a-sky .a-wheel { max-width: 380px; }
.a-sky figcaption { margin-top: 4px; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }

/* thư viện ảnh: lưới các cung / các con số */
.a-gallery { margin: 38px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.a-gallery h2 { font-size: 1.7rem; font-weight: 500; margin-bottom: 4px; }
.a-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.a-gal-item { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink-soft); }
.a-gal-img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #1b1814; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; transition: border-color .2s, transform .3s; }
.a-gal-item:hover .a-gal-img { border-color: var(--accent); transform: translateY(-2px); }
.a-gal-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.a-gal-item b { margin-top: 8px; font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; color: var(--ink); line-height: 1.1; }
.a-gal-item em { font-style: normal; font-size: .8rem; color: var(--muted); }
.a-gal-grid.nums { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.a-gal-grid.nums .a-gal-img { aspect-ratio: 1; background: transparent; border-color: transparent; padding: 4px; }
.a-gal-grid.nums .a-gal-img svg { width: 100%; height: auto; }
.a-gal-grid.nums .a-gal-item:hover .a-gal-img { transform: none; }
.a-gal-grid.nums .a-gal-item:hover svg .fig { stroke: #f3d9a4; }

/* ảnh trong kết quả */
.a-hero { flex-wrap: wrap; }
.a-hero-txt { flex: 1 1 200px; min-width: 0; }
.a-plate-fig { margin-left: auto; display: block; flex: none; }
.a-plate.res { display: block; width: auto; max-width: 230px; max-height: 190px; height: auto; border-radius: 3px; box-shadow: 0 10px 26px rgba(0, 0, 0, .5), 0 0 0 1px rgba(185, 138, 74, .5); }
.a-emb-fig { margin-left: auto; flex: none; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.a-emb-fig svg { display: block; width: 96px; height: 96px; }
.a-emb-fig span { display: flex; flex-direction: column; max-width: 150px; }
.a-emb-fig b { font-family: var(--f-display); font-size: 1.05rem; color: var(--ink); font-weight: 600; line-height: 1.15; }
.a-pair .a-plate-fig.sm { margin: 0; }
.a-pair .a-plate.res { max-width: 190px; max-height: 150px; }
.a-sel-prev { display: block; margin-top: 8px; min-height: 0; }
.a-plate.prev { display: block; width: auto; max-width: 150px; max-height: 108px; height: auto; border-radius: 3px; box-shadow: 0 6px 16px rgba(0, 0, 0, .45), 0 0 0 1px rgba(185, 138, 74, .4); }

/* trang công khai: tranh lớn của cung, lá bài của số */
.ap-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 34px; align-items: center; }
.ap-art { margin: 0; justify-self: center; width: 100%; }
.ap-art img { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(185, 138, 74, .5); }
.ap-art.ap-emb { max-width: 280px; }
.ap-art.ap-emb svg { display: block; width: 100%; height: auto; }
.ap-art figcaption { margin-top: 8px; font-size: .75rem; color: var(--dim); line-height: 1.5; text-align: center; }

@media (max-width: 800px) {
  .a-top { grid-template-columns: 1fr; gap: 18px; }
  .a-top .a-fan, .a-top .a-sky { order: -1; }
  .a-fan { height: 190px; max-width: 340px; } .a-fan.art { height: 230px; max-width: 330px; }
  .a-plate-fig, .a-emb-fig { margin-left: 0; }
  .ap-hero { grid-template-columns: 1fr; gap: 20px; }
  .ap-art { max-width: 420px; } .ap-art.ap-emb { max-width: 220px; }
}
@media (max-width: 560px) {
  .a-gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .a-gal-grid.nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .a-plate.res { max-width: 180px; }
}
@media (prefers-reduced-motion: reduce) { .a-fan .f, .a-gal-img { transition: none; } }

/* Biểu tượng hình học của từng con số (SVG do js/astro/numer.js vẽ) */
svg.emb .bg { fill: rgba(185, 138, 74, .07); }
svg.emb .ring { fill: none; stroke: var(--accent-dk); stroke-width: 1.2; }
svg.emb .ring.thin { stroke-width: .6; opacity: .7; }
svg.emb .fig { fill: none; stroke: var(--accent-lt); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; transition: stroke .25s; }
svg.emb .fig.thin { stroke-width: .7; opacity: .55; }
svg.emb .dot { fill: var(--accent-lt); }

/* Bản đồ sao: nền Dải Ngân Hà (Devils Tower, ảnh Damon Joyce / NPS, phạm vi công cộng) */
.a-top.starry { position: relative; isolation: isolate; padding: 30px 28px 34px; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.a-top.starry::before { content: ""; position: absolute; inset: 0; z-index: -2; background: #05060d url(/assets/sky/milkyway.webp) 50% 28% / cover no-repeat; }
.a-top.starry::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 7, 14, .88) 0%, rgba(8, 7, 14, .6) 46%, rgba(8, 7, 14, .25) 100%), linear-gradient(180deg, rgba(8, 7, 14, 0) 55%, rgba(8, 7, 14, .65) 100%); }
.a-top.starry .hero-intro { text-shadow: 0 1px 10px rgba(0, 0, 0, .75); }
.a-top.starry .a-sky .a-wheel { background: radial-gradient(circle, rgba(8, 7, 14, .82) 0 58%, rgba(8, 7, 14, 0) 71%); }
.a-credit { grid-column: 1 / -1; margin: -6px 0 -14px; font-size: .68rem; color: rgba(236, 228, 214, .5); text-align: right; }
@media (max-width: 800px) {
  .a-top.starry { padding: 20px 16px 28px; }
  .a-top.starry::before { background-image: url(/assets/sky/sm/milkyway.webp); }
  .a-top.starry::after { background: linear-gradient(180deg, rgba(8, 7, 14, .22), rgba(8, 7, 14, .62)); }
  .a-emb-fig svg { width: 80px; height: 80px; }
}

/* Bốn giai đoạn lớn (Thần số học): dòng của giai đoạn hiện tại sáng hơn */
.a-periods td { font-variant-numeric: lining-nums; }
.a-periods tr.cur th, .a-periods tr.cur td { color: var(--ink); background: rgba(185, 138, 74, .08); }
.a-periods tr.cur th em { font-style: normal; font-size: .78rem; color: var(--accent-lt); }

/* Nhịp 12 tháng tới (Bản đồ sao): bảng thời điểm nổi bật */
.a-hits td:first-child { white-space: normal; font-variant-numeric: lining-nums; color: var(--ink); min-width: 7em; }

/* ---------- Kinh Dịch ---------- */
.dich-hero { display: flex; gap: 34px; justify-content: center; align-items: flex-end; margin: 22px 0 6px; }
.dich-hero span { display: grid; justify-items: center; gap: 10px; animation: dichFloat 7s ease-in-out infinite; }
.dich-hero span:nth-child(2) { animation-delay: -2.3s; } .dich-hero span:nth-child(3) { animation-delay: -4.6s; }
.dich-hero em { font-style: normal; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.dich-hero .dich-line { filter: drop-shadow(0 0 6px rgba(216, 178, 119, .28)); }
@keyframes dichFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.dich-hex { display: block; max-width: 100%; height: auto; overflow: visible; }
.dich-line { fill: var(--accent); }
.dich-line.mv { fill: var(--accent-lt); filter: drop-shadow(0 0 5px rgba(216, 178, 119, .55)); }
.dich-dot { fill: none; stroke: var(--accent-lt); stroke-width: 2; }
/* hình quẻ kết quả: hào hiện dần từ đáy lên đỉnh */
.dich-hex.anim .dich-line, .dich-hex.anim .dich-dot { transform-box: fill-box; transform-origin: center; animation: dichRise .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
.dich-figs figure.changed .dich-hex.anim .dich-line { animation-delay: calc(var(--i, 0) * 110ms + 900ms); }
@keyframes dichRise { from { opacity: 0; transform: scaleX(.2); } to { opacity: 1; transform: none; } }

/* bàn gieo */
.dich-stage { margin: 16px 0 8px; padding: 16px 18px 12px; max-width: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(120% 90% at 50% 0%, rgba(185, 138, 74, .09), transparent 66%), rgba(255, 255, 255, .012); }
.dich-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.dich-rows li { display: grid; grid-template-columns: 54px 1fr auto 96px; align-items: center; gap: 12px; min-height: 30px; font-size: .82rem; color: var(--muted); }
.dich-rows li > span:first-child { font-variant-numeric: lining-nums; letter-spacing: .04em; }
.dich-rows li.empty { opacity: .55; padding: 0; border: 0; border-radius: 0; text-align: left; }
.dich-rows li.empty.next { opacity: 1; color: var(--accent-lt); }
.dich-rows .ln { display: flex; gap: 22%; height: 9px; }
.dich-rows .ln.ghost { border: 1px dashed var(--line); border-radius: 2px; height: 7px; grid-column: 2; }
.dich-rows li.next .ln.ghost { border-color: var(--accent-dk); animation: dichNext 1.8s ease-in-out infinite; }
@keyframes dichNext { 0%, 100% { box-shadow: 0 0 0 0 rgba(185, 138, 74, 0); } 50% { box-shadow: 0 0 12px 0 rgba(185, 138, 74, .35); } }
.dich-rows .ln.y { background: var(--accent); border-radius: 2px; }
.dich-rows .ln.n i { flex: 1; background: var(--accent); border-radius: 2px; }
.dich-rows li.mv .ln.y, .dich-rows li.mv .ln.n i { background: var(--accent-lt); box-shadow: 0 0 8px rgba(216, 178, 119, .45); }
.dich-rows li.line em { font-style: normal; color: var(--ink-soft); text-align: left; }
.dich-rows li.mv em { color: var(--accent-lt); }
.dich-rows .coins { display: inline-flex; gap: 6px; perspective: 400px; }
/* đồng xu có lỗ vuông; mặt ngửa sáng, mặt sấp tối */
.coin { position: relative; display: inline-block; width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--accent); }
.coin::after { content: ""; position: absolute; inset: 0; margin: auto; width: 5px; height: 5px; border: 1px solid currentColor; box-sizing: border-box; }
.coin.h { background: radial-gradient(circle at 35% 30%, #f0d39c, var(--accent) 60%, #8a6431); color: #4a3418; }
.coin.t { background: radial-gradient(circle at 35% 30%, #4b3c28, #2a2118 70%); color: var(--accent); }
/* hào vừa gieo: xu xoay rồi rơi, nét hào hiện sau */
.dich-rows li.fresh .coin { animation: coinFlip .62s cubic-bezier(.3, .6, .3, 1) both; animation-delay: calc(var(--c, 0) * 70ms); }
.dich-rows li.fresh .ln { transform-origin: center; animation: dichRise .4s ease-out both; animation-delay: .5s; }
.dich-rows li.fresh em { animation: fadeIn .35s ease-out both; animation-delay: .62s; }
@keyframes coinFlip { 0% { opacity: 0; transform: translateY(-14px) rotateY(0); } 60% { opacity: 1; transform: translateY(2px) rotateY(900deg); } 100% { transform: translateY(0) rotateY(1080deg); } }
.dich-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; }
.dich-manual { margin-top: 18px; }
.dich-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 12px; }

/* kết quả */
.dich-result { display: grid; gap: 12px; }
.dich-figs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 30px; padding: 14px 0 6px; background: radial-gradient(60% 80% at 50% 40%, rgba(185, 138, 74, .08), transparent 70%); }
.dich-figs figure { margin: 0; display: grid; justify-items: center; gap: 14px; }
.dich-figs figcaption { display: grid; gap: 3px; text-align: center; font-size: 1rem; color: var(--ink); font-family: var(--f-display, inherit); }
.dich-figs figcaption b { font-family: var(--f-body); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.dich-figs figcaption em { font-family: var(--f-body); font-style: normal; font-size: .84rem; color: var(--ink-soft); max-width: 210px; }
.dich-figs figcaption small { font-family: var(--f-body); font-size: .72rem; color: var(--muted); max-width: 210px; }
.dich-figs figure.changed { opacity: .92; }
.dich-arrow { font-size: 1.6rem; color: var(--accent); animation: fadeIn .4s ease-out both; animation-delay: .8s; }
.dich-result .btn { justify-self: start; }
@media (max-width: 520px) {
  .dich-stage { padding: 14px 12px 10px; }
  .dich-rows li { grid-template-columns: 46px 1fr auto; gap: 10px; }
  .dich-rows li em { grid-column: 2 / 4; margin-top: -4px; }
  .dich-rows li.empty { grid-template-columns: 46px 1fr; }
  .dich-hero { gap: 20px; }
  .dich-figs { gap: 18px; }
  .dich-arrow { transform: rotate(90deg); flex-basis: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .dich-hero span, .dich-hex.anim .dich-line, .dich-hex.anim .dich-dot, .dich-rows li.next .ln.ghost, .dich-rows li.fresh .coin, .dich-rows li.fresh .ln, .dich-rows li.fresh em, .dich-arrow { animation: none; }
}

/* ---------- Tử Vi: lá số 12 cung ---------- */
.tv-sex { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.tv-sex legend { float: left; margin-right: 6px; padding: 0; font-size: .78rem; color: var(--muted); letter-spacing: .06em; }
.tv-pills { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .02); }
.tv-pills label { position: relative; cursor: pointer; }
.tv-pills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tv-pills span { display: block; min-width: 64px; padding: 6px 16px; border-radius: 999px; text-align: center; font-size: .92rem; color: var(--ink-soft); transition: background .2s, color .2s; }
.tv-pills label:hover span { color: var(--ink); }
.tv-pills input:checked + span { background: var(--accent); color: #1a140c; font-weight: 600; }
.tv-pills input:focus-visible + span { outline: 2px solid var(--accent-lt); outline-offset: 2px; }
.tv-hourhint { display: block; min-height: 1.2em; margin-top: 4px; font-size: .74rem; color: var(--accent-lt); letter-spacing: .02em; }

.tv-wrap { display: grid; gap: 14px; }
@media (min-width: 860px) { .tv-wrap { max-width: none; width: min(1120px, calc(100vw - 48px)); margin-inline: calc((100% - min(1120px, calc(100vw - 48px))) / 2); } }
.tv-chart { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, rgba(185, 138, 74, .035), transparent 40%), var(--surface); }
.tv-cell { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 230px; padding: 9px 10px 8px; border: 1px solid var(--line); margin: -0.5px; font-size: .76rem; line-height: 1.5; min-width: 0; cursor: pointer; transition: background .25s, opacity .25s, box-shadow .25s; animation: tvIn .45s ease-out backwards; animation-delay: calc(var(--o, 0) * 30ms); }
@keyframes tvIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tv-cell:hover { background: rgba(185, 138, 74, .045); }
.tv-cell.menh { box-shadow: inset 0 0 0 1px var(--accent); }
.tv-cell header { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; }
.tv-can { font-size: .68rem; color: var(--muted); }
.tv-cung { appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: center; font: inherit; font-size: .8rem; letter-spacing: .06em; color: var(--ink); font-weight: 600; min-width: 0; }
.tv-cung:focus-visible { outline: 2px solid var(--accent-lt); outline-offset: 2px; border-radius: 2px; }
.tv-cell.on .tv-cung { color: var(--accent-lt); }
.tv-dh { font-size: .8rem; font-weight: 600; color: var(--accent); }
.tv-main { display: grid; gap: 1px; justify-items: center; text-align: center; font-size: 1rem; }
.tv-main .tv-s { font-weight: 700; letter-spacing: .02em; }
.tv-empty { color: var(--muted); font-size: .76rem; font-style: italic; }
.tv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; flex: 1; }
.tv-cols ul { list-style: none; margin: 0; padding: 0; min-width: 0; }
.tv-cols li { overflow-wrap: anywhere; }
.tv-s small { font-size: .85em; opacity: .85; }
.tv-s.hK { color: #d7dbe4; } .tv-s.hM { color: #7fd98c; } .tv-s.hT { color: #72b9f2; } .tv-s.hH { color: #ff8070; } .tv-s.hO { color: #e8bd52; }
.tv-s.lu { opacity: .72; }
.tv-cell footer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; margin-top: auto; padding-top: 4px; border-top: 1px dashed var(--line); font-size: .72rem; color: var(--muted); }
.tv-cell footer b { color: var(--ink-soft); font-weight: 600; }
.tv-th, .tv-badge { font-style: normal; font-size: .66rem; padding: 0 6px; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent-lt); white-space: nowrap; }
.tv-badge { background: rgba(185, 138, 74, .16); border-color: transparent; }
.tv-mark { position: absolute; right: 8px; top: 31px; font-style: normal; font-size: .62rem; letter-spacing: .08em; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line); background: #000; color: #fff; }
.tv-mark.tuan { border-color: #d6a548; color: #e8c06b; } .tv-mark.triet { border-color: #d9826a; color: #ee9a83; }

/* tam phương tứ chính: cung đang chọn, hai cung tam hợp, cung xung chiếu */
.tv-cell.on { background: rgba(185, 138, 74, .1); box-shadow: inset 0 0 0 2px var(--accent); }
.tv-cell.tam { background: rgba(185, 138, 74, .05); box-shadow: inset 0 0 0 1px var(--accent-dk); }
.tv-cell.xung { background: rgba(114, 185, 242, .05); box-shadow: inset 0 0 0 1px rgba(114, 185, 242, .45); }
@media (min-width: 860px) {
  .tv-chart.focus .tv-cell:not(.on):not(.tam):not(.xung) { opacity: .5; }
  .tv-chart.focus .tv-cell:not(.on):not(.tam):not(.xung):hover { opacity: .85; }
}
.tv-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .3s; }
.tv-links.show { opacity: 1; }
.tv-links polygon { fill: rgba(185, 138, 74, .04); stroke: var(--accent); stroke-width: 1.2; stroke-opacity: .55; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tv-links line { stroke: #72b9f2; stroke-width: 1.2; stroke-opacity: .5; stroke-dasharray: .015 .012; }
.tv-links.show polygon { animation: tvDraw .7s ease-out both; }
@keyframes tvDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.tv-center { position: relative; grid-area: 2 / 2 / 4 / 4; display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border: 1px solid var(--line); margin: -0.5px; background: radial-gradient(70% 70% at 50% 50%, rgba(185, 138, 74, .07), rgba(185, 138, 74, .02) 70%); font-size: .86rem; color: var(--ink-soft); overflow: hidden; }
.tv-center > :not(.tv-orn) { position: relative; z-index: 2; }   /* chữ nằm trên đường tam hợp */
.tv-orn { position: absolute; z-index: 0; left: 50%; top: 50%; width: min(78%, 330px); height: auto; transform: translate(-50%, -50%); fill: none; stroke: var(--accent); stroke-width: .6; opacity: .14; animation: tvTurn 240s linear infinite; }
@keyframes tvTurn { to { transform: translate(-50%, -50%) rotate(360deg); } }
.tv-center h3 { margin: 0 0 4px; text-align: center; font-size: .96rem; letter-spacing: .2em; color: var(--accent-lt); border-bottom: 1px solid var(--accent-dk); padding-bottom: 8px; }
.tv-center dl { display: grid; gap: 3px; margin: 4px 0; }
.tv-center dl div { display: grid; grid-template-columns: 62px 1fr; gap: 6px; }
.tv-center dt { color: var(--muted); }
.tv-center dd { margin: 0; display: flex; justify-content: space-between; gap: 10px; }
.tv-center dd b { color: var(--ink); font-weight: 600; }
.tv-line { margin: 0; } .tv-line b { color: var(--ink); }
.tv-age { margin-left: 8px; }
.tv-focus { margin: 6px 0 0; padding: 7px 10px; border-left: 2px solid var(--accent); background: rgba(10, 8, 6, .55); font-size: .8rem; line-height: 1.5; color: var(--ink-soft); border-radius: 0 4px 4px 0; }
.tv-focus b { color: var(--accent-lt); font-weight: 600; }
.tv-hoa { margin: auto 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: .8rem; padding-top: 8px; border-top: 1px solid var(--line); }
.tv-hoa b { color: var(--accent-lt); font-weight: 600; }
.tv-legend { margin: 0; padding-left: 18px; font-size: .78rem; color: var(--muted); display: grid; gap: 3px; }
.tv-p5 { grid-area: 1 / 1; } .tv-p6 { grid-area: 1 / 2; } .tv-p7 { grid-area: 1 / 3; } .tv-p8 { grid-area: 1 / 4; }
.tv-p4 { grid-area: 2 / 1; } .tv-p9 { grid-area: 2 / 4; } .tv-p3 { grid-area: 3 / 1; } .tv-p10 { grid-area: 3 / 4; }
.tv-p2 { grid-area: 4 / 1; } .tv-p1 { grid-area: 4 / 2; } .tv-p0 { grid-area: 4 / 3; } .tv-p11 { grid-area: 4 / 4; }
@media (max-width: 859px) {
  .tv-chart { display: flex; flex-direction: column; gap: 10px; border: 0; background: transparent; overflow: visible; }
  .tv-cell { order: var(--o); min-height: 0; margin: 0; border-radius: var(--radius); background: var(--surface); border-color: var(--line); }
  .tv-cell.on { background: linear-gradient(rgba(185, 138, 74, .1), rgba(185, 138, 74, .1)), var(--surface); }
  .tv-center { order: -1; margin: 0; border-radius: var(--radius); }
  .tv-cols { grid-template-columns: 1fr 1fr; }
  .tv-hoa { margin-top: 8px; }
  .tv-links { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-cell, .tv-orn, .tv-links.show polygon { animation: none; }
  .tv-cell, .tv-links, .tv-pills span { transition: none; }
}

/* ---------- Điều khoản: tiểu mục trong mục 5 (Thần số, chiêm tinh, Tử Vi, Kinh Dịch) ---------- */
.notes #terms-astro h2 { grid-row: 1 / span 20; }
.notes h3 { grid-column: 2; max-width: 68ch; margin: 16px 0 6px; font-family: var(--f-body); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.notes h3:first-of-type { margin-top: 2px; }
@media (max-width: 860px) { .notes h3 { grid-column: 1; } }

/* ---------- Xem ngày tốt xấu ---------- */
.lv-tot { --lv: #9fd39a; } .lv-kha { --lv: var(--accent-lt); } .lv-binh { --lv: #a9b0bc; } .lv-can { --lv: #e9a774; }
.ng-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 6px; }
@media (max-width: 860px) { .ng-top { grid-template-columns: 1fr; } }

/* tờ lịch */
.ng-sheet { position: relative; padding: 28px 22px 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, rgba(185, 138, 74, .13), transparent 62%), var(--surface);
  box-shadow: 0 22px 46px -30px rgba(0, 0, 0, .9); animation: fadeIn .4s ease-out both; }
.ng-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--lv); opacity: .9; }
.ng-rings { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: min(42%, 220px); pointer-events: none; }
.ng-rings i { width: 11px; height: 11px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px rgba(236, 228, 214, .18); }
.ng-bar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
.ng-bar h2 { margin: 0; text-align: center; font-family: var(--f-body); font-size: .9rem; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.ng-bar h2 span { display: block; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--lv); font-weight: 600; }
.ng-step, .ng-mstep { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; transition: border-color .2s, background .2s; }
.ng-step:hover, .ng-mstep:hover { border-color: var(--accent); background: rgba(185, 138, 74, .1); }
.ng-step:focus-visible, .ng-mstep:focus-visible { outline: 2px solid var(--accent-lt); outline-offset: 2px; }
.ng-face { display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin: 14px 0 6px; }
.ng-solar { display: grid; justify-items: center; padding-right: 10px; border-right: 1px dashed var(--line); }
.ng-solar b { font-family: var(--f-display); font-weight: 600; font-size: clamp(4.6rem, 12vw, 6.6rem); line-height: .95; color: var(--lv); text-shadow: 0 0 28px rgba(185, 138, 74, .25); font-variant-numeric: lining-nums; }
.ng-solar span { font-size: .78rem; color: var(--muted); letter-spacing: .06em; }
.ng-lunar { display: grid; justify-items: center; gap: 1px; text-align: center; padding-left: 10px; color: var(--ink-soft); font-size: .82rem; }
.ng-lunar small { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.ng-lunar b { font-family: var(--f-display); font-weight: 600; font-size: 2.9rem; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums; }
.ng-moon { width: 22px; height: 22px; border-radius: 50%; margin-bottom: 4px; background: radial-gradient(circle at 36% 34%, #f6e6c4, #cfa865 62%, #8a6431); box-shadow: 0 0 14px rgba(216, 178, 119, .45); }
.ng-cc { margin: 8px 0 12px; text-align: center; font-size: .86rem; color: var(--muted); }
.ng-cc b { color: var(--ink); font-weight: 600; }
.ng-level { padding: 12px 14px; border-left: 3px solid var(--lv); background: rgba(255, 255, 255, .025); border-radius: 0 6px 6px 0; }
.ng-level b { display: block; font-family: var(--f-display); font-size: 1.45rem; font-weight: 600; color: var(--lv); line-height: 1.2; }
.ng-level p { margin: 4px 0 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.55; }
.ng-why { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ng-why li, .ng-rels li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; border: 1px solid var(--line); color: var(--ink-soft); }
.ng-why li::before, .ng-rels li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.ng-why li.up::before, .ng-rels li.up::before { background: #9fd39a; } .ng-why li.down::before, .ng-rels li.down::before { background: #e9a774; }
.ng-why li.up, .ng-rels li.up { border-color: rgba(159, 211, 154, .35); } .ng-why li.down, .ng-rels li.down { border-color: rgba(233, 167, 116, .35); }
.ng-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ng-pick { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin-left: auto; }
.ng-pick input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255, 255, 255, .03); color: var(--ink); font: inherit; color-scheme: dark; }

/* theo tuổi */
.ng-me { padding: 18px 18px 14px; border-radius: 14px; animation: fadeIn .45s ease-out both; animation-delay: .06s; }
.ng-me h2 { margin: 0 0 6px; font-size: 1.15rem; }
.ng-tuoi { margin: 0 0 10px; color: var(--muted); font-size: .86rem; } .ng-tuoi b { color: var(--ink); }
.ng-plevel { --pc: #a9b0bc; padding: 10px 12px; border-left: 3px solid var(--pc); background: rgba(255, 255, 255, .025); border-radius: 0 6px 6px 0; }
.ng-p-hop .ng-plevel { --pc: #9fd39a; } .ng-p-nhe .ng-plevel { --pc: #e6c48a; } .ng-p-xung .ng-plevel { --pc: #e9a774; } .ng-p-khac .ng-plevel { --pc: #ef9278; }
.ng-plevel b { display: block; font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; color: var(--pc); }
.ng-plevel p { margin: 4px 0 0; font-size: .86rem; line-height: 1.55; color: var(--ink-soft); }
.ng-rels { list-style: none; margin: 10px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ng-age { display: grid; gap: 10px; margin-top: 8px; }
.ng-age #ngYear { max-width: 160px; }
.ng-chk { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-soft); cursor: pointer; }
.ng-age .btn { justify-self: start; }

/* các thẻ */
.ng-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; margin: 18px 0; }
.ng-card { position: relative; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); animation: fadeIn .45s ease-out both; }
.ng-grid .ng-card:nth-child(2) { animation-delay: .04s; } .ng-grid .ng-card:nth-child(3) { animation-delay: .08s; } .ng-grid .ng-card:nth-child(4) { animation-delay: .12s; }
.ng-grid .ng-card:nth-child(5) { animation-delay: .16s; } .ng-grid .ng-card:nth-child(6) { animation-delay: .2s; } .ng-grid .ng-card:nth-child(7) { animation-delay: .24s; }
.ng-card h3 { margin: 0 0 8px; font-family: var(--f-body); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-lt); display: flex; align-items: center; gap: 8px; }
.ng-card.good h3::before, .ng-card.bad h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ng-card.good h3::before { background: #9fd39a; box-shadow: 0 0 8px rgba(159, 211, 154, .6); } .ng-card.bad h3::before { background: #e9a774; }
.ng-card p { margin: 0 0 6px; font-size: .88rem; line-height: 1.6; color: var(--ink-soft); }
.ng-card p b { color: var(--ink); font-weight: 600; }
.ng-card p.ng-note { font-size: .78rem; color: var(--muted); }
.ng-hours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ng-hours li { display: grid; justify-items: center; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(185, 138, 74, .05); }
.ng-hours b { font-size: .92rem; color: var(--ink); font-weight: 600; } .ng-hours span { font-size: .68rem; color: var(--muted); }
.ng-hours li.now { border-color: var(--accent); background: rgba(185, 138, 74, .16); box-shadow: 0 0 12px rgba(185, 138, 74, .25); }

/* lịch tháng */
.ng-cal { padding: 16px; border-radius: 14px; }
.ng-calbar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin-bottom: 10px; }
.ng-calbar h2 { margin: 0; text-align: center; font-size: 1.15rem; }
.ng-week, .ng-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ng-week span { text-align: center; font-size: .7rem; letter-spacing: .12em; color: var(--muted); padding: 2px 0 4px; }
.ng-c { position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 58px; padding: 6px 2px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .015); color: var(--ink); cursor: pointer; font: inherit; transition: border-color .2s, background .2s; }
.ng-c.blank { border: 0; background: none; cursor: default; }
.ng-c:not(.blank):hover { border-color: var(--accent-dk); background: rgba(185, 138, 74, .07); }
.ng-c:focus-visible { outline: 2px solid var(--accent-lt); outline-offset: 1px; }
.ng-c b { font-size: 1rem; font-weight: 600; font-variant-numeric: lining-nums; }
.ng-c small { font-size: .66rem; color: var(--muted); }
.ng-c i { position: absolute; bottom: 5px; width: 18px; height: 3px; border-radius: 2px; background: var(--lv); opacity: .9; }
.ng-c.hd::before { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--accent-lt); }
.ng-c.xung::after, .ng-c.hop::after { content: ""; position: absolute; top: 0; left: 0; border-top: 9px solid #ef9278; border-right: 9px solid transparent; border-top-left-radius: 7px; }
.ng-c.hop::after { border-top-color: #9fd39a; }
.ng-c.today { border-color: var(--accent-dk); border-style: dashed; }
.ng-c.sel { border: 1px solid var(--accent); background: rgba(185, 138, 74, .16); box-shadow: 0 0 0 1px var(--accent) inset; }
.ng-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .74rem; color: var(--muted); }
.ng-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ng-legend i { width: 16px; height: 3px; border-radius: 2px; background: var(--lv); }
.ng-legend i.hd { width: 7px; height: 7px; border-radius: 50%; background: none; border: 1.5px solid var(--accent-lt); }
.ng-legend i.xung { width: 0; height: 0; border-radius: 0; background: none; border-top: 9px solid #ef9278; border-right: 9px solid transparent; }
.ng-legend i.hop { width: 0; height: 0; border-radius: 0; background: none; border-top: 9px solid #9fd39a; border-right: 9px solid transparent; }
.ng-how { margin-top: 16px; }
.ng-how ul { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; font-size: .84rem; color: var(--ink-soft); }
@media (max-width: 520px) {
  .ng-sheet { padding: 26px 14px 14px; }
  .ng-c { min-height: 50px; padding: 5px 0 9px; }
  .ng-week, .ng-days { gap: 4px; }
  .ng-hours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ng-pick { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) { .ng-sheet, .ng-me, .ng-card { animation: none; } .ng-c, .ng-step, .ng-mstep { transition: none; } }
