:root {
  --ink: #242c29;
  --sub: #59645f;
  --muted: #68716b;
  --paper: #f8f8f4;
  --card: #fffefa;
  --line: #dddfd6;
  --quiet: #f4f4ed;
  --red: #a33d2b;
  --deep: #83301f;
  --redwash: #f7e9e2;
  --serif: "STIX Two Text", Georgia, "Times New Roman", serif;
  --sans:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --wood: #47745a;
  --fire: #ac4838;
  --earth: #906b36;
  --metal: #73767a;
  --water: #416e83;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 300px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
a {
  color: var(--deep);
}
[hidden] {
  display: none !important;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.12;
}
button {
  color: inherit;
}
button,
.brand,
a {
  text-decoration: none;
}
button {
  border: 0;
}
svg.ico {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-block;
  flex: none;
  vertical-align: middle;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: #fff;
  padding: 0.7rem;
  z-index: 20;
}
.skip:focus {
  top: 0.3rem;
}
.topbar {
  background: #fffefa;
  border-bottom: 1px solid var(--line);
}
.bar-inner,
.shell,
.site-foot {
  width: min(100% - 80px, 1336px);
  margin: auto;
}
.bar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: clamp(34px, 6vw, 90px);
}
.brand,
.help-nav,
.mainnav a,
.title-icon,
.actions,
.soft-btn,
.primary,
.place-input,
.sex-controls label,
.compare-actions,
.mode,
.card-header,
.section-topline,
.chart-meta {
  display: flex;
  align-items: center;
}
.brand {
  gap: 12px;
  color: var(--ink);
  font: 600 1.52rem var(--serif);
  white-space: nowrap;
  letter-spacing: -0.055rem;
}
.seal {
  display: grid;
  align-content: center;
  width: 36px;
  height: 40px;
  border-radius: 6px 5px 6px 3px;
  background: #a1402c;
  color: #fff5e4;
  text-align: center;
  font:
    600 16px/0.92 "Songti SC",
    "STSong",
    serif;
  letter-spacing: 0;
  outline: 1px solid #e5b3a1;
  outline-offset: -4px;
}
.mainnav {
  align-self: stretch;
  display: flex;
  gap: 30px;
}
.mainnav a {
  position: relative;
  color: var(--sub);
  font-weight: 520;
  font-size: 0.9rem;
  white-space: nowrap;
}
.mainnav a:hover,
.help-nav:hover {
  color: var(--red);
}
.mainnav a[aria-current="page"] {
  color: var(--red);
}
.mainnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--red);
}
.help-nav {
  margin-left: auto;
  gap: 8px;
  color: var(--sub);
  font-size: 0.9rem;
}
.help-nav[aria-current] {
  color: var(--red);
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 26px 0 24px;
  min-height: 202px;
  border: 1px solid #e2ded1;
  border-radius: 12px;
  background: #f4efe2;
  display: flex;
  align-items: center;
}
.hero-art,
.hero-fade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-art {
  width: 67%;
  left: auto;
  object-fit: cover;
  object-position: 64% 49%;
  mix-blend-mode: multiply;
}
.hero-fade {
  background: linear-gradient(
    90deg,
    #f4efe2 26%,
    rgba(244, 239, 226, 0.93) 36%,
    rgba(244, 239, 226, 0.36) 54%,
    transparent 67%
  );
}
.hero-copy {
  padding: 28px 40px 31px;
  max-width: 60%;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-weight: 650;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: #884430;
}
.eyebrow i {
  width: 24px;
  height: 1.5px;
  background: #a14b35;
}
h1 {
  font: 500 clamp(2.7rem, 4.45vw, 4.35rem)/1.03 var(--serif);
  letter-spacing: -0.048em;
  margin: 10px 0 8px;
  color: #262d27;
}
.hero p {
  font-size: 1rem;
  line-height: 1.5;
  color: #4d564d;
  max-width: 38rem;
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(295px, 0.82fr) minmax(0, 1.72fr);
  gap: 22px;
  align-items: start;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 6px #3f483a05;
  min-width: 0;
}
.card-header {
  padding: 20px 24px;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.title-icon {
  gap: 12px;
  min-width: 0;
}
.icon-box {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: #526b59;
  background: #eaf0e7;
  border: 1px solid #e1e8dc;
  border-radius: 8px;
}
.icon-box.warm {
  color: var(--red);
  background: #f6ebe3;
  border-color: #f1e4d9;
}
h2 {
  font: 550 1.62rem/1.14 var(--serif);
  letter-spacing: -0.045em;
}
h3 {
  font: 550 1.26rem/1.22 var(--serif);
  letter-spacing: -0.022em;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--quiet);
  color: var(--ink);
}
.icon-btn .ico {
  width: 1.08rem;
  height: 1.08rem;
}
.form-body,
.search-body {
  padding: 21px 24px 23px;
  display: grid;
  gap: 17px;
}
.field {
  display: block;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 570;
  line-height: 1.38;
}
.field > input,
.field > select,
.field > label > select,
.field > .place-input {
  margin-top: 7px;
}
input:not([type="checkbox"]):not([type="radio"]),
select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  max-width: 100%;
  border: 1px solid #cdd2c8;
  border-radius: 6px;
  background-color: #fffefa;
  color: var(--ink);
  padding: 9px 11px;
  font-size: 0.93rem;
  line-height: 1.35;
  font-weight: 420;
}
input::placeholder {
  color: #818981;
  opacity: 1;
}
input:disabled {
  background: #eeefe9 !important;
  color: #868b84 !important;
}
input:focus,
select:focus {
  border-color: var(--red) !important;
}
input[type="date"],
input[type="time"] {
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%23606c62' stroke-width='1.6'/%3E%3C/svg%3E");
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 32px;
}
.optional {
  font-size: 0.735rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.birth-time {
  grid-template-columns: 1.3fr 0.9fr;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 450;
  line-height: 1.4;
  cursor: pointer;
}
.check input {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
  accent-color: var(--red);
}
.unknown {
  margin-top: -8px;
  color: var(--sub);
}
.city {
  position: relative;
}
.place-input {
  position: relative;
}
.place-input > .ico {
  position: absolute;
  left: 11px;
  color: #747f75;
  width: 17px;
  height: 17px;
  pointer-events: none;
}
.place-input input {
  padding-left: 36px !important;
}
.city-note {
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 450;
}
.city-note:not(:empty) {
  padding-top: 5px;
}
.city-list {
  position: absolute;
  top: 68px;
  width: 100%;
  left: 0;
  z-index: 12;
  padding: 4px;
  background: #fff;
  border: 1px solid #ced3c8;
  border-radius: 8px;
  box-shadow: 0 10px 30px #1d332522;
  max-height: 260px;
  overflow: auto;
}
.city-list button {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  padding: 9px 10px;
  border-radius: 4px;
}
.city-list button:hover,
.city-list [aria-selected="true"] {
  background: var(--quiet);
}
.city-list small,
.data-table small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}
.suggest-status {
  padding: 10px;
  color: var(--sub);
  font-size: 0.85rem;
}
fieldset.sex {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.sex legend {
  padding: 0;
  margin-bottom: 7px;
  font-size: 0.875rem;
  font-weight: 570;
}
.sex-controls {
  display: flex;
  gap: 8px;
}
.sex-controls label {
  flex: 1;
  justify-content: center;
  gap: 7px;
  position: relative;
  min-height: 41px;
  border: 1px solid #cdd2c8;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--sub);
  cursor: pointer;
}
.sex-controls input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.sex-controls label:has(input:checked) {
  background: var(--redwash);
  border-color: #b9745e;
  color: var(--deep);
  font-weight: 600;
}
.sex-controls label:focus-within {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.calc-settings {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.calc-settings summary,
.result-section summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.calc-settings summary::-webkit-details-marker,
.result-section summary::-webkit-details-marker {
  display: none;
}
.calc-settings summary {
  gap: 9px;
  min-height: 25px;
  font-weight: 550;
  color: var(--sub);
  font-size: 0.875rem;
}
.calc-settings summary .ico:last-child,
.result-section summary > .ico {
  margin-left: auto;
  width: 0.96rem;
  transition: transform 0.15s;
}
.calc-settings[open] > summary .ico:last-child,
.result-section[open] > summary > .ico {
  transform: rotate(180deg);
}
.settings-body,
.manual-fields {
  display: grid;
  gap: 12px;
}
.settings-body {
  margin-top: 14px;
}
.primary,
.soft-btn {
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.91rem;
}
.primary {
  background: var(--red);
  color: white;
  border: 1px solid var(--red);
}
.primary:hover {
  background: var(--deep);
}
.soft-btn {
  background: #fffdf8;
  border: 1px solid #d5d8cc;
  color: #46544b;
}
.soft-btn:hover {
  background: var(--quiet);
  border-color: #aeb7aa;
}
.form-error,
.dirty {
  padding: 10px 12px;
  background: #fbece5;
  border-left: 3px solid var(--red);
  color: #833521;
  font-size: 0.86rem;
  line-height: 1.45;
}
.dirty {
  margin: 15px 24px 0;
}
.fold small,
.caption,
.soft-note {
  font-size: 0.84rem;
  font-weight: 420;
  color: var(--sub);
  line-height: 1.5;
}
.fold small {
  display: block;
  margin-top: 4px;
}
.mode {
  background: #f3f3ed;
  border: 1px solid #dadcd2;
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.mode button {
  min-height: 29px;
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 11px;
  font-size: 0.81rem;
  font-weight: 550;
  border-radius: 4px;
  color: var(--sub);
}
.mode button[aria-pressed="true"] {
  background: #fffefa;
  border-color: #dedfd6;
  color: var(--ink);
  box-shadow: 0 1px 2px #2030200c;
}
.natal-inner {
  padding: 18px 24px 21px;
}
.result-subtitle,
.chart-meta {
  font-size: 0.88rem;
  font-weight: 460;
  color: var(--sub);
  margin-bottom: 15px;
}
.chart-meta {
  justify-content: space-between;
  gap: 8px;
  line-height: 1.5;
}
.chart-meta b {
  color: var(--ink);
}
.chart-meta .icon-btn {
  border: 1px solid var(--line);
}
.pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pillar {
  border: 1px solid #d6dbd0;
  border-radius: 8px;
  background: #fcfcf8;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.pillar-label {
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 620;
  padding: 9px 0;
  border-bottom: 1px solid #dfe1d7;
  background: #f1f3ec;
  color: #536257;
}
.day-pillar .pillar-label {
  background: #f5ece5;
  color: #8f4d3e;
}
.day-pillar {
  border-color: #dfc4b8;
}
.empty-tiles .pillar {
  background: linear-gradient(155deg, #f7f7f0, #fbfaf4);
}
.empty-tiles .day-pillar {
  background: linear-gradient(145deg, #f8f1e9, #fcf8f1);
}
.empty-tiles .pillar-label {
  font-size: 0.74rem;
}
.empty-han,
.han,
.pair,
.hidden-grid i,
.qi-cell > strong,
.kin-tree i {
  font-family:
    "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun",
    "Hiragino Mincho ProN", serif;
}
.empty-han {
  font-weight: 400;
  font-size: clamp(2.8rem, 4.5vw, 4.6rem);
  color: #939d8a;
  opacity: 0.68;
  line-height: 1.1;
  padding: 18px 0 8px;
}
.day-pillar .empty-han {
  color: #b28e7b;
}
.ink-rule {
  width: 20px;
  height: 1px;
  background: #c4c8b9;
  margin: 0 auto 18px;
}
.empty-guide {
  text-align: center;
  padding: 22px 8px 5px;
}
.small-flower {
  color: var(--red);
  font-size: 1.55rem;
  line-height: 1;
  margin: 0 0 5px;
}
.empty-guide h3 {
  font-size: 1.45rem;
}
.empty-guide p {
  font-size: 0.89rem;
  color: var(--sub);
  line-height: 1.5;
  margin: 6px 0 14px;
}
.empty-guide .soft-btn {
  margin: auto;
  font-size: 0.85rem;
  min-height: 37px;
  padding: 7px 15px;
}
.empty-guide .soft-btn .ico {
  width: 15px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 14px;
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 0.78rem;
}
.legend b {
  font-weight: 600;
  color: #485247;
  margin-right: 1px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.c0 {
  background: var(--wood);
}
.c1 {
  background: var(--fire);
}
.c2 {
  background: var(--earth);
}
.c3 {
  background: var(--metal);
}
.c4 {
  background: var(--water);
}
.el0 {
  color: var(--wood);
}
.el1 {
  color: var(--fire);
}
.el2 {
  color: var(--earth);
}
.el3 {
  color: var(--metal);
}
.el4 {
  color: var(--water);
}
.stem-block,
.branch-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 3px;
}
.stem-block {
  border-bottom: 1px solid #e1e3d9;
}
.han {
  font-size: clamp(2.2rem, 3.9vw, 3.7rem);
  line-height: 1.18;
  font-weight: 500;
}
.stem-block span,
.branch-block span {
  font-weight: 600;
  font-size: 0.86rem;
}
.stem-block small,
.branch-block small {
  color: var(--muted);
  font-size: 0.72rem;
}
.uncertain {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 125px;
  padding: 5px;
  color: var(--muted);
}
.uncertain small {
  font-size: 0.72rem;
}
.uncertain .pair {
  font-size: 1.6rem;
}
.day-master,
.hidden-row {
  margin-top: 14px;
}
.day-master {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid #e4d9cb;
  border-radius: 6px;
  background: #faf5ed;
  font-size: 0.87rem;
}
.hidden-row > b,
.overlay > strong {
  font-size: 0.84rem;
  font-weight: 580;
}
.hidden-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  margin-top: 9px;
}
.hidden-grid span {
  background: var(--quiet);
  border-radius: 4px;
  padding: 5px 2px;
}
.hidden-grid small {
  display: block;
  font-size: 0.69rem;
  color: var(--sub);
}
.hidden-grid i,
.pair i,
.kin-tree i {
  font-style: normal;
}
.hidden-grid i {
  font-size: 1.25rem;
}
.overlay {
  padding: 13px 24px 17px;
  border-top: 1px solid var(--line);
}
.overlay > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.overlay > div > span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 1.03rem;
}
.overlay small {
  font: 500 0.75rem var(--sans);
  color: var(--sub);
}
.highlighted {
  outline: 2px solid var(--red) !important;
  outline-offset: -2px;
  background: #f8e6dc !important;
}
#details-content,
.search-results,
#compare-output {
  margin-top: 15px;
}
#details-content {
  display: grid;
  gap: 11px;
}
.result-section {
  margin: 0;
}
.result-section summary {
  padding: 16px 21px;
  min-height: 57px;
  gap: 12px;
}
.result-section summary h2 {
  font-size: 1.37rem;
}
.section-body {
  border-top: 1px solid var(--line);
  padding: 17px 21px;
  min-width: 0;
}
.section-body > h3 {
  margin: 17px 0 10px;
}
.section-body > h3:first-child {
  margin-top: 0;
}
.soft-note {
  margin: 11px 0;
}
.soft-note:first-child {
  margin-top: 0;
}
.soft-note:last-child {
  margin-bottom: 0;
}
.caption {
  display: block;
}
.section-topline {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--sub);
  font-size: 0.81rem;
  margin-bottom: 12px;
}
.takt-grid,
.year-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(auto-fit, minmax(61px, 1fr));
}
.takt-grid button,
.year-grid button {
  padding: 7px 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafaf5;
  text-align: center;
  min-width: 0;
}
.takt-grid button[aria-pressed="true"],
.year-grid button[aria-pressed="true"],
.relation-list button[aria-pressed="true"] {
  background: #f7ece3;
  border-color: #b97c68;
}
.takt-grid small,
.year-grid b {
  display: block;
  font-size: 0.72rem;
  color: var(--sub);
  font-weight: 470;
}
.takt-grid .pair,
.year-grid .pair {
  font-size: 1.25rem;
  line-height: 1.5;
}
.takt-grid button > b {
  font-size: 0.8rem;
  line-height: 2.4;
}
.facts {
  margin: 0;
}
.facts > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) 1.6fr;
  gap: 11px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.85rem;
  line-height: 1.48;
}
.facts dt,
.directions span,
small {
  color: var(--sub);
}
.facts dd {
  margin: 0;
}
.gua {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-top: 16px;
}
.gua > div:first-child {
  flex: none;
  text-align: center;
  background: #eef1e7;
  padding: 9px 12px;
  border-radius: 6px;
}
.gua strong,
.gua small {
  display: block;
}
.gua strong {
  font: 500 2rem var(--serif);
}
.directions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px 12px;
}
.directions span {
  font-size: 0.76rem;
}
.directions b {
  color: var(--ink);
}
.bars {
  display: grid;
  gap: 8px;
}
.bars > div {
  display: grid;
  grid-template-columns: minmax(85px, 1fr) 2fr 20px;
  gap: 12px;
  align-items: center;
  font-size: 0.84rem;
}
.track {
  height: 8px;
  background: #efefe8;
  border-radius: 3px;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.table-scroll {
  width: 100%;
  overflow: auto;
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.83rem;
  line-height: 1.45;
}
.data-table th,
.data-table td {
  padding: 9px 7px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table thead th {
  color: var(--sub);
  background: var(--quiet);
  font-weight: 580;
}
.data-table tbody th {
  font-weight: 520;
}
.data-table .pair {
  font-size: 1.1rem;
  white-space: nowrap;
}
.palace-list,
.kin-tree,
.qimen {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 15px;
}
.palace-list > div,
.kin-tree > div,
.qi-cell {
  background: #f5f5ef;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
}
.palace-list small,
.palace-list b,
.qi-cell span,
.qi-cell > strong,
.qi-cell > small {
  display: block;
}
.palace-list small,
.qi-cell small {
  font-size: 0.74rem;
}
.palace-list .pair {
  font-size: 1.4rem;
}
.kin-tree {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.kin-tree h3 {
  font-size: 1.07rem;
  margin: 1px 0 8px;
}
.kin-tree p {
  margin: 6px 0;
  font-size: 0.78rem;
}
.kin-tree p b,
.kin-tree p span {
  display: block;
}
.kin-tree p span {
  color: var(--sub);
}
.qi-cell > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  gap: 3px;
}
.qi-cell > strong {
  font-size: 1.4rem;
  margin: 7px 0;
}
.qi-cell span {
  font-size: 0.77rem;
  line-height: 1.5;
}
.qi-cell.life {
  border-color: var(--wood);
  background: #e8eee3;
}
.relation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.relation-list button {
  background: #fafaf5;
  border: 1px solid var(--line);
  border-radius: 5px;
  display: flex;
  gap: 9px;
  align-items: center;
  text-align: left;
  padding: 7px 9px;
  font-size: 0.78rem;
}
.relation-list b {
  font-size: 1.03rem;
  white-space: nowrap;
}
.relation-list small {
  display: block;
  font-size: 0.72rem;
  line-height: 1.4;
}
.star-label {
  margin-bottom: 13px;
}
#event-host .entry-form {
  box-shadow: none;
  background: transparent;
  border: 0;
}
#event-host .card-header {
  display: none;
}
#event-host .form-body {
  padding: 0;
  gap: 14px;
  max-width: 540px;
}
.event-result {
  margin-top: 16px;
}
.event-result h3 {
  margin-bottom: 10px;
}
.compare-actions {
  justify-content: space-between;
  gap: 12px;
  margin: 5px 0 16px;
}
.compare-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.comparison-card,
.search-results,
.guide {
  padding: 23px;
}
.comparison-card > p,
.guide p,
.print-dialog p {
  color: var(--sub);
  line-height: 1.6;
  margin: 8px 0 16px;
}
.comparison-card .compact .han {
  font-size: 2.4rem;
}
#compare-output > .result-section {
  margin-top: 14px;
}
.search-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.search-filters > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #f7f7f1;
}
.search-filters h3 {
  margin: 0 0 8px;
}
.search-filters .field + .field {
  margin-top: 8px;
}
.search-location {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}
.search-form .settings-body {
  max-width: 450px;
}
.actions {
  gap: 10px;
  flex-wrap: wrap;
}
.search-summary {
  margin: 8px 0 12px;
  color: var(--sub);
}
.search-results .actions {
  margin-top: 12px;
}
.guide {
  max-width: 900px;
  margin: auto;
  padding: clamp(22px, 4vw, 42px);
}
.guide h3 {
  margin: 24px 0 4px;
}
.guide p {
  font-size: 0.97rem;
}
.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
}
.guide-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.88rem;
}
.site-foot {
  margin-top: 30px;
  padding: 17px 0 23px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
}
.site-foot b {
  color: #9a4c39;
  margin-right: 5px;
}
.print-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  color: var(--ink);
  background: var(--card);
  max-height: 85vh;
  max-width: min(440px, 94vw);
}
.print-dialog::backdrop {
  background: #17251a66;
}
.print-dialog form > div {
  display: grid;
  gap: 8px;
}
.print-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
@media (min-width: 1500px) {
  .hero {
    min-height: 230px;
  }
  .hero-copy {
    padding-left: 48px;
  }
}
@media (max-width: 1020px) {
  .bar-inner,
  .shell,
  .site-foot {
    width: calc(100% - 40px);
  }
  .bar-inner {
    gap: 32px;
  }
  .workspace-grid {
    grid-template-columns: minmax(285px, 0.86fr) minmax(0, 1.4fr);
    gap: 15px;
  }
  .card-header {
    padding: 16px;
  }
  .form-body,
  .natal-inner,
  .section-body {
    padding: 16px;
  }
  .legend,
  .overlay {
    padding-left: 16px;
    padding-right: 16px;
  }
  .title-icon {
    gap: 8px;
  }
  h2 {
    font-size: 1.4rem;
  }
  .pillars {
    gap: 6px;
  }
  .mainnav {
    gap: 20px;
  }
  .hero-copy {
    padding-left: 27px;
  }
  .hero {
    min-height: 185px;
  }
  .directions {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .bar-inner,
  .shell,
  .site-foot {
    width: calc(100% - 28px);
  }
  .bar-inner {
    flex-wrap: wrap;
    gap: 0;
    min-height: 0;
  }
  .brand {
    height: 56px;
    font-size: 1.37rem;
  }
  .seal {
    width: 30px;
    height: 34px;
    font-size: 13px;
  }
  .help-nav {
    order: 1;
    font-size: 0.83rem;
  }
  .mainnav {
    order: 2;
    width: 100%;
    height: 40px;
    gap: 24px;
  }
  .mainnav a {
    font-size: 0.81rem;
  }
  .hero {
    margin: 16px 0;
    min-height: 155px;
  }
  .hero-copy {
    max-width: 80%;
    padding: 21px;
  }
  .hero-art {
    opacity: 0.76;
    width: 66%;
    object-position: 62% center;
  }
  .hero-fade {
    background: linear-gradient(
      90deg,
      #f4efe2 14%,
      rgba(244, 239, 226, 0.93) 43%,
      rgba(244, 239, 226, 0.2) 83%
    );
  }
  .hero h1 {
    font-size: clamp(2.28rem, 7.4vw, 3rem);
  }
  .hero p {
    font-size: 0.9rem;
    max-width: 80%;
  }
  .eyebrow {
    font-size: 0.62rem;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .hero .wide-only {
    display: none;
  }
  .card-header {
    padding: 17px;
  }
  .form-body {
    gap: 15px;
    padding: 17px;
  }
  .entry-form .primary {
    min-height: 45px;
  }
  .compare-forms {
    grid-template-columns: 1fr;
  }
  .search-filters {
    grid-template-columns: repeat(2, 1fr);
  }
  .search-location {
    grid-template-columns: 1fr;
  }
  .search-body {
    padding: 16px;
  }
  .empty-han {
    font-size: 3.1rem;
  }
  .result-section summary {
    padding: 14px 16px;
  }
  .han {
    font-size: 2.6rem;
  }
  .site-foot {
    margin-top: 22px;
  }
  .compare-actions h2 {
    font-size: 1.25rem;
  }
  .compare-actions .soft-btn {
    font-size: 0.78rem;
    padding: 7px 10px;
  }
  .relation-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 400px) {
  .shell,
  .bar-inner,
  .site-foot {
    width: calc(100% - 20px);
  }
  .hero-copy {
    max-width: 95%;
    padding: 17px;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .hero p {
    font-size: 0.84rem;
  }
  .mode button {
    padding: 3px 7px;
  }
  .icon-box {
    width: 29px;
    height: 29px;
  }
  .title-icon h2 {
    font-size: 1.27rem;
  }
  .mainnav {
    gap: 18px;
  }
  .facts > div {
    grid-template-columns: 1fr 1.15fr;
  }
  .palace-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .qi-cell {
    padding: 5px;
  }
  .qi-cell span {
    font-size: 0.69rem;
  }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  * {
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body,
  :root {
    background: white;
    font-size: 11px;
  }
  .topbar,
  .hero,
  .site-foot,
  #birth-form,
  .mode,
  .skip,
  .icon-btn,
  .dirty,
  .calc-settings,
  .star-label,
  #event-host,
  .print-dialog,
  .skip-print,
  .empty-guide .soft-btn,
  .app-view[hidden],
  .actions {
    display: none !important;
  }
  .shell,
  .workspace-grid,
  #result-column {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .card {
    background: white;
  }
  .result-section:not([open]) {
    display: none;
  }
  .card-header,
  .natal-inner,
  .legend,
  .overlay,
  .section-body,
  .result-section summary {
    padding: 7px 10px;
  }
  .result-section summary {
    min-height: 0;
  }
  .result-section summary > .ico {
    display: none;
  }
  .card-header {
    border-bottom: 1px solid #bbb;
  }
  #details-content {
    display: block;
    margin-top: 5px;
  }
  .result-section {
    margin: 5px 0;
    break-inside: auto;
  }
  .result-section summary,
  h3 {
    break-after: avoid;
  }
  .pillars,
  .gua,
  .qimen,
  .takt-grid,
  .year-grid,
  .bars,
  .kin-tree > div,
  tr {
    break-inside: avoid;
  }
  .han {
    font-size: 26px;
  }
  .stem-block,
  .branch-block {
    padding: 3px;
  }
  .pillar-label {
    padding: 3px;
  }
  .hidden-row,
  .day-master {
    margin-top: 6px;
  }
  .data-table {
    font-size: 10px;
  }
  .table-scroll {
    overflow: visible;
  }
  .caption,
  .soft-note {
    margin: 3px 0;
  }
  .relation-list button {
    break-inside: avoid;
  }
  .comparison-card .compact .han {
    font-size: 20px;
  }
}
.source-dialog {
  width: min(700px, 92vw);
  max-height: 84vh;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.source-dialog::backdrop {
  background: #17251a66;
}
.source-dialog form {
  float: right;
  margin: 0 0 10px 12px;
}
.source-dialog pre {
  clear: both;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 400 0.85rem/1.55 var(--sans);
}
.season-note {
  margin: 13px 0;
  padding: 10px 13px;
  background: #f6efdd;
  color: #654f32;
  border-radius: 6px;
  border: 1px solid #e6d6b5;
  font-size: 0.84rem;
  line-height: 1.5;
}
.season-note p {
  margin: 3px 0 0;
}
