/*
Theme Name: Lich Hanh Thong
Theme URI: #
Author: Kincarot
Author URI: #
Description: Theme WordPress mot trang cho lich van nien, ngay tot xau va tra cuu ngay lanh
Version: 2.0.1
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lich-hanh-thong
Tags: custom-background, custom-logo, custom-menu, one-column, featured-images
*/

:root {
  --ink: #1d1715;
  --muted: #766560;
  --paper: #fff8ed;
  --surface: #ffffff;
  --line: rgba(96, 32, 24, 0.14);
  --gold: #e2b63d;
  --gold-soft: #f6df9a;
  --good-green: #198754;
  --good-green-soft: #eaf7ef;
  --jade: #8f1f18;
  --vermillion: #a1281d;
  --night: #63100c;
  --red-deep: #760f0c;
  --red-warm: #b23a24;
  --sky: #fff4e3;
  --shadow: 0 22px 60px rgba(96, 16, 12, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(226, 182, 61, 0.2), transparent 32rem),
    linear-gradient(135deg, #fffaf0 0%, #fff8ed 52%, #fff2df 100%);
  font-family: "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(118, 15, 12, 0.1);
  background: rgba(255, 252, 246, 0.9);
  backdrop-filter: blur(18px);
}

.top-ribbon {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: #fff4df;
  background: var(--red-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
}

.brand-logo img {
  display: block;
  width: 206px;
  max-width: 52vw;
  height: auto;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: conic-gradient(from 120deg, var(--gold), var(--vermillion), var(--red-deep), var(--gold));
  border-radius: 50%;
  box-shadow: 0 12px 26px rgba(185, 75, 58, 0.24);
}

.brand-mark svg,
.button svg,
.tool-icon svg,
.nav-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.brand-text {
  display: grid;
  line-height: 1.05;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 10px 12px;
  color: #3b4652;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 650;
}

.site-nav a:hover {
  color: var(--vermillion);
  background: rgba(161, 40, 29, 0.08);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.hero {
  position: relative;
  padding: clamp(54px, 7vw, 80px) 0 clamp(88px, 10vw, 112px);
  color: #fff;
  background:
    linear-gradient(105deg, rgba(118, 15, 12, 0.98), rgba(139, 28, 17, 0.98) 50%, rgba(178, 58, 36, 0.95)),
    repeating-linear-gradient(150deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 42px);
}

.hero::before {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(30deg, rgba(255, 255, 255, 0.055) 12%, transparent 12% 88%, rgba(255, 255, 255, 0.055) 88%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.055) 12%, transparent 12% 88%, rgba(255, 255, 255, 0.055) 88%);
  background-size: 138px 70px;
  mask-image: linear-gradient(#000, rgba(0, 0, 0, 0.2));
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(340px, 0.84fr);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.hero-content {
  max-width: 670px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  padding: 8px 12px;
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--gold);
  border-radius: 50%;
}

.hero h1 {
  max-width: 620px;
  margin: 20px 0 18px;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(2.15rem, 3.55vw, 3.5rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  color: #2a1710;
  background: var(--gold);
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: 0 14px 28px rgba(82, 13, 9, 0.24);
  cursor: pointer;
  font-weight: 780;
}

.button.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.button:hover {
  transform: translateY(-1px);
}

.hero-card {
  position: relative;
  width: min(100%, 520px);
  justify-self: end;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 88% 14%, rgba(246, 223, 154, 0.25), transparent 13rem);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card::before {
  position: absolute;
  inset: -18px -18px auto auto;
  width: 118px;
  height: 118px;
  pointer-events: none;
  content: "";
  background: conic-gradient(from 18deg, rgba(226, 182, 61, 0), rgba(226, 182, 61, 0.42), rgba(161, 40, 29, 0));
  border-radius: 50%;
  filter: blur(1px);
}

.hero-card-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card-header strong {
  color: var(--gold-soft);
  letter-spacing: 0;
  text-transform: none;
}

.today-panel {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 18%, rgba(246, 223, 154, 0.3), transparent 12rem),
    linear-gradient(135deg, rgba(126, 36, 24, 0.72), rgba(172, 75, 48, 0.78)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 16px);
}

.today-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 24px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.today-kicker,
.small-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.today-date {
  margin-top: 6px;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(2rem, 4.4vw, 3.7rem);
  line-height: 1.1;
  max-width: 360px;
}

.today-score {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--gold-soft);
  border-radius: 50%;
  text-align: center;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.22);
}

.today-score strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
}

.today-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.today-item {
  min-height: 104px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.today-item strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.moon {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 96px;
  height: 96px;
  background: #f8df9b;
  border-radius: 50%;
  box-shadow: -18px 8px 0 rgba(248, 223, 155, 0.18);
  opacity: 0.92;
}

.utility-dock {
  position: relative;
  z-index: 5;
	background-color: rgba(255, 255, 255, 0.44);
}

.utility-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(118, 15, 12, 0.13);
  box-shadow: 0 22px 54px rgba(96, 16, 12, 0.14);
	position: relative;
	top: -36px;
}

.utility-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 18px;
  border-right: 1px solid rgba(118, 15, 12, 0.1);
}

.utility-item:last-child {
  border-right: 0;
}

.utility-item:hover {
  background: #fff8ed;
}

.utility-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--vermillion);
  background: #f8eedf;
  border-radius: 50%;
}

.utility-icon svg {
  width: 20px;
  height: 20px;
}

.utility-item strong,
.utility-item small {
  display: block;
}

.utility-item strong {
  color: var(--ink);
  font-weight: 850;
}

.utility-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.section {
  padding: 66px 0;
}

.section.alt {
  background: rgba(255, 255, 255, 0.44);
	padding-top: 30px;
/*   border-block: 1px solid rgba(24, 32, 39, 0.07); */
}

.section-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-heading h2 {
  max-width: 680px;
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.section-heading p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

.section-heading.compact h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.8rem);
}

.lookup-grid {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 20px;
  align-items: stretch;
}

.lookup-form,
.result-panel,
.calendar-panel,
.feature-card,
.ritual-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(24, 32, 39, 0.1);
  box-shadow: 0 16px 40px rgba(24, 32, 39, 0.08);
}

.lookup-form {
  padding: 22px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #3d4853;
  font-weight: 760;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: rgba(24, 32, 39, 0.06);
}

.segmented button {
  min-height: 42px;
  color: #45515d;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 760;
}

.segmented button.is-active {
  color: #fff;
  background: var(--vermillion);
  box-shadow: 0 8px 18px rgba(161, 40, 29, 0.2);
}

.result-panel {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  min-height: 100%;
  overflow: hidden;
  outline: none;
  transition: box-shadow 0.24s ease, transform 0.24s ease;
}

.result-panel.is-updated {
  box-shadow: 0 20px 54px rgba(161, 40, 29, 0.2);
  transform: translateY(-2px);
}

.result-grade {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.28), transparent 44%),
    linear-gradient(160deg, var(--red-deep), var(--red-warm));
  text-align: center;
}

.grade-ring {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  background: conic-gradient(#fff 0deg, rgba(255, 255, 255, 0.22) 0);
  border-radius: 50%;
}

.grade-ring span {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  color: var(--ink);
  background: #fff8e8;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 900;
}

.result-grade h3 {
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 2rem;
}

.result-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.result-details {
  padding: 24px;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: rgba(161, 40, 29, 0.06);
  border: 1px solid rgba(161, 40, 29, 0.1);
}

.tool-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--vermillion);
  background: #fff;
  border-radius: 50%;
}

.detail-list strong {
  display: block;
  margin-bottom: 2px;
}

.detail-list span {
  color: var(--muted);
}

.calendar-panel {
  padding: 20px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
}

.icon-button:hover {
  color: #fff;
  background: var(--vermillion);
  border-color: var(--vermillion);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.calendar-title {
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
  line-height: 1;
}

.calendar-heading {
  text-align: center;
}

.calendar-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--muted);
  background: #fffaf2;
  border: 1px solid rgba(96, 32, 24, 0.1);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.legend-dot.good {
  background: var(--good-green);
}

.legend-dot.caution {
  background: var(--vermillion);
}

.legend-dot.today {
  background: var(--gold);
}

.legend-dot.muted {
  background: #c8b7aa;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.weekday-row {
  margin-bottom: 10px;
  color: #8a3329;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.weekday-row span {
  padding: 8px 4px;
  background: rgba(161, 40, 29, 0.06);
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-items: start;
  min-height: 104px;
  padding: 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(96, 32, 24, 0.12);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.day-cell:hover {
  border-color: rgba(161, 40, 29, 0.28);
  box-shadow: 0 14px 26px rgba(96, 16, 12, 0.1);
  transform: translateY(-1px);
}

.day-cell.is-muted {
  color: #a99a91;
  background: rgba(255, 255, 255, 0.58);
  opacity: 0.72;
}

.day-cell.is-good {
  background: linear-gradient(180deg, #fff, var(--good-green-soft));
  border-color: rgba(25, 135, 84, 0.34);
  box-shadow: inset 0 0 0 1px rgba(25, 135, 84, 0.12);
}

.day-cell.is-caution {
  background: linear-gradient(180deg, #fff, #fff2f0);
  border-color: rgba(185, 75, 58, 0.26);
}

.day-cell.is-today {
  border-color: rgba(226, 182, 61, 0.72);
  box-shadow: inset 0 0 0 2px rgba(226, 182, 61, 0.34), 0 14px 30px rgba(226, 182, 61, 0.14);
}

.day-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--ink);
  background: #fff8ed;
  border-radius: 50%;
  font-weight: 900;
}

.day-score {
  color: rgba(29, 23, 21, 0.56);
  font-size: 0.75rem;
  font-weight: 900;
}

.lunar-note {
  display: block;
  margin-top: 8px;
  color: #7d3a30;
  font-size: 0.78rem;
  font-weight: 850;
}

.can-chi-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.day-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: #fff;
  background: var(--vermillion);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
}

.is-good .day-pill {
  background: var(--good-green);
}

.is-caution .day-pill {
  background: var(--vermillion);
}

.today-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: #4c2b00;
  background: var(--gold-soft);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.feature-card {
  padding: 22px;
}

.feature-card .tool-icon {
  margin-bottom: 18px;
  color: #fff;
  background: var(--night);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.tools-section {
  padding-top: 58px;
}

.tools-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(360px, 0.95fr);
  grid-template-areas:
    "converter ages"
    "converter stars"
    "converter direction";
  align-items: stretch;
  gap: 16px;
}

.tool-card {
  min-height: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid rgba(118, 15, 12, 0.12);
  box-shadow: 0 14px 34px rgba(96, 16, 12, 0.08);
}

.converter-card {
  grid-area: converter;
  display: block;
  min-height: 430px;
  padding: 26px;
}

.tools-grid .tool-card:nth-child(2) {
  grid-area: ages;
}

.tools-grid .tool-card:nth-child(3) {
  grid-area: stars;
}

.tools-grid .tool-card:nth-child(4) {
  grid-area: direction;
}

.tools-grid .tool-card:not(.converter-card) {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "icon title"
    "icon copy"
    "icon result";
  column-gap: 14px;
  row-gap: 4px;
  align-content: center;
  min-height: 132px;
}

.tool-card .tool-icon {
  margin-bottom: 0;
  color: var(--vermillion);
  background: #fff3de;
}

.tool-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.tool-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.94rem;
}

.tools-grid .tool-card:not(.converter-card) .tool-icon {
  grid-area: icon;
}

.tools-grid .tool-card:not(.converter-card) h3 {
  grid-area: title;
}

.tools-grid .tool-card:not(.converter-card) p {
  grid-area: copy;
}

.converter-card .tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 16px;
}

.converter-card h3 {
  font-size: 1.24rem;
}

.converter-card p {
  max-width: 620px;
}

.converter-card .mini-action {
  margin-top: 2px;
}

.mini-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.mini-form input,
.mini-form button,
.converter-fields input,
.converter-fields select,
.mini-action {
  min-height: 42px;
}

.mini-form input,
.converter-fields input,
.converter-fields select {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.mini-form button,
.mini-action {
  width: max-content;
  min-width: 118px;
  min-height: 48px;
  padding: 8px 12px;
  color: #fff;
  background: var(--vermillion);
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.converter-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  margin-top: 18px;
  margin-bottom: 14px;
  background: rgba(96, 32, 24, 0.07);
}

.converter-tabs button {
  min-height: 46px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.converter-tabs button.is-active {
  color: #fff;
  background: var(--vermillion);
}

.converter-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.lunar-leap-toggle {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.tool-result {
  display: block;
  margin-top: 8px;
  min-height: 0;
  color: var(--vermillion);
  line-height: 1.45;
}

.tools-grid .tool-card:not(.converter-card) .tool-result {
  grid-area: result;
}

.converter-card .tool-result {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fff7ea;
  border: 1px solid rgba(161, 40, 29, 0.12);
  font-size: 1.04rem;
}

.page-hero {
  padding: 70px 0 46px;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(118, 15, 12, 0.98), rgba(139, 28, 17, 0.98) 50%, rgba(178, 58, 36, 0.95)),
    repeating-linear-gradient(150deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 42px);
}

.page-hero h1 {
  max-width: 720px;
  margin: 18px 0;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 1.25;
}

.page-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
}

.calendar-page-section {
  padding-top: 34px;
}

.calendar-panel-large {
  padding: clamp(18px, 2.4vw, 30px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 252, 246, 0.9)),
    radial-gradient(circle at 100% 0%, rgba(226, 182, 61, 0.14), transparent 18rem);
  border-color: rgba(96, 32, 24, 0.12);
}

.calendar-grid-large .day-cell {
  min-height: 132px;
}

.ritual-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.ritual-copy {
  padding: 34px;
}

.ritual-copy h2 {
  margin: 0 0 14px;
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.8rem, 2.7vw, 2.6rem);
  line-height: 1.2;
}

.ritual-copy p {
  margin: 0 0 20px;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline time {
  color: var(--vermillion);
  font-weight: 900;
}

.ritual-art {
  position: relative;
  min-height: 430px;
  background:
    linear-gradient(135deg, rgba(118, 15, 12, 0.88), rgba(178, 58, 36, 0.66)),
    url("assets/pattern.svg");
  background-size: cover;
}

.compass {
  position: absolute;
  inset: 50%;
  width: min(72%, 330px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.compass::before,
.compass::after {
  position: absolute;
  inset: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.48);
  transform: translate(-50%, -50%);
}

.compass::before {
  width: 1px;
  height: 112%;
}

.compass::after {
  width: 112%;
  height: 1px;
}

.compass span {
  position: absolute;
  inset: 28%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 3.2rem;
}

.site-footer {
  padding: 46px 0 0;
  color: rgba(255, 255, 255, 0.78);
  background: var(--night);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  gap: 34px;
}

.footer-inner strong {
  color: #fff;
}

.footer-logo {
  display: block;
  width: 214px;
  max-width: 100%;
  height: auto;
  padding: 8px 10px;
  background: #fff8ed;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-brand p,
.footer-note p {
  margin: 10px 0 0;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links h2,
.footer-note h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
}

.footer-links a:hover {
  color: var(--gold-soft);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
}

@media (max-width: 920px) {
  .site-nav {
    position: fixed;
    inset: 106px 16px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: grid;
  }

  .hero-inner,
  .lookup-grid,
  .result-panel,
  .ritual-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 46px 0 80px;
  }

  .hero-card {
    justify-self: stretch;
    width: 100%;
  }

  .hero h1 {
    max-width: 760px;
  }

  .utility-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "converter"
      "ages"
      "stars"
      "direction";
  }

  .converter-card {
    min-height: 0;
  }

  .utility-item {
    border-bottom: 1px solid rgba(118, 15, 12, 0.1);
  }

  .hero-content {
    max-width: none;
  }

  .section-heading {
    display: grid;
  }

}

@media (max-width: 640px) {
  .header-inner,
  .hero-inner,
  .section-inner,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding: 34px 0 66px;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.95rem);
    line-height: 1.08;
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .hero-actions .button {
    width: 100%;
  }

  .utility-inner {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tools-grid .tool-card:not(.converter-card) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "icon"
      "title"
      "copy"
      "result";
  }

  .converter-card {
    padding: 20px;
  }

  .converter-tabs {
    grid-template-columns: 1fr;
  }

  .mini-form {
    grid-template-columns: 1fr;
  }

  .today-top,
  .today-body {
    grid-template-columns: 1fr;
  }

  .today-body {
    display: grid;
  }

  .today-score {
    width: 76px;
    height: 76px;
  }

  .weekday-row,
  .calendar-grid {
    gap: 5px;
  }

  .day-cell {
    min-height: 86px;
    padding: 7px;
  }

  .calendar-panel {
    padding: 12px;
  }

  .calendar-toolbar {
    gap: 8px;
  }

  .calendar-heading p,
  .calendar-legend {
    display: none;
  }

  .calendar-title {
    font-size: 1.2rem;
  }

  .day-number {
    width: 28px;
    height: 28px;
  }

  .day-score,
  .can-chi-note {
    display: none;
  }

  .day-pill {
    right: 5px;
    bottom: 5px;
    max-width: calc(100% - 10px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lunar-note {
    font-size: 0.68rem;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    display: grid;
  }

  .converter-fields {
    grid-template-columns: 1fr;
  }
	.tools-section{
		padding-bottom: 30px;
	}
}
