:root {
  /* Authentic MyHora Classic Palette: Crisp White, Soft Sky-Blue, Light Gray, Deep Brown & Web Blue */
  --mh-brown-800:  #4a2c11;
  --mh-brown-700:  #5e3816;
  --mh-brown-600:  #78481d;
  --mh-sky-700:    #154c79;
  --mh-sky-600:    #1e6299;
  --mh-sky-500:    #2b7bbb;
  --mh-sky-100:    #e7f2fb;
  --mh-sky-50:     #f3f8fd;
  --mh-amber-600:  #c95f00;
  --mh-amber-500:  #e06d06;
  --mh-gold-600:   #b07800;
  --mh-red:        #cc1f1f;

  --bg-outer:      #eef1f4;
  --bg-card:       #ffffff;
  --bg-subtle:     #f8f9fb;
  --border:        #d5dde5;
  --border-light:  #e5ebf0;
  --text:          #1f262d;
  --text-body:     #2b333b;
  --muted:         #5c6873;
  --link:          #0b5394;
  --link-hover:    #c93b00;
  --base-size:     16px;
}

html {
  font-size: var(--base-size);
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
html[data-font="large"]  { --base-size: 18px; }
html[data-font="xlarge"] { --base-size: 20px; }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sarabun', Tahoma, 'IBM Plex Sans Thai', 'Noto Sans Thai', sans-serif;
  background-color: var(--bg-outer);
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.68;
  max-width: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4, strong {
  color: var(--text);
  line-height: 1.4;
}

p, li, td, th, div {
  overflow-wrap: break-word;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

img, svg, iframe, canvas {
  max-width: 100%;
}

/* Classic Centered White Sheet Container */
.page-shell {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-left: 1px solid #d4dce3;
  border-right: 1px solid #d4dce3;
  box-shadow: 0 0 14px rgba(15, 23, 42, 0.05);
  min-height: 100vh;
}
@media (max-width: 1124px) {
  .page-shell { border-left: none; border-right: none; }
}

/* Top Utility Date & Font Bar */
.top-strip {
  background: #f7f9fb;
  border-bottom: 1px solid var(--border-light);
  color: #44505c;
  font-size: 0.87rem;
  padding: 5px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 5px 12px;
}
.top-strip > div:first-child {
  flex: 1 1 260px;
  min-width: 0;
}
.top-strip-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  max-width: 100%;
}
.wanphra-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff8dc;
  border: 1px solid #e6c35c;
  color: #7d5200;
  padding: 2px 9px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.83rem;
  line-height: 1.35;
  max-width: 100%;
}
.font-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #ffffff;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
  max-width: 100%;
}
.font-switcher-label {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 4px;
}
.font-btn {
  border: none;
  background: transparent;
  color: var(--text-body);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.81rem;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
}
.font-btn:hover { background: var(--mh-sky-100); }
.font-btn.active { background: var(--mh-sky-600); color: #ffffff; }

/* Classic MyHora Header */
.brand-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 18px;
  background: #ffffff;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 280px;
  text-decoration: none !important;
}
.brand-logo > div:last-child {
  min-width: 0;
  flex: 1;
}
.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3c4 0%, #e09f24 55%, #5e3816 100%);
  border: 2px solid #5e3816;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 1.66rem;
  font-weight: 800;
  color: var(--mh-brown-700);
  line-height: 1.14;
  letter-spacing: -0.01em;
}
.brand-name span {
  color: var(--mh-sky-600);
  font-weight: 700;
}
.brand-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.header-search {
  display: flex;
  gap: 5px;
  align-items: center;
  max-width: 100%;
  flex: 0 1 330px;
}
.header-search input {
  flex: 1 1 170px;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #b8c6d4;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.92rem;
  background: #ffffff;
}
.header-search input:focus {
  outline: none;
  border-color: var(--mh-sky-500);
}
.header-search button {
  height: 38px;
  background: var(--mh-sky-600);
  color: #ffffff;
  border: 1px solid var(--mh-sky-700);
  padding: 0 14px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-search button:hover { background: var(--mh-sky-700); }

/* Classic MyHora Warm Brown Primary Bar + Soft Sky-Blue Sub-Bar */
.primary-nav {
  background: linear-gradient(180deg, #683f1b 0%, #4e2e12 100%);
  border-top: 1px solid #3d230d;
  border-bottom: 3px solid #d98218;
}
.primary-nav ul {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  padding: 0 10px;
  scrollbar-width: none;
}
.primary-nav ul::-webkit-scrollbar { display: none; }
.primary-nav li {
  flex-shrink: 0;
}
.primary-nav li a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 9px 13px;
  white-space: nowrap;
  text-decoration: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}
.primary-nav li:last-child a {
  border-right: none;
}
.primary-nav li a:hover,
.primary-nav li a.active {
  background: #d98218;
  color: #ffffff;
}

.sub-nav {
  background: var(--mh-sky-50);
  border-bottom: 1px solid #cfe0ef;
  padding: 6px 16px;
  font-size: 0.87rem;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  align-items: center;
  scrollbar-width: none;
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav a {
  color: var(--mh-sky-700);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.sub-nav a:hover {
  color: var(--link-hover);
}
.sub-sep {
  color: #b5cade;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.89rem;
  color: var(--muted);
  padding: 2px 0 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  overflow-wrap: anywhere;
}

/* Main Content Layout */
.main-body {
  padding: 15px 18px 36px;
}
.mh-layout-home {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(290px, 1fr);
  gap: 18px;
  align-items: start;
}
.mh-layout-inner {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(265px, 1fr);
  gap: 18px;
  align-items: start;
}
.mh-layout-home > *,
.mh-layout-inner > *,
.mh-main-col,
.mh-side-col {
  min-width: 0;
  max-width: 100%;
}
.mh-side-col .mh-list li a.active-side {
  color: var(--link-hover);
  font-weight: 800;
}

/* Proportional Chart + Planet Table Layout on Desktop */
.chart-table-split {
  display: grid;
  grid-template-columns: minmax(250px, 295px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
.chart-table-split:last-child {
  margin-bottom: 0;
}
.chart-table-split > * {
  min-width: 0;
  max-width: 100%;
}
.chart-table-split > .mh-box {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.chart-table-split > .mh-box > .mh-box-bd {
  flex: 1;
}
html[data-font="xlarge"] .chart-table-split {
  grid-template-columns: minmax(0, 1fr);
}

.siamsi-slip {
  max-width: 560px;
  width: 100%;
  margin: 0 auto 16px;
  background: #fffdf5;
  border: 2px solid #c92a2a;
  box-shadow: inset 0 0 0 3px #e6b85c, 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 18px 20px;
  border-radius: 3px;
}
@media (max-width: 480px) {
  .siamsi-slip { padding: 14px 12px; }
}

/* Balanced Multi-Column Grids — Equal Card Heights & Consistent Vertical/Horizontal Spacing */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.grid-2:last-child, .grid-3:last-child, .grid-4:last-child { margin-bottom: 0; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.grid-2 > .mh-box, .grid-3 > .mh-box, .grid-4 > .mh-box {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.grid-2 > .mh-box > .mh-box-bd,
.grid-3 > .mh-box > .mh-box-bd,
.grid-4 > .mh-box > .mh-box-bd {
  flex: 1;
}

@media (max-width: 1040px) {
  .chart-table-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 980px) {
  .mh-layout-home,
  .mh-layout-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  /* Sleek compact mobile header so content starts high above the fold */
  .top-strip { padding: 4px 10px; font-size: 0.77rem; gap: 4px 8px; }
  .wanphra-pill { font-size: 0.76rem; padding: 1px 7px; }
  .font-switcher-label { display: none; }
  .font-btn { font-size: 0.76rem; padding: 2px 6px; }
  .brand-bar { padding: 8px 10px; gap: 7px; }
  .brand-logo { gap: 9px; flex: 1 1 100%; }
  .brand-icon { width: 38px; height: 38px; font-size: 20px; }
  .brand-name { font-size: 1.28rem; }
  .brand-tagline {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
  }
  .header-search { flex: 1 1 100%; width: 100%; }
  .header-search input { flex: 1; width: auto; height: 36px; font-size: 16px; }
  .header-search button { height: 36px; font-size: 0.88rem; padding: 0 13px; }
  .primary-nav ul { padding: 0 6px; }
  .primary-nav li a { padding: 8px 11px; font-size: 0.89rem; }
  .sub-nav { padding: 6px 10px; font-size: 0.82rem; gap: 6px; }
  .breadcrumb { font-size: 0.82rem; padding: 0 0 7px; margin-bottom: 10px; }
  .main-body { padding: 10px 10px 26px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* Classic MyHora Functional Box (.mh-box) */
.mh-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 16px;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}
.mh-box-hd {
  background: linear-gradient(180deg, #f5fafe 0%, #e4eff9 100%);
  border-bottom: 1px solid #c5daec;
  border-radius: 4px 4px 0 0;
  color: var(--mh-sky-700);
  padding: 9px 14px;
  font-size: 1.01rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 10px;
}
.mh-box-hd > h1,
.mh-box-hd > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.mh-box-hd > a {
  flex-shrink: 0;
  white-space: nowrap;
}
.mh-box-hd h1 {
  font-size: 1.04rem !important;
  font-weight: 700;
  color: inherit;
  margin: 0;
  line-height: 1.4;
}
.mh-box-hd > form,
.mh-box-hd > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.mh-box-hd.orange {
  background: linear-gradient(180deg, #fdf8f2 0%, #f7ead9 100%);
  border-bottom-color: #e2c6a6;
  color: var(--mh-brown-700);
}
.mh-box-hd.blue {
  background: linear-gradient(180deg, #f5fafe 0%, #e4eff9 100%);
  border-bottom-color: #c5daec;
  color: var(--mh-sky-700);
}
.mh-box-hd.purple {
  background: linear-gradient(180deg, #f8f6fc 0%, #ece6f7 100%);
  border-bottom-color: #d2c6e8;
  color: #493073;
}
.mh-box-hd.gold {
  background: linear-gradient(180deg, #fffdf4 0%, #fbf1d0 100%);
  border-bottom-color: #e6cf8b;
  color: #784c08;
}
.mh-box-bd {
  padding: 14px 16px;
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 640px) {
  .mh-box-hd { padding: 8px 11px; font-size: 0.95rem; }
  .mh-box-hd h1 { font-size: 0.97rem !important; }
  .mh-box-bd { padding: 11px; }
}

/* Signature MyHora Tear-Off Daily Calendar Card (7 Weekday Colors) */
.almanac-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.almanac-grid > * { min-width: 0; }
@media (max-width: 620px) {
  .almanac-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .almanac-grid > .tear-sheet { max-width: 210px; width: 100%; margin: 0 auto; }
}
.tear-sheet {
  border: 1px solid #bfc9d4;
  border-radius: 6px;
  overflow: hidden;
  text-align: center;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.tear-top {
  background: var(--mh-sky-600);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 7px 8px;
}
.tear-top.wd-0 { background: #d63031; }
.tear-top.wd-1 { background: #d49b00; color: #fff; }
.tear-top.wd-2 { background: #d64185; }
.tear-top.wd-3 { background: #2e8540; }
.tear-top.wd-4 { background: #df691a; }
.tear-top.wd-5 { background: #1f75bd; }
.tear-top.wd-6 { background: #6f42c1; }

.tear-day {
  font-size: 3.75rem;
  font-weight: 800;
  line-height: 1.05;
  color: #222831;
  padding: 10px 0 2px;
}
.tear-day.sun { color: var(--mh-red); }
.tear-wd {
  font-size: 1rem;
  font-weight: 700;
  color: #3c4854;
  padding-bottom: 6px;
}
.tear-lunar {
  font-size: 0.86rem;
  font-weight: 700;
  color: #6b4500;
  padding: 7px 8px 9px;
  background: #fff9e6;
  border-top: 1px solid #ecd99e;
  line-height: 1.45;
}

/* MyHora Classic Key-Value Almanac Table — Sleek 2-Col on Desktop AND Mobile */
.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.kv-table th {
  width: 172px;
  background: #f3f8fc;
  color: #264a69;
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid #dde6ef;
  vertical-align: top;
  line-height: 1.48;
}
.kv-table td {
  background: #ffffff;
  color: var(--text-body);
  padding: 8px 12px;
  border: 1px solid #dde6ef;
  line-height: 1.64;
  overflow-wrap: break-word;
}
@media (max-width: 600px) {
  .kv-table { font-size: 0.89rem; }
  .kv-table th {
    width: 112px;
    padding: 7px 8px;
    font-size: 0.84rem;
    line-height: 1.4;
  }
  .kv-table td {
    padding: 7px 9px;
    line-height: 1.56;
  }
}
@media (max-width: 340px) {
  .kv-table, .kv-table tbody, .kv-table tr, .kv-table th, .kv-table td {
    display: block;
    width: 100%;
  }
}

/* Golden Buddha Icon SVG for Wan Phra */
.buddha-svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  display: inline-block;
  flex-shrink: 0;
}

/* Classic Link Lists inside Portal Boxes */
.mh-list { list-style: none; }
.mh-list li {
  position: relative;
  display: block;
  padding: 6px 2px 6px 16px;
  border-bottom: 1px dotted #dce4ec;
  font-size: 0.95rem;
  line-height: 1.62;
  overflow-wrap: break-word;
}
.mh-list li:last-child { border-bottom: none; }
.mh-list li::before {
  content: "▪";
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--mh-amber-500);
  font-size: 0.85rem;
  line-height: 1.62;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  max-width: 100%;
}
.badge-good   { background: #e6f5ea; color: #166534; border: 1px solid #a6dcb4; }
.badge-warn   { background: #fff7db; color: #855200; border: 1px solid #edd07b; }
.badge-bad    { background: #fde8e8; color: #b91c1c; border: 1px solid #f5b2b2; }
.badge-green  { background: var(--mh-sky-600); color: #ffffff; }
.badge-orange { background: var(--mh-amber-500); color: #ffffff; }

/* Stat Sub-boxes */
.stat-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}
.stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 10px 13px;
  line-height: 1.62;
  min-width: 0;
  overflow-wrap: break-word;
}
.stat-label { font-size: 0.84rem; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.stat-val { font-size: 0.96rem; font-weight: 700; color: var(--text); }

/* Iconic MyHora 7-Color Weekday Monthly Calendar */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 7px 10px;
  border-radius: 4px;
}
.cal-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.cal-grid th {
  color: #ffffff;
  padding: 7px 3px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid #cbd5e0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-grid th .wd-short { display: none; }
.cal-grid th.d0 { background: #d63031; }
.cal-grid th.d1 { background: #d49b00; }
.cal-grid th.d2 { background: #d64185; }
.cal-grid th.d3 { background: #2e8540; }
.cal-grid th.d4 { background: #df691a; }
.cal-grid th.d5 { background: #1f75bd; }
.cal-grid th.d6 { background: #6f42c1; }

.cal-grid td {
  border: 1px solid #d4dde6;
  vertical-align: top;
  padding: 5px 6px;
  background: #ffffff;
  overflow: hidden;
}
.cal-grid td:hover {
  background: #f2f8fd;
}
.cal-grid td.out-month {
  background: #f7f9fb;
  opacity: 0.45;
}
.cal-grid td.is-today {
  background: #fffbe6;
  box-shadow: inset 0 0 0 2px #e06d06;
}
.cal-cell-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 80px;
  height: 100%;
  color: inherit !important;
  text-decoration: none !important;
}
.cal-day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
}
.cal-solar {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
  color: #222831;
  margin-left: auto;
}
.cal-solar.sun {
  color: var(--mh-red);
}
.cal-wanphra {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  color: #8a5600;
  background: #fff6cf;
  border: 1px solid #ebd078;
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 700;
  white-space: nowrap;
}
.cal-lunar {
  font-size: 0.78rem;
  color: #4a5560;
  line-height: 1.26;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.cal-holiday {
  font-size: 0.73rem;
  color: var(--mh-red);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.cal-thongchai {
  font-size: 0.72rem;
  color: #166534;
  font-weight: 700;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .cal-grid th { font-size: 0.8rem; padding: 5px 1px; }
  .cal-grid th .wd-full { display: none; }
  .cal-grid th .wd-short { display: inline; }
  .cal-grid td { padding: 3px 2px; }
  .cal-cell-link { min-height: 60px; }
  .cal-solar { font-size: 0.94rem; }
  .cal-wanphra { padding: 0 1px; background: transparent; border: none; }
  .cal-wanphra .wp-txt { display: none; }
  .cal-lunar { font-size: 0.62rem; letter-spacing: -0.02em; line-height: 1.16; margin-top: 2px; }
  .cal-holiday {
    font-size: 0.6rem;
    line-height: 1.14;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cal-thongchai { font-size: 0.6rem; }
  .cal-toolbar .cal-hint { display: none; }
}

/* Classic Clean Forms & Buttons — Strict Uniform 40px Single-Line Controls! */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  align-items: end;
}
.form-row > * { min-width: 0; }
@media (max-width: 640px) {
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .form-row > .form-group:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 360px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
}
.form-group { min-width: 0; }
.form-group label {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #2c3a47;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.time-pair {
  display: flex;
  gap: 5px;
  align-items: center;
}
.time-pair .input {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 0 4px;
}
.input, select.input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #b8c6d4;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 38px;
  background: #ffffff;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
textarea.input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  padding: 8px 10px;
  border: 1px solid #b8c6d4;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.55;
  background: #ffffff;
  color: var(--text);
}
.mh-box-hd .input,
.mh-box-hd select.input {
  height: 32px;
  line-height: 30px;
  padding: 0 8px;
  font-size: 0.88rem;
}
.cal-toolbar .input,
.cal-toolbar select.input {
  height: 34px;
  line-height: 32px;
  padding: 0 8px;
  font-size: 0.89rem;
}
@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on input focus while maintaining crisp height */
  .input, select.input, textarea.input { font-size: 16px; }
  .mh-box-hd .input, .mh-box-hd select.input { font-size: 15px; }
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none;
  border-color: var(--mh-sky-500);
  box-shadow: 0 0 0 2px rgba(43, 123, 187, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.38;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
  text-align: center;
  max-width: 100%;
  white-space: normal;
}
.mh-box-hd .btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  /* Full-width balanced submit buttons inside calculator forms on mobile */
  .mh-box-bd form:not([style*="display:flex"]) > .btn,
  .mh-box-bd form > div[style*="display:flex"] > .btn {
    width: 100%;
    flex: 1 1 100%;
  }
}

.btn-green  { background: var(--mh-sky-600); color: #ffffff !important; border-color: var(--mh-sky-700); }
.btn-green:hover { background: var(--mh-sky-700); }
.btn-orange { background: var(--mh-amber-500); color: #ffffff !important; border-color: var(--mh-amber-600); }
.btn-orange:hover { background: var(--mh-amber-600); }
.btn-outline { background: #ffffff; border-color: #c2cfd9; color: #2b3a48 !important; }
.btn-outline:hover { background: var(--mh-sky-50); border-color: var(--mh-sky-500); color: var(--mh-sky-700) !important; }

/* Responsive Table Scroll Container & Data Tables */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.54;
}
.data-table th {
  background: #edf4fb;
  color: #1b4b75;
  padding: 8px 9px;
  border: 1px solid #ceddea;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}
.data-table td {
  padding: 8px 9px;
  border: 1px solid #e1e8ef;
  vertical-align: top;
  overflow-wrap: break-word;
}
.data-table tbody tr:nth-child(even) {
  background: #fafcfe;
}
.data-table tbody tr:hover {
  background: #f0f7fd;
}

@media (max-width: 720px) {
  .data-table th, .data-table td { padding: 6px 7px; font-size: 0.87rem; }
  .table-wrap > .data-table:has(th:nth-child(4)):not(.seven-table):not(.matrix-3x3) { min-width: 480px; }
  .table-wrap > .data-table:has(th:nth-child(5)):not(.seven-table):not(.matrix-3x3) { min-width: 560px; }
  .table-wrap > .data-table:has(th:nth-child(6)):not(.seven-table):not(.matrix-3x3) { min-width: 650px; }
  .table-wrap > .data-table:has(th:nth-child(8)):not(.seven-table):not(.matrix-3x3) { min-width: 780px; }
}

.seven-table th,
.seven-table td {
  text-align: center;
  white-space: nowrap;
  padding: 7px 6px;
}
.seven-sum-row td {
  background: #fff6df !important;
  font-weight: 800;
  color: #b91c1c;
  font-size: 1rem;
}

/* 3x3 Sacred Matrix Grids (Taksa Transit & Lo Shu Flying Stars) */
.matrix-3x3 {
  table-layout: fixed;
  width: 100%;
  min-width: 290px;
  text-align: center;
}
.matrix-3x3 td {
  padding: 12px 6px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 520px) {
  .matrix-3x3 td { padding: 8px 4px; font-size: 0.84rem; }
}

/* SVG Charts — Fully Responsive with Zero Mobile Viewport Overflow */
.epae-svg { width: 100%; max-width: 310px; height: auto; display: block; margin: 0 auto; }
.life-graph-svg { width: 100%; max-width: 100%; height: auto; display: block; }

/* Ornate Tarot & Playing Cards */
.tarot-spread {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.tarot-back {
  height: 126px;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 38%, #7a491d 0%, #4b2b0e 65%, #331c08 100%);
  border: 2px solid #e6b450;
  box-shadow: inset 0 0 0 3px #3b210a, inset 0 0 0 4px rgba(255, 229, 153, 0.45), 0 2px 5px rgba(0, 0, 0, 0.12);
  color: #ffe599;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  padding: 6px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tarot-back:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 3px #3b210a, inset 0 0 0 4px rgba(255, 229, 153, 0.8), 0 6px 12px rgba(0, 0, 0, 0.18);
}
.tarot-back.selected {
  background: linear-gradient(145deg, #f59e0b, #c95f00);
  color: #ffffff;
  border-color: #fde68a;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5), 0 5px 12px rgba(201, 95, 0, 0.3);
  transform: translateY(-4px);
}
@media (max-width: 520px) {
  .tarot-spread { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .tarot-back { height: 98px; font-size: 0.78rem; padding: 4px; }
}

/* Progress Meters */
.meter-row { margin-bottom: 8px; }
.meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; font-weight: 700; margin-bottom: 3px; }
.meter-track { height: 8px; background: #e5ecf2; border-radius: 99px; overflow: hidden; }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--mh-sky-500), var(--mh-amber-500)); }

/* Letter Index & Shortcut Pill Bar */
.letter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.letter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #c5d3e0;
  background: #ffffff;
  font-weight: 700;
  font-size: 0.87rem;
  line-height: 1.36;
  color: var(--link);
  text-decoration: none !important;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.letter-pill.active, .letter-pill:hover {
  background: var(--mh-sky-600);
  color: #ffffff;
  border-color: var(--mh-sky-700);
}

/* Share & Print Action Bar */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

@media print {
  body { background: #ffffff !important; font-size: 13pt; }
  .no-print, .top-strip, .primary-nav, .sub-nav, .mh-side-col, .header-search, .site-footer, .cal-toolbar form, .letter-bar {
    display: none !important;
  }
  .page-shell {
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
  }
  .mh-layout-home, .mh-layout-inner {
    display: block !important;
  }
  .mh-box {
    break-inside: avoid;
    border-color: #bbb !important;
  }
}

/* Classic MyHora Footer */
.site-footer {
  background: #f5f8fb;
  color: #3f4c59;
  padding: 24px 18px 20px;
  border-top: 3px solid var(--mh-brown-700);
  font-size: 0.88rem;
  line-height: 1.68;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 20px;
}
.footer-grid > * { min-width: 0; }
.footer-title { color: var(--mh-brown-700); font-size: 0.96rem; font-weight: 800; margin-bottom: 8px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 5px; line-height: 1.55; }
.footer-links a { color: var(--link); font-size: 0.88rem; }
.footer-links a:hover { color: var(--link-hover); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
