/* MAYA — 十三月亮历图腾计算 Web App 主题
   品牌色取自 01_brand/MAYA_color_tokens.css；图腾四原色为低饱和灵性配色。 */
:root {
  --maya-moss: #3E5A4A;
  --maya-sage: #8BAA8F;
  --maya-celadon: #C7D6C9;
  --maya-mist: #E8EFE8;
  --maya-ivory: #F6F7F4;
  --maya-card: #FBFCF8;
  --maya-text: #31463A;
  --maya-muted: #78897C;
  --maya-border: #D7E2D8;
  --maya-moss-deep: #31493B;
  --maya-shadow: 0 10px 30px rgba(62, 90, 74, 0.08);
  --maya-shadow-sm: 0 2px 10px rgba(62, 90, 74, 0.06);
  /* 20 图腾四原色（柔和、安静，与绿色体系协调） */
  --seal-red: #C25B50;
  --seal-white: #93A098;
  --seal-blue: #4E7FA6;
  --seal-yellow: #C49B45;
  --seal-red-bg: #F6E9E7;
  --seal-white-bg: #EEF2EF;
  --seal-blue-bg: #E8F0F6;
  --seal-yellow-bg: #F7F1E2;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --tab-h: 72px;
  --font-ui: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  --font-zh: var(--font-ui);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-zh);
  color: var(--maya-text);
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--maya-mist), transparent 70%),
    var(--maya-ivory);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
.app {
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 18px calc(var(--tab-h) + 28px);
  position: relative;
}

/* ===== 顶部 ===== */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 2px 14px;
}
.brand-logo { width: 42px; height: 42px; border-radius: 11px; overflow: hidden; flex: 0 0 auto; box-shadow: var(--maya-shadow-sm); }
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-text { flex: 1 1 auto; min-width: 0; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 3px; color: var(--maya-moss-deep); line-height: 1.1; }
.brand-tag { font-size: 12px; color: var(--maya-muted); margin-top: 2px; letter-spacing: .5px; }
.mode-switch { display: flex; background: var(--maya-mist); border-radius: 999px; padding: 3px; gap: 2px; flex: 0 0 auto; }
.mode-switch button {
  border: 0; background: transparent; color: var(--maya-muted);
  font-family: inherit; font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer; min-height: 32px;
}
.mode-switch button.active { background: var(--maya-card); color: var(--maya-moss-deep); font-weight: 600; box-shadow: var(--maya-shadow-sm); }
.local-note {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--maya-muted);
  background: var(--maya-mist); border: 1px solid var(--maya-border);
  border-radius: var(--radius-sm); padding: 7px 11px; margin: 0 2px 14px;
}
.local-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--maya-sage); flex: 0 0 auto; }

/* ===== 卡片 / 通用 ===== */
.card {
  background: var(--maya-card);
  border: 1px solid var(--maya-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--maya-shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 13px; }
.field label { font-size: 13px; color: var(--maya-moss); font-weight: 600; }
.field .sub { color: var(--maya-muted); font-weight: 400; font-size: 11px; }
input[type="date"], input[type="text"], input[type="time"], select {
  width: 100%; min-height: 46px; padding: 10px 13px;
  border: 1px solid var(--maya-border); border-radius: var(--radius-md);
  background: #fff; color: var(--maya-text); font-family: inherit; font-size: 15px;
}
input:focus { outline: 2px solid var(--maya-celadon); border-color: var(--maya-sage); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 18px; width: 100%;
  border: 0; border-radius: var(--radius-md); cursor: pointer;
  background: var(--maya-moss); color: #F4F8F3; font-family: inherit;
  font-size: 15px; font-weight: 600; letter-spacing: 1px;
  transition: transform .08s ease, background .2s ease;
}
.btn:hover { background: var(--maya-moss-deep); }
.btn:active { transform: scale(.985); }
.btn.ghost { background: var(--maya-mist); color: var(--maya-moss-deep); }
.btn.ghost:hover { background: var(--maya-celadon); }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 13px; width: auto; border-radius: 10px; }
.btn.danger { background: transparent; color: var(--seal-red); border: 1px solid #E6C9C6; }
.btn.danger:hover { background: var(--seal-red-bg); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1 1 auto; }

/* ===== 13-Moon 信息条 ===== */
.moon-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--maya-muted); }
.moon-strip b { color: var(--maya-moss-deep); font-weight: 600; }
.moon-strip .item { display: inline-flex; gap: 5px; align-items: baseline; }

/* ===== 固定九宫格 ===== */
.oracle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 4px;
}
.kin-cell {
  position: relative;
  background: var(--maya-card);
  border: 1px solid var(--maya-border);
  border-radius: var(--radius-md);
  padding: 10px 8px 11px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px;
  box-shadow: var(--maya-shadow-sm);
  overflow: hidden;
}
.kin-cell .role-zh { font-size: 12px; font-weight: 700; color: var(--maya-moss-deep); }
.kin-cell .role-en { font-size: 9px; letter-spacing: .4px; color: var(--maya-muted); text-transform: uppercase; }
.kin-cell .seal-icon { width: 54px; height: 54px; margin: 3px 0 1px; display: grid; place-items: center; border-radius: 12px; overflow:hidden; background:#fff; box-shadow: 0 4px 14px rgba(62, 90, 74, 0.06); }
.kin-cell .seal-icon svg { width: 30px; height: 30px; }
.kin-cell .seal-zh { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.kin-cell .seal-en { font-size: 9px; color: var(--maya-muted); line-height: 1.2; }
.kin-cell .kin-no { font-size: 12px; font-weight: 700; color: var(--maya-moss); letter-spacing: .5px; margin-top: 1px; }
.kin-cell .tone-line { font-size: 10px; color: var(--maya-muted); line-height: 1.25; }
.kin-cell .tone-glyph {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:5px; margin: 2px 0 4px; min-height: 26px;
}
.kin-cell .tg-dots { display:flex; align-items:center; justify-content:center; gap:6px; }
.kin-cell .tg-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--seal-yellow); display:block;
}
.kin-cell .tg-bars { display:flex; flex-direction:column; gap:4px; align-items:center; }
.kin-cell .tg-bar {
  width: 34px; height: 6px; border-radius: 999px;
  background: var(--seal-yellow); display:block;
}
/* 中心主图腾位视觉权重最高 */
.kin-cell.is-main {
  grid-column: 2; grid-row: 2;
  background: linear-gradient(160deg, #ffffff, var(--maya-mist));
  border: 1.5px solid var(--maya-sage);
  box-shadow: 0 12px 28px rgba(62,90,74,.16);
  padding: 14px 8px;
}
.kin-cell.is-main .seal-icon { width: 74px; height: 74px; border-radius: 16px; }
.kin-cell.is-main .seal-icon svg { width: 48px; height: 48px; }
.kin-cell.is-main .seal-zh { font-size: 15px; }
.kin-cell.is-main .seal-en { font-size: 10px; }
.kin-cell.is-main .kin-no { font-size: 14px; }
.kin-cell.is-main .tone-line { font-size: 11px; }
/* 四原色着色 */
.c-red { color: var(--seal-red); } .bg-red { background: var(--seal-red-bg); }
.c-white { color: var(--seal-white); } .bg-white { background: var(--seal-white-bg); }
.c-blue { color: var(--seal-blue); } .bg-blue { background: var(--seal-blue-bg); }
.c-yellow { color: var(--seal-yellow); } .bg-yellow { background: var(--seal-yellow-bg); }

/* 待核验 */
.badge-v {
  position: absolute; top: 6px; right: 6px;
  font-size: 8px; letter-spacing: .3px; line-height: 1;
  color: #9A7B2F; background: #F4ECD6; border: 1px solid #E4D4A8;
  padding: 3px 5px; border-radius: 999px;
}
.kin-cell.is-pending { opacity: .92; }
.kin-cell.is-pending .seal-icon { background: var(--maya-mist) !important; }
.kin-cell.is-pending .seal-icon svg { display: none; }
.pending-text { font-size: 10px; color: #9A7B2F; text-align: center; line-height: 1.3; padding: 6px 2px; }
.verify-note {
  font-size: 11px; color: #8A6D28; background: #F7F1DE; border: 1px solid #E8DCAE;
  border-radius: var(--radius-sm); padding: 9px 12px; margin-top: 10px; line-height: 1.5;
}

/* ===== 多人 ===== */
.member-row { display: flex; gap: 10px; align-items: flex-end; padding: 12px; border: 1px dashed var(--maya-border); border-radius: var(--radius-md); margin-bottom: 10px; background: #fff; }
.member-row .grow { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.member-row .two { display: flex; gap: 8px; }
.member-row .two > div { flex: 1; min-width: 0; }
.member-row .idx { width: 26px; height: 26px; border-radius: 50%; background: var(--maya-mist); color: var(--maya-moss); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; margin-bottom: 8px; }
.icon-btn { border: 1px solid var(--maya-border); background: #fff; color: var(--seal-red); border-radius: 10px; min-height: 38px; padding: 0 12px; cursor: pointer; font-family: inherit; font-size: 12.5px; }
.mini-kin-strip { display: flex; gap: 9px; overflow-x: auto; padding: 4px 2px 10px; }
.mini-kin { flex: 0 0 auto; width: 108px; border: 1px solid var(--maya-border); border-radius: var(--radius-md); padding: 10px; text-align: center; background: #fff; }
.mini-kin .nm { font-size: 12px; font-weight: 600; color: var(--maya-moss-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-kin .seal-icon { width: 40px; height: 40px; margin: 4px auto; display: grid; place-items: center; border-radius: 50%; }
.mini-kin .seal-icon svg { width: 28px; height: 28px; }
.mini-kin .kn { font-size: 11px; color: var(--maya-muted); }
.combined-head { text-align: center; padding: 6px 0 2px; }
.combined-head .seal-icon { width: 76px; height: 76px; margin: 6px auto; display: grid; place-items: center; border-radius: 50%; box-shadow: var(--maya-shadow); }
.combined-head .seal-icon svg { width: 56px; height: 56px; }
.relation-line { font-size: 12px; color: var(--maya-muted); margin: 4px 0; display: flex; justify-content: space-between; gap: 10px; }
.relation-line b { color: var(--maya-moss-deep); font-weight: 600; }
.section-title { font-size: 13px; font-weight: 700; color: var(--maya-moss); margin: 4px 0 10px; letter-spacing: .5px; }
.empty-hint { text-align: center; color: var(--maya-muted); font-size: 13px; padding: 26px 16px; line-height: 1.7; }

/* ===== 历史 ===== */
.hist-item { border: 1px solid var(--maya-border); border-radius: var(--radius-md); padding: 13px 14px; margin-bottom: 10px; background: #fff; }
.hist-item .h-top { display: flex; align-items: center; gap: 9px; }
.hist-item .h-title { font-size: 14.5px; font-weight: 700; color: var(--maya-moss-deep); flex: 1; min-width: 0; }
.hist-item .h-tag { font-size: 10.5px; color: var(--maya-moss); background: var(--maya-mist); border-radius: 999px; padding: 3px 9px; flex: 0 0 auto; }
.hist-item .h-meta { font-size: 11.5px; color: var(--maya-muted); margin: 6px 0 9px; }
.hist-item .h-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.hist-item .h-actions .btn.small { min-height: 34px; font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px); transform: translateX(-50%) translateY(20px);
  background: var(--maya-moss-deep); color: #F2F6F0; font-size: 13px; padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60; max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 底部 Tab ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: center;
  background: rgba(251, 252, 248, .92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--maya-border);
}
.tabbar-inner { width: 100%; max-width: 580px; display: grid; grid-template-columns: repeat(4,1fr); height: var(--tab-h); }
.tabbar button {
  border: 0; background: transparent; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--maya-muted); font-size: 11.5px; min-height: 44px;
}
.tabbar button .ticon { width: 23px; height: 23px; display: grid; place-items: center; }
.tabbar button .ticon svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--maya-moss-deep); font-weight: 700; }
.tabbar button.active .ticon { transform: translateY(-1px); }

.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 英文模式：隐藏中文主标之外的处理由 JS 加 lang 类；这里仅微调 */
body.lang-en .zh-only { display: none; }
body.lang-zh .en-only { display: none; }
.seal-en, .role-en { /* 副标题常驻，由显示模式控制显隐 */ }
body.lang-zh .seal-en, body.lang-zh .role-en { display: none; }
body.lang-en .seal-zh, body.lang-en .role-zh { display: none; }
body.lang-en .seal-en { display: block; } body.lang-en .role-en { display: block; }

@media (max-width: 380px) {
  .app { padding-left: 13px; padding-right: 13px; }
  .oracle-grid { gap: 7px; }
  .kin-cell { padding: 8px 5px 9px; }
  .kin-cell .seal-icon { width: 36px; height: 36px; }
  .kin-cell .seal-icon svg { width: 27px; height: 27px; }
}
@media (min-width: 620px) {
  .app { padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
/* ===== 通用双语元素（components 生成） ===== */
body.lang-zh .bi-en { display: none !important; }
body.lang-en .bi-zh { display: none !important; }
body.lang-bi .bi-zh, body.lang-bi .bi-en { display: inline; }
body.lang-en .tone-sep { display: none; }
/* ===== v0.4.4 visual / confirmed JPG seals ===== */
:root {
  --maya-cream: #FCFDF9;
  --maya-lilac: #B4A0C9;
}
body {
  background:
    radial-gradient(900px 520px at 50% 0%, #eef5ee 0, transparent 72%),
    linear-gradient(180deg, #f9fbf7 0%, #f3f7f1 100%);
}
.app { max-width: 620px; padding-left: 22px; padding-right: 22px; }
.app-header { padding-top: max(22px, env(safe-area-inset-top)); }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: .18em; }
.brand-tag { letter-spacing: .08em; }

.page-hero { text-align: center; padding: 26px 12px 28px; }
.eyebrow { font-family: Georgia, "Times New Roman", serif; color: var(--maya-sage); letter-spacing: .24em; font-size: 12px; margin-bottom: 10px; }
.hero-title, .chart-heading { font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif; color: var(--maya-moss-deep); font-weight: 400; }
.hero-title { font-size: clamp(26px, 6vw, 35px); letter-spacing: .08em; line-height: 1.35; }
.hero-sub { color: var(--maya-muted); font-size: 13px; margin-top: 10px; }
.chart-heading { text-align: center; font-size: 22px; letter-spacing: .12em; margin: 25px 0 16px; }
.chart-heading::before, .chart-heading::after { content:""; display:inline-block; width:54px; height:1px; background:var(--maya-border); vertical-align:middle; margin:0 14px; }

.chart-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
.moon-card { margin-bottom: 10px; }
.oracle-grid, .group-oracle-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.group-oracle-grid .kin-cell:nth-child(7) { grid-column: 2; }
.group-editor-card { padding: 22px; }

.kin-cell { min-height: 205px; justify-content: flex-start; padding: 12px 8px 14px; border-radius: 18px; background: rgba(255,255,255,.86); }
.kin-cell .role-zh { font-size: 13px; color:#8b7aa1; font-weight:500; }
.kin-cell .role-en { font-size: 9px; color:#aa9bb8; font-family: Georgia, serif; }
.kin-cell .seal-icon { width: 78px; height: 78px; margin: 8px 0 5px; border-radius: 16px; overflow:hidden; background:#fff; box-shadow: 0 3px 9px rgba(49,70,58,.10); }
.kin-cell .seal-icon .seal-jpg { width:100%; height:100%; object-fit:cover; display:block; }
.kin-cell .seal-zh { font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 15px; font-weight: 500; color:#3f4a43; line-height:1.25; }
.kin-cell .seal-en { font-family: Georgia, "Times New Roman", serif; font-size: 10px; color:#8d9890; }
.kin-cell .kin-no { font-family: Georgia, "Times New Roman", serif; font-size:12px; color:#9a8aad; font-weight:500; margin-top:2px; }
.kin-cell .tone-line { color:#9a7344; font-size:10px; margin-top:1px; }
.kin-cell.is-main { min-height:205px; background: linear-gradient(160deg,#fff,#edf4ed); border:1.5px solid #9fb8a3; box-shadow:0 12px 28px rgba(62,90,74,.13); padding:12px 8px 14px; }
.kin-cell.is-main .seal-icon { width:88px; height:88px; }
.kin-cell.is-main .seal-zh { font-size:17px; }
.kin-cell.is-main .seal-en { font-size:10px; }
.kin-cell.is-main .kin-no { font-size:13px; }
.kin-cell.is-main .tone-line { font-size:11px; }

/* old SVG styling no longer drives the seals */
.kin-cell .seal-icon svg, .mini-kin .seal-icon svg, .combined-head .seal-icon svg { display:none; }
.kin-cell .seal-jpg, .mini-kin .seal-jpg, .combined-head .seal-jpg { width:100%; height:100%; object-fit:cover; display:block; }
.mini-kin .seal-icon, .combined-head .seal-icon { overflow:hidden; border-radius:14px; background:#fff; }
.mini-kin .seal-jpg, .combined-head .seal-jpg { width:100%; height:100%; object-fit:cover; display:block; }

.member-row { align-items:center; background:rgba(255,255,255,.75); border-style:solid; border-radius:18px; padding:14px; }
.member-row .idx { align-self:flex-start; margin-top:10px; }
.member-row input + input { margin-top:4px; }
.icon-btn:disabled { visibility:hidden; }
.btn:disabled { opacity:.45; cursor:not-allowed; }

body.lang-bi .seal-names, body.lang-bi .role-names { display:block; }
body.lang-bi .seal-en, body.lang-bi .role-en { display:block; }
body.lang-bi .seal-zh, body.lang-bi .role-zh { display:block; }

/* 调性与图腾组合显示：浮标附着图腾框，不改变原版JPG，也不占卡片纵向空间。 */
.kin-cell .seal-stage {
  position:relative;
  width:78px;
  height:78px;
  margin:8px 0 5px;
  flex:0 0 auto;
}
.kin-cell .seal-stage .seal-icon {
  width:100%;
  height:100%;
  margin:0;
}
.kin-cell .seal-stage .tone-glyph {
  position:absolute;
  top:-7px;
  right:-9px;
  z-index:2;
  min-width:34px;
  min-height:24px;
  margin:0;
  padding:4px 5px 3px;
  gap:3px;
  border:1px solid rgba(196,155,69,.45);
  border-radius:10px;
  background:rgba(252,249,239,.96);
  box-shadow:0 3px 9px rgba(80,67,39,.12);
}
.kin-cell .seal-stage .tg-dots { gap:3px; }
.kin-cell .seal-stage .tg-dot { width:4px; height:4px; }
.kin-cell .seal-stage .tg-bars { gap:2px; }
.kin-cell .seal-stage .tg-bar { width:20px; height:3px; }
.kin-cell.is-main .seal-stage { width:88px; height:88px; }

@media (max-width: 460px) {
  .app { padding-left: 12px; padding-right:12px; }
  .oracle-grid, .group-oracle-grid { gap:7px; }
  .kin-cell { min-height:178px; padding:9px 4px 10px; border-radius:15px; }
  .kin-cell .seal-icon { width:64px; height:64px; border-radius:13px; }
  .kin-cell .tg-dot { width:7px; height:7px; }
  .kin-cell .tg-bar { width:34px; height:6px; }
  .kin-cell.is-main { min-height:178px; padding:9px 4px 10px; }
  .kin-cell.is-main .seal-icon { width:72px; height:72px; }
  .kin-cell .seal-stage { width:64px; height:64px; }
  .kin-cell.is-main .seal-stage { width:72px; height:72px; }
  .kin-cell .seal-stage .tone-glyph { top:-6px; right:-7px; min-width:31px; padding:3px 4px; }
  .kin-cell .seal-stage .tg-dot { width:3.5px; height:3.5px; }
  .kin-cell .seal-stage .tg-bar { width:18px; height:3px; }
  .kin-cell .seal-zh { font-size:13px; }
  .kin-cell.is-main .seal-zh { font-size:14px; }
  .kin-cell .role-zh { font-size:12px; }
  .chart-heading { font-size:19px; }
  .chart-heading::before, .chart-heading::after { width:30px; margin:0 9px; }
  .member-row { gap:7px; padding:10px; }
  .member-row .idx { display:none; }
  .icon-btn { padding:0 8px; }
}
body.lang-zh .tone-sep, body.lang-en .tone-sep { display:none !important; }
body.lang-bi .tone-sep { display:inline; color:#c0b7c8; }

/* v0.4.4 typography normalization: one clean sans-serif system across the app */
html, body, button, input, select, textarea {
  font-family: var(--font-ui);
}
button, input, select, textarea {
  font: inherit;
}
.bi-en, .role-en, .seal-en, .brand-tag, .kin-no, .tone-line {
  font-family: var(--font-ui);
}
.brand-name, .chart-heading, .seal-zh, .role-zh, .kin-no {
  font-weight: 600;
}
body {
  letter-spacing: 0;
}


/* ===== v0.4.5: unified Heiti-style sans, bilingual date blocks, chakra colors, Records/Sync ===== */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Heiti SC", "SimHei", Arial, sans-serif;
}
html, body, button, input, select, textarea,
.brand-name, .brand-tag, .eyebrow, .hero-title, .hero-sub, .chart-heading,
.role-zh, .role-en, .seal-zh, .seal-en, .kin-no, .tone-line, .section-title {
  font-family: var(--font-ui) !important;
}
.brand-name { font-weight: 700; letter-spacing: .15em; }
.eyebrow { font-weight: 600; }
.hero-title, .chart-heading { font-weight: 600; }

.moon-detail { display:block; font-size:12.5px; line-height:1.65; }
.moon-detail .moon-lang { display:block; }
.moon-detail .moon-lang + .moon-lang { margin-top:10px; padding-top:10px; border-top:1px solid rgba(215,226,216,.72); }
.moon-detail .moon-sub { display:flex; align-items:center; gap:6px; color:var(--maya-muted); }
.chakra-dot { width:9px; height:9px; border-radius:50%; background:var(--chakra); display:inline-block; flex:0 0 auto; box-shadow:0 0 0 3px color-mix(in srgb, var(--chakra) 15%, transparent); }
body.lang-zh .moon-detail .moon-lang + .moon-lang, body.lang-en .moon-detail .moon-lang + .moon-lang { margin-top:0; padding-top:0; border-top:0; }

/* In bilingual mode, language blocks stay on separate lines rather than interleaving inline spans. */
body.lang-bi .moon-detail .bi-zh, body.lang-bi .moon-detail .bi-en { display:block !important; }

/* Records */
.record-tools { margin-bottom:12px; }
.hist-item .h-identity { margin-top:5px; color:var(--maya-moss); font-size:12.5px; font-weight:600; }
.hist-item .h-meta { line-height:1.6; }
.edit-person-row { display:flex; gap:8px; margin-bottom:7px; }
.edit-person-row > input { flex:1; min-width:0; }

.sync-card { padding:16px; }
.sync-hint { color:var(--maya-muted); font-size:11.5px; line-height:1.6; margin:-2px 0 12px; }

.sync-status-row { display:flex; align-items:center; gap:8px; margin:4px 0 12px; color:var(--maya-muted); font-size:12px; }
.sync-status-dot { width:8px; height:8px; border-radius:50%; background:var(--maya-border); box-shadow:0 0 0 3px rgba(62,90,74,.05); }
.sync-card.is-connected .sync-status-dot { background:var(--maya-sage); }
.sync-card.is-connected .sync-status-row { color:var(--maya-text); }
.sync-key-field { margin: 0 0 10px; }
.sync-key-field input { width:100%; }
.sync-only-row .btn { width:100%; flex:1 1 100%; }
.paste-card textarea { width:100%; resize:vertical; min-height:230px; margin:6px 0 12px; padding:12px 13px; border:1px solid var(--maya-border); border-radius:var(--radius-md); background:#fff; color:var(--maya-text); font:12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.paste-card textarea:focus { outline:2px solid var(--maya-celadon); border-color:var(--maya-sage); }

@media (max-width:460px){
  .moon-detail { font-size:11.5px; }
  .moon-detail .moon-lang + .moon-lang { margin-top:8px; padding-top:8px; }
  .record-tools .btn { flex:1 1 30%; padding-left:7px; padding-right:7px; }
  .sync-card .btn-row .btn { flex:1 1 100%; padding-left:7px; padding-right:7px; }
}


/* ===== v0.4.8: Header version aligned to Today information hierarchy ===== */
.brand-tag { white-space: nowrap; }
.brand-version {
  margin-top: 3px;
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--maya-muted);
  opacity: 1;
  font-variant-numeric: tabular-nums;
}
body.lang-bi .tone-line .bi-zh,
body.lang-bi .tone-line .bi-en {
  display: block !important;
}
body.lang-bi .tone-line .tone-sep { display: none !important; }

/* ===== v0.4.8: bilingual Tone = two rows, each row never splits ===== */
body.lang-bi .tone-line .bi-zh,
body.lang-bi .tone-line .bi-en {
  display: block !important;
  width: 100%;
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 460px) {
  .kin-cell .tone-line {
    font-size: 9.2px;
    line-height: 1.38;
    letter-spacing: -0.012em;
  }
  .kin-cell.is-main .tone-line {
    font-size: clamp(7.6px, 2.2vw, 8.6px);
    letter-spacing: -0.025em;
  }
}


/* ===== v0.4.9: SN49 cleanup / two-line chart headings / ISO date fields / record notes ===== */
.chart-heading {
  display: grid;
  grid-template-columns: minmax(28px, 1fr) minmax(0, auto) minmax(28px, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  letter-spacing: 0;
}
.chart-heading::before,
.chart-heading::after {
  width: 100%;
  margin: 0;
}
.chart-heading-copy { display: block; min-width: 0; text-align: center; line-height: 1.3; }
.chart-heading-copy .bi-zh { font-size: 22px; font-weight: 600; letter-spacing: .10em; white-space: nowrap; }
.chart-heading-copy .bi-en { font-size: 16px; font-weight: 500; letter-spacing: .055em; white-space: nowrap; margin-top: 3px; }
body.lang-bi .chart-heading-copy .bi-zh,
body.lang-bi .chart-heading-copy .bi-en { display: block !important; }
body.lang-zh .chart-heading-copy .bi-zh,
body.lang-en .chart-heading-copy .bi-en { display: block !important; }

.chart-identity {
  margin: -6px 0 14px;
  text-align: center;
  color: var(--maya-moss-deep);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
}
@media (max-width: 460px) {
  .chart-identity { margin-top: -4px; font-size: 12.5px; padding: 0 10px; }
}

.date-input { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.record-note-field { margin-top: 4px; margin-bottom: 13px; }
.record-note-field textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 11px 13px;
  border: 1px solid var(--maya-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--maya-text);
  font: inherit;
  line-height: 1.55;
}
.record-note-field textarea:focus { outline: 2px solid var(--maya-celadon); border-color: var(--maya-sage); }

.sync-card { padding: 0; overflow: hidden; }
.sync-card > summary { list-style: none; }
.sync-card > summary::-webkit-details-marker { display: none; }
.sync-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.sync-summary .section-title { margin: 0; }
.sync-summary-state { color: var(--maya-muted); font-size: 11.5px; white-space: nowrap; }
.sync-summary::after { content: "＋"; color: var(--maya-muted); font-size: 16px; line-height: 1; margin-left: 2px; }
.sync-card[open] .sync-summary::after { content: "−"; }
.sync-card.is-connected .sync-summary-state { color: var(--maya-moss); }
.sync-panel { padding: 0 16px 16px; border-top: 1px solid rgba(215,226,216,.72); }
.sync-panel .sync-hint { margin: 12px 0; }

@media (max-width: 460px) {
  .chart-heading { gap: 9px; grid-template-columns: minmax(20px,1fr) minmax(0,auto) minmax(20px,1fr); }
  .chart-heading-copy .bi-zh { font-size: 19px; letter-spacing: .06em; }
  .chart-heading-copy .bi-en { font-size: 13px; letter-spacing: .02em; }
}

/* ===== v0.5.0: Today / Profile / Share / Archive ===== */
.date-control { position:relative; display:flex; align-items:center; gap:7px; width:100%; }
.date-control .date-input { flex:1 1 auto; min-width:0; padding-right:48px; }
.date-picker-proxy { position:absolute; right:0; top:0; width:46px; height:46px; opacity:0; pointer-events:none; }
.date-picker-btn { position:absolute; right:5px; top:5px; width:36px; height:36px; display:grid; place-items:center; border:0; border-radius:10px; background:var(--maya-mist); color:var(--maya-moss); cursor:pointer; }
.date-picker-btn svg { width:18px; height:18px; }
select, input[type="time"] { width:100%; min-height:46px; padding:10px 13px; border:1px solid var(--maya-border); border-radius:var(--radius-md); background:#fff; color:var(--maya-text); font-size:15px; }
select:focus, input[type="time"]:focus { outline:2px solid var(--maya-celadon); border-color:var(--maya-sage); }
.profile-more { margin:0 0 14px; border:1px solid var(--maya-border); border-radius:var(--radius-md); background:rgba(232,239,232,.45); overflow:hidden; }
.profile-more > summary { list-style:none; cursor:pointer; padding:11px 13px; color:var(--maya-moss); font-size:12.5px; font-weight:600; }
.profile-more > summary::-webkit-details-marker { display:none; }
.profile-more > summary::after { content:"＋"; float:right; color:var(--maya-muted); }
.profile-more[open] > summary::after { content:"−"; }
.profile-more-body { padding:2px 12px 1px; border-top:1px solid rgba(215,226,216,.75); }
.profile-more-body .field:first-child { margin-top:10px; }
.member-profile-card { align-items:flex-start; }
.member-more { margin:5px 0 0; }
.archive-person { border-bottom:1px solid rgba(215,226,216,.7); padding:4px 0 10px; margin-bottom:10px; }
.archive-person:last-child { border-bottom:0; }
.edit-person-row > .date-control { flex:1; min-width:0; }
.result-actions { margin:2px 0 18px; }
.result-actions .btn { min-width:0; }
body.lang-bi .chart-identity .bi-zh, body.lang-bi .chart-identity .bi-en { display:block !important; }
body.lang-bi .hero-title .bi-zh, body.lang-bi .hero-title .bi-en,
body.lang-bi .hero-sub .bi-zh, body.lang-bi .hero-sub .bi-en { display:block !important; }
body.lang-bi .hero-title .bi-en { font-size:.58em; letter-spacing:.025em; margin-top:4px; }
body.lang-bi .hero-sub .bi-en { margin-top:3px; }

/* Gregorian month overview, enriched with MAYA seal + tone. One month per page. */
.month-card-view { padding:15px 12px 13px; }
.month-section-label { text-align:center; color:var(--maya-sage); font-size:11px; font-weight:700; letter-spacing:.18em; margin-bottom:5px; }
body.lang-bi .month-section-label .bi-zh, body.lang-bi .month-section-label .bi-en { display:block !important; }
.month-nav { display:grid; grid-template-columns:40px 1fr 40px; align-items:center; gap:5px; margin-bottom:10px; }
.month-title { text-align:center; color:var(--maya-moss-deep); font-size:18px; font-weight:700; line-height:1.25; }
body.lang-bi .month-title .bi-zh, body.lang-bi .month-title .bi-en { display:block !important; }
body.lang-bi .month-title .bi-en { font-size:12px; color:var(--maya-muted); margin-top:2px; font-weight:500; }
.month-arrow { width:38px; height:38px; border:1px solid var(--maya-border); border-radius:12px; background:#fff; color:var(--maya-moss); font-size:26px; line-height:1; cursor:pointer; }
.month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.month-weekdays { margin-bottom:4px; }
.month-weekday { text-align:center; font-size:10px; color:var(--maya-muted); line-height:1.25; padding:2px 0; }
body.lang-bi .month-weekday .bi-zh, body.lang-bi .month-weekday .bi-en { display:block !important; }
body.lang-bi .month-weekday .bi-en { font-size:8px; }
.month-day { position:relative; min-width:0; min-height:82px; padding:5px 2px 4px; border:1px solid transparent; border-radius:12px; background:rgba(255,255,255,.66); color:var(--maya-text); cursor:pointer; overflow:visible; }
.month-day.is-empty { background:transparent; border-color:transparent; cursor:default; }
.month-day.is-today { border-color:var(--maya-sage); box-shadow:inset 0 0 0 1px var(--maya-sage); }
.month-day.is-selected { background:var(--maya-mist); border-color:var(--maya-moss); }
.month-day-no { display:block; text-align:left; padding-left:3px; font-size:10px; font-weight:700; color:var(--maya-muted); line-height:1; }
.month-seal-stage { position:relative; width:42px; height:42px; display:block; margin:5px auto 1px; }
.month-seal-stage .seal-icon.month-seal { width:42px; height:42px; display:block; border-radius:10px; overflow:hidden; background:#fff; box-shadow:0 2px 7px rgba(49,70,58,.08); }
.month-seal-stage .seal-jpg { width:100%; height:100%; object-fit:cover; display:block; }
.month-tone { position:absolute; top:-6px; right:-7px; z-index:2; display:flex; flex-direction:column; align-items:center; gap:1.5px; min-width:18px; padding:2px 3px; border:1px solid rgba(196,155,69,.42); border-radius:7px; background:rgba(252,249,239,.97); box-shadow:0 2px 5px rgba(80,67,39,.10); }
.month-tone .tg-dots { display:flex; gap:1.5px; }
.month-tone .tg-dot { width:2.3px; height:2.3px; border-radius:50%; background:var(--seal-yellow); }
.month-tone .tg-bars { display:flex; flex-direction:column; gap:1px; }
.month-tone .tg-bar { width:11px; height:1.8px; border-radius:999px; background:var(--seal-yellow); }
.month-kin { display:block; text-align:center; color:var(--maya-muted); font-size:7.5px; line-height:1.1; }
.today-date-label { text-align:center; margin:-7px 0 10px; color:var(--maya-muted); font-size:12px; }
.text-btn { border:0; background:transparent; color:var(--maya-moss); text-decoration:underline; font:inherit; cursor:pointer; padding:0 0 0 5px; }
.today-oracle-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.today-oracle-grid .kin-cell:nth-child(1) { grid-column:2; grid-row:1; }
.today-oracle-grid .kin-cell:nth-child(2) { grid-column:1; grid-row:2; }
.today-oracle-grid .kin-cell:nth-child(3) { grid-column:2; grid-row:2; }
.today-oracle-grid .kin-cell:nth-child(4) { grid-column:3; grid-row:2; }
.today-oracle-grid .kin-cell:nth-child(5) { grid-column:2; grid-row:3; }
.today-wave { text-align:center; color:var(--maya-muted); font-size:12px; line-height:1.45; margin:-2px 0 13px; }
body.lang-bi .today-wave .bi-zh, body.lang-bi .today-wave .bi-en { display:block !important; }

@media (max-width:460px){
  .tabbar button { font-size:10.5px; gap:3px; }
  .tabbar button .ticon svg { width:20px; height:20px; }
  .month-card-view { padding-left:8px; padding-right:8px; }
  .month-grid { gap:2px; }
  .month-day { min-height:68px; border-radius:9px; padding:4px 1px 3px; }
  .month-day-no { font-size:9px; }
  .month-seal-stage { width:34px; height:34px; margin-top:4px; }
  .month-seal-stage .seal-icon.month-seal { width:34px; height:34px; border-radius:8px; }
  .month-tone { top:-5px; right:-6px; min-width:16px; padding:1.5px 2px; }
  .month-tone .tg-dot { width:2px; height:2px; }
  .month-tone .tg-bar { width:9px; height:1.6px; }
  .month-kin { font-size:6.5px; }
  .today-oracle-grid { gap:6px; }
  .today-oracle-grid .kin-cell { min-height:165px; }
  .edit-person-row { flex-direction:column; }
  .edit-person-row > input, .edit-person-row > .date-control { width:100%; flex:none; }
}
