/* Màu, chữ và form dùng chung cho mọi trang của Lá Số Tử Vi */
:root {
  --paper: #F4F3F8; --cell: #FFFFFF; --mid: #ECE8F4; --ink: #221C33; --soft: #6B6480; --line: #D3CDE0;
  --tu: #6A2C91; --hl: #F1E9F8; --tag: #221C33; --tag-fg: #FFFFFF;
  --kim: #6F757E; --moc: #2E7A39; --thuy: #1D4F91; --hoa: #BF3328; --tho: #9C6410;
  --f-display: 'Literata', Georgia, 'Times New Roman', serif;
  --f-ui: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14121B; --cell: #1B1825; --mid: #221E30; --ink: #ECE8F5; --soft: #A39BB8; --line: #363049;
    --tu: #C9A2EC; --hl: #2A2240; --tag: #ECE8F5; --tag-fg: #14121B;
    --kim: #B4BAC3; --moc: #74C47F; --thuy: #86ACE8; --hoa: #F27F72; --tho: #E2A64C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14121B; --cell: #1B1825; --mid: #221E30; --ink: #ECE8F5; --soft: #A39BB8; --line: #363049;
  --tu: #C9A2EC; --hl: #2A2240; --tag: #ECE8F5; --tag-fg: #14121B;
  --kim: #B4BAC3; --moc: #74C47F; --thuy: #86ACE8; --hoa: #F27F72; --tho: #E2A64C;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 56px;
}
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--tu); margin: 0; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 4.4vw, 42px); line-height: 1.1; margin: 4px 0 6px; text-wrap: balance; }
.lede { margin: 0; color: var(--soft); max-width: 62ch; font-size: 15px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span, .f > legend { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); padding: 0; }
fieldset.f { border: 0; margin: 0; padding: 0; }
input[type="text"], input[type="number"], input[type="password"], select {
  height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
  font: 500 15px var(--f-ui); padding: 0 10px; width: 100%; font-variant-numeric: tabular-nums;
}
input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, .seg input:focus-visible + span { outline: 2px solid var(--tu); outline-offset: 1px; }
.date { display: flex; gap: 6px; align-items: center; }
.date input { width: 52px; text-align: center; padding: 0 4px; }
.date input.y { width: 72px; }
.date i { color: var(--soft); font-style: normal; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; height: 40px; }
.seg label { display: flex; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; padding: 0 14px; font-weight: 500; font-size: 14px; color: var(--soft); }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.nhuan { display: flex; align-items: center; gap: 6px; height: 40px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.nhuan input { width: 16px; height: 16px; accent-color: var(--tu); }
button.go { height: 40px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--tu); color: var(--cell); font: 600 15px var(--f-ui); cursor: pointer; }
button.go:hover { filter: brightness(1.08); }
.err { color: var(--hoa); font-weight: 500; margin: -8px 0 0; }

/* Khung chung: tiêu đề site, menu, chân trang */
body { margin: 0; }
[hidden] { display: none !important; }
a:focus-visible { outline: 2px solid var(--tu); outline-offset: 2px; border-radius: 4px; }
.site { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.brand svg { width: 22px; height: 22px; color: var(--tu); flex: none; }
.site nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site nav a { color: var(--soft); text-decoration: none; font-weight: 500; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.site nav a:hover { color: var(--ink); background: var(--hl); }
.site nav a[aria-current="page"] { color: var(--ink); background: var(--hl); font-weight: 600; }
.foot { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 12px; color: var(--soft); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.K { color: var(--kim); } .M { color: var(--moc); } .T { color: var(--thuy); } .H { color: var(--hoa); } .O { color: var(--tho); }
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; }
a.btn.primary { background: var(--tu); color: var(--cell); }
a.btn.ghost { border: 1px solid var(--line); color: var(--ink); background: var(--cell); }
a.btn:hover { filter: brightness(1.08); }
