:root {
  color-scheme: light;
  --caption-leading: 1.22;
  --note-leading: 1.35;
  --ink: #272624;
  --muted: #645f59;
  --dark: #22211f;
  --gold: #efd294;
  --line: #e7e4de;
  --serif: "Songti SC","STSong","Noto Serif CJK SC",serif;
  font-family: "PingFang SC","Hiragino Sans GB",system-ui,sans-serif;
  color: var(--ink);
  background: #e8e8e6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button,input,select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
:focus-visible,.segments input:focus-visible + span { outline: 2px solid #aa762f; outline-offset: 2px; }
.app-shell { width: 100%; max-width: 560px; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(56px + env(safe-area-inset-bottom)); background: white; margin: 0 auto; box-shadow: 0 0 0 1px #dadad6; }
.mast { background: white; }
.mast-inner { position: relative; min-height: 57px; display: flex; align-items: center; justify-content: center; }
.brand { text-align:center; }
.app-shell:has(#entry:not([hidden])) .brand { padding-block:10px; }
.wordmark { justify-content:center; display: flex; align-items: center; gap: 8px; font: 700 1.28rem var(--serif); letter-spacing: .08em; }
.seal { border: 1px solid #8b473b; color: #8b473b; width: 23px; height: 25px; display: grid; place-items: center; font: 700 16px var(--serif); }
#phone-link { position: absolute; right: 16px; color: #58534b; font-size: .8rem; text-underline-offset: 4px; padding-block: 13px; }
.mobile-nav { position: fixed; bottom: 0; inset-inline: 0; max-width: 560px; margin: auto; z-index: 2; display: flex; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: white; }
.mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 55px; color: #53504a; text-decoration: none; font-size: .74rem; line-height: 1.2; }
.mobile-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mobile-nav a[aria-current="page"] { color: #936719; font-weight: 650; }
.mobile-nav a[aria-current="page"] svg { stroke-width: 1.9; }
.mobile-nav a[aria-disabled="true"] { color: #a8a59e; cursor: default; }
.workspace { padding-bottom: max(36px,env(safe-area-inset-bottom)); }
aside { background: #2b2a27; color: #f1e9d5; }
.edit-toggle { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; padding: 14px 18px; background: transparent; color: inherit; }
#birth-kind { color: var(--gold); min-width: 2em; font: 600 1.2rem var(--serif); }
.birth-dates { min-width: 0; overflow-wrap: anywhere; display: grid; gap: 1px; font-size: .84rem; line-height: 1.28; font-variant-numeric: tabular-nums; }
#edit-label { margin-left: auto; flex-shrink: 0; color: var(--gold); font-size: .83rem; }
#place-summary { color: #d3c6a9; }
#timing-summary { color: var(--gold); }
#entry { background: #f5f5f3; padding: 24px 16px max(36px,env(safe-area-inset-bottom)); }
.app-shell:has(#entry:not([hidden])) { background: #f5f5f3; }
.entry-title { margin: 0 4px 12px; font: 650 1.08rem/1.5 var(--serif); }
.entry-card { padding-inline: 16px; background: white; border-radius: 16px; }
.form-row,.form-choice { min-height: 58px; border: 0; border-bottom: 1px solid #eeece7; padding: 0; margin: 0; min-width: 0; }
.entry-card > :last-child { border: 0; }
.form-row { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: center; gap: 12px; }
.form-row > label,.field-label,.form-choice legend { font-size: .95rem; font-weight: 550; }
.form-choice legend { float: left; display: flex; align-items: center; height: 57px; padding: 0; }
.segments { display: flex; justify-content: flex-end; align-items: center; min-height: 57px; }
.segments label { position: relative; display: grid; align-items: center; min-height: 44px; cursor: pointer; }
.segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segments span { display: grid; place-items: center; min-width: 55px; height: 32px; border-radius: 32px; background: #f4f3f1; color: #655f56; font-size: .87rem; }
.segments label + label { margin-left: 4px; }
.segments input:checked + span { background: #ecd09a; color: #3e3020; font-weight: 650; }
input[type=date],input[type=time],select { min-width: 0; max-width: 100%; font-size: 16px; color: var(--ink); }
.form-row > input,.form-row select { min-width: 0; width: 100%; height: 48px; border: 0; border-radius: 0; background-color: transparent; color: var(--ink); font-size: 16px; line-height: normal; text-align: right; }
.form-row input[type=date],.form-row input[type=time] { justify-self: end; width: auto; max-width: 100%; }
.form-row input::-webkit-date-and-time-value { text-align: right; }
.form-row input::placeholder { color: #777269; }
.form-row select { text-align-last: right; }
.lunar-selects { display: flex; justify-content: flex-end; }
.lunar-selects select { width: auto; }
.region-field { border: 0; border-bottom: 1px solid #eeece7; margin: 0; min-width: 0; padding: 12px 0; }
.region-field legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; font-size: .95rem; font-weight: 550; }
.region-selects { clear: both; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.region-selects select { width: 100%; height: 44px; padding-inline: 5px; text-overflow: ellipsis; background: #f8f7f4; border: 1px solid #e6e2d9; border-radius: 5px; }
.basis-choice { border-bottom: 0; }
.basis-choice .segments span { padding-inline: 10px; }
.time-preview { background: #f8f5ed; border-radius: 7px; padding: 9px 12px; }
.time-preview dl { margin: 0; }
.time-preview dl > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1px 8px; padding: 2px 0; line-height: var(--caption-leading); }
.time-preview dt,.time-preview dd { font-size: .83rem; }
.time-preview dt { color: #6b5d46; }
.time-preview dd { margin: 0; font-variant-numeric: tabular-nums; }
#preview-status { margin: 3px 0 0; color: var(--muted); font-size: .76rem; line-height: var(--note-leading); }
#preview-status:empty { display: none; }
.retry { padding: 7px 0; min-height: 44px; border: 0; background: transparent; color: #79521e; text-decoration: underline; text-underline-offset: 3px; font-size: .82rem; }
.hint { margin: 7px 4px 0; color: var(--muted); font-size: .78rem; line-height: var(--note-leading); }
.primary { background: var(--dark); color: var(--gold); border: 0; min-height: 46px; font-weight: 600; }
.primary { display: block; width: 100%; min-height: 50px; margin-top: 22px; border-radius: 28px; letter-spacing: .1em; }
.status { margin: 6px 4px 0; font-size: .85rem; line-height: var(--note-leading); color: #78412c; }
@media (max-width: 340px) {
  #entry { padding-inline: 10px; }
  .entry-card { padding-inline: 12px; }
  .form-row { gap: 6px; }
}
.status:empty { display: none; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 17px 16px 12px; }
h1,h2 { margin: 0; font: 650 1.26rem/1.32 var(--serif); }
.section-head > span { color: var(--muted); font-size: .8rem; }
table { border-collapse: collapse; table-layout: fixed; width: 100%; border-block: 1px solid var(--line); }
th,td { text-align: center; padding: 7px 2px; }
thead th { background: #efeeeb; color: #45413b; font-size: .9rem; font-weight: 600; }
thead th:first-child { width: 16%; }
tbody th { color: var(--muted); font-weight: 500; font-size: .83rem; }
td { font-size: .88rem; }
td:has(span) { vertical-align: top; }
td span { display: block; line-height: 1.55; }
tbody tr:nth-child(even) { background: #f6f6f4; }
tbody tr.large td { font: 650 clamp(1.9rem,6vw,2.25rem)/1.15 var(--serif); padding-block: 9px; }
.wood { color: #297344; } .fire { color: #bd3c33; } .earth { color: #835327; } .metal { color: #966c13; } .water { color: #285fab; }
.subtitle { margin: 0 16px 8px; color: var(--muted); font-size: .88rem; line-height: var(--caption-leading); }
.luck-board { --visible-luck-cells: 10; border-block: 1px solid var(--line); background: white; }
@media (min-width: 800px) { .luck-board { --visible-luck-cells: 14; } }
@media (min-width: 940px) { .luck-board { --visible-luck-cells: 16; } }
.luck-band { display: flex; min-width: 0; }
.luck-band + .luck-band { border-top: 1px solid var(--line); }
.band-title { display: grid; place-items: center; flex: 0 0 34px; writing-mode: vertical-rl; letter-spacing: .17em; color: #685d4c; background: #f5f3ed; border-right: 1px solid var(--line); font: 600 .85rem var(--serif); }
.luck-strip { display: flex; flex: 1; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #d6cdb8 transparent; }
.luck-cell { flex: 0 0 calc(100% / var(--visible-luck-cells)); min-width: 0; white-space: nowrap; scroll-snap-align: start; padding: 7px 0; border: 0; border-radius: 0; border-right: 1px solid #efede7; background: white; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; line-height: 1.2; }
#annuals .luck-cell span { font-size: .67rem; }
.luck-cell span { font-size: .72rem; color: var(--muted); }
.luck-cell b { display: block; font: 650 1.23rem/1.07 var(--serif); }
.luck-cell .pre-luck { writing-mode: vertical-rl; letter-spacing: .15em; }
.luck-cell[aria-pressed="true"] { background: #f7efdf; box-shadow: inset 0 -2px #9a702f; }
.luck-cell:focus-visible { outline-offset: -2px; }
.sheet section { scroll-margin-top: 245px; }

.save-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; font-size: .95rem; font-weight: 550; cursor: pointer; }
#save-record { appearance: none; width: 43px; height: 26px; margin: 0; border-radius: 16px; background: #d6d3cd; cursor: pointer; }
#save-record::before { content: ""; display: block; width: 20px; height: 20px; margin: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 2px #0002; }
#save-record:checked { background: #967130; }
#save-record:checked::before { transform: translateX(17px); }
#records { padding: 22px 16px 30px; }
.app-shell:has(#records:not([hidden])) { background: #f5f5f3; }
.records-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 0 3px; margin-bottom: 15px; }
#record-count { color: var(--muted); font-size: .8rem; }
.record-search { display: flex; gap: 9px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.record-search svg { width: 19px; height: 19px; fill: none; stroke: #817b70; stroke-width: 1.6; flex: none; }
.record-search input { min-width: 0; width: 100%; height: 44px; background: transparent; border: 0; font-size: 16px; }
#record-list { margin-top: 16px; background: white; border-radius: 12px; }
.record-item { display: grid; gap: 5px; align-items: center; grid-template-columns: minmax(0,1fr) auto; width: 100%; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 16px; text-align: left; overflow-wrap: anywhere; }
.record-item:last-child { border-bottom: 0; }
.record-item strong { font: 650 1.08rem var(--serif); }
.record-item small { color: var(--muted); grid-column: 1; font-size: .8rem; line-height: 1.5; }
.record-item .record-pillars { color: #795c29; font: 550 1rem var(--serif); letter-spacing: .08em; }
.record-item .chevron { grid-column: 2; grid-row: 1 / span 3; color: #9a9285; font-size: 1.4rem; }
#records-empty { text-align: center; padding: 56px 16px; }
.book-mark { display: inline-grid; place-items: center; width: 42px; height: 52px; border: 1px solid #ad9468; border-left: 5px double #ad9468; border-radius: 3px; color: #846a3c; font: 600 1.4rem var(--serif); }
#records-empty h2 { font-size: 1.05rem; margin-top: 18px; }
#records-empty p { margin: 5px 0 10px; font-size: .85rem; line-height: var(--note-leading); color: var(--muted); }
#go-entry { color: var(--gold); background: var(--dark); border: 0; border-radius: 24px; padding: 0 24px; min-height: 44px; }

.filter-row { display: flex; align-items: center; gap: 10px; padding: 10px 3px 0; font-size: .88rem; }
.filter-row label { color: var(--muted); }
.filter-row select { max-width: 80%; min-height: 44px; padding-inline: 10px; border: 0; background: transparent; font-weight: 600; }
.record-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-right: 10px; border-bottom: 1px solid var(--line); }
.record-row:last-child { border-bottom: 0; }
.record-row .record-item { display: flex; flex-direction: column; align-items: flex-start; border: 0; }
.record-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.record-title .group-tag { background: #f7f2e7; color: #755d34; border-radius: 4px; padding: 1px 6px; font: 500 .72rem/1.6 system-ui, sans-serif; }
.edit-record { background: transparent; color: #745a30; border: 0; min-height: 44px; min-width: 44px; font-size: .83rem; }
#record-editor { width: min(92vw, 390px); max-height: 86dvh; padding: 22px 20px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
#record-editor::backdrop { background: rgb(33 30 24 / .38); }
#editor-title { margin-bottom: 10px; }
#delete-prompt { overflow-wrap: anywhere; font-size: .94rem; line-height: var(--note-leading); }
.dialog-actions { display: flex; gap: 8px; align-items: center; margin-top: 15px; }
.dialog-actions button { min-height: 44px; padding-inline: 12px; border-radius: 8px; border: 0; }
#delete-record { margin-right: auto; padding-left: 2px; color: #993c34; background: transparent; }
#cancel-edit { margin-left: auto; background: #f4f3ef; color: var(--ink); }
#commit-edit { background: var(--dark); color: var(--gold); }
#commit-edit.danger { background: #90382f; color: white; }
#chart:not([hidden]) + #luck { border-top: 6px solid #f5f4f1; }

.browser-storage-note:not([hidden]) { display: block; margin-block: .35rem; color: var(--muted, #695f50); font-size: .75rem; }

.entry-card .form-row,
.entry-card .form-choice,
.entry-card .save-row,
.entry-option summary { min-height: 50px; }
.entry-card .form-choice legend { height: 49px; }
.entry-card .segments { min-height: 49px; }
.entry-card .form-row small { color: var(--muted); font-size: .76rem; font-weight: 400; }
.entry-option { border-bottom: 1px solid #eeece7; }
.entry-option summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-weight: 550;
  font-size: .95rem;
}
.entry-option summary::-webkit-details-marker { display: none; }
.entry-option summary span {
  flex: 1;
  text-align: right;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.entry-option summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid #857b6a;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}
.entry-option[open] summary::after { transform: rotate(225deg) translate(-2px,-1px); }
.entry-option .region-field { padding-top: 0; }
.entry-option .region-field legend { font-size: .82rem; color: var(--muted); }
.entry-option .time-preview { margin-bottom: 12px; }
.entry-option .time-preview p { margin: 0; }
.entry-option .segments input:disabled + span { color: #837e77; background: #f4f3f1; cursor: default; }
.entry-save { display: flex; align-items: center; gap: 18px; }
.entry-save .form-row { flex: 1; border: 0; }
.entry-save .form-row input { text-align: left; }
.entry-save .save-row { gap: 8px; font-size: .86rem; flex-shrink: 0; }

.today-card { margin-top: 20px; padding: 12px 16px; border-radius: 16px; background: white; }
.today-head { display: flex; justify-content: space-between; align-items: center; }
.today-head h2 { font: 650 1.06rem/1.5 var(--serif); }
#instant-chart { padding: 0 2px 0 12px; min-height: 44px; border: 0; background: transparent; color: #76531c; font-weight: 600; font-size: .85rem; }
#today-pillars { display: grid; grid-template-columns: repeat(4, 1fr); margin: 3px 0 10px; }
.today-pillar { display: grid; gap: 3px; justify-items: center; border-inline-start: 1px solid var(--line); }
.today-pillar:first-child { border: 0; }
.today-pillar small { font-size: .72rem; color: var(--muted); }
.today-pillar b { font: 650 1.28rem/1.1 var(--serif); }
#today-solar,#today-lunar { margin: 3px 0; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

#chart-tabs { display: flex; position: sticky; top: 0; z-index: 3; background: #211f1d; }
#chart-tabs button { flex: 1; min-height: 46px; background: transparent; color: #f9f6f1; border: 0; border-bottom: 2px solid transparent; font-weight: 550; }
#chart-tabs button[aria-selected="true"] { color: #e9cc90; border-bottom-color: #c4a165; }
.term { background: transparent; font: inherit; border: 0; border-radius: 2px; padding: 1px 2px; line-height: inherit; color: inherit; cursor: help; text-align: inherit; }
.term:focus-visible { outline-offset: 0; }
@media (hover:hover) { .term:hover { background: #e9dfca; text-decoration: underline; text-underline-offset: 3px; } }
.chart-matrix td > .term { display: block; margin: 0 auto; }
.chart-matrix .wood { color: #297344; } .chart-matrix .fire { color: #b23931; }
.chart-matrix .earth { color: #835327; } .chart-matrix .metal { color: #936914; } .chart-matrix .water { color: #285fab; }
.chart-matrix .star-name { color: #795c24; font-size: .82rem; line-height: var(--caption-leading); }
.matrix-scroll { overflow-x:auto; }
.pro-matrix { width:100%; table-layout:auto; }
.pro-matrix td,.pro-matrix th { min-width: 55px; white-space:nowrap; padding: 2px; }
.pro-matrix tbody th,.pro-matrix thead th:first-child { width:auto; min-width:43px; position:sticky; left:0; z-index:1; background:#f0eeea; }
.pro-matrix .hidden-stem span { display:inline; line-height:inherit; }
.pro-matrix td { border-left:1px solid #f1efea; }
.pro-matrix .natal-start { border-left:2px solid #d6c6a7; }
.pro-matrix tbody tr.large td { font-size:1.7rem; padding-block:3px; }
.pro-matrix tbody tr:not(.large) .term { font-size:.8rem; }
.chart-matrix .star-name { text-wrap:balance; }
#pillars tr:last-child td { vertical-align:top; }
#pro-pillars:not(.all-stars) .star-name ~ .star-name { display:none; }
.stars-toggle { background:transparent; border:0; color:#73592f; font-size:.8rem; cursor:pointer; }
.stars-toggle { color:inherit; white-space:nowrap; padding:4px 0; }
.stars-toggle::after { display:inline-block; content:""; width:4px; height:4px; margin:0 1px 3px 4px; border:solid currentColor; border-width:0 1px 1px 0; transform:rotate(45deg); }
.stars-toggle[aria-expanded="true"]::after { transform:rotate(225deg); margin-bottom:0; }
.pro-header-actions { display:none; }
.professional-view aside { display:flex; align-items:center; position:relative; }
.professional-view .edit-toggle { flex:1; min-width:0; }
.professional-view .pro-header-actions { display:grid; justify-items:end; flex:none; gap:0; padding-right:12px; }
.palace-switch,.pro-header-actions summary { color:#ecd6a6; font-size:.78rem; cursor:pointer; }
.palace-switch { display:flex; gap:5px; align-items:center; min-height:25px; }
.palace-switch input { appearance:none; margin:0; width:24px; height:14px; border:1px solid #938b7c; border-radius:10px; background:#595650; cursor:pointer; }
.palace-switch input::before { content:""; display:block; width:10px; height:10px; margin:1px; border-radius:50%; background:white; }
.palace-switch input:checked { background:#957440; }
.palace-switch input:checked::before { transform:translateX(10px); }
.pro-header-actions summary { padding:4px 0 4px 8px; }
.pro-options { position:absolute; top:100%; right:8px; z-index:4; padding:6px 12px; background:white; border:1px solid var(--line); border-radius:5px; box-shadow:0 3px 10px #302a2422; }
.pro-options label { display:flex; align-items:center; gap:6px; min-height:36px; color:var(--ink); font-size:.83rem; }
.pro-options select { font:inherit; color:inherit; background:white; padding:5px; border:1px solid var(--line); border-radius:4px; }
.chart-fold > summary { cursor:pointer; color:#675d4b; font-size:.84rem; padding:9px 14px; }
.chart-fold > summary { border-bottom:1px solid var(--line); }
#pro-status:empty { display:none; }
#flow-hint:not(:empty) { padding:0 14px; }
.relation-empty { margin:3px 14px; font-size:.86rem; }
@media (max-width:560px) {
  .professional-view .mast-inner { min-height:34px; }
  .professional-view .wordmark { font-size:1rem; }
  .professional-view .seal { width:18px; height:20px; font-size:13px; }
  .professional-view #phone-link { padding-block:6px; }
  .professional-view #chart-tabs button { min-height:38px; }
  .professional-view .edit-toggle { padding:6px 12px; gap:10px; }
  .professional-view .birth-dates { row-gap:0; line-height:1.22; font-size:.78rem; }
  .professional-view #luck { border-top-width:2px; }
  .professional-view #luck .section-head { padding:5px 12px 1px; }
  .professional-view #luck-heading { font-size:1rem; }
  .professional-view #luck-start { font-size:.76rem; line-height:var(--caption-leading); margin:0 12px 3px; }
  .professional-view .luck-cell { gap:1px; padding:3px 0; min-height:44px; }
  .professional-view .luck-cell b { font-size:1.06rem; line-height:1.05; }
  .professional-view .luck-cell span { line-height:1.1; }
  .pro-matrix { table-layout:fixed; min-width:calc(32px + var(--columns) * 31px); line-height:1.15; }
  .pro-matrix th,.pro-matrix td { min-width:0; padding:1px 0; white-space:normal; }
  .pro-matrix tbody th,.pro-matrix thead th:first-child { min-width:0; width:32px; }
  .pro-matrix tbody tr.large td { font-size:1.5rem; line-height:1.06; padding-block:1px; }
  .pro-matrix .star-name { line-height:1.15; }
  .pro-matrix .term { max-width:100%; padding:0; }
  .pro-matrix .stars-toggle { font-size:.73rem; }
}
@media (max-width:410px) {
  .pro-matrix .hidden-stem span { display:none; }
  .pro-matrix .hidden-stem::after { content:attr(data-short); }
}
@media (max-width:560px) and (max-height:700px) {
  .professional-view .mast { display:none; }
  .professional-view .birth-dates { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 8px; }
  .professional-view #birth-lunar,.professional-view #place-summary { display:none; }
  .professional-view #luck { display:flex; flex-direction:column; }
  .professional-view #luck .section-head,.professional-view .luck-board { order:-1; }
  .professional-view #luck-start { margin-block:5px; }
}
.info-block h2,.relation-block h2 { font-size:1rem; padding:14px 16px 9px; }
.info-block dl { margin:0; }
.info-block dl > div { display:grid; grid-template-columns: minmax(7em,30%) minmax(0,1fr); align-items:center; padding:8px 16px; font-size:.88rem; gap:8px; }
.info-block dl > div:nth-child(odd) { background:#f5f4f1; }
.info-block dt { color:#60594f; }
.info-block dd { margin:0; overflow-wrap:anywhere; }
.relation-block { padding-block:5px; }
.relation-line { display:grid; grid-template-columns:3em minmax(0,1fr); padding:3px 16px; font-size:.84rem; line-height:var(--note-leading); }
.relation-line strong { color:#856832; }
.relation-line .term { margin:0 7px 1px 0; border-bottom:1px dotted #d3c5a9; }
#term-tip { box-sizing:border-box; position:fixed; inset:auto; width:max-content; max-width:min(340px,calc(100vw - 16px)); max-height:46dvh; overflow:auto; margin:0; padding:12px 32px 12px 14px; background:#fffdf7; border:1px solid #cabea1; border-radius:8px; color:#322e26; box-shadow:0 5px 20px #31291b33; z-index:50; }
#tip-heading { font-size:.94rem; color:#705426; }
#tip-text { margin:3px 0 0; font-size:.86rem; line-height:var(--note-leading); white-space:pre-line; }
#tip-close { position:absolute; top:2px; right:2px; width:30px; height:32px; border:0; background:transparent; font-size:1.12rem; color:#635644; }

/* Native-style profile and paired almanac rows. */
.info-view .workspace > aside { display:none; }
.info-profile { display:flex; align-items:center; gap:14px; padding:20px 16px 26px; color:#e7cf98; background:linear-gradient(125deg,#302b23,#1d1c1a 75%); }
.zodiac-seal { display:grid; place-items:center; flex:0 0 46px; height:46px; border:2px double #bfaa76; border-radius:50%; font:600 1.5rem var(--serif); }
.profile-name { flex:1; min-width:0; overflow-wrap:anywhere; border:0; padding:6px 0; text-align:left; background:none; color:inherit; font:600 1.08rem var(--serif); }
.profile-badges { display:grid; justify-items:end; gap:1px; white-space:nowrap; }
.profile-badges .term { padding:2px 8px; line-height:1.25; border:1px solid #544c40; border-radius:5px; background:#34302a; color:#fff8e8; font-size:.78rem; }
.info-sheet { margin:-10px 0 0; overflow:hidden; border-radius:12px 12px 0 0; background:white; position:relative; }
.info-sheet > div { display:grid; align-items:baseline; padding:5px 14px; column-gap:6px; font-size:.85rem; line-height:1.3; }
.info-sheet .info-single { grid-template-columns:auto 1fr; }
.info-sheet .info-pair { grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr); }
.info-sheet > div:nth-child(even) { background:#eeedeb; }
.info-sheet dt { color:#524e48; }
.info-sheet dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.info-sheet .term { padding:0; }
.natal-section { padding:14px; border-top:6px solid #f3f2ef; background:#fff; }
.natal-section h2,.star-list h2 { margin:0; font:600 1rem var(--serif); }
.natal-heading { display:flex; align-items:center; justify-content:space-between; }
.natal-heading .term { color:#806536; font-size:.76rem; }
.natal-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:12px; background:#f7f5ef; border-radius:5px; padding:10px 0; }
.natal-stat { text-align:center; display:grid; gap:2px; padding:2px; }
.natal-stat + .natal-stat { border-left:1px solid #ded9cc; border-radius:0; }
.natal-section small,.star-period small { color:var(--muted); font-size:.76rem; }
.natal-stat strong,.natal-pattern > .term { font:600 .95rem var(--serif); color:#72582a; }
.strength-factors { margin:6px 0 0; font-size:.82rem; line-height:var(--note-leading); }
.strength-factors > div { display:grid; grid-template-columns:3.5em 1fr; gap:8px; padding:4px 4px; }
.strength-factors > div + div { border-top:1px solid #eeebe4; }
.strength-factors dt { font-weight:600; color:#59544e; }
.strength-factors dt.supported { color:#72582a; }
.strength-factors dd { margin:0; }
.natal-pattern { margin-top:10px; padding:8px 10px; border-left:2px solid #b39961; background:#fbfaf7; }
.natal-pattern > .term { margin-left:12px; }
.natal-pattern p { margin:3px 0 0; color:#686055; font-size:.8rem; line-height:var(--note-leading); }
.energy-summary { margin-top:12px; font-variant-numeric:tabular-nums; }
.energy-summary thead td { width:4rem; }
.energy-summary thead th { padding:8px 0 0; background:white; font:600 .94rem/1.4 var(--serif); }
.energy-summary tr > :not(:first-child) { border-inline-start:1px solid #ede9e1; }
.energy-summary tbody th { text-align:left; padding-inline:0; font-size:.78rem; white-space:nowrap; }
.energy-summary tbody tr + tr { border-top:1px solid #eeebe4; }
.energy-summary tbody tr:first-child td { padding-top:2px; }
.energy-summary strong { font-size:1.08rem; line-height:1.35; font-variant-numeric:tabular-nums; }
.energy-track { width:70%; height:4px; margin:6px auto 0; background:#f0ede7; border-radius:5px; overflow:hidden; }
.energy-track i { display:block; height:100%; background:currentColor; border-radius:inherit; }
#pro-relations .relation-line { grid-template-columns:5em minmax(0,1fr); }
#pro-relations .relation-block + .relation-block { border-top:1px solid var(--line); }
.star-list-head { display:flex; align-items:center; justify-content:space-between; background:#f4f3f1; padding:9px 14px; }
.star-list-head button { color:#766348; background:none; border:0; font-size:.8rem; }
.star-list-row { display:grid; grid-template-columns:4em minmax(0,1fr); align-items:start; gap:6px; padding:5px 14px; line-height:var(--caption-leading); }
.star-period strong { display:inline-block; padding:2px 8px; font-size:.86rem; border-radius:14px; background:#f5f4f1; }
.star-period.selected strong { background:#94773d; color:white; }
.star-period small { display:block; padding-left:3px; font-size:.67rem; }
.star-tags { display:flex; flex-wrap:wrap; align-items:baseline; gap:1px 6px; color:#806735; font-size:.85rem; }
.star-tags .term { padding:2px 0; }
#luck .luck-cell b[data-god]::after { content:attr(data-god); color:#97584a; font:500 .62rem/1 sans-serif; vertical-align:middle; }
#annual-label { writing-mode:horizontal-tb; grid-template-rows:1fr auto; padding:5px 0; }
#annual-label span { writing-mode:vertical-rl; }
#annual-label small,.minor-year { white-space:nowrap; letter-spacing:0; font:.72rem/1.2 var(--serif); color:#625d55; }
#annuals .luck-cell { gap:2px; padding:5px 0; }
#annuals .minor-year { margin-top:auto; padding-top:2px; }
#map-body { padding:8px 14px; }
#map-body select { font:inherit; padding:4px 6px; }
.map-row { display:grid; grid-template-columns:3em minmax(4em,1fr) minmax(5em,1.1fr); align-items:center; margin:3px 0; gap:8px; font-size:.8rem; line-height:var(--note-leading); }
.map-row .term { text-align:center; background:#f4efe6; border-radius:4px; }
@media(max-width:370px) {
  #luck .band-title { flex-basis:30px; }
  #luck .luck-cell span { font-size:.63rem; }
  #luck .luck-cell b[data-god]::after { font-size:.55rem; }
}

@media (max-width:560px) and (max-height:620px) {
  .professional-view #luck .section-head { padding-block:0; }
  .professional-view .mobile-nav a { min-height:50px; }
}
#map-body { padding:0; }
.gz-board { --track-paper:#fffdf7; background:var(--track-paper); }
.gz-region h4 { margin:0; padding:6px 12px; background:#f6f0e4; color:#6a5b45; font:600 .7rem/1.2 var(--sans); letter-spacing:.09em; }
.gz-tracks { overflow-y:auto; max-height:clamp(110px,21vh,185px); scrollbar-width:thin; scrollbar-color:#c3b393 transparent; }
.gz-axis,.gz-tracks { background-image:repeating-linear-gradient(90deg,transparent 0 calc(100% / var(--gz-cols) - 1px),#e9decb calc(100% / var(--gz-cols) - 1px) calc(100% / var(--gz-cols))); }
.gz-axis { display:grid; grid-template-columns:repeat(var(--gz-cols),minmax(0,1fr)); border-block:1px solid #bbab8e; background-color:#f8f0e1; }
.gz-axis button { display:grid; align-content:center; justify-items:center; gap:1px; min-width:0; padding:6px 0; background:none; border:0; border-radius:0; }
.gz-axis button[aria-pressed=true] { background:#f6dfd0; box-shadow:inset 0 -3px #a73d32; }
.gz-axis small { white-space:nowrap; color:#635643; font:550 clamp(9px,2.8vw,12px)/1.25 var(--sans); }
.gz-axis b { font:700 clamp(18px,5.4vw,26px)/1.08 var(--serif); }
.gz-board .gz-lane { appearance:none; background:transparent; cursor:pointer; display:block; width:100%; height:38px; border:0; border-radius:0; position:relative; padding:0; color:#70503a; font:600 12px/1 var(--sans); }
.gz-lane + .gz-lane { border-top:1px dotted #eee5d6; }
.gz-region:last-child .gz-lane { color:#3f624f; }
.gz-stroke { position:absolute; top:26px; height:1px; background:currentColor; opacity:.75; }
.gz-end { position:absolute; top:18px; transform:translateX(-50%); padding-inline:2px; background:var(--track-paper); font:650 14px/1.15 var(--serif); }
.gz-caption { position:absolute; top:2px; width:var(--label-w); text-align:center; white-space:nowrap; font-size:11px; }
.gz-empty { margin:0; padding:10px 12px; color:var(--muted); font-size:.75rem; }

:root { --mountain-art: url("/assets/23940002bb85b0e4/mountains-small.webp"); }
@media (min-width: 720px) { :root { --mountain-art: url("/assets/26c174364dca45af/mountains.webp"); } }
/* 浅土盘面，木绿辅助操作，朱红主操作。 */
:root {
  color-scheme:light;
  --ground:#f6efe2; --sheet:#fffdf7; --raised:#f4ebdc; --deep:#f5eedf;
  --ink:#312b20; --muted:#695e50; --line:#ded3c0;
  --relation-red:#b13e32; --flame:#9f3530; --sand:#765333; --clay:#ebd9bc; --leaf:#35573f;
  --wood-button:#415e43; --red-button:#af403c; --red-wash:#f2d6cd;
  --gold:var(--sand); --dark:var(--deep); --mast-h:60px;
  --serif:"Songti SC","STSong","Noto Serif CJK SC",serif;
  --sans:"PingFang SC","Hiragino Sans GB",system-ui,sans-serif;
  font-family:var(--sans); color:var(--ink); background:#e7d9c4;
}
html { scroll-padding-block:104px 74px; }
body { background:#eae2d4; }
.app-shell,.app-shell:has(#entry:not([hidden])),.app-shell:has(#records:not([hidden])) { background:var(--ground); box-shadow:0 0 0 1px #d4c2a9,0 12px 90px #48342112; }
.app-shell { --top-edge:calc(var(--mast-h) + env(safe-area-inset-top)); padding-top:var(--top-edge); padding-bottom:calc(70px + env(safe-area-inset-bottom)); }
.icon-sprite { position:absolute; width:0; height:0; overflow:hidden; pointer-events:none; }
.ui-icon { width:1.1em; height:1.1em; flex:none; fill:none; stroke:currentColor; stroke-width:1.55; stroke-linecap:round; stroke-linejoin:round; vertical-align:-.16em; }
:focus-visible,.segments input:focus-visible + span { outline-color:var(--flame); }
.mast,.professional-view .mast { display:block; position:fixed; inset:0 0 auto; z-index:9; margin:auto; max-width:560px; padding-top:env(safe-area-inset-top); background:var(--ground); }
.mast-inner,.professional-view .mast-inner { justify-content:space-between; height:var(--mast-h); min-height:0; padding:0 18px; }
.mast .brand { display:flex; align-items:center; gap:9px; text-align:left; }
.app-shell:has(#entry:not([hidden])) .brand { padding:0; }
.brand img { width:38px; height:38px; border-radius:7px; background:#140915; }
.wordmark,.professional-view .wordmark { justify-content:start; font:800 1.28rem/1.1 var(--serif); letter-spacing:.12em; color:var(--ink); }
.mast .brand-line { display:block; margin:2px 0 0; color:var(--sand); font:.65rem/1.2 var(--sans); letter-spacing:.08em; }
#phone-link,.professional-view #phone-link { position:static; display:flex; align-items:center; gap:6px; min-height:36px; padding:0 10px; border:1px solid #60755a; border-radius:20px; background:var(--wood-button); color:#f5f8ee; text-decoration:none; font-size:.72rem; }
#phone-link svg { width:15px; height:15px; }
.mobile-nav { z-index:8; max-width:560px; padding:0 0 env(safe-area-inset-bottom); background:#fbf4e8; border-color:var(--line); }
.mobile-nav a,.professional-view .mobile-nav a { flex-direction:column; gap:3px; min-height:52px; color:var(--muted); font-size:.71rem; }
.mobile-nav a[aria-current=page] { color:var(--flame); font-weight:650; }
.mobile-nav a[aria-disabled=true] { color:#786d60; }
.mobile-nav svg { width:21px; height:21px; }
#entry,#records { padding:6px 15px 22px; background:var(--ground); }
.today-card { position:relative; isolation:isolate; overflow:hidden; margin:0 0 18px; padding:16px 16px 1px; border-radius:5px; border:1px solid #cebfa6; background:#efdfc5; }
.today-card::before,.records-heading::before { content:""; position:absolute; z-index:-1; inset:0; pointer-events:none; background-image:linear-gradient(90deg,#f7efdfed,transparent 75%),var(--mountain-art); background-size:cover; background-position:right center; }
.dial-layout { display:grid; grid-template-columns:minmax(0,1fr) clamp(94px,28vw,122px); gap:5px; align-items:center; }
.dial-date h2 { font:600 .82rem/1.3 var(--sans); letter-spacing:.12em; color:#714e32; }
#today-solar { display:flex; align-items:baseline; gap:7px; color:#44311f; font-variant-numeric:tabular-nums; margin:4px 0 0; }
#today-solar strong { font:500 clamp(2.6rem,12vw,3.7rem)/1 Georgia,"Songti SC",serif; letter-spacing:-.06em; }
#today-solar small { color:#71593f; font:.76rem/1.2 ui-monospace,monospace; }
#today-lunar { color:#544635; font-size:.8rem; margin:3px 0 0; line-height:var(--caption-leading); }
#hour-dial { width:100%; aspect-ratio:1; align-self:start; filter:drop-shadow(0 1px 1px #55371732); }
.dial-face { fill:#f5e4c7; stroke:#b28d64; stroke-width:1; }
.dial-rim,.dial-tick { stroke:#917859; fill:none; stroke-width:.75; }
.dial-letter { fill:#493d32; text-anchor:middle; font:600 9px var(--serif); }
.dial-current { fill:#863c27; }
.dial-letter.active { fill:#fff1db; }
.dial-needle { fill:#a0462b; stroke:#843b26; stroke-width:.5; }
.dial-hub { fill:#4a372a; stroke:#edc397; stroke-width:1; }
#today-pillars { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:9px 0 0; padding:9px 0; background:#fffbf1ed; border-block:1px solid #beaa8b; border-inline:0; border-radius:0; }
.today-pillar { grid-template-columns:repeat(2,max-content); justify-content:center; column-gap:1px; row-gap:1px; border-color:#d6bea0; }
.today-pillar small { grid-column:1/-1; color:var(--muted); font-size:.66rem; }
.today-pillar b { font:650 clamp(1.18rem,5vw,1.5rem)/1.14 var(--serif); }
.today-foot { position:relative; isolation:isolate; display:flex; justify-content:space-between; align-items:center; gap:4px; }
.today-foot::before { content:""; position:absolute; z-index:-1; inset:0 -18px -1px; background:linear-gradient(90deg,#f8efddde,transparent); }
#beijing-clock { font-size:.71rem; color:#534431; font-variant-numeric:tabular-nums; }
#instant-chart { display:flex; align-items:center; gap:5px; min-height:30px; margin-block:3px; padding:0 9px; border-radius:7px; background:var(--wood-button); color:#f5f8ee; font-size:.76rem; }
.entry-title,.records-heading h1,.section-head h2,.natal-section h2,.relation-block h2,.star-list h2,#editor-title,#records-empty h2 { color:var(--ink); font-family:var(--sans); font-weight:650; }
.entry-title { margin:0 0 10px 2px; font-size:1.15rem; }
.entry-card { padding:12px 13px 2px; border:1px solid var(--line); background:var(--sheet); border-radius:15px; }
.choice-pair,.birth-clock-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.choice-pair .form-choice { border:0; min-height:0; }
.choice-pair .form-choice legend { float:none; height:auto; font-size:.72rem; color:var(--muted); margin-bottom:4px; }
.choice-pair .segments { justify-content:stretch; gap:2px; min-height:0; padding:3px; background:var(--deep); border-radius:9px; }
.segments label + label { margin:0; }
.choice-pair .segments label { flex:1; min-width:0; min-height:32px; }
.segments span { min-width:0; padding-inline:8px; height:32px; border-radius:6px; background:transparent; color:var(--muted); }
.segments input:checked + span { background:var(--wood-button); color:#f5f8ee; }
.entry-option .segments input:disabled + span { background:var(--deep); color:#807566; }
.birth-clock-fields { padding:12px 0; }
.birth-clock-fields .form-row { grid-template-columns:minmax(0,1fr); align-content:start; gap:2px; padding:8px 9px; background:var(--deep); border:1px solid var(--line); border-radius:9px; }
.birth-clock-fields .form-row label,.birth-clock-fields .field-label { font-size:.72rem; color:var(--muted); }
.birth-clock-fields .form-row input { min-height:27px; height:27px; width:100%; text-align:left; justify-self:stretch; }
.birth-clock-fields input::-webkit-date-and-time-value { text-align:left; }
.birth-clock-fields:has(#lunar-fields:not([hidden])) { grid-template-columns:1fr; }
.birth-clock-fields #lunar-fields { display:flex; align-items:center; justify-content:space-between; }
.birth-clock-fields .lunar-selects select { background:var(--deep); }
.entry-card .form-row small { color:var(--muted); font-size:.65rem; }
.entry-option,.form-row,.region-field { border-color:var(--line); }
.entry-option summary,.entry-save .form-row,.entry-card .save-row { min-height:44px; }
.entry-option summary,.form-row > label,.field-label { font-size:.86rem; color:var(--ink); }
.form-row > label .ui-icon,.field-label .ui-icon,.entry-option summary .ui-icon { color:var(--leaf); width:15px; height:15px; }
.form-row > label .ui-icon,.field-label .ui-icon { margin-right:5px; }
.entry-save { gap:8px; }
.region-selects select,.time-preview,.pro-options select,#map-body select { background:var(--deep); color:var(--ink); border-color:var(--line); border-radius:6px; }
.time-preview dt,.entry-option summary span,.entry-option .region-field legend { color:var(--muted); }
.form-row input::placeholder,.record-search input::placeholder { color:#746957; }
#save-record { background:#b9ab97; }
#save-record:checked,.palace-switch input:checked { background:var(--wood-button); }
.primary,#go-entry,#commit-edit { display:inline-flex; align-items:center; justify-content:center; gap:9px; border:0; background:var(--red-button); color:#fff6ee; border-radius:10px; font-family:var(--sans); font-weight:700; }
.primary { min-height:47px; margin-top:12px; letter-spacing:.06em; }
.primary:active,#go-entry:active,#commit-edit:active { background:#8e302e; }
.status,#delete-record { color:var(--flame); }
.retry,.edit-record,.star-list-head button,.natal-heading .term { color:var(--leaf); }
/* 卷首页题与检索栏 */
.records-heading { position:relative; isolation:isolate; overflow:hidden; display:grid; justify-content:start; align-content:center; justify-items:start; gap:4px; min-height:116px; margin:0 0 12px; padding:17px 23px; border:1px solid #cfbea1; border-radius:5px; }
.records-heading::before { background-position:78% 54%; }
.records-heading h1 { margin:0; font:750 1.9rem/1.15 var(--serif); letter-spacing:.08em; }
.record-tools { display:grid; grid-template-columns:minmax(0,1fr) minmax(92px,31%); gap:8px; }

#record-count { font-variant-numeric:tabular-nums; }
.record-title .group-tag { border:1px solid #d9d2bc; border-radius:3px; padding:1px 5px; font:.65rem/var(--caption-leading) var(--sans); color:#546048; background:#f4f3e8; overflow-wrap:anywhere; }
.record-search,.pro-options,#record-editor { background:var(--sheet); border:1px solid var(--line); border-radius:11px; }
.record-search svg { stroke:var(--leaf); }
.record-search input { color:var(--ink); }
.filter-row { min-width:0; position:relative; padding:0; }
.filter-row select { appearance:none; width:100%; max-width:100%; height:100%; border:1px solid #c9cdb9; border-radius:6px; background:#eef0e3; color:var(--leaf); padding:0 22px 0 12px; font:600 .82rem var(--sans); text-overflow:ellipsis; }
.filter-row::after { content:""; pointer-events:none; position:absolute; right:11px; top:50%; width:6px; height:6px; border:solid var(--leaf); border-width:0 1.5px 1.5px 0; transform:translateY(-65%) rotate(45deg); }
#record-list { display:grid; gap:0; margin-top:12px; overflow:hidden; background:var(--sheet); border:1px solid var(--line); border-radius:6px; }
#record-list:empty { display:none; }
.record-row,.record-row:last-child { padding:0 7px 0 0; background:transparent; border:0; }
.record-row + .record-row { border-top:1px solid var(--line); }
.record-row .record-item { display:grid; grid-template-columns:3.55rem minmax(0,1fr); align-items:center; column-gap:12px; padding:15px 0 15px 13px; background:transparent; color:var(--ink); min-width:0; }
.record-date { display:grid; align-content:center; justify-items:center; gap:2px; align-self:stretch; padding-right:9px; border-right:1px solid #dfd0ba; font-variant-numeric:tabular-nums; white-space:nowrap; }
.record-date b { color:#89503a; font:500 1.15rem/1.2 Georgia,serif; font-variant-numeric:lining-nums tabular-nums; }
.record-date span { color:var(--muted); font:.66rem/1.4 var(--sans); }
.record-details { display:grid; min-width:0; gap:2px; }
.record-title { align-items:center; gap:6px; }
.record-item strong { font:750 1.05rem/1.3 var(--serif); }
.record-item .record-pillars { display:flex; flex-wrap:wrap; gap:0 .57em; color:#675032; font:600 .91rem/var(--caption-leading) var(--serif); letter-spacing:.01em; }
.record-item .record-meta { font:.74rem/var(--caption-leading) var(--sans); font-variant-numeric:tabular-nums; }
.edit-record { display:inline-flex; align-items:center; gap:3px; justify-content:center; padding:4px; font-size:.76rem; }
.edit-record .ui-icon { width:13px; height:13px; }
.book-mark { width:52px; height:52px; color:var(--sand); background:var(--clay); border:1px solid #6e5845; border-radius:14px; }
.book-mark svg { width:26px; height:26px; }
#records-empty { padding:36px 16px; }
#chart-tabs { top:var(--top-edge); background:var(--deep); border-bottom:1px solid var(--line); }
#chart-tabs button,#chart-tabs button[aria-selected=true] { min-height:40px; color:var(--muted); font:600 .88rem var(--sans); border-bottom:2px solid transparent; }
#chart-tabs button[aria-selected=true] { color:var(--flame); border-bottom-color:var(--flame); background:var(--red-wash); }
/* 三个命盘共用的题头与印色。 */
.workspace aside,.info-profile {
  color:#fff9e9; background-color:#294437;
  background-image:linear-gradient(100deg,rgba(32,59,46,.97) 12%,rgba(39,66,52,.94) 62%,rgba(34,56,44,.84)),var(--mountain-art);
  background-position:center,right 56%; background-size:cover;
  border-bottom:1px solid #9b805a;
}
#edit-label,.pro-header-actions summary,.palace-switch { color:#f2dfb7; }
#edit-label { display:inline-flex; align-items:center; padding:3px 6px; border:1px solid #8b9a82; border-radius:4px; font-weight:600; }
#chart-name,.profile-name { color:#fff9e9; font-family:var(--serif); font-weight:750; }
.profile-name { font-size:1.3rem; }
#birth-solar > span:last-child { font-weight:650; }
#place-summary,#timing-summary { color:inherit; }
.palace-switch input { background:#53645a; border-color:#a6b4a1; }
.palace-switch input:checked { background:#ad4634; }
.workspace aside :focus-visible,.info-profile :focus-visible { outline-color:#f3d89d; }
#chart,#luck,#pro-links,.info-sheet,.natal-section,.luck-board,.luck-cell { background:var(--sheet); color:var(--ink); }
.info-sheet { margin:0; border-radius:0; }
.info-profile { padding:13px 15px; }
.zodiac-seal,#birth-kind { background:#a24633; color:#fff2d7; border:1px solid #ce9779; box-shadow:inset 0 0 0 2px #a24633,inset 0 0 0 3px #d89e7c; }
.info-profile .profile-badges .term { color:#f4e9d2; background:#34503f; border-color:#73856e; }
.info-profile .profile-badges .term:hover { background:#435d49; }
.info-sheet dt,.info-sheet dd,.natal-pattern p,.strength-factors dt,.minor-year,#annual-label small { color:var(--muted); }
.info-sheet dd,.strength-factors dt.supported,.natal-stat strong { color:var(--ink); }
.chart-matrix,.energy-summary { background:var(--sheet); }
thead th,.pro-matrix tbody th,.pro-matrix thead th:first-child,.band-title,.star-list-head { background:#e7d5b7; color:#51402f; }
.info-sheet > div:nth-child(even),tbody tr:nth-child(even),.info-block dl > div:nth-child(odd) { background:#f6eedf; }
.pro-matrix td,.energy-summary tr > :not(:first-child),.strength-factors > div + div,.energy-summary tbody tr + tr,.luck-cell { border-color:var(--line); }
.pro-matrix .natal-start { border-left-color:#846b50; }
.natal-section,#chart:not([hidden]) + #luck { border-color:var(--ground); }
.natal-cards { background:var(--raised); }
.natal-stat + .natal-stat { border-color:var(--line); }
.natal-pattern { background:var(--clay); border-color:#bc8b63; }
.natal-pattern > .term,.relation-line strong,.star-tags,.chart-matrix .star-name { color:var(--sand); }
.natal-pattern p { color:#524332; }
.chart-fold > summary { color:var(--ink); }
.energy-summary thead th { background:var(--sheet); }
.energy-track { background:#e2d5c4; }
.energy-summary .ui-icon { display:block; width:16px; height:16px; margin:0 auto 3px; }
.wood,.chart-matrix .wood { color:#197c32; }
.fire,.chart-matrix .fire { color:#c32022; }
.earth,.chart-matrix .earth { color:#80543d; }
.metal,.chart-matrix .metal { color:#9c6a00; }
.water,.chart-matrix .water { color:#235ed1; }
.chart-matrix td > .element-term { display:inline-flex; align-items:baseline; justify-content:center; gap:3px; white-space:nowrap; }
.element-term .element-mark { width:clamp(16px,4.6vw,20px); height:auto; aspect-ratio:1; align-self:center; margin-top:.14em; }
#luck .luck-cell b[data-god]::after { color:#984731; }
.star-period.selected strong { background:var(--red-wash); color:var(--flame); }
.chart-matrix,#luck,.luck-board,#luck .luck-cell:not([aria-pressed=true]) { background:#fffdf8; }
.chart-matrix tbody tr:nth-child(even) { background:#faf6ed; }
.chart-matrix thead th,.pro-matrix tbody th,.pro-matrix thead th:first-child,#luck .band-title { background:#f4ecdd; }
.chart-matrix,.chart-matrix td,.luck-board,.luck-band + .luck-band,#luck .luck-cell { border-color:#e8dfce; }
#luck-heading { display:flex; align-items:center; gap:7px; }
#selected-year { padding:2px 6px; border-radius:3px; color:#963930; background:#fae9df; font:650 .8rem/1.3 var(--sans); font-variant-numeric:tabular-nums; white-space:nowrap; }
#luck .luck-cell[aria-pressed=true] { color:#fffaf0; background:#a73d34; box-shadow:inset 0 -3px #7d2b25; }
#luck .luck-cell[aria-pressed=true] :is(span,b,small),
#luck .luck-cell[aria-pressed=true] b[data-god]::after { color:inherit; }
#annuals .luck-cell[aria-pressed=true] > span { font-weight:750; }

.star-period strong,.map-row .term { color:var(--ink); background:var(--raised); }
#record-editor { padding:18px; }
#record-editor::backdrop { background:#1d140faa; }
.dialog-actions button { border-radius:8px; }
#cancel-edit { background:var(--wood-button); color:#f5f8ee; }
#commit-edit.danger { background:#93312e; color:white; }
#term-tip { background:#fff7eb; border:1px solid #c8b69d; color:#392e22; box-shadow:0 6px 24px #35271b26; border-radius:11px; }
#tip-heading,#tip-close { color:#795237; }
.action-notice { line-height:var(--note-leading); position:fixed; bottom:calc(67px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100vw - 32px); padding:10px 16px; border:1px solid #bb9875; border-radius:10px; background:#f3e2c7; color:#493523; z-index:15; font-size:.88rem; }
/* 表单与弹窗沿用同一套选择框、焦点和分隔线。 */
:is(#birth-form,#editor-form,.pro-options,#map-body) select {
  appearance:none; padding-inline:8px 22px; border-radius:5px;
  background-image:linear-gradient(45deg,transparent 48%,#766954 50% 62%,transparent 64%),linear-gradient(-45deg,transparent 48%,#766954 50% 62%,transparent 64%);
  background-size:5px 6px; background-position:right 12px center,right 8px center; background-repeat:no-repeat;
}
#record-editor { border-top:3px solid var(--leaf); }
#editor-title { padding-bottom:10px; border-bottom:1px solid var(--line); }
#editor-fields .form-row { grid-template-columns:4.5em minmax(0,1fr); gap:8px; }
#editor-fields :is(input,select) { text-align:left; text-align-last:left; }
#editor-fields input { padding-inline:8px; }
/* 页边、栏线与控件共用同一条对齐线。 */
.app-shell { --gutter:clamp(12px,3.7vw,20px); }
.mast { box-shadow:inset 0 -1px #d7c9b399; }
.mast-inner,.professional-view .mast-inner { padding-inline:var(--gutter); }
#entry,#records { padding-top:10px; }
#phone-link,.professional-view #phone-link { background:#f6efe2e8; color:var(--leaf); border-color:#b1bcaa; border-radius:5px; }
.entry-title,.section-head h2,.natal-section h2,.star-list h2,#editor-title,#records-empty h2 { font-family:var(--serif); font-weight:750; }
.entry-title { display:flex; align-items:center; gap:10px; margin-left:0; letter-spacing:.07em; font-size:1.27rem; }
.entry-title::after { content:""; flex:1; height:1px; background:var(--line); }
.entry-card { padding-inline:14px; border-radius:6px; }
.choice-pair .segments { border-radius:5px; background:#eee8db; }
.segments span,.birth-clock-fields .form-row,.record-search,.primary,#instant-chart,#go-entry,#commit-edit { border-radius:5px; }
.form-row > label,.field-label { display:inline-flex; align-items:center; gap:6px; line-height:1.3; }
.form-row > label .ui-icon,.field-label .ui-icon { margin:0; }
.entry-option summary { gap:6px; }
.entry-option summary span,.form-row small,.today-pillar small,#beijing-clock,#record-count,#luck-direction,.energy-summary tbody th,.natal-stat small { line-height:var(--caption-leading); }
.birth-clock-fields .form-row { background:#fbf8f0; grid-template-rows:auto 1fr; }
.birth-clock-fields .form-row > label { flex-wrap:wrap; row-gap:1px; }
.birth-clock-fields .form-row input { align-self:end; padding-inline:0; font-variant-numeric:tabular-nums; }
.record-tools .record-search:focus-within,.birth-clock-fields .form-row:focus-within { border-color:var(--leaf); }
.mobile-nav { background:#fffbf3; }
.mobile-nav a { position:relative; }
.mobile-nav a[aria-current=page]::before { content:""; position:absolute; top:0; width:28px; height:2px; border-radius:0 0 2px 2px; background:var(--flame); }
#birth-kind { display:grid; place-items:center; flex:none; min-width:2.45em; height:2.12em; border-radius:3px; font:700 1rem/1 var(--serif); }
.birth-detail { display:grid; grid-template-columns:4.15em minmax(0,1fr); gap:5px; align-items:baseline; }
.birth-detail > span:first-child { color:#d0d9c7; }
#chart-tabs { background:#faf5e9; }
#chart-tabs button[aria-selected=true] { background:#faf1e5; }
#luck .band-title { justify-content:center; }
#luck .section-head { align-items:center; }
.info-sheet dt { white-space:nowrap; }
.info-sheet .info-single { grid-template-columns:6.1em minmax(0,1fr); }
.info-sheet .info-pair { grid-template-columns:6.1em minmax(0,1fr) 4em minmax(0,1fr); }
.chart-matrix tbody tr.large td { vertical-align:middle; }
#pro-settings summary { list-style:none; }
#pro-settings summary::-webkit-details-marker { display:none; }
#pro-settings summary::after { content:""; display:inline-block; width:5px; height:5px; margin:0 2px 3px 5px; border:solid currentColor; border-width:0 1px 1px 0; transform:rotate(45deg); }
#pro-settings[open] summary::after { transform:rotate(225deg); }
@media(hover:hover) {
  .term:hover,.map-row .term:hover,.record-item:hover { background:var(--raised); }
  #phone-link:hover { background:#e1e8d7; }
  .mobile-nav a:not([aria-disabled=true]):hover { color:var(--flame); }
}
@media (max-width:560px) {
  #entry,#records { padding-inline:var(--gutter); }
  .pro-matrix td > .element-term { font-size:clamp(19px,5.4vw,24px); }
  #record-editor { width:min(100%,500px); inset:auto 0 0; max-width:100%; max-height:82dvh; margin:auto; padding-bottom:calc(16px + env(safe-area-inset-bottom)); border-radius:15px 15px 0 0; }
}
@media(pointer:coarse) and (max-width:600px) {
  #term-tip { inset:auto 8px calc(60px + env(safe-area-inset-bottom)) !important; margin:auto; width:auto; max-width:480px; padding:15px 40px 15px 16px; }
  #tip-close { min-height:40px; min-width:40px; }
}
@media (max-width:350px) {
  .app-shell { --gutter:10px; }
  .entry-card { padding-inline:9px; }
  .birth-clock-fields { gap:6px; }
  .birth-clock-fields .form-row { padding-inline:6px; }
  .today-card { padding-inline:12px; }
}
@media (min-width:800px) {
  body { background:linear-gradient(#f4eee4e6,#eae1d3cc),var(--mountain-art) center bottom / cover fixed; }
  .app-shell,.mast,.professional-view .mast,.mobile-nav { max-width:940px; }
  .app-shell { --gutter:26px; }
  #entry,#records { padding:20px var(--gutter) 28px; }
  #entry { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); column-gap:24px; align-content:start; }
  #entry .today-card { grid-row:1 / span 2; align-self:start; margin:0; padding:22px 18px 4px; }
  .dial-layout { min-height:168px; }
  #birth-form { grid-column:2; min-width:0; }
  .entry-title { align-self:start; }
  .records-heading { min-height:150px; padding-inline:32px; }
  .records-heading h1 { font-size:2.25rem; }
  .record-tools { grid-template-columns:minmax(0,1fr) 165px; }
  .record-row .record-item { grid-template-columns:4.7rem minmax(0,1fr); padding:14px 16px; column-gap:22px; }
  .record-details { grid-template-columns:minmax(0,1fr) minmax(9em,auto); align-items:center; column-gap:16px; }
  .record-pillars { grid-row:1 / span 2; grid-column:2; }
  .edit-record { margin-inline:14px; }
  .workspace .sheet { border-inline:1px solid var(--line); }
}

/* 书架与古籍阅读 */
#knowledge { padding:10px var(--gutter) 22px; }
.library-tabs { display:flex; border-bottom:1px solid var(--line); margin-bottom:12px; gap:20px; }
.library-tabs a { display:grid; align-items:center; min-height:42px; border-bottom:2px solid transparent; color:var(--muted); font-weight:600; }
.library-tabs a[aria-current=page] { color:var(--flame); border-color:currentColor; }
#knowledge a { text-decoration:none; }
#book-shelf { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px 13px; padding:4px 2px 12px; }
.shelf-title { grid-column:1/-1; display:flex; align-items:center; gap:9px; margin:4px 0 -4px; color:var(--ink); font:700 1.02rem var(--serif); }
.shelf-title::after { content:""; flex:1; border-top:1px solid var(--line); }
.book-cover[data-book=minglizhenbao] { background-position:100% 0; }
.book-cover[data-book=duanshilixiang] { background-position:50% 100%; }
.book-cover[data-book=mangpaimingli] { background-position:0 100%; }
.book-card { display:block; min-width:0; color:var(--ink); }
.book-cover { display:block; position:relative; aspect-ratio:1; border-radius:2px 5px 3px 2px; background:#414d3d url("/assets/21181cd5d5f7d2b1/books/woodcuts.webp") 0 0 / 300% 200%; box-shadow:2px 2px #e9ddc5,3px 3px #bfad90,0 4px 8px #4c382a20; }
.book-cover::before { content:""; position:absolute; inset:0 auto 0 0; width:8%; border-right:1px solid #f2e6c348; background:linear-gradient(90deg,#211d1b60,transparent); }
.book-cover[data-book=ditiansui] { background-position:50% 0; }
.book-cover[data-book=sanming] { background-position:100% 0; }
.book-cover[data-book=yuanhai] { background-position:0 100%; }
.book-cover[data-book=ziping] { background-position:50% 100%; }
.book-cover[data-book=qiongtong] { background-position:100% 100%; }
.cover-slip { position:absolute; left:14%; top:8%; writing-mode:vertical-rl; border:3px solid #f8ecd2; outline:1px solid #5c4e38; box-shadow:inset 0 0 0 1px #8c7556; padding:7px 4px; background:#f8ecd2; color:#30271f; font:750 clamp(16px,4vw,23px)/1.1 var(--serif); letter-spacing:.11em; }
.book-copy { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:2px 6px; padding:8px 0 2px; }
.book-copy strong { font:700 1rem/1.3 var(--serif); }
.book-copy small,#book-reader > small { color:var(--muted); font-size:.73rem; }
#knowledge-topics { display:grid; gap:7px; }
.knowledge-topic { background:var(--sheet); border:1px solid var(--line); border-radius:6px; }
.knowledge-topic summary { list-style:none; display:grid; grid-template-columns:32px minmax(0,1fr) auto 8px; gap:9px; padding:9px 12px; align-items:center; cursor:pointer; }
.knowledge-topic summary::-webkit-details-marker,.reader-toc summary::-webkit-details-marker { display:none; }
.topic-symbol { display:grid; place-items:center; height:32px; color:#4b6048; background:#e9ecdF; border:1px solid #d6dbc7; border-radius:6px; }
.knowledge-topic summary strong { font:700 1rem var(--serif); }
.knowledge-topic summary small { color:var(--muted); font-size:.72rem; }
.knowledge-topic summary::after,.reader-toc summary::after { content:""; width:6px; height:6px; border:solid currentColor; border-width:0 1px 1px 0; transform:rotate(45deg); }
.knowledge-topic[open] summary::after,.reader-toc[open] summary::after { transform:rotate(225deg); }
.knowledge-topic[open] .topic-symbol { color:#fff6df; background:#3b5644; }
.knowledge-topic dl { margin:0 12px 7px; border-top:1px solid var(--line); }
.knowledge-topic dl > div { display:grid; grid-template-columns:minmax(4em,23%) minmax(0,1fr); padding:8px 0; gap:8px; }
.knowledge-topic dl > div + div { border-top:1px solid #ece4d8; }
.knowledge-topic dt { color:var(--leaf); font:650 .86rem/1.45 var(--sans); }
.knowledge-topic dd { margin:0; font-size:.84rem; line-height:1.45; }
#book-reader { max-width:42rem; margin:auto; padding:8px clamp(12px,3vw,25px) 18px; border:1px solid var(--line); border-radius:5px; background:var(--sheet); }
.book-back,.book-source { display:block; color:var(--leaf); font-size:.82rem; padding-block:10px; }
#book-reader h1 { margin:15px 0 12px; color:var(--ink); font:750 1.36rem/1.4 var(--serif); }
.reader-toolbar { position:sticky; top:var(--top-edge); z-index:3; display:flex; justify-content:space-between; align-items:center; background:var(--sheet); border-bottom:1px solid var(--line); margin-bottom:6px; }
.reader-toolbar .book-back { padding:12px 2px; }
.reader-toolbar .reader-toc { width:max-content; }
.reader-toolbar .reader-toc small { padding-left:4px; }
.reader-toolbar .toc-pane { position:absolute; top:100%; inset-inline:0; padding:6px; background:var(--sheet); border:1px solid var(--line); box-shadow:0 5px 12px #48342118; }
.reader-toc summary { display:flex; align-items:center; gap:7px; padding:10px 3px; list-style:none; cursor:pointer; color:var(--leaf); }
.reader-toc summary small { margin-left:auto; color:var(--muted); font-variant-numeric:tabular-nums; }
.toc-pane select { width:100%; height:36px; padding-inline:6px; border:1px solid var(--line); background:var(--deep); border-radius:4px; }
.toc-links { max-height:42dvh; overflow:auto; overscroll-behavior:contain; }
.toc-links a { display:block; padding:9px 7px; font-size:.88rem; border-bottom:1px solid var(--line); color:var(--ink); }
.toc-links a[aria-current] { color:var(--flame); background:var(--red-wash); font-weight:650; }
.book-prose { font:400 1.06rem/1.75 var(--serif); overflow-wrap:anywhere; line-break:strict; }
.book-prose p { margin:0 0 .72em; text-indent:2em; }
.book-turn { display:flex; justify-content:space-between; gap:10px; border-top:1px solid var(--line); padding-top:12px; }
.book-credits { color:var(--muted); font-size:.72rem; line-height:var(--note-leading); }
.book-credits a { color:var(--leaf); }
.book-turn a { padding:9px 14px; background:var(--wood-button); color:var(--sheet); border-radius:4px; font-size:.86rem; }
@media(min-width:800px) {
  #knowledge { padding-top:20px; }
  #book-shelf { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

.chart-matrix th.relation-hit,.gz-axis small.relation-hit { color:var(--flame); box-shadow:inset 0 -2px var(--flame); }
.chart-matrix td.relation-hit,.gz-axis b.relation-hit { outline:2px solid var(--relation-red); outline-offset:-2px; }
.gz-axis b { width:100%; }
.gz-axis small { padding:1px 3px; }
.relation-line .term[data-relation-key] { padding:2px 4px; cursor:pointer; }
.relation-line .term[aria-pressed=true] { color:var(--relation-red); background:transparent; border-bottom-color:transparent; outline:2px solid var(--relation-red); outline-offset:-1px; }
.gz-lane[aria-pressed=true] .gz-caption { color:var(--relation-red); }
.gz-lane[aria-pressed=true] .gz-stroke { height:2px; background:var(--relation-red); opacity:1; }
.gz-lane[aria-pressed=true] .gz-end { outline:2px solid var(--relation-red); border-radius:2px; }
.gz-selection { display:flex; align-items:baseline; gap:7px; padding:6px 10px; background:#fffaef; border-bottom:1px solid var(--line); font:.72rem/1.45 var(--sans); }
.gz-selection details { flex:1; min-width:0; }
.gz-selection summary { cursor:pointer; font-weight:600; color:#82392f; }
.gz-selection details p { margin:5px 0; }
.gz-selection > button { flex:none; min-height:30px; padding:2px 8px; background:var(--sheet); border:1px solid var(--line); border-radius:4px; font:inherit; color:var(--leaf); }

.date-part { display:inline-block; white-space:nowrap; }
#resume-book { display:block; margin:10px 12px; padding:10px 12px; border-left:3px solid var(--leaf); }
#resume-book[hidden] { display:none; }
#save-copy { display:block; margin:6px auto; min-height:40px; }
#save-copy[hidden] { display:none; }
@media (max-width:600px) {
  #pro-pillars .pro-matrix .star-name {
    display:block; width:100%; max-width:100%; min-height:32px;
    padding:1px 0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; text-align:center;
  }
  #pro-pillars:not(.all-stars) .star-name ~ .star-name { display:none; }
  #pro-pillars .stars-toggle { min-height:32px; }
}
#record-tabs { margin-inline:14px; }
.case-card,.case-year { display:flex; justify-content:space-between; align-items:center; gap:10px; color:var(--ink); text-decoration:none; }
.case-card,.case-article,.famous-record { background:var(--sheet); border:1px solid var(--line); border-radius:7px; }
.case-card,.case-article { padding:12px 14px; margin:0 0 9px; }
.case-card > span:first-child { display:grid; gap:4px; }
.case-card strong,.case-article h2 { font:700 1.12rem/1.35 var(--serif); }
.case-card small,.case-credits,.famous-record .case-card > span > span:not(.case-pillars) { color:var(--muted); font-size:.8rem; }
.case-chevron,.case-credits a,.case-year span { color:var(--leaf); }
.case-pillars { color:var(--sand); font:600 .94rem/1.4 var(--serif); word-spacing:.3em; }
.case-article h2,.case-article p,.case-credits p { margin:4px 0; }
.case-credits { line-height:1.45; padding:8px 0; }
.case-credits a { display:inline-block; padding:6px 0; margin-right:12px; text-decoration:underline; }
.case-event { border-top:1px solid var(--line); padding:6px 0; }
.case-event dl { margin:4px 0 10px; }
.case-event dt { font-size:.76rem; font-weight:650; color:var(--leaf); }
.case-event dd { margin:3px 0 9px; font-size:.92rem; line-height:1.5; }
.case-year { min-height:44px; color:var(--flame); }
.case-year span,.case-cycle-note { font-size:.8rem; }
.case-cycle-note { color:var(--sand); line-height:1.4; }
#case-note { margin:4px 12px; }
#case-loading { margin:12px; }
#famous-list { padding:0 14px; }
.famous-record { margin:8px 0; overflow:hidden; }
.famous-record .case-card { margin:0; border:0; }
.famous-record .case-credits { border-top:1px solid var(--line); margin:0 14px; }
#public-provenance { padding:6px 12px; background:var(--raised); }
#public-provenance a { padding:2px 0; }
#records .record-switcher { position:sticky; top:var(--top-edge); z-index:3; background:var(--ground); padding:7px 0 9px; }
#record-tabs { display:flex; width:min(100%,19rem); margin:0 auto; padding:3px; border:1px solid #c3b69f; border-radius:9px; background:#ebe2d2; }
#record-tabs a { flex:1; display:grid; place-items:center; min-height:36px; border-radius:6px; font-weight:650; color:var(--muted); text-decoration:none; }
#record-tabs a[aria-current=page] { background:var(--wood-button); color:#fffdf7; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#famous-records .record-tools { display:flex; align-items:center; gap:8px; }
#famous-records .record-search { flex:1; min-width:0; }
#record-count,#famous-count { display:block; color:var(--muted); font-size:.76rem; }
#personal-records .record-tools { display:flex; flex-direction:column; gap:6px; }
#personal-records .record-search { width:100%; min-height:42px; margin:0; }
.record-filter-line { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.record-filter-line .filter-row { width:max-content; max-width:70%; }
.record-filter-line select { min-height:38px; padding-inline:11px 29px; }
#record-count { white-space:nowrap; padding-inline:5px; }
@media (min-width:600px) {
  #personal-records .record-tools { flex-direction:row; align-items:center; }
  #personal-records .record-search { flex:1; min-width:0; }
  .record-filter-line .filter-row { max-width:14rem; }
}
#birth-versions { background:var(--sheet); padding:8px 12px; border-bottom:1px solid var(--line); }
#birth-versions h2 { font:700 .9rem var(--serif); margin:0 0 4px; }
.birth-version { display:grid; align-items:center; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:5px 0; }
.birth-version + .birth-version { border-top:1px solid var(--line); }
.birth-version strong { margin-right:7px; font-size:.9rem; }
.birth-version a { color:var(--leaf); font-size:.8rem; }
.birth-version small { display:block; line-height:1.4; color:var(--muted); font-size:.76rem; margin-top:2px; }
.version-action { display:grid; place-items:center; padding:0 9px; min-height:38px; border:1px solid var(--line); border-radius:5px; font-size:.76rem; text-decoration:none; }
.is-current .version-action { color:var(--flame); background:#fbf0e8; border-color:transparent; }
#famous-groups { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; padding:3px 0 8px; }
#famous-groups button { min-height:38px; padding:2px 0; border:1px solid var(--line); border-radius:5px; background:var(--sheet); color:var(--muted); font:inherit; }
#famous-groups button[aria-pressed=true] { color:var(--flame); border-color:var(--flame); background:#faeee4; font-weight:650; }
#famous-list { padding:0; }
.famous-record { margin:0 0 5px; }
.person-link { display:grid; gap:3px; padding:9px 12px; text-decoration:none; color:var(--ink); }
.person-heading { display:flex; align-items:center; justify-content:space-between; gap:4px; }
.person-heading strong { font:700 1.04rem/1.3 var(--serif); }
.person-heading small { font-size:.71rem; padding:2px 5px; border-radius:3px; }
.time-qualified { color:#864028; background:#f8eadb; }
.time-recorded { color:var(--leaf); background:#eaefe5; }
.person-meta { color:var(--muted); font-size:.8rem; line-height:1.4; }
.partial-chart { margin:12px; padding:12px 16px; border:1px solid var(--line); background:var(--sheet); }
.partial-chart h1 { font:700 1.5rem var(--serif); margin:8px 0; }
.partial-pillars { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); border-block:1px solid var(--line); padding:12px 0; text-align:center; }
.partial-pillars dt { color:var(--muted); font-size:.78rem; }
.partial-pillars dd { margin:4px 0 0; color:var(--sand); font:700 1.22rem var(--serif); }

.publisher-chapter { position:relative; width:100%; overflow:hidden; background:#fff; }
.publisher-chapter iframe { display:block; position:absolute; inset:0 auto auto 0; border:0; max-width:none; transform-origin:top left; }
.original-leaf { margin:10px 0 18px; }
.original-leaf .book-source { display:block; padding:0; }
.original-leaf img { display:block; width:100%; height:auto; background:var(--raised); }
.original-leaf figcaption { margin-top:4px; color:var(--muted); text-align:center; font:.76rem var(--sans); }
.book-prose blockquote { margin:18px 0; padding:4px 12px; border-left:2px solid var(--line); }

#local-library { margin:12px 0 16px; padding:12px; border:1px solid var(--line); border-radius:6px; background:var(--sheet); }
.local-library-bar,.local-book { display:flex; align-items:center; gap:10px; }
.local-library-bar { justify-content:space-between; }
.local-library-bar h2 { margin:0; font:700 1.06rem var(--serif); }
.local-library-bar small,.local-book small { color:var(--muted); font-size:.73rem; line-height:1.35; }
#import-book { flex:none; padding:0 10px; min-height:40px; color:var(--leaf); background:#eef0e3; border:1px solid #c4c9b4; border-radius:5px; font-weight:600; }
#import-status { margin:6px 0 0; font-size:.84rem; overflow-wrap:anywhere; }
#import-status:empty { display:none; }
.local-book { border-top:1px solid var(--line); margin-top:7px; padding:8px 0 1px; color:var(--ink); text-decoration:none; }
.local-book .ui-icon { flex:none; width:22px; color:var(--leaf); }
.local-book span:first-of-type { flex:1; min-width:0; display:grid; }
.local-book strong { overflow-wrap:anywhere; font-family:var(--serif); }
.local-book span:last-child { flex:none; font-size:.8rem; color:var(--leaf); }
.imported-prose { overflow-wrap:anywhere; }
.imported-prose img { max-width:100%; height:auto; vertical-align:middle; }
.imported-prose > img { display:block; width:100%; margin:auto; }
.imported-prose table { display:block; overflow:auto; max-width:100%; border-collapse:collapse; }
.imported-prose td,.imported-prose th { border:1px solid var(--line); padding:3px 6px; }
.imported-prose pre { white-space:pre-wrap; }
