/* Result v2: the board leads, the reading follows. */
body.result-mode .topbar { display: none; }
body.result-mode .view { padding-top: 0; }
body.result-mode .tabbar { display: none; }

.ziwei-result-v2 { max-width: 920px; margin: 0 auto; padding-bottom: 18px; }
.result-appbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 10px 14px; background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.result-back { color: var(--ink); display: grid; place-items: center; width: 28px; height: 32px; }
.result-back svg { transform: rotate(180deg); }
.result-appbar-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-appbar-title strong { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.result-appbar-title small { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-appbar-actions { display: flex; gap: 2px; }
.result-appbar-actions .icon-btn { width: 30px; height: 30px; }
.result-tabs {
  position: sticky; top: 55px; z-index: 25;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.result-tabs button {
  position: relative; border: 0; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 13px; padding: 12px 4px 10px;
}
.result-tabs button.active { color: var(--ink); font-weight: 600; }
.result-tabs button.active::after {
  content: ''; position: absolute; left: 26%; right: 26%; bottom: 0; height: 2px; background: var(--accent);
}
.ziwei-board-wrap { margin-top: 0; }
.ziwei-result-v2 .ziwei-board { border-radius: 2px; overflow: hidden; }
.ziwei-result-v2 .board-hint { display: flex; gap: 5px; align-items: center; margin: 8px 2px 0; color: var(--muted); font-size: 10.5px; }
.ziwei-summary {
  margin: 18px 0 6px; padding: 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  scroll-margin-top: 110px;
}
.result-kicker { color: var(--accent); font-size: 10.5px; letter-spacing: .12em; }
.ziwei-summary h2 { margin: 7px 0 8px; font-family: var(--serif); font-size: 25px; font-weight: 500; }
.ziwei-summary p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.85; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.summary-chips span { border: 1px solid var(--line); padding: 4px 7px; color: var(--muted); font-size: 10.5px; }
.ziwei-detail { margin-top: 26px; scroll-margin-top: 110px; }
.ziwei-detail .section-head { margin-bottom: 10px; }
.ziwei-notes { gap: 10px; }
.ziwei-notes .reading-card { border-radius: 2px; }
.ziwei-daxian { margin-top: 26px; scroll-margin-top: 110px; }
.ziwei-result-v2 .zw-center-name small { display: none; }
.result-bottom-actions {
  position: sticky; bottom: 0; z-index: 24;
  display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  margin: 14px -14px 0; background: color-mix(in srgb, var(--bg) 96%, transparent);
  border-top: 1px solid var(--line); backdrop-filter: blur(12px);
}
.result-bottom-actions .btn { min-height: 44px; justify-content: center; font-size: 13px; }
.ziwei-result-v2 .disclaimer { margin: 10px 0 0; }

/* Mobile: the center is a lead card, the 12 palaces follow in two columns. */
@media (max-width: 760px) {
  .ziwei-result-v2 { max-width: none; }
  .result-appbar { padding: 8px 12px; }
  .result-tabs { top: 51px; }
  .result-tabs button { font-size: 12.5px; padding: 11px 2px 9px; }
  .ziwei-result-v2 .ziwei-board {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px; background: #1c2740; border: 1px solid rgba(224, 195, 139, .16);
  }
  .ziwei-result-v2 .ziwei-center {
    grid-column: 1 / -1; grid-row: auto !important; width: auto; min-height: 0;
    margin: 0; padding: 16px 14px 14px;
  }
  .ziwei-result-v2 .zw-cell {
    grid-row: auto !important; grid-column: auto !important;
    min-height: 92px; padding: 8px 9px 7px; border: 0;
  }
  .ziwei-result-v2 .zw-head { font-size: 11.5px; }
  .ziwei-result-v2 .zw-major { font-size: 13px; min-height: 24px; }
  .ziwei-result-v2 .zw-minor { font-size: 9px; line-height: 1.5; }
  .ziwei-result-v2 .zw-foot { font-size: 9.5px; }
  .ziwei-result-v2 .zw-center-name { font-size: 24px; }
  .ziwei-result-v2 .zw-center-name small { display: none; }
  .ziwei-result-v2 .zw-center-grid { gap: 4px; }
  .ziwei-result-v2 .zw-center-four { font-size: 11px; gap: 6px; flex-wrap: wrap; }
  .ziwei-summary { margin-top: 14px; padding: 15px 14px; }
  .ziwei-summary h2 { font-size: 22px; }
  .ziwei-detail, .ziwei-daxian { margin-top: 22px; }
  .result-bottom-actions { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 360px) {
  .result-appbar-title strong { font-size: 15px; }
  .ziwei-result-v2 .zw-cell { min-height: 86px; padding: 7px; }
  .ziwei-result-v2 .zw-major { font-size: 12px; }
  .ziwei-result-v2 .zw-minor { display: none; }
}
