
:where([hidden]) { display: none !important; }

:root {
  --bg-1: #f5ebdc;
  --bg-2: #ddc39b;
  --ink: #22180f;
  --muted: #6c5f50;
  --line: rgba(91, 61, 31, 0.16);
  --panel: rgba(255, 250, 243, 0.84);
  --panel-strong: rgba(255, 251, 245, 0.95);
  --accent: #9f3d1e;
  --accent-soft: rgba(159, 61, 30, 0.12);
  --water: #2d5f82;
  --good: #2d6a52;
  --warn: #9f3d1e;
  --shadow: 0 18px 58px rgba(58, 37, 18, 0.14);
  --workspace-gap: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body,
button,
input,
textarea,
select,
a,
span,
strong,
small,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  min-width: 0;
  word-break: break-word;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Source Han Sans SC", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 240, 214, 0.88), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(208, 138, 54, 0.22), transparent 22%),
    radial-gradient(circle at 78% 82%, rgba(45, 95, 130, 0.16), transparent 30%),
    linear-gradient(145deg, var(--bg-1) 0%, #ead6b5 52%, var(--bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(105, 76, 45, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 76, 45, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 92%);
}

body[data-site-variant="hk-mirror"] {
  background:
    radial-gradient(circle at 14% 12%, rgba(222, 242, 255, 0.9), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(37, 102, 141, 0.22), transparent 24%),
    radial-gradient(circle at 76% 84%, rgba(22, 61, 88, 0.16), transparent 30%),
    linear-gradient(145deg, #f2f7fb 0%, #d7e8f3 54%, #a9c9db 100%);
}

body[data-site-variant="hk-mirror"]::before {
  background-image:
    linear-gradient(rgba(45, 95, 130, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 95, 130, 0.05) 1px, transparent 1px);
}

.page {
  position: relative;
  max-width: 1420px;
  margin: 0 auto;
  padding: 24px 16px 36px;
  overflow-x: clip;
}

.hero {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px 24px;
  background:
    linear-gradient(135deg, rgba(255, 249, 240, 0.9), rgba(248, 235, 212, 0.78)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0));
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 18px 22px auto auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(208, 138, 54, 0.16), transparent 70%);
  pointer-events: none;
  opacity: 0.8;
}

.hero-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
  max-width: min(780px, 100%);
}

body[data-site-variant="hk-mirror"] .hero {
  background:
    linear-gradient(135deg, rgba(247, 252, 255, 0.94), rgba(222, 240, 250, 0.82)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0));
  border-color: rgba(45, 95, 130, 0.18);
  box-shadow: 0 20px 64px rgba(34, 74, 104, 0.14);
}

body[data-site-variant="hk-mirror"] .hero::after {
  background: radial-gradient(circle, rgba(45, 95, 130, 0.2), transparent 72%);
}

.hero-auth-shell {
  display: grid;
  justify-items: end;
  gap: 10px;
  min-width: min(340px, 100%);
  max-width: 360px;
  position: relative;
  z-index: 1;
}

.hero-auth-toggle {
  display: none;
}

.hero-auth-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 251, 245, 0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.hero-auth-panel.collapsed {
  display: none;
}

.hero-auth-summary {
  display: grid;
  gap: 8px;
}

.hero-auth-summary .hero-auth-status {
  font-size: 0.95rem;
}

.hero-auth-status {
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.hero-auth-badge {
  justify-self: start;
  max-width: 100%;
}

.hero-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.hero-quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-mirror-banner {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(45, 95, 130, 0.18);
  background:
    linear-gradient(135deg, rgba(225, 241, 251, 0.94), rgba(244, 251, 255, 0.82)),
    linear-gradient(180deg, rgba(255,255,255,0.52), rgba(255,255,255,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.hero-mirror-banner p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.hero-site-identity {
  display: grid;
  gap: 4px;
  padding-left: 2px;
}

.hero-site-identity-line {
  font-size: 0.94rem;
  color: var(--water);
  letter-spacing: 0.01em;
}

.site-localization-strip {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  background: rgba(255, 250, 243, 0.8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
}

.site-localization-copy {
  display: grid;
  gap: 4px;
}

.site-localization-copy strong {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.site-localization-copy span {
  color: var(--muted);
  line-height: 1.68;
}

.site-localization-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-site-localization-strip {
  margin-top: 10px;
}

body[data-site-variant="hk-mirror"] .site-localization-strip {
  border-color: rgba(45, 95, 130, 0.18);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.92), rgba(247, 252, 255, 0.82)),
    rgba(255,255,255,.78);
}

body[data-site-variant="hk-mirror"] .site-localization-copy span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .badge-pill {
  border-color: rgba(45, 95, 130, 0.18);
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.1), rgba(86, 144, 181, 0.14));
  color: #194766;
}

body[data-site-variant="hk-mirror"] .hero-auth-panel,
body[data-site-variant="hk-mirror"] .auth-card {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(250, 253, 255, 0.82);
}

.hero-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.agent-page {
  display: grid;
  gap: 22px;
}

.agent-hero {
  align-items: stretch;
  gap: 28px;
}

.agent-hero-copy {
  max-width: min(760px, 100%);
}

.agent-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.agent-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding-inline: 20px;
  text-decoration: none;
}

.agent-hero-panel {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(248, 235, 212, 0.82)),
    rgba(255,255,255,.78);
  box-shadow: 0 16px 42px rgba(58, 37, 18, 0.14);
}

.agent-hero-panel-head {
  display: grid;
  gap: 6px;
}

.agent-hero-panel-head strong {
  font-size: 1.04rem;
  letter-spacing: -.02em;
}

.agent-hero-panel-head small {
  color: var(--muted);
  line-height: 1.55;
}

.agent-hero-metrics {
  display: grid;
  gap: 10px;
}

.agent-metric-card,
.agent-mode-card,
.agent-benefit-card,
.agent-flow-step,
.agent-apply-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 252, 247, 0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.agent-metric-card small,
.agent-mode-card small,
.agent-benefit-card small,
.agent-flow-step small,
.agent-apply-card small {
  color: var(--muted);
  line-height: 1.58;
}

.agent-metric-card strong,
.agent-mode-card strong,
.agent-benefit-card strong,
.agent-flow-step strong,
.agent-apply-card strong {
  font-size: 1rem;
  line-height: 1.42;
  letter-spacing: -.02em;
}

.agent-hero-notes {
  display: grid;
  gap: 10px;
}

.agent-layout {
  display: grid;
  gap: 20px;
}

.agent-section {
  padding: 22px;
}

.agent-mode-grid,
.agent-benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.agent-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.agent-flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(159, 61, 30, 0.12);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
}

.agent-apply-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 18px;
  align-items: start;
}

.agent-apply-copy {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.agent-apply-copy strong {
  font-size: 1.08rem;
  letter-spacing: -.02em;
}

.agent-apply-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.agent-apply-card-head {
  display: grid;
  gap: 6px;
}

.agent-apply-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.62;
}

.agent-dashboard-page {
  gap: 24px;
}

.agent-dashboard-hero {
  align-items: stretch;
}

.agent-dashboard-hero-panel {
  width: min(440px, 100%);
}

.agent-dashboard-strip {
  display: grid;
  gap: 10px;
}

.agent-dashboard-chip,
.agent-dashboard-tile {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.9), rgba(250, 239, 220, 0.78)),
    rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
}

.agent-dashboard-chip small,
.agent-dashboard-tile small {
  color: var(--muted);
  line-height: 1.6;
}

.agent-dashboard-chip strong,
.agent-dashboard-tile strong {
  font-size: 1rem;
  line-height: 1.42;
  letter-spacing: -.02em;
}

.agent-dashboard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.68fr);
  gap: 20px;
  align-items: start;
}

.agent-dashboard-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.agent-dashboard-main,
.agent-dashboard-side {
  display: grid;
  gap: 18px;
}

.agent-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.agent-dashboard-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-dashboard-focus {
  background:
    linear-gradient(180deg, rgba(255, 248, 237, 0.98), rgba(243, 223, 186, 0.82)),
    rgba(255,255,255,.86);
  border-color: rgba(159, 61, 30, 0.18);
  box-shadow: 0 14px 30px rgba(79, 47, 18, 0.12), inset 0 1px 0 rgba(255,255,255,.52);
}

.agent-dashboard-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.agent-dashboard-timeline {
  display: grid;
  gap: 10px;
}

.agent-dashboard-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.62;
}

.agent-dashboard-side-stack {
  display: grid;
  gap: 14px;
}

.agent-workspace-zone {
  display: grid;
  gap: 14px;
}

.agent-dashboard-action-band {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(260px, 0.86fr);
  gap: 16px;
  align-items: start;
}

.agent-dashboard-form {
  display: grid;
  gap: 12px;
}

.agent-dashboard-form .inline-actions {
  margin-top: 6px;
}

.agent-filter-bar {
  margin-top: -2px;
  margin-bottom: 6px;
}

.agent-filter-bar .ghost-btn.active {
  border-color: rgba(159, 61, 30, 0.42);
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.12), rgba(208, 138, 54, 0.16));
}

.agent-dashboard-page .overview-card.is-actionable {
  cursor: pointer;
}

.agent-dashboard-page .overview-card.is-actionable:focus-visible {
  outline: 2px solid rgba(159, 61, 30, 0.38);
  outline-offset: 3px;
}

.agent-dashboard-main .row-card.is-focused {
  border-color: rgba(159, 61, 30, 0.24);
  background: linear-gradient(180deg, rgba(255, 248, 237, 0.94), rgba(250, 239, 220, 0.8));
  box-shadow: 0 10px 24px rgba(79, 47, 18, 0.08), inset 0 1px 0 rgba(255,255,255,.48);
}

.metric-compact {
  font-size: 1.16rem;
  line-height: 1.3;
}

.app-welcome-feedback {
  margin-top: 16px;
  border: 1px solid rgba(45, 95, 130, 0.16);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 251, 245, 0.78);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
  overflow-wrap: anywhere;
}

.app-welcome-feedback.ok {
  border-color: rgba(45, 106, 82, 0.22);
  background: rgba(45, 106, 82, 0.08);
  color: var(--good);
}

.app-welcome-feedback.warn {
  border-color: rgba(159, 61, 30, 0.22);
  background: rgba(159, 61, 30, 0.08);
  color: var(--accent);
}

.brand-easter-egg {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 35;
}

.brand-easter-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(217, 119, 6, 0.22);
  background: rgba(255, 248, 238, 0.98);
  color: #6b4f33;
  box-shadow: 0 20px 40px rgba(148, 92, 24, 0.18);
}

.brand-easter-card strong {
  color: #8a4b17;
  font-size: 1rem;
}

.brand-easter-card a {
  color: #c26b1f;
  font-weight: 600;
  text-decoration: none;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.toolbar-row input,
.toolbar-row select {
  min-width: 220px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.eyebrow {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero h1 {
  margin: 14px 0 8px;
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  max-width: 66ch;
  overflow-wrap: anywhere;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: var(--workspace-gap);
  margin-top: 20px;
  align-items: start;
}

.profile-layout {
  display: grid;
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.95fr);
  gap: 20px;
  align-items: start;
}

.profile-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
  gap: 20px;
  align-items: start;
}

.profile-finance-stack {
  display: grid;
  gap: 20px;
}

.profile-main,
.profile-side,
.profile-redeem,
.profile-billing,
.profile-ledger,
.profile-history,
.profile-security {
  padding: 20px;
}

.profile-main,
.profile-side,
.profile-redeem,
.profile-billing,
.profile-ledger,
.profile-history,
.profile-security,
.profile-finance-stack {
  min-width: 0;
}

.profile-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}

.profile-summary-wide {
  grid-column: 1 / -1;
}

.profile-overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.profile-focus-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin: 0 0 18px;
  border-radius: 20px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.92), rgba(252, 243, 232, 0.8));
}

.profile-focus-message {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px dashed rgba(91, 61, 31, 0.16);
  color: var(--ink);
  line-height: 1.68;
}

.profile-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-focus-actions > * {
  flex: 1 1 160px;
}

.profile-page .section-head {
  align-items: flex-start;
}

.profile-overview-tile {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.74);
  border: 1px solid rgba(91, 61, 31, 0.1);
}

.profile-overview-tile small {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-overview-tile strong {
  font-size: 0.98rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 18px;
}

.profile-section-nav .badge-pill {
  text-decoration: none;
  min-height: 40px;
  align-items: center;
  justify-content: center;
}

.profile-summary-block {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(91, 61, 31, 0.1);
}

.profile-summary-primary,
.profile-summary-secondary {
  min-width: 0;
}

.profile-summary-block .analysis-grid {
  margin: 0;
}

.profile-main .result-top {
  align-items: start;
  gap: 14px;
}

.profile-main .result-top p,
.profile-main .section-head .helper,
.profile-side .helper,
.profile-history-shell .helper {
  overflow-wrap: anywhere;
}

.profile-quick-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.profile-quick-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(91, 61, 31, 0.1);
}

.profile-quick-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-quick-item strong {
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-quick-note {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.78);
  border: 1px solid rgba(91, 61, 31, 0.08);
  color: var(--muted);
  line-height: 1.65;
}

.profile-quick-item.good {
  background: rgba(45, 106, 82, 0.1);
  border-color: rgba(45, 106, 82, 0.16);
}

.profile-quick-item.soft {
  background: rgba(45, 95, 130, 0.08);
  border-color: rgba(45, 95, 130, 0.14);
}

.profile-quick-item.warn {
  background: rgba(159, 61, 30, 0.1);
  border-color: rgba(159, 61, 30, 0.16);
}

.profile-quick-note {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.66);
  border: 1px dashed rgba(91, 61, 31, 0.16);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.profile-side {
  position: static !important;
  top: auto !important;
  height: auto !important;
  align-self: start;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 250, 243, 0.96), rgba(255, 249, 240, 0.88)),
    var(--panel);
}

.profile-history-shell {
  display: grid;
  gap: 12px;
}

.profile-redeem,
.profile-billing,
.profile-ledger,
.profile-security {
  display: grid;
  gap: 14px;
}

.profile-security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-side {
  overflow-wrap: anywhere;
}

.profile-security .collapse-shell {
  margin-top: 0;
}

.profile-security .collapse-body {
  padding: 14px;
}

.profile-history-actions {
  margin-bottom: 12px;
}

.profile-history-actions {
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.profile-history-actions .ghost-input {
  flex: 1 1 220px;
  min-width: 0;
}

.profile-history-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-history-quick-filters .ghost-btn.active {
  border-color: rgba(159, 61, 30, 0.32);
  background: rgba(159, 61, 30, 0.08);
  color: var(--accent);
}

.profile-history-summary-strip {
  margin-bottom: 12px;
}

.profile-finance-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-finance-quick-filters {
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-finance-quick-filters .ghost-btn.active {
  border-color: rgba(159, 61, 30, 0.32);
  background: rgba(159, 61, 30, 0.08);
  color: var(--accent);
}

.profile-finance-summary-strip {
  margin-bottom: 12px;
}

.history-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.history-record-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.history-record-head .status-pill {
  flex: 0 0 auto;
}

.profile-page .collapse-shell {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.64);
  border: 1px solid rgba(91, 61, 31, 0.08);
}

.profile-page .collapse-shell summary {
  padding: 12px 14px;
  font-weight: 700;
}

.profile-page .collapse-shell .table-list {
  padding: 0 12px 12px;
}

.profile-page .collapse-shell[open] summary {
  border-bottom: 1px solid rgba(91, 61, 31, 0.08);
}

.profile-page .row-card {
  border-radius: 18px;
}

.profile-page .row-card strong {
  line-height: 1.5;
}

.profile-page .row-card small {
  line-height: 1.6;
}

.profile-page .table-list {
  gap: 10px;
}

.profile-page .row-card .inline-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.profile-finance-stack .panel,
.profile-history-shell,
.profile-security {
  border: 1px solid rgba(91, 61, 31, 0.08);
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(34, 24, 15, 0.4);
}

.profile-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 20px;
}

.profile-modal-open {
  overflow: hidden;
}

.layout-shell {
  position: relative;
  margin-top: 20px;
}

.layout-shell.panel-collapsed .layout {
  grid-template-columns: 104px minmax(0, 1fr);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  min-width: 0;
}

.control-panel {
  padding: 20px;
  position: sticky;
  top: 16px;
  height: fit-content;
  transition: width 180ms ease, padding 180ms ease, transform 180ms ease, opacity 180ms ease;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-mark-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.16), rgba(45, 95, 130, 0.12));
  color: var(--accent);
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-weight: 700;
}

.panel-mark-copy {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.panel-title,
.section-head,
.result-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.mobile-panel-title {
  position: relative;
  min-height: 60px;
}

.mobile-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  align-self: start;
}

.result-top {
  align-items: flex-start;
  gap: 14px;
}

.panel-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.panel-copy {
  transition: opacity 180ms ease, max-height 180ms ease;
  max-width: 28ch;
}

.panel-title h2,
.result-top h2,
.section-head h3 {
  margin: 0;
}

.panel-title p,
.result-top p,
.helper,
.field small,
.empty-hint {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.build-stamp {
  margin-top: 12px;
}

.badge-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(45, 95, 130, 0.1);
  color: var(--water);
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.panel-toggle {
  font: inherit;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.82);
  color: var(--ink);
  cursor: pointer;
}

.panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1rem;
  flex: 0 0 auto;
}
.panel-toggle-glyph {
  font-size: 1.1rem;
  line-height: 1;
}

.panel-toggle-copy {
  display: none;
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(34, 24, 15, 0.24);
  z-index: 4;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  min-width: 0;
}

.mobile-mode-grid {
  position: relative;
  overscroll-behavior-x: contain;
  overflow-y: visible;
}

.mode-chip,
.tab-chip,
.ghost-btn,
.tool-btn,
.history-item {
  font: inherit;
}

.history-toggle {
  border: 1px dashed rgba(111, 74, 39, 0.26);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 251, 245, 0.64);
  color: var(--muted);
  cursor: pointer;
}

.mode-chip,
.tab-chip {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px;
  background: rgba(255, 252, 247, 0.72);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tab-chip[data-tab="report"] {
  color: var(--accent);
}

.tab-chip[data-tab="report"].disabled-mode {
  color: rgba(159, 61, 30, 0.58);
  border-style: dashed;
  background: rgba(159, 61, 30, 0.06);
}

.mode-chip {
  display: grid;
  gap: 4px;
  text-align: left;
  align-content: start;
}

.mode-chip-short {
  display: none;
}

.mode-chip.active,
.tab-chip.active {
  border-color: rgba(159, 61, 30, 0.42);
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.12), rgba(208, 138, 54, 0.16));
}

.mode-chip:hover,
.tab-chip:hover,
.history-item:hover,
.ghost-btn:hover,
.tool-btn:hover,
.submit-btn:hover {
  transform: translateY(-1px);
}

.fields,
.control-section,
.history-list,
.result-stack,
.analysis-grid,
.tab-row {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.result-stack,
.section-stack,
.workspace-section {
  gap: 14px;
}

.workspace-state-pills,
.key-value-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-state-pill,
.key-value-pill {
  display: inline-grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  border-radius: 14px;
  background: rgba(255, 251, 245, 0.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
  overflow-wrap: anywhere;
}

.workspace-state-pill {
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.workspace-state-pill.accent {
  color: var(--accent);
  background: rgba(159, 61, 30, 0.1);
}

.workspace-state-pill.good {
  color: var(--good);
  background: rgba(45, 106, 82, 0.1);
}

.workspace-state-pill.water {
  color: var(--water);
  background: rgba(45, 95, 130, 0.1);
}

.key-value-pill small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.key-value-pill strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.35;
}

.fields { margin-top: 16px; }

.field { display: grid; gap: 7px; }

.field-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.input-note-box {
  display: grid;
  gap: 4px;
  min-height: 100%;
  border: 1px solid rgba(91, 61, 31, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 249, 240, 0.78);
}

.input-note-box strong {
  font-size: 0.92rem;
}

.input-note-box span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.field-row .field small {
  min-height: 2.5em;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(111, 74, 39, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 252, 247, 0.86);
  font: inherit;
}

textarea { min-height: 96px; resize: vertical; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(159, 61, 30, 0.42);
  box-shadow: 0 0 0 4px rgba(159, 61, 30, 0.08);
}

.advanced {
  margin-top: 4px;
  border: 1px dashed rgba(111, 74, 39, 0.25);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 251, 246, 0.65);
}

.advanced summary {
  cursor: pointer;
  font-weight: 700;
}

[data-bazi-lunar] input {
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  letter-spacing: 0.01em;
}

.submit-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  align-items: start;
}

.mobile-submit-row {
  position: relative;
}

.submit-btn {
  border: none;
  border-radius: 16px;
  padding: 14px;
  color: #fff7ec;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #aa4726, #d08a36);
  box-shadow: 0 12px 26px rgba(159, 61, 30, 0.22);
}

.submit-btn:disabled {
  cursor: wait;
  opacity: 0.76;
}

.status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.status.ok { color: var(--good); }
.status.warn { color: var(--warn); }

.control-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 252, 247, 0.75);
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.history-item strong { display: block; margin: 4px 0; }
.history-item strong,
.history-item span {
  overflow-wrap: anywhere;
}
.history-item span { color: var(--muted); font-size: 0.88rem; }

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  align-items: start;
}

.history-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.history-label {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(45, 95, 130, 0.1);
  color: var(--water);
  font-size: 0.76rem;
  font-weight: 700;
}

.history-label-ai {
  background: rgba(208, 138, 54, 0.18);
  color: #a85918;
}

.history-label-ai.good {
  background: rgba(208, 138, 54, 0.18);
  color: #a85918;
}

.history-label-ai.warn {
  background: rgba(159, 61, 30, 0.14);
  color: var(--accent);
}

.history-ai-note {
  color: #a85918;
  font-size: 0.82rem;
  font-weight: 700;
}

.history-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.history-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(45, 95, 130, 0.08);
  color: var(--water);
  font-size: 0.78rem;
  font-weight: 700;
}

.history-summary-pill-ai {
  background: rgba(208, 138, 54, 0.14);
  color: #a85918;
}

.history-summary-pill-focus {
  background: rgba(159, 61, 30, 0.1);
  color: var(--accent);
}

.ghost-select {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.72);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.history-section-head {
  align-items: center;
  gap: 12px;
}

.history-toolbar {
  margin-top: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  display: inline-flex;
  width: min(100%, 520px);
  min-width: 0;
}

.history-toolbar-compact {
  gap: 8px;
}

.history-toolbar .ghost-input {
  min-width: 180px;
  flex: 1 1 240px;
}

.history-toolbar .ghost-select {
  min-width: 136px;
  flex: 0 1 156px;
}

.history-summary-pill-reset {
  border: 1px solid rgba(159, 61, 30, 0.16);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.history-summary-pill-reset:hover,
.history-summary-pill-reset:focus-visible {
  border-color: rgba(159, 61, 30, 0.32);
  background: rgba(159, 61, 30, 0.08);
  color: var(--accent);
}

.history-toolbar .ghost-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.result-stack .workspace-actions {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.result-stack .workspace-actions .tool-btn,
.result-stack .workspace-actions .ghost-btn {
  min-height: 42px;
  padding-inline: 13px;
}

.ghost-btn,
.tool-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 252, 247, 0.72);
  color: var(--ink);
  cursor: pointer;
  max-width: 100%;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.btn-md {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.btn-lg {
  min-height: 48px;
  padding: 12px 16px;
  font-size: 0.98rem;
}
.tool-btn.primary {
  background: linear-gradient(135deg, rgba(159,61,30,.15), rgba(208,138,54,.18));
  border-color: rgba(159,61,30,.22);
  color: var(--accent);
  font-weight: 700;
}

.input-preview {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  border: 1px dashed rgba(111, 74, 39, 0.24);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 251, 245, 0.72);
}

.input-preview strong {
  font-size: 0.85rem;
}

.input-preview span {
  color: var(--muted);
  font-size: 0.88rem;
}

.ghost-btn:disabled,
.tool-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-panel {
  min-height: 680px;
  padding: 20px;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.result-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
  min-width: 0;
  flex: 0 0 auto;
  align-items: stretch;
}

.mobile-edit-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(111, 74, 39, 0.16);
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(247, 236, 219, 0.84));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.48);
}

.mobile-edit-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.mobile-edit-panel-main {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mobile-edit-panel-caption {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.32;
}

.mobile-scroll-nudge {
  position: relative;
}

.mobile-scroll-nudge::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 8px;
  bottom: 8px;
  width: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245, 235, 220, 0), rgba(245, 235, 220, 0.96));
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.mobile-scroll-nudge.nudge-ready::after {
  opacity: 0.72;
}

.mobile-scroll-nudge.nudge-active {
  animation: mobile-strip-nudge 0.9s ease-in-out 2;
}

.mobile-mode-grid.nudge-ready::after {
  opacity: 0.72;
}

.mobile-mode-grid.nudge-active {
  animation: mobile-strip-nudge 0.9s ease-in-out 2;
}

@keyframes mobile-strip-nudge {
  0%,
  100% { transform: translateX(0); }
  35% { transform: translateX(-12px); }
  70% { transform: translateX(0); }
}

.result-top-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 60ch;
}

.result-top-copy h2,
.result-top-copy p {
  min-width: 0;
}

.workspace-shell {
  display: grid;
  gap: 14px;
}

.workspace-shell > * {
  min-width: 0;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.workspace-header-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.workspace-header-copy h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.workspace-header-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
  font-size: 0.9rem;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workspace-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-gap-sm {
  display: grid;
  gap: 10px;
}

.stack-gap-md {
  display: grid;
  gap: 12px;
}

.stack-gap-lg {
  display: grid;
  gap: 16px;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 61, 31, 0.18), transparent);
}

.report-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.result-meta { margin: 14px 0; }
.timezone-preview-strip {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  background: rgba(255, 251, 245, 0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
}

.timezone-preview-copy {
  display: grid;
  gap: 4px;
}

.timezone-preview-copy strong {
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.timezone-preview-copy span,
.timezone-preview-copy small {
  color: var(--muted);
  line-height: 1.62;
}

.timezone-preview-copy small {
  font-size: 0.82rem;
}

.timezone-quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.timezone-quick-pick {
  min-height: 34px;
}

.timezone-quick-pick.is-active {
  border-color: rgba(159, 61, 30, 0.28);
  background: rgba(159, 61, 30, 0.12);
  color: var(--accent);
}

.timezone-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.timezone-preview-meta strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.timezone-consistency-hint {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.timezone-consistency-hint strong {
  font-size: 0.9rem;
}

.timezone-consistency-hint span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.timezone-consistency-hint.is-ok {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(240, 249, 242, 0.86);
}

.timezone-consistency-hint.is-ok strong {
  color: #1f6b46;
}

.timezone-consistency-hint.is-warn {
  border-color: rgba(208, 138, 54, 0.22);
  background: rgba(255, 247, 235, 0.92);
}

.timezone-consistency-hint.is-warn strong {
  color: #9f3d1e;
}

.timezone-consistency-hint.is-info {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(239, 247, 252, 0.88);
}

.timezone-consistency-hint.is-info strong {
  color: #315a74;
}

.timezone-mode-receipt {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  background: rgba(255, 255, 255, 0.66);
}

.timezone-mode-receipt strong {
  font-size: 0.9rem;
}

.timezone-mode-receipt span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.timezone-mode-receipt.is-ok {
  border-color: rgba(33, 128, 79, 0.14);
  background: rgba(241, 249, 243, 0.84);
}

.timezone-mode-receipt.is-ok strong {
  color: #1f6b46;
}

.timezone-mode-receipt.is-info {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(239, 247, 252, 0.84);
}

.timezone-mode-receipt.is-info strong {
  color: #315a74;
}

.timezone-lock-state {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  background: rgba(255, 255, 255, 0.64);
}

.timezone-lock-state strong {
  font-size: 0.9rem;
}

.timezone-lock-state span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.timezone-lock-state.is-ok {
  border-color: rgba(33, 128, 79, 0.14);
  background: rgba(241, 249, 243, 0.82);
}

.timezone-lock-state.is-ok strong {
  color: #1f6b46;
}

.timezone-lock-state.is-warn {
  border-color: rgba(208, 138, 54, 0.2);
  background: rgba(255, 247, 235, 0.9);
}

.timezone-lock-state.is-warn strong {
  color: #9f3d1e;
}

.timezone-lock-state.is-info {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(239, 247, 252, 0.82);
}

.timezone-lock-state.is-info strong {
  color: #315a74;
}

.timezone-memory-board {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 251, 245, 0.72);
}

.timezone-memory-board-copy {
  display: grid;
  gap: 4px;
}

.timezone-memory-board-copy strong {
  font-size: 0.94rem;
}

.timezone-memory-board-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.timezone-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.timezone-memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-drift-stack {
  display: grid;
  gap: 8px;
}

.timezone-memory-health {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.timezone-memory-health-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.timezone-memory-health-score strong {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink);
}

.timezone-memory-health-score span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.timezone-memory-health-copy {
  display: grid;
  gap: 4px;
}

.timezone-memory-health-copy strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.timezone-memory-health-copy span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.timezone-memory-health-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-health-receipt {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-health-receipt strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-health-receipt span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.timezone-memory-health-receipt small {
  color: var(--muted);
  font-size: 0.74rem;
}

.timezone-memory-health-receipt.is-up {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
}

.timezone-memory-health-receipt.is-up strong,
.timezone-memory-health-receipt.is-up span {
  color: #1f6b46;
}

.timezone-memory-health-receipt.is-down {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.94);
}

.timezone-memory-health-receipt.is-down strong,
.timezone-memory-health-receipt.is-down span {
  color: #8b4a18;
}

.timezone-memory-health-receipt.is-flat {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(239, 247, 252, 0.88);
}

.timezone-memory-health-receipt.is-flat strong,
.timezone-memory-health-receipt.is-flat span {
  color: var(--water);
}

.timezone-memory-history {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed rgba(91, 61, 31, 0.14);
}

.timezone-memory-history-head {
  display: grid;
  gap: 4px;
}

.timezone-memory-history-head strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.timezone-memory-history-head small {
  color: var(--muted);
  font-size: 0.74rem;
}

.timezone-memory-history-list {
  display: grid;
  gap: 8px;
}

.timezone-memory-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-history-filter {
  border-color: rgba(91, 61, 31, 0.14);
  background: rgba(255, 251, 245, 0.84);
  color: var(--ink);
}

.timezone-memory-history-filter[data-timezone-history-filter="align"],
.timezone-memory-history-filter[data-timezone-history-filter="sync"] {
  border-color: rgba(33, 128, 79, 0.12);
}

.timezone-memory-history-filter[data-timezone-history-filter="reset"],
.timezone-memory-history-filter[data-timezone-history-filter="undo"] {
  border-color: rgba(194, 110, 47, 0.16);
}

.timezone-memory-history-filter[data-timezone-history-filter="borrow"],
.timezone-memory-history-filter[data-timezone-history-filter="preset"] {
  border-color: rgba(45, 95, 130, 0.14);
}

.timezone-memory-history-filter.is-active {
  border-color: rgba(45, 95, 130, 0.2);
  background: rgba(239, 247, 252, 0.94);
  color: var(--water);
  box-shadow: inset 0 0 0 1px rgba(45, 95, 130, 0.12);
}

.timezone-memory-history-empty {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(91, 61, 31, 0.14);
  background: rgba(255, 251, 245, 0.84);
  color: var(--muted);
  font-size: 0.74rem;
}

.timezone-memory-history-filter-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-filter-summary strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-filter-summary span {
  color: var(--ink);
  font-size: 0.74rem;
}

.timezone-memory-history-filter-summary small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.timezone-memory-history-action-summary {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-action-summary strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-history-action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 251, 245, 0.84);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.timezone-memory-history-action-chip span {
  color: inherit;
  font-size: 0.7rem;
  font-weight: 800;
}

.timezone-memory-history-action-chip small {
  color: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.86;
}

.timezone-memory-history-action-chip.is-active {
  box-shadow: inset 0 0 0 1px rgba(91, 61, 31, 0.12);
  transform: translateY(-1px);
}

.timezone-memory-history-action-chip.impact-up {
  box-shadow: inset 0 0 0 1px rgba(33, 128, 79, 0.12);
}

.timezone-memory-history-action-chip.impact-down {
  box-shadow: inset 0 0 0 1px rgba(194, 110, 47, 0.14);
}

.timezone-memory-history-action-chip.impact-flat {
  box-shadow: inset 0 0 0 1px rgba(45, 95, 130, 0.1);
}

.timezone-memory-history-action-chip.is-align,
.timezone-memory-history-action-chip.is-sync {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
  color: #1f6b46;
}

.timezone-memory-history-action-chip.is-reset,
.timezone-memory-history-action-chip.is-undo {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.94);
  color: #8b4a18;
}

.timezone-memory-history-action-chip.is-borrow,
.timezone-memory-history-action-chip.is-preset {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(239, 247, 252, 0.88);
  color: var(--water);
}

.timezone-memory-history-action-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-history-action-insight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  text-align: left;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-action-insight strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.timezone-memory-history-action-insight span {
  color: var(--muted);
  font-size: 0.72rem;
}

.timezone-memory-history-action-insight.is-up {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
}

.timezone-memory-history-action-insight.is-down {
  border-color: rgba(194, 110, 47, 0.16);
  background: rgba(255, 244, 235, 0.94);
}

.timezone-memory-history-action-insight.is-flat {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(241, 247, 252, 0.92);
}

.timezone-memory-history-action-insight.is-active {
  box-shadow: inset 0 0 0 1px rgba(91, 61, 31, 0.12);
  transform: translateY(-1px);
}

.timezone-memory-history-filter-insight {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-filter-insight strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-filter-insight span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.timezone-memory-history-filter-insight.is-up {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
}

.timezone-memory-history-filter-insight.is-up strong {
  color: #1f6b46;
}

.timezone-memory-history-filter-insight.is-down {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.94);
}

.timezone-memory-history-filter-insight.is-down strong {
  color: #8b4a18;
}

.timezone-memory-history-filter-insight.is-flat {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(239, 247, 252, 0.88);
}

.timezone-memory-history-filter-insight.is-flat strong {
  color: var(--water);
}

.timezone-memory-history-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-history-filter-copy {
  border-color: rgba(91, 61, 31, 0.14);
  background: rgba(255, 251, 245, 0.84);
  color: var(--ink);
}

.timezone-memory-history-trend {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-trend strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-trend span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.timezone-memory-history-trend.is-up,
.timezone-memory-history-trend.is-mixed-up {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
}

.timezone-memory-history-trend.is-up strong,
.timezone-memory-history-trend.is-mixed-up strong {
  color: #1f6b46;
}

.timezone-memory-history-trend.is-down,
.timezone-memory-history-trend.is-mixed-down {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.94);
}

.timezone-memory-history-trend.is-down strong,
.timezone-memory-history-trend.is-mixed-down strong {
  color: #8b4a18;
}

.timezone-memory-history-trend.is-flat {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(239, 247, 252, 0.88);
}

.timezone-memory-history-trend.is-flat strong {
  color: var(--water);
}

.timezone-memory-history-inflection {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(91, 61, 31, 0.16);
  background: rgba(255, 251, 245, 0.88);
}

.timezone-memory-history-inflection strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-inflection span {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.timezone-memory-history-inflection.is-upturn {
  border-color: rgba(33, 128, 79, 0.18);
  background: rgba(245, 251, 246, 0.94);
}

.timezone-memory-history-inflection.is-upturn strong {
  color: #1f6b46;
}

.timezone-memory-history-inflection.is-downturn {
  border-color: rgba(194, 110, 47, 0.2);
  background: rgba(255, 247, 240, 0.95);
}

.timezone-memory-history-inflection.is-downturn strong {
  color: #8b4a18;
}

.timezone-memory-history-inflection.is-stabilizing {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(242, 248, 252, 0.9);
}

.timezone-memory-history-inflection.is-stabilizing strong {
  color: var(--water);
}

.timezone-memory-history-review {
  display: grid;
  gap: 8px;
}

.timezone-memory-history-review-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-review-card strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-review-card span {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.timezone-memory-history-review-card small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.timezone-memory-history-review-card.is-best {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
}

.timezone-memory-history-review-card.is-best strong,
.timezone-memory-history-review-card.is-best span {
  color: #1f6b46;
}

.timezone-memory-history-review-card.is-watch {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.94);
}

.timezone-memory-history-review-card.is-watch strong,
.timezone-memory-history-review-card.is-watch span {
  color: #8b4a18;
}

.timezone-memory-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-history-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-history-item strong {
  display: block;
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-history-kind {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 251, 245, 0.84);
  color: var(--muted);
}

.timezone-memory-history-kind.is-align,
.timezone-memory-history-kind.is-sync {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
  color: #1f6b46;
}

.timezone-memory-history-kind.is-preset,
.timezone-memory-history-kind.is-borrow {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(239, 247, 252, 0.88);
  color: var(--water);
}

.timezone-memory-history-kind.is-reset,
.timezone-memory-history-kind.is-undo {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.94);
  color: #8b4a18;
}

.timezone-memory-history-item span {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.timezone-memory-history-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.timezone-memory-history-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.timezone-memory-history-delta.is-up {
  color: #1f6b46;
  background: rgba(241, 249, 243, 0.92);
}

.timezone-memory-history-delta.is-down {
  color: #8b4a18;
  background: rgba(255, 244, 235, 0.94);
}

.timezone-memory-history-delta.is-flat {
  color: var(--water);
  background: rgba(239, 247, 252, 0.88);
}

.timezone-memory-health-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.timezone-memory-health-chip.is-ok {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
  color: #1f6b46;
}

.timezone-memory-health-chip.is-warn {
  border-color: rgba(208, 138, 54, 0.18);
  background: rgba(255, 247, 235, 0.94);
  color: #9f3d1e;
}

.timezone-memory-health.is-ok {
  border-color: rgba(33, 128, 79, 0.14);
  background: rgba(241, 249, 243, 0.78);
}

.timezone-memory-health.is-ok .timezone-memory-health-score strong {
  color: #1f6b46;
}

.timezone-memory-health.is-warn {
  border-color: rgba(208, 138, 54, 0.18);
  background: rgba(255, 247, 235, 0.9);
}

.timezone-memory-health.is-warn .timezone-memory-health-score strong {
  color: #9f3d1e;
}

.timezone-memory-health.is-risk {
  border-color: rgba(159, 61, 30, 0.2);
  background: rgba(255, 241, 237, 0.92);
}

.timezone-memory-health.is-risk .timezone-memory-health-score strong {
  color: #9f3d1e;
}

.timezone-memory-drift {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.timezone-memory-drift strong {
  font-size: 0.88rem;
}

.timezone-memory-drift span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.timezone-memory-drift-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timezone-memory-drift-distribution {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timezone-memory-drift-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.timezone-memory-drift-outliers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.timezone-memory-drift-outliers strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-drift-aligned {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.timezone-memory-drift-aligned strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-drift-suggestion {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.timezone-memory-drift-reason {
  color: var(--muted);
  font-size: 0.76rem;
}

.timezone-memory-drift-impact {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
}

.timezone-memory-drift-impact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.timezone-memory-drift-impact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.timezone-memory-drift-impact-chip.is-change {
  border-color: rgba(194, 110, 47, 0.18);
  background: rgba(255, 244, 235, 0.92);
  color: #8b4a18;
}

.timezone-memory-drift-impact-chip.is-keep {
  border-color: rgba(33, 128, 79, 0.16);
  background: rgba(241, 249, 243, 0.92);
  color: #1f6b46;
}

.timezone-memory-drift-change-list {
  display: grid;
  gap: 8px;
}

.timezone-memory-drift-change-list strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.timezone-memory-drift-change-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timezone-memory-drift-change-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 0.74rem;
}

.timezone-memory-drift-post-align {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(33, 128, 79, 0.12);
  background: rgba(241, 249, 243, 0.7);
}

.timezone-memory-drift-post-align strong {
  color: #1f6b46;
  font-size: 0.78rem;
}

.timezone-memory-drift-post-align span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.timezone-memory-drift-post-align small {
  color: var(--muted);
  font-size: 0.74rem;
}

.timezone-memory-drift-benefit {
  color: #1f6b46;
  font-size: 0.76rem;
  font-weight: 700;
}

.timezone-memory-drift-risk {
  color: #8a3b12;
  font-size: 0.75rem;
  font-weight: 700;
}

.timezone-memory-drift-recommendation {
  color: #6a4d18;
  font-size: 0.75rem;
  font-weight: 700;
}

.timezone-memory-drift-action {
  border-color: rgba(91, 61, 31, 0.14);
  background: rgba(255, 255, 255, 0.82);
}

.timezone-memory-drift-copy {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(239, 247, 252, 0.88);
  color: var(--water);
}

.timezone-memory-drift.is-ok {
  border-color: rgba(33, 128, 79, 0.14);
  background: rgba(241, 249, 243, 0.82);
}

.timezone-memory-drift.is-ok strong {
  color: #1f6b46;
}

.timezone-memory-drift.is-warn {
  border-color: rgba(208, 138, 54, 0.2);
  background: rgba(255, 247, 235, 0.9);
}

.timezone-memory-drift.is-warn strong {
  color: #9f3d1e;
}

.timezone-memory-action {
  border-color: rgba(91, 61, 31, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.timezone-memory-copy {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(239, 247, 252, 0.88);
  color: var(--water);
}

.timezone-memory-undo {
  border-color: rgba(194, 110, 47, 0.16);
  background: rgba(255, 244, 235, 0.9);
  color: #8b4a18;
}

.timezone-memory-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.timezone-memory-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timezone-memory-card-head strong {
  font-size: 0.88rem;
}

.timezone-memory-card-head span {
  color: var(--water);
  font-size: 0.76rem;
}

.timezone-memory-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.timezone-memory-card-foot {
  display: flex;
  justify-content: flex-end;
}

.timezone-memory-jump {
  border-color: rgba(91, 61, 31, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.timezone-memory-borrow {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(239, 247, 252, 0.82);
  color: var(--water);
}

.timezone-memory-current-badge {
  color: var(--water);
  font-size: 0.78rem;
  font-weight: 600;
}

.timezone-memory-card.is-current {
  border-color: rgba(45, 95, 130, 0.2);
  box-shadow: inset 0 0 0 1px rgba(45, 95, 130, 0.08);
}

.result-localization-state {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  background: rgba(255, 251, 245, 0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
}

.result-localization-copy {
  display: grid;
  gap: 4px;
}

.result-localization-copy strong {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.result-localization-copy span {
  color: var(--muted);
  line-height: 1.68;
}

.result-timezone-policy-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(91, 61, 31, 0.18);
  background: rgba(255, 248, 239, 0.74);
}

.site-mirror-workspace-banner {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(45, 95, 130, 0.18);
  background:
    linear-gradient(135deg, rgba(45, 95, 130, 0.1), rgba(208, 138, 54, 0.09)),
    rgba(255, 251, 245, 0.94);
}

.site-mirror-workspace-copy {
  display: grid;
  gap: 4px;
}

.site-mirror-workspace-copy strong {
  font-size: 1rem;
  color: var(--ink);
}

.site-mirror-workspace-copy span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.site-mirror-workspace-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-shell {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.08), rgba(208, 138, 54, 0.08)), rgba(255, 251, 245, 0.9);
  min-width: 0;
}

.meta-shell .workspace-header {
  align-items: center;
}

body[data-site-variant="hk-mirror"] .site-mirror-workspace-banner {
  border-color: rgba(45, 95, 130, 0.22);
  box-shadow: 0 16px 36px rgba(31, 54, 88, 0.08);
}

body[data-site-variant="hk-mirror"] .result-localization-state {
  border-color: rgba(45, 95, 130, 0.18);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.9), rgba(247, 252, 255, 0.8)),
    rgba(255,255,255,.78);
}

body[data-site-variant="hk-mirror"] .result-localization-copy span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-preview-strip {
  border-color: rgba(45, 95, 130, 0.2);
  background:
    linear-gradient(135deg, rgba(235, 246, 252, 0.9), rgba(247, 252, 255, 0.8)),
    rgba(255,255,255,.78);
}

body[data-site-variant="hk-mirror"] .timezone-preview-copy span,
body[data-site-variant="hk-mirror"] .timezone-preview-copy small {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-quick-pick {
  border-color: rgba(45, 95, 130, 0.2);
}

body[data-site-variant="hk-mirror"] .timezone-quick-pick.is-active {
  border-color: rgba(45, 95, 130, 0.28);
  background: rgba(45, 95, 130, 0.12);
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-preview-meta {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-consistency-hint {
  border-color: rgba(45, 95, 130, 0.16);
  background:
    linear-gradient(135deg, rgba(234, 246, 252, 0.9), rgba(247, 252, 255, 0.82)),
    rgba(255,255,255,.72);
}

body[data-site-variant="hk-mirror"] .timezone-consistency-hint span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-mode-receipt {
  border-color: rgba(45, 95, 130, 0.16);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.88), rgba(247, 252, 255, 0.8)),
    rgba(255,255,255,.72);
}

body[data-site-variant="hk-mirror"] .timezone-mode-receipt span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-lock-state {
  border-color: rgba(45, 95, 130, 0.16);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.86), rgba(247, 252, 255, 0.8)),
    rgba(255,255,255,.72);
}

body[data-site-variant="hk-mirror"] .timezone-lock-state span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-board {
  border-color: rgba(45, 95, 130, 0.18);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.88), rgba(247, 252, 255, 0.8)),
    rgba(255,255,255,.74);
}

body[data-site-variant="hk-mirror"] .timezone-memory-health {
  border-color: rgba(45, 95, 130, 0.16);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.9), rgba(247, 252, 255, 0.82)),
    rgba(255,255,255,.78);
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-score span,
body[data-site-variant="hk-mirror"] .timezone-memory-health-copy span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health.is-ok .timezone-memory-health-score strong {
  color: #285a78;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health.is-warn .timezone-memory-health-score strong,
body[data-site-variant="hk-mirror"] .timezone-memory-health.is-risk .timezone-memory-health-score strong {
  color: #8c4f00;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-chip {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.9);
  color: #244b63;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-chip.is-ok {
  border-color: rgba(63, 138, 102, 0.18);
  background: rgba(241, 250, 245, 0.94);
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-chip.is-warn {
  border-color: rgba(211, 143, 66, 0.2);
  background: rgba(255, 246, 232, 0.94);
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt small {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt.is-up strong,
body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt.is-up span {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt.is-down strong,
body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt.is-down span {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt.is-flat strong,
body[data-site-variant="hk-mirror"] .timezone-memory-health-receipt.is-flat span {
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history {
  border-top-color: rgba(45, 95, 130, 0.16);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-head strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-item strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-item span {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-head small,
body[data-site-variant="hk-mirror"] .timezone-memory-history-item small {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-item {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-kind {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(255, 255, 255, 0.82);
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-kind.is-align,
body[data-site-variant="hk-mirror"] .timezone-memory-history-kind.is-sync {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-kind.is-preset,
body[data-site-variant="hk-mirror"] .timezone-memory-history-kind.is-borrow {
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-kind.is-reset,
body[data-site-variant="hk-mirror"] .timezone-memory-history-kind.is-undo {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-trend {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter[data-timezone-history-filter="align"],
body[data-site-variant="hk-mirror"] .timezone-memory-history-filter[data-timezone-history-filter="sync"] {
  border-color: rgba(33, 128, 79, 0.18);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter[data-timezone-history-filter="reset"],
body[data-site-variant="hk-mirror"] .timezone-memory-history-filter[data-timezone-history-filter="undo"] {
  border-color: rgba(194, 110, 47, 0.2);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter[data-timezone-history-filter="borrow"],
body[data-site-variant="hk-mirror"] .timezone-memory-history-filter[data-timezone-history-filter="preset"] {
  border-color: rgba(45, 95, 130, 0.22);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter.is-active {
  border-color: rgba(45, 95, 130, 0.22);
  background: rgba(235, 245, 252, 0.96);
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-empty {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(248, 251, 255, 0.94);
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-summary {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-summary {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-summary strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-summary span {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-summary small {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-summary strong {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(255, 255, 255, 0.84);
  color: #45657b;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip span,
body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip small {
  color: inherit;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-active {
  box-shadow: inset 0 0 0 1px rgba(45, 95, 130, 0.14);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.impact-up {
  box-shadow: inset 0 0 0 1px rgba(33, 128, 79, 0.14);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.impact-down {
  box-shadow: inset 0 0 0 1px rgba(194, 110, 47, 0.16);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.impact-flat {
  box-shadow: inset 0 0 0 1px rgba(45, 95, 130, 0.12);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-align,
body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-sync {
  border-color: rgba(33, 128, 79, 0.2);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-reset,
body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-undo {
  border-color: rgba(194, 110, 47, 0.2);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-borrow,
body[data-site-variant="hk-mirror"] .timezone-memory-history-action-chip.is-preset {
  border-color: rgba(45, 95, 130, 0.22);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight strong {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight.is-up {
  border-color: rgba(33, 128, 79, 0.18);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight.is-down {
  border-color: rgba(194, 110, 47, 0.2);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight.is-flat {
  border-color: rgba(45, 95, 130, 0.18);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-action-insight.is-active {
  box-shadow: inset 0 0 0 1px rgba(45, 95, 130, 0.14);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-insight {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-insight strong {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-insight span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-insight.is-up strong {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-insight.is-down strong {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-insight.is-flat strong {
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-filter-copy {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-trend strong {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-trend span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-trend.is-up strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-trend.is-mixed-up strong {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-trend.is-down strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-trend.is-mixed-down strong {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-trend.is-flat strong {
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-inflection {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(248, 251, 255, 0.94);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-inflection strong {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-inflection span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-inflection.is-upturn strong {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-inflection.is-downturn strong {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-inflection.is-stabilizing strong {
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card {
  border-color: rgba(45, 95, 130, 0.16);
  background: rgba(245, 250, 255, 0.92);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card span {
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card small {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card.is-best strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card.is-best span {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card.is-watch strong,
body[data-site-variant="hk-mirror"] .timezone-memory-history-review-card.is-watch span {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-delta.is-up {
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-delta.is-down {
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-history-delta.is-flat {
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-action,
body[data-site-variant="hk-mirror"] .timezone-memory-borrow,
body[data-site-variant="hk-mirror"] .timezone-memory-jump {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(255, 255, 255, 0.8);
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-copy {
  border-color: rgba(57, 108, 161, 0.18);
  background: rgba(236, 246, 255, 0.92);
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-undo {
  border-color: rgba(57, 108, 161, 0.16);
  background: rgba(239, 247, 255, 0.9);
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift {
  border-color: rgba(45, 95, 130, 0.16);
  background:
    linear-gradient(135deg, rgba(236, 247, 253, 0.86), rgba(247, 252, 255, 0.78)),
    rgba(255,255,255,.72);
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-action {
  border-color: rgba(45, 95, 130, 0.18);
  background: rgba(255, 255, 255, 0.84);
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-copy {
  border-color: rgba(57, 108, 161, 0.18);
  background: rgba(236, 246, 255, 0.9);
  color: #2b5977;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-chip {
  border-color: rgba(45, 95, 130, 0.18);
  color: var(--water);
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-outliers {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-aligned {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-impact-chip.is-change {
  border-color: rgba(211, 143, 66, 0.2);
  background: rgba(255, 246, 232, 0.94);
  color: #8a5118;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-impact-chip.is-keep {
  border-color: rgba(63, 138, 102, 0.18);
  background: rgba(241, 250, 245, 0.94);
  color: #216b4a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-change-item {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(245, 250, 255, 0.9);
  color: #244b63;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-post-align {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(240, 248, 255, 0.78);
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-post-align strong {
  color: #285a78;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-benefit {
  color: #285a78;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-risk {
  color: #8c4f00;
}

body[data-site-variant="hk-mirror"] .timezone-memory-drift-recommendation {
  color: #3d5f8a;
}

body[data-site-variant="hk-mirror"] .timezone-memory-board-copy span,
body[data-site-variant="hk-mirror"] .timezone-memory-card small {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .timezone-memory-card {
  border-color: rgba(45, 95, 130, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

body[data-site-variant="hk-mirror"] .timezone-memory-card-head span {
  color: #315a74;
}

body[data-site-variant="hk-mirror"] .result-timezone-policy-card {
  border-color: rgba(45, 95, 130, 0.22);
  background:
    linear-gradient(135deg, rgba(230, 244, 252, 0.88), rgba(247, 252, 255, 0.78)),
    rgba(255,255,255,.78);
}

.meta-shell h3 { margin: 0; }
.meta-shell p { margin: 8px 0 0; color: var(--muted); }

.tab-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
  align-items: stretch;
}

.result-card,
.empty-state,
.raw-output {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  overflow: hidden;
}

.result-card {
  position: relative;
  min-width: 0;
}

.result-card.accent {
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.08), rgba(208, 138, 54, 0.08)), var(--panel-strong);
}

.result-card.soft {
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.06), rgba(45, 106, 82, 0.06)), var(--panel-strong);
}

.card-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 { margin: 0; font-size: 1.02rem; }
.card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.card-body { padding: 14px 16px 16px; }

.result-card .workspace-header {
  align-items: start;
}

.card-body > :first-child {
  margin-top: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.tag-row.compact .tag {
  padding: 6px 9px;
  font-size: 0.8rem;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(111, 74, 39, 0.08);
  font-size: 0.86rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.tag.good {
  background: rgba(45, 106, 82, 0.12);
  color: var(--good);
}

.tag.water {
  background: rgba(45, 95, 130, 0.12);
  color: var(--water);
}

.tag.accent {
  background: rgba(159, 61, 30, 0.12);
  color: var(--accent);
}

.analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-grid.dense {
  gap: 10px;
}

.analysis-grid.triplet {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.text-block {
  display: grid;
  gap: 12px;
}

.analysis-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 251, 245, 0.82);
  min-width: 0;
}

.analysis-item strong { display: block; }
.analysis-item span { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.stat-metric {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 251, 245, 0.8);
}

.stat-metric small,
.timeline-item span,
.pillar-facts span {
  color: var(--muted);
  display: block;
  line-height: 1.55;
}

.stat-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pillar-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 251, 245, 0.84);
  display: grid;
  gap: 10px;
}

.pillar-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.pillar-top span {
  color: var(--muted);
  font-size: 0.84rem;
}

.pillar-facts {
  display: grid;
  gap: 6px;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 4px solid rgba(159, 61, 30, 0.3);
  border-radius: 0 14px 14px 0;
  padding: 10px 12px;
  background: rgba(255, 249, 240, 0.78);
}

.wuxing-bars {
  display: grid;
  gap: 10px;
}

.wuxing-dashboard {
  display: grid;
  gap: 14px;
}

.wuxing-bar-row {
  display: grid;
  grid-template-columns: minmax(70px, 96px) minmax(0, 1fr) 30px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(91, 61, 31, 0.08);
  border-radius: 14px;
  background: rgba(255, 252, 248, 0.62);
}

.wuxing-bar-meta {
  display: grid;
  gap: 2px;
}

.wuxing-bar-meta strong {
  font-size: 0.92rem;
}

.wuxing-bar-meta small {
  color: var(--muted);
  font-size: 0.75rem;
}

.wuxing-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(111, 74, 39, 0.08);
  overflow: hidden;
}

.wuxing-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #9f3d1e, #d08a36);
  width: var(--wuxing-fill, 0%);
}

.source-note {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(91, 61, 31, 0.22);
  border-radius: 14px;
  background: rgba(255, 249, 240, 0.62);
}

.source-note strong {
  font-size: 0.88rem;
}

.source-note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-note-list span {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(45, 95, 130, 0.08);
  color: var(--water);
  font-size: 0.8rem;
}

.hexagram-showcase {
  display: block;
}

.hexagram-traditional-shell {
  display: grid;
  gap: 14px;
}

.liuyao-replay-shell {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(159, 61, 30, 0.14);
  background: linear-gradient(180deg, rgba(255, 247, 236, 0.96), rgba(255, 252, 247, 0.9));
  box-shadow: 0 14px 32px rgba(77, 49, 22, 0.08);
}

@media (min-width: 960px) {
  .liuyao-replay-shell {
    gap: 14px;
    padding: 18px 20px;
    border-radius: 22px;
  }

  .liuyao-replay-rail {
    gap: 10px;
  }

  .liuyao-replay-rail-step {
    padding: 10px 10px 11px;
    border-radius: 14px;
  }

  .liuyao-replay-rail-step strong {
    font-size: 0.88rem;
  }

  .liuyao-replay-rail-step small,
  .liuyao-replay-rail-step em {
    font-size: 0.72rem;
  }

  .liuyao-replay-block-head strong {
    font-size: 0.9rem;
  }

  .liuyao-replay-block-head span {
    font-size: 0.78rem;
  }

  .liuyao-replay-stage {
    gap: 12px;
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
    align-items: start;
  }

  .liuyao-replay-row {
    grid-template-columns: 96px minmax(0, 1fr) 116px;
    gap: 14px;
    padding: 12px 14px;
  }

  .liuyao-replay-head strong {
    font-size: 1.08rem;
  }

  .liuyao-replay-head span,
  .liuyao-replay-progress-meta,
  .liuyao-replay-note,
  .liuyao-replay-pending {
    font-size: 0.82rem;
  }

  .liuyao-replay-trigger {
    padding: 18px 18px 16px;
    gap: 12px;
  }

  .liuyao-replay-trigger strong {
    font-size: 1rem;
  }

  .liuyao-replay-stage-caption {
    font-size: 0.8rem;
  }

  .liuyao-coin {
    width: 52px;
    height: 52px;
  }

  .liuyao-coin-row {
    gap: 12px;
  }

  .liuyao-replay-result strong {
    font-size: 0.98rem;
  }

  .liuyao-replay-current .liuyao-replay-row {
    padding: 14px 16px;
    border-radius: 18px;
  }

  .liuyao-replay-current {
    position: sticky;
    top: 10px;
  }

  .liuyao-replay-locked-list-wrap {
    align-self: start;
  }

  .liuyao-replay-locked-list {
    grid-template-columns: 1fr;
    gap: 9px;
  }
}

.liuyao-replay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.liuyao-replay-head strong {
  font-size: 1rem;
  color: var(--ink-strong, #3f2a18);
}

.liuyao-replay-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.liuyao-replay-stage {
  display: grid;
  gap: 8px;
}

.liuyao-replay-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.liuyao-replay-rail-step {
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  padding: 8px 8px 9px;
  border-radius: 12px;
  border: 1px solid rgba(91, 61, 31, 0.08);
  background: rgba(255, 255, 255, 0.68);
}

.liuyao-replay-rail-step strong {
  font-size: 0.8rem;
  color: var(--ink-strong, #3f2a18);
}

.liuyao-replay-rail-step small,
.liuyao-replay-rail-step em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--muted);
}

.liuyao-replay-rail-step.locked {
  border-color: rgba(208, 138, 54, 0.24);
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.94), rgba(255, 243, 224, 0.88));
}

.liuyao-replay-rail-step.current {
  border-color: rgba(208, 138, 54, 0.48);
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(255, 243, 225, 0.94));
  box-shadow: 0 10px 20px rgba(208, 138, 54, 0.1);
}

.liuyao-replay-current,
.liuyao-replay-locked-list {
  display: grid;
  gap: 8px;
}

.liuyao-replay-locked-list-wrap {
  display: grid;
  gap: 8px;
}

.liuyao-replay-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.liuyao-replay-block-head strong {
  font-size: 0.84rem;
  color: var(--ink-strong, #3f2a18);
}

.liuyao-replay-block-head span {
  font-size: 0.74rem;
  color: var(--muted);
}

.liuyao-replay-block-head.current strong {
  color: var(--earth, #8f5a22);
}

.liuyao-replay-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.liuyao-replay-progress-meta strong {
  color: var(--ink-strong, #3f2a18);
  font-size: 0.84rem;
}

.liuyao-replay-progress {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(208, 138, 54, 0.12);
}

.liuyao-replay-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(216, 142, 36, 0.92), rgba(184, 92, 24, 0.92));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.22) inset;
  transition: width 220ms ease;
}

.hexagram-traditional-shell.hidden-during-replay {
  display: none;
}

.liuyao-replay-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(91, 61, 31, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.liuyao-replay-row.is-current {
  border-color: rgba(208, 138, 54, 0.48);
  box-shadow: 0 10px 24px rgba(208, 138, 54, 0.12);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(255, 244, 226, 0.92));
}

.liuyao-replay-row.interactive {
  border-width: 1.5px;
}

.liuyao-replay-row.locked-row {
  background: rgba(255, 252, 248, 0.88);
}

.liuyao-replay-row.locked-row.is-latest {
  border-color: rgba(208, 138, 54, 0.36);
  box-shadow: 0 10px 22px rgba(208, 138, 54, 0.1);
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(255, 246, 232, 0.9));
}

.liuyao-replay-step {
  display: grid;
  gap: 3px;
}

.liuyao-replay-step strong {
  font-size: 0.84rem;
}

.liuyao-replay-step small {
  color: var(--muted);
  font-size: 0.72rem;
}

.liuyao-replay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(208, 138, 54, 0.12);
  color: var(--earth, #8f5a22);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.liuyao-coin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.liuyao-coin-row.is-animating {
  position: relative;
}

.liuyao-coin-row.is-animating::after {
  content: "";
  position: absolute;
  inset: auto 8% -8px 8%;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(141, 92, 35, 0.18), rgba(141, 92, 35, 0));
  filter: blur(4px);
  pointer-events: none;
}

.liuyao-replay-trigger {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(208, 138, 54, 0.32);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255, 246, 232, 0.96));
  color: inherit;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
}

.liuyao-replay-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(208, 138, 54, 0.12);
}

.liuyao-replay-trigger:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(208, 138, 54, 0.18);
}

.liuyao-replay-trigger strong {
  font-size: 0.96rem;
  color: var(--ink-strong, #3f2a18);
}

.liuyao-replay-trigger small {
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.liuyao-coin-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.liuyao-replay-stage-caption {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.liuyao-coin {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-block;
  transform-style: preserve-3d;
  perspective: 600px;
}

.liuyao-coin-face {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(91, 61, 31, 0.2);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: rgba(255, 245, 226, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.84),
    inset 0 -2px 6px rgba(139, 89, 34, 0.12),
    0 8px 16px rgba(77, 49, 22, 0.08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.liuyao-coin-face.yang {
  background-image: url("/assets/liuyao/coin-yang.png");
}

.liuyao-coin-face.yin {
  background-image: url("/assets/liuyao/coin-yin.png");
  transform: rotateY(180deg);
}

.liuyao-coin.locked .liuyao-coin-face {
  display: none;
}

.liuyao-coin.locked.yang .liuyao-coin-face.yang,
.liuyao-coin.locked.yin .liuyao-coin-face.yin {
  display: block;
  transform: none;
}

.liuyao-coin.live {
  animation: liuyao-coin-flip 0.82s linear infinite;
  animation-delay: var(--coin-delay, 0s);
  filter: drop-shadow(0 10px 18px rgba(98, 62, 28, 0.16));
}

.liuyao-coin.live .liuyao-coin-face.yang {
  animation: liuyao-coin-front 0.82s steps(1, end) infinite;
  animation-delay: var(--coin-delay, 0s);
}

.liuyao-coin.live .liuyao-coin-face.yin {
  animation: liuyao-coin-back 0.82s steps(1, end) infinite;
  animation-delay: var(--coin-delay, 0s);
}

.liuyao-replay-result {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.liuyao-replay-result strong {
  font-size: 0.92rem;
  color: var(--ink-strong, #3f2a18);
}

.liuyao-replay-row.locked-row.is-latest .liuyao-replay-result strong {
  color: var(--earth, #8f5a22);
}

.liuyao-replay-result small,
.liuyao-replay-note,
.liuyao-replay-pending {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.liuyao-replay-pending {
  padding: 2px 4px 0;
}

.liuyao-replay-pending.done {
  color: var(--earth, #8f5a22);
}

.liuyao-replay-note {
  padding-top: 2px;
}

@keyframes liuyao-coin-flip {
  0% {
    transform: rotateY(0deg) rotateZ(0deg) scale(1);
  }
  48% {
    transform: rotateY(180deg) rotateZ(3deg) scale(1.06);
  }
  52% {
    transform: rotateY(180deg) rotateZ(-2deg) scale(0.92);
  }
  100% {
    transform: rotateY(360deg) rotateZ(0deg) scale(1);
  }
}

@keyframes liuyao-coin-front {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

@keyframes liuyao-coin-back {
  0%, 49% {
    opacity: 0;
  }
  50%, 100% {
    opacity: 1;
  }
}

.hexagram-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hexagram-insight-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 251, 245, 0.82);
}

.hexagram-insight-card strong {
  font-size: 0.92rem;
}

.hexagram-insight-card span {
  font-weight: 600;
  line-height: 1.6;
}

.hexagram-insight-card small {
  color: var(--muted);
  line-height: 1.55;
}

.hexagram-reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.reading-summary-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.07), rgba(255, 251, 245, 0.92));
}

.reading-summary-block strong {
  font-size: 0.96rem;
}

.reading-summary-block p,
.reading-focus-item p,
.reading-text-block p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted-strong, #493525);
}

.reading-focus-list {
  display: grid;
  gap: 10px;
}

.reading-focus-item,
.reading-text-block {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 251, 245, 0.84);
}

.reading-focus-item small,
.reading-text-block small {
  color: var(--muted);
  line-height: 1.5;
}

.hexagram-overview-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.liuyao-basic-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.liuyao-basic-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.liuyao-basic-board {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 10px 12px;
  border: 1px solid rgba(111, 74, 39, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(250, 243, 235, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.liuyao-basic-head-row {
  display: grid;
  grid-template-columns: 136px minmax(156px, 1fr) 64px 92px minmax(156px, 1fr) 64px;
  gap: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0 2px 6px;
  min-width: 704px;
  border-bottom: 1px solid rgba(111, 74, 39, 0.12);
}

.liuyao-basic-lines {
  display: grid;
  gap: 0;
}

.liuyao-basic-row {
  display: grid;
  grid-template-columns: 136px minmax(156px, 1fr) 64px 92px minmax(156px, 1fr) 64px;
  gap: 4px;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 8px 4px;
  background: transparent;
  min-width: 704px;
  border-top: 1px solid rgba(111, 74, 39, 0.1);
}

.liuyao-basic-row.changing {
  background: linear-gradient(90deg, rgba(159, 61, 30, 0.07), rgba(255, 251, 245, 0));
}

.liuyao-basic-cell {
  min-width: 0;
}

.liuyao-basic-cell strong {
  display: block;
  line-height: 1.35;
  font-size: 0.82rem;
}

.liuyao-basic-cell small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.liuyao-basic-cell em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.3;
  font-style: normal;
}

.liuyao-basic-cell.spirit,
.liuyao-basic-cell.main-meta,
.liuyao-basic-cell.changed-meta,
.liuyao-basic-cell.flags-switch {
  display: grid;
  gap: 2px;
}

.liuyao-basic-cell.glyph {
  display: grid;
  justify-items: start;
}

.liuyao-basic-cell.flags-switch {
  align-self: stretch;
  justify-items: stretch;
}

.liuyao-basic-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.liuyao-basic-switch-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.2;
}

.liuyao-basic-switch-note strong {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1;
  color: var(--ink-strong, #3f2a18);
}

.hexagram-panel,
.hexagram-sidepanel {
  display: grid;
  gap: 10px;
}

.hexagram-panel-head,
.hexagram-mini-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 251, 245, 0.78);
}

.hexagram-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.hexagram-panel-head span,
.hexagram-mini-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hexagram-mini-card {
  display: grid;
  gap: 4px;
}

.hexagram-mini-card small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.hexagram-mini-card.emphasis {
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.07), rgba(255, 251, 245, 0.88));
}

.hexagram-lines {
  display: grid;
  gap: 10px;
}

.hexagram-board-head {
  display: grid;
  grid-template-columns: 110px minmax(140px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0 4px;
}

.hexagram-board-head.traditional {
  grid-template-columns: 108px minmax(150px, 1fr) minmax(260px, 1.1fr) minmax(260px, 1.1fr);
  align-items: end;
  overflow-x: auto;
}

.hexagram-traditional-board {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
}

.line-compare-row {
  display: grid;
  grid-template-columns: 108px minmax(150px, 1fr) minmax(260px, 1.1fr) minmax(260px, 1.1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 251, 245, 0.88);
  min-width: 860px;
}

.line-compare-row.changing {
  border-color: rgba(159, 61, 30, 0.32);
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.08), rgba(255, 251, 245, 0.92));
}

.line-slot {
  min-width: 0;
}

.line-slot.position strong,
.line-slot.meta strong {
  display: block;
}

.line-slot.position span,
.line-slot.meta span,
.line-slot.visual small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.line-slot.position {
  display: grid;
  gap: 6px;
}

.line-slot.meta.spirit strong {
  color: var(--accent);
}

.line-slot.meta.spirit span {
  line-height: 1.65;
}

.line-slot.visual {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.line-slot.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.line-inline-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.line-group {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "visual meta"
    "reading reading";
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid rgba(111, 74, 39, 0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  min-width: 0;
}

.line-group.transformed {
  background: rgba(255, 249, 242, 0.9);
}

.line-group-head {
  grid-area: head;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.line-group-head span {
  font-weight: 700;
  color: var(--text);
}

.line-group-head small {
  color: var(--muted);
}

.line-visual-card {
  grid-area: visual;
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: start;
}

.line-group-meta {
  grid-area: meta;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.line-group-meta strong {
  display: block;
}

.line-group-meta span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.line-group-reading {
  grid-area: reading;
  color: var(--text);
  line-height: 1.66;
  font-size: 0.82rem;
  padding-top: 2px;
  border-top: 1px dashed rgba(111, 74, 39, 0.14);
}

@media (max-width: 1540px) {
  .hexagram-reading-grid {
    grid-template-columns: 1fr;
  }
}

.hexagram-mobile-list {
  display: none;
  gap: 10px;
}

.mobile-line-card {
  gap: 8px;
}

.mobile-line-main,
.mobile-line-glyphs {
  display: grid;
  gap: 8px;
}

.mobile-line-main span,
.mobile-line-glyphs span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.line-card {
  display: grid;
  grid-template-columns: 110px minmax(140px, auto) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 251, 245, 0.86);
}

.line-card.changing {
  border-color: rgba(159, 61, 30, 0.32);
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.08), rgba(255, 251, 245, 0.92));
}

.line-card-index strong {
  display: block;
}

.line-card-index span {
  color: var(--muted);
  font-size: 0.82rem;
}

.line-card-side strong {
  display: block;
}

.line-card-side span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.line-visual-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.line-visual,
.line-transform {
  display: flex;
  align-items: center;
  gap: 6px;
}

.line-transform {
  color: var(--muted);
  font-size: 0.8rem;
}

.yao {
  display: inline-block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8f3619, #d08a36);
}

.yao.yang.wide {
  width: 54px;
}

.yao.yin {
  width: 24px;
}

.line-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.layout-shell.panel-collapsed .control-panel {
  padding: 14px 8px;
  min-height: 520px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.layout-shell.panel-collapsed .panel-copy,
.layout-shell.panel-collapsed .panel-heading,
.layout-shell.panel-collapsed .panel-mark-copy,
.layout-shell.panel-collapsed .field small,
.layout-shell.panel-collapsed .advanced,
.layout-shell.panel-collapsed .submit-row .status,
.layout-shell.panel-collapsed .control-section,
.layout-shell.panel-collapsed .input-preview,
.layout-shell.panel-collapsed .field-label,
.layout-shell.panel-collapsed .field,
.layout-shell.panel-collapsed #dynamic-fields,
.layout-shell.panel-collapsed #advanced-fields {
  display: none;
}

.layout-shell.panel-collapsed .control-panel h2 {
  display: none;
}

.layout-shell.panel-collapsed .panel-title {
  justify-content: center;
  min-height: 48px;
}

.layout-shell.panel-collapsed .panel-mark {
  justify-content: center;
  margin: 0;
}

.layout-shell.panel-collapsed .panel-mark-glyph {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.layout-shell.panel-collapsed .panel-toggle {
  margin: 0 auto;
}

.layout-shell.panel-collapsed .panel-toggle[aria-label]::after {
  content: none !important;
}

.layout-shell.panel-collapsed .panel-mark-copy {
  display: none;
}

.layout-shell.panel-collapsed .mode-grid {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.layout-shell.panel-collapsed .mode-chip {
  justify-items: center;
  text-align: center;
  padding: 12px 6px;
  min-height: 58px;
  border-radius: 18px;
}

.layout-shell.panel-collapsed .mode-chip-full {
  display: none;
}

.layout-shell.panel-collapsed .mode-chip-short {
  display: inline;
}

.layout-shell.panel-collapsed .submit-btn {
  display: none;
}

.layout-shell.panel-collapsed .panel-toggle {
  width: 48px;
}

.layout-shell.panel-collapsed .result-panel {
  min-height: 70vh;
}

body[data-can-use-ai="false"] .result-tools .primary,
body[data-can-use-ai="false"] .tab-row [data-tab="report"] {
  display: none;
}

.ziwei-mobile-palace summary {
  list-style: none;
}

.ziwei-mobile-palace summary::-webkit-details-marker {
  display: none;
}

.mobile-line-card summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.auth-link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-page-shell {
  max-width: 920px;
}

.auth-layout {
  margin-top: 20px;
}

.auth-hero .hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.auth-form {
  gap: 14px;
}

.auth-card {
  padding: 22px;
}

.auth-invite-preview.ok {
  border-color: rgba(45, 106, 82, 0.22);
  background: rgba(45, 106, 82, 0.08);
}

.auth-invite-preview.warn {
  border-color: rgba(159, 61, 30, 0.22);
  background: rgba(159, 61, 30, 0.08);
}

.auth-alt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.password-strength {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(111, 74, 39, 0.12);
  overflow: hidden;
}

.password-strength-bar {
  display: block;
  height: 100%;
  width: 34%;
  border-radius: inherit;
  transition: width 180ms ease, background 180ms ease;
}

.password-strength-bar.weak {
  width: 28%;
  background: linear-gradient(90deg, #bc4b3a, #d36a4d);
}

.password-strength-bar.medium {
  width: 62%;
  background: linear-gradient(90deg, #d59b32, #e0b45e);
}

.password-strength-bar.strong {
  width: 100%;
  background: linear-gradient(90deg, #2d6a52, #4f8f74);
}

.profile-security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.profile-security .panel {
  border: 1px solid rgba(111, 74, 39, 0.16);
  background: rgba(255, 250, 243, 0.72);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.collapse-shell {
  border: 1px solid rgba(111, 74, 39, 0.16);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.56);
  padding: 10px 12px;
}

.collapse-shell summary {
  cursor: pointer;
  font-weight: 700;
}

.collapse-body {
  margin-top: 12px;
}

.ziwei-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(150px, auto));
  gap: 10px;
}

.ziwei-focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ziwei-focus-card {
  display: grid;
  gap: 6px;
  padding: 14px 15px;
  border: 1px solid rgba(111, 74, 39, 0.12);
  border-radius: 18px;
  background: rgba(255, 251, 245, 0.84);
  min-width: 0;
}

.ziwei-focus-card.accent {
  background: linear-gradient(135deg, rgba(159, 61, 30, 0.1), rgba(255, 251, 245, 0.92));
}

.ziwei-focus-card.water {
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.1), rgba(255, 251, 245, 0.92));
}

.ziwei-focus-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.ziwei-focus-card strong {
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--text);
  font-family: "Source Han Serif SC", "Songti SC", serif;
}

.ziwei-focus-card small {
  color: var(--muted);
  line-height: 1.55;
}

.ziwei-desktop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ziwei-chart-shell {
  position: relative;
  border: 1px solid rgba(111, 74, 39, 0.12);
  border-radius: 22px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(255, 249, 240, 0.9));
}

.ziwei-palace,
.ziwei-center {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 251, 245, 0.88);
  position: relative;
  z-index: 1;
}

.ziwei-palace {
  display: grid;
  gap: 7px;
  grid-row: var(--ziwei-row, auto);
  grid-column: var(--ziwei-col, auto);
  min-width: 0;
  overflow: hidden;
  align-content: start;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.ziwei-palace:hover,
.ziwei-side-item:hover {
  transform: translateY(-1px);
}

.ziwei-palace:focus-visible,
.ziwei-mobile-palace:focus-visible,
.ziwei-side-item:focus-visible {
  outline: 2px solid rgba(159, 61, 30, 0.28);
  outline-offset: 2px;
}

.ziwei-palace.soul {
  border-color: rgba(159, 61, 30, 0.42);
  box-shadow: inset 0 0 0 1px rgba(159, 61, 30, 0.18);
}

.ziwei-palace.body {
  background: linear-gradient(135deg, rgba(45, 95, 130, 0.08), rgba(255, 251, 245, 0.9));
}

.ziwei-palace.origin {
  background: linear-gradient(135deg, rgba(45, 106, 82, 0.07), rgba(255, 251, 245, 0.9));
}

.ziwei-palace.is-selected,
.ziwei-mobile-palace.is-selected {
  border-color: rgba(159, 61, 30, 0.5);
  box-shadow: inset 0 0 0 1px rgba(159, 61, 30, 0.2), 0 0 0 2px rgba(159, 61, 30, 0.08);
  background: linear-gradient(180deg, rgba(255, 247, 238, 0.96), rgba(255, 251, 245, 0.92));
}

.ziwei-palace.is-related,
.ziwei-mobile-palace.is-related {
  border-color: rgba(208, 138, 54, 0.36);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.94), rgba(255, 251, 245, 0.9));
}

.ziwei-palace-head {
  display: grid;
  gap: 8px;
  align-items: start;
}

.ziwei-palace-title {
  display: grid;
  gap: 3px;
}

.ziwei-palace-head strong {
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: 1.04rem;
  line-height: 1.14;
}

.ziwei-palace-head span,
.ziwei-center small {
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.ziwei-foot {
  display: grid;
  gap: 2px;
  color: var(--muted);
}

.ziwei-foot strong {
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.32;
  font-weight: 650;
}

.ziwei-foot small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.28;
}

.ziwei-stars,
.ziwei-labels,
.ziwei-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ziwei-stars {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 5px 12px;
}

.ziwei-labels-vertical {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, minmax(0, auto));
  justify-content: start;
  align-content: start;
  gap: 4px 6px;
}

.ziwei-meta-row.compact {
  gap: 4px;
}

.ziwei-stars span,
.ziwei-labels span {
  display: inline-block;
  padding: 0;
  background: none;
  font-size: 0.82rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.ziwei-labels-vertical span {
  padding: 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  letter-spacing: 0.02em;
}

.ziwei-stars.major span {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.04em;
}

.ziwei-stars.minor span {
  color: var(--water);
  font-size: 0.86rem;
}

.ziwei-stars.adjective span {
  color: var(--good);
  font-size: 0.8rem;
}

.ziwei-center {
  grid-row: 2 / span 2;
  grid-column: 2 / span 2;
  display: grid;
  align-content: center;
  gap: 7px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(208, 138, 54, 0.16), rgba(255, 251, 245, 0.92) 58%),
    rgba(255, 251, 245, 0.92);
}

.ziwei-meta-row.center {
  justify-content: center;
}

.ziwei-center h4 {
  margin: 0;
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: 1.4rem;
}

.ziwei-center p,
.ziwei-center small {
  margin: 0;
}

.ziwei-center-meta {
  display: grid;
  gap: 4px;
}

.ziwei-center-meta span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.32;
}

.ziwei-center-eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.ziwei-sidepanel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(111, 74, 39, 0.12);
  border-radius: 22px;
  padding: 15px;
  background: rgba(255, 251, 245, 0.88);
  min-width: 0;
}

.ziwei-sidepanel-lower {
  max-width: min(100%, 1120px);
}

.ziwei-sidepanel-head {
  display: grid;
  gap: 4px;
}

.ziwei-sidepanel-head strong {
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: 1.04rem;
}

.ziwei-sidepanel-head span {
  color: var(--muted);
  line-height: 1.55;
}

.ziwei-side-list {
  display: grid;
  gap: 8px;
}

.ziwei-side-item {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-radius: 15px;
  border: 1px solid rgba(111, 74, 39, 0.1);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.ziwei-side-item strong {
  line-height: 1.32;
  font-size: 0.94rem;
}

.ziwei-side-item span,
.ziwei-side-item small {
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.ziwei-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ziwei-shell {
  display: grid;
  gap: 14px;
}

.ziwei-mobile-chart {
  display: none;
}

.fengshui-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(156px, auto));
  gap: 10px;
  align-items: stretch;
}

.fengshui-layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.fengshui-grid-shell {
  border: 1px solid rgba(111, 74, 39, 0.12);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(255, 249, 240, 0.9));
}

.fengshui-cell {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 251, 245, 0.82);
  grid-row: var(--fengshui-row, auto);
  grid-column: var(--fengshui-col, auto);
  min-width: 0;
  overflow: hidden;
  align-content: start;
}

.fengshui-cell span,
.fengshui-cell small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.fengshui-cell small,
.fengshui-cell p,
.fengshui-cell strong,
.fengshui-cell b {
  min-width: 0;
}

.fengshui-cell p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  font-size: 0.81rem;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fengshui-cell-meta {
  font-size: 0.76rem;
}

.fengshui-cell-head,
.fengshui-cell-star {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.fengshui-cell-head strong,
.fengshui-cell-star b {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fengshui-cell-star small {
  flex: 0 0 auto;
  text-align: right;
}

.fengshui-sidepanel {
  display: grid;
  gap: 12px;
}

.fengshui-side-head {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(111, 74, 39, 0.12);
  background: rgba(255, 251, 245, 0.86);
}

.fengshui-side-head strong {
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: 1.02rem;
}

.fengshui-side-head span {
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  padding: 24px 20px;
  display: grid;
  gap: 8px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.quote {
  border-left: 4px solid rgba(208, 138, 54, 0.68);
  background: rgba(208, 138, 54, 0.11);
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  color: #544230;
}

.report-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ai-report-summary {
  gap: 12px;
}

.markdown-render {
  display: grid;
  gap: 10px;
  color: var(--ink);
}

.markdown-render h1,
.markdown-render h2,
.markdown-render h3,
.markdown-render h4,
.markdown-render h5,
.markdown-render h6 {
  margin: 0;
  font-family: "Source Han Serif SC", "Songti SC", serif;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.markdown-render h1 {
  font-size: 1.42rem;
  font-weight: 800;
}

.markdown-render h2 {
  font-size: 1.26rem;
  font-weight: 780;
}

.markdown-render h3 {
  font-size: 1.12rem;
  font-weight: 760;
}

.markdown-render h4,
.markdown-render h5,
.markdown-render h6 {
  font-size: 1rem;
  font-weight: 740;
}

.markdown-render p {
  margin: 0;
  color: var(--ink);
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.ai-report-reading {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(91, 61, 31, 0.12);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(249, 241, 229, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 26px rgba(111,74,39,.06);
  overflow: hidden;
}

.ai-mode-disabled-shell {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.ai-mode-disabled-preview {
  display: grid;
  gap: 14px;
  filter: grayscale(0.2) blur(4px);
  opacity: 0.7;
  pointer-events: none;
}

.ai-mode-disabled-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(180deg, rgba(235, 229, 222, 0.2), rgba(235, 229, 222, 0.42));
}

.ai-mode-disabled-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  min-width: min(320px, 100%);
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(91, 61, 31, 0.14);
  background: rgba(255, 251, 245, 0.95);
  box-shadow: 0 18px 40px rgba(58, 37, 18, 0.12);
}

.ai-mode-disabled-card strong {
  font-size: 1rem;
  color: var(--accent);
}

.ai-mode-disabled-card small {
  font-size: 0.9rem;
  color: var(--muted);
}

.ai-report-reading-disabled {
  min-height: 240px;
}

.ai-report-body {
  gap: 22px;
  min-width: 0;
  font-size: 1.08rem;
  line-height: 1.84;
}

.ai-report-body blockquote {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid rgba(159, 61, 30, 0.28);
  border-radius: 0 16px 16px 0;
  background: rgba(159, 61, 30, 0.07);
  color: var(--muted);
}

.ai-report-body h1,
.ai-report-body h2,
.ai-report-body h3 {
  color: var(--accent);
}

.ai-report-body h1 {
  font-size: 1.56rem;
  font-weight: 820;
}

.ai-report-body h2 {
  font-size: 1.32rem;
  font-weight: 790;
}

.ai-report-body h3 {
  font-size: 1.14rem;
  font-weight: 760;
}

.ai-report-body p {
  font-size: 1.05rem;
}

.markdown-render ul {
  margin: 0;
  padding-left: 1.34em;
  display: grid;
  gap: 10px;
}

.markdown-render li {
  color: var(--ink);
  line-height: 1.72;
}

.markdown-render strong {
  font-weight: 760;
}

.code-block,
.raw-output pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  padding: 12px 14px;
  background: #2a231c;
  color: #f3e8d7;
  font-family: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
}

.raw-output {
  margin-top: 14px;
  padding: 12px;
}

.raw-output summary { cursor: pointer; font-weight: 700; }
.raw-output pre { margin-top: 10px; }

code {
  font-family: "JetBrains Mono", "Sarasa Mono SC", "SFMono-Regular", monospace;
  font-size: 0.92em;
  background: rgba(111, 74, 39, 0.08);
  border-radius: 7px;
  padding: 0.15em 0.4em;
}

@media (max-width: 1120px) {
  .page {
    max-width: 1160px;
    padding: 18px 14px 28px;
  }
  .hero {
    padding: 20px;
    gap: 18px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .profile-layout {
    gap: 18px;
  }
  .profile-overview-grid,
  .profile-secondary-grid {
    grid-template-columns: 1fr;
  }
  .profile-main-grid {
    grid-template-columns: 1fr;
  }
  .profile-overview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-focus-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-focus-actions > * {
    min-width: 0;
  }
  .toolbar-row input,
  .toolbar-row select {
    min-width: min(100%, 220px);
  }
  .profile-quick-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-side {
    position: static;
  }
  .ziwei-focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ziwei-desktop-layout,
  .fengshui-layout-shell {
    grid-template-columns: 1fr;
  }
  .control-panel { position: static; }
  .hero-auth-shell {
    max-width: none;
  }
  .agent-mode-grid,
  .agent-benefit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agent-flow-grid,
  .agent-apply-grid {
    grid-template-columns: 1fr;
  }
  .layout-shell.panel-collapsed .layout {
    grid-template-columns: 1fr;
  }
  .metric-grid,
  .analysis-grid.triplet,
  .report-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .page { padding: 12px 10px 24px; }
  .hero, .panel, .control-panel, .result-panel { border-radius: 18px; padding: 15px; }
  .profile-main,
  .profile-side,
  .profile-redeem,
  .profile-billing,
  .profile-ledger,
  .profile-history,
  .profile-security {
    padding: 16px;
  }
  .profile-overview-grid,
  .profile-secondary-grid,
  .profile-finance-stack,
  .profile-security-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .profile-summary-block {
    padding: 14px;
    border-radius: 16px;
  }
  .profile-main .result-top {
    gap: 10px;
  }
  .profile-quick-summary {
    grid-template-columns: 1fr;
  }
  .profile-overview-strip {
    grid-template-columns: 1fr;
  }
  .profile-focus-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .agent-hero-panel {
    width: 100%;
  }
  .agent-mode-grid,
  .agent-benefit-grid,
  .agent-flow-grid {
    grid-template-columns: 1fr;
  }
  .agent-dashboard-shell,
  .agent-dashboard-grid,
  .agent-dashboard-secondary,
  .agent-dashboard-action-band {
    grid-template-columns: 1fr;
  }
  .agent-section {
    padding: 16px;
  }
  .agent-hero-actions,
  .hero-landing-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero::after {
    width: 120px;
    height: 120px;
    top: 14px;
    right: 14px;
  }
  .hero-auth-shell {
    width: 100%;
    justify-items: stretch;
    min-width: 0;
    max-width: none;
    gap: 8px;
  }
  .hero-auth-toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 46px;
    border-radius: 16px;
    padding-inline: 14px;
  }
  .hero-auth-panel {
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    gap: 10px;
  }
  .hero-auth-status {
    font-size: 0.92rem;
  }
  .hero-auth-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }
  .control-panel > .mode-grid {
    display: flex;
    margin-top: 10px;
    padding-bottom: 6px;
    min-width: 0;
  }
  .mode-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    margin-inline: -2px;
    padding-inline: 2px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    min-width: 0;
    width: 100%;
  }
  .mode-grid::-webkit-scrollbar,
  .tab-row::-webkit-scrollbar,
  .profile-section-nav::-webkit-scrollbar,
  .hero-quick-facts::-webkit-scrollbar,
  .workspace-strip::-webkit-scrollbar,
  .history-summary-strip::-webkit-scrollbar {
    display: none;
  }
  .mode-chip {
    flex: 0 0 clamp(132px, 38vw, 186px);
    min-width: 132px;
    scroll-snap-align: start;
  }
  .mobile-mode-grid .mode-chip {
    justify-items: start;
    align-content: start;
    min-height: 62px;
    padding: 10px 10px 9px;
  }
  .mobile-mode-grid .mode-chip-full {
    display: inline;
    font-size: 1.02rem;
    line-height: 1.18;
  }
  .mobile-mode-grid .mode-chip-short {
    display: inline;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.18;
  }
  .mobile-mode-grid::after {
    content: "";
    position: absolute;
    right: -2px;
    top: 14px;
    bottom: 8px;
    width: 24px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(245, 235, 220, 0), rgba(245, 235, 220, 0.98));
    pointer-events: none;
  }
  .tab-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    margin-inline: -2px;
    padding-inline: 2px;
    scroll-snap-type: x proximity;
  }
  .tab-chip {
    flex: 0 0 min(42vw, 180px);
    scroll-snap-align: start;
    text-align: center;
  }
  .hero-copy {
    max-width: none;
  }
  .hero-quick-facts {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-inline: -2px;
    padding-inline: 2px;
  }
  .hero-quick-facts > * {
    flex: 0 0 max-content;
  }
  .field-row,
  .analysis-grid,
  .metric-grid,
  .pillar-grid,
  .analysis-grid.triplet,
  .report-status-grid {
    grid-template-columns: 1fr;
  }
  .panel-title,
  .section-head,
  .result-top,
  .result-tools,
  .workspace-header {
    flex-direction: column;
    align-items: start;
  }
  .history-meta {
    flex-direction: column;
    align-items: start;
  }
  .result-top-copy {
    max-width: none;
  }
  .result-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
    justify-content: stretch;
  }
  .result-tools > * {
    min-width: 0;
  }
  .result-tools .badge-pill {
    justify-self: end;
    align-self: center;
  }
  .mobile-mode-head {
    align-items: start;
  }
  .workspace-actions {
    width: 100%;
    justify-content: stretch;
  }
  .workspace-actions > * {
    flex: 1 1 160px;
  }
  .profile-history-actions,
  .profile-page .inline-actions {
    width: 100%;
  }
  .history-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: stretch;
    flex-wrap: nowrap;
  }
  .history-toolbar .ghost-select {
    width: 100%;
    min-width: 0;
  }
  .history-toolbar .ghost-btn {
    min-height: 42px;
  }
  .profile-main-grid {
    grid-template-columns: 1fr;
  }
  .profile-history-actions > *,
  .profile-page .inline-actions > * {
    flex: 1 1 140px;
  }
  .profile-page .row-card .inline-actions {
    justify-content: stretch;
  }
  .hexagram-showcase,
  .line-card,
  .hexagram-board-head,
  .fengshui-grid {
    grid-template-columns: 1fr;
  }
  .hexagram-overview-row,
  .hexagram-insight-grid,
  .hexagram-traditional-board {
    display: block;
  }
  .liuyao-basic-head {
    grid-template-columns: 1fr;
  }
  .liuyao-basic-board {
    display: grid;
    gap: 4px;
    overflow-x: hidden;
    padding: 8px 7px 10px 6px;
    border-radius: 14px;
  }
  .liuyao-basic-head-row {
    grid-template-columns: 76px minmax(0, 1fr) 40px 50px minmax(0, 1fr) 40px;
    min-width: 0;
    gap: 2px;
    font-size: 0.54rem;
    line-height: 1.16;
    padding: 0 1px 5px 0;
  }
  .liuyao-basic-row {
    grid-template-columns: 76px minmax(0, 1fr) 40px 50px minmax(0, 1fr) 40px;
    min-width: 0;
    gap: 2px;
    padding: 6px 1px 6px 0;
    border-radius: 0;
    background: transparent;
  }
  .liuyao-basic-lines {
    gap: 0;
  }
  .liuyao-basic-cell strong {
    font-size: 0.64rem;
    line-height: 1.18;
  }
  .liuyao-basic-cell small {
    font-size: 0.52rem;
    line-height: 1.16;
  }
  .liuyao-basic-cell em {
    font-size: 0.5rem;
    line-height: 1.12;
  }
  .liuyao-basic-cell.spirit,
  .liuyao-basic-cell.main-meta,
  .liuyao-basic-cell.changed-meta,
  .liuyao-basic-cell.flags-switch {
    gap: 1px;
  }
  .liuyao-basic-cell.spirit strong,
  .liuyao-basic-cell.main-meta strong,
  .liuyao-basic-cell.changed-meta strong {
    letter-spacing: -0.01em;
  }
  .liuyao-basic-cell.glyph {
    justify-items: start;
  }
  .liuyao-basic-cell .line-visual {
    transform: scale(0.72);
    transform-origin: left center;
  }
  .liuyao-basic-flag-row {
    gap: 1px;
    justify-content: center;
  }
  .liuyao-basic-cell.flags-switch {
    align-self: center;
  }
  .liuyao-basic-cell.flags-switch .tag {
    padding: 2px 4px;
    min-height: 16px;
    border-radius: 999px;
    font-size: 0.48rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
  }
  .liuyao-basic-switch-note {
    gap: 4px;
    justify-content: center;
    font-size: 0.46rem;
  }
  .liuyao-basic-switch-note strong {
    font-size: 0.56rem;
  }
  .liuyao-replay-head,
  .liuyao-replay-row {
    grid-template-columns: 1fr;
  }
  .liuyao-replay-shell {
    padding: 12px 12px 14px;
    border-radius: 16px;
    gap: 10px;
  }
  .liuyao-replay-head strong {
    font-size: 0.96rem;
  }
  .liuyao-replay-head span {
    font-size: 0.76rem;
  }
  .liuyao-replay-block-head {
    display: grid;
    gap: 3px;
    justify-items: start;
  }
  .liuyao-replay-block-head strong {
    font-size: 0.78rem;
  }
  .liuyao-replay-block-head span {
    font-size: 0.68rem;
  }
  .liuyao-replay-progress-meta {
    display: grid;
    gap: 4px;
    justify-items: start;
  }
  .liuyao-replay-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .liuyao-replay-rail-step {
    padding: 7px 6px 8px;
    border-radius: 10px;
  }
  .liuyao-replay-rail-step strong {
    font-size: 0.74rem;
  }
  .liuyao-replay-rail-step small,
  .liuyao-replay-rail-step em {
    font-size: 0.64rem;
  }
  .liuyao-replay-row {
    gap: 10px;
    padding: 10px;
  }
  .liuyao-replay-current,
  .liuyao-replay-locked-list {
    gap: 8px;
  }
  .liuyao-replay-locked-list-wrap {
    gap: 7px;
  }
  .liuyao-replay-stage {
    grid-template-columns: 1fr;
  }
  .liuyao-replay-trigger {
    padding: 12px 12px 13px;
    gap: 9px;
  }
  .liuyao-replay-trigger strong {
    font-size: 0.92rem;
  }
  .liuyao-replay-trigger small,
  .liuyao-replay-stage-caption,
  .liuyao-replay-note,
  .liuyao-replay-pending {
    font-size: 0.74rem;
  }
  .liuyao-coin-row {
    justify-content: center;
    gap: 8px;
  }
  .liuyao-coin {
    width: 42px;
    height: 42px;
  }
  .liuyao-replay-head {
    align-items: start;
  }
  .liuyao-replay-result {
    justify-items: start;
    text-align: left;
  }
  .liuyao-replay-badge {
    font-size: 0.64rem;
    padding: 2px 7px;
  }
  .liuyao-replay-result strong {
    font-size: 0.88rem;
  }
  .hexagram-insight-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hexagram-board-head.traditional {
    display: none;
  }
  .hexagram-lines.traditional {
    display: grid;
    gap: 10px;
  }
  .line-compare-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(111,74,39,.12);
    background: rgba(255,255,255,.74);
  }
  .line-group {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .hexagram-mobile-list {
    display: none;
  }
  .hexagram-reading-grid {
    grid-template-columns: 1fr;
  }
  .line-flags {
    justify-content: start;
  }
  .ziwei-chart {
    display: none;
  }
  .ziwei-focus-grid {
    grid-template-columns: 1fr;
  }
  .ziwei-mobile-chart {
    display: grid;
    gap: 10px;
  }
.ziwei-mobile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, 174px);
  gap: 6px;
}
.ziwei-mobile-core {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 16px;
  border: 1px dashed rgba(159, 61, 30, 0.16);
  background:
    radial-gradient(circle at center, rgba(208, 138, 54, 0.12), rgba(255, 251, 245, 0.82) 68%);
  text-align: center;
  z-index: 0;
}
.ziwei-mobile-core-eyebrow {
  color: var(--accent);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}
.ziwei-mobile-core strong {
  font-family: "Source Han Serif SC", "Songti SC", serif;
  font-size: 1.02rem;
  line-height: 1.1;
}
.ziwei-mobile-core p,
.ziwei-mobile-core small {
  margin: 0;
  color: var(--muted);
  line-height: 1.22;
  font-size: 0.68rem;
}

.ziwei-mobile-core-foot {
  opacity: 0.9;
}
.ziwei-mobile-core .ziwei-meta-row {
  justify-content: center;
}
.ziwei-mobile-palace {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  align-content: start;
  gap: 4px;
  padding: 7px 6px 23px;
  border-radius: 13px;
  border: 1px solid rgba(111,74,39,.12);
  background: rgba(255,255,255,.76);
  min-width: 0;
  min-height: 174px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}
.ziwei-mobile-palace.soul,
.ziwei-mobile-palace.body,
.ziwei-mobile-palace.origin {
  box-shadow: inset 0 0 0 1px rgba(159, 61, 30, 0.12);
}
.ziwei-mobile-head {
  display: grid;
  gap: 1px;
  align-items: start;
}
.ziwei-mobile-head strong {
  font-size: 1.08rem;
  line-height: 1.04;
}
.ziwei-mobile-head span,
.ziwei-mobile-palace small {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.18;
}
.ziwei-mobile-palace .ziwei-meta-row,
.ziwei-mobile-palace .ziwei-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: flex-start;
  min-width: 0;
}
.ziwei-mobile-palace .ziwei-meta-row > *,
.ziwei-mobile-palace .ziwei-stars span {
  width: auto;
  max-width: 100%;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.14;
  background: none;
  overflow-wrap: anywhere;
}
.ziwei-mobile-palace .ziwei-stars.major {
  gap: 4px 9px;
}
.ziwei-mobile-palace .ziwei-stars.major span {
  color: var(--accent);
  font-size: 1.06rem;
  font-weight: 700;
}
.ziwei-mobile-palace .ziwei-stars.minor span {
  color: var(--water);
  font-size: 0.86rem;
}
.ziwei-mobile-palace .ziwei-stars.adjective span {
  color: var(--good);
  font-size: 0.84rem;
  font-weight: 600;
}
.ziwei-mobile-corner {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 0.66rem;
  line-height: 1.1;
  color: var(--muted);
  letter-spacing: 0.01em;
  max-width: calc(100% - 12px);
  overflow-wrap: anywhere;
}
  .ziwei-mobile-grid .ziwei-mobile-pos-1-1 { grid-column: 1; grid-row: 1; }
  .ziwei-mobile-grid .ziwei-mobile-pos-1-2 { grid-column: 2; grid-row: 1; }
  .ziwei-mobile-grid .ziwei-mobile-pos-1-3 { grid-column: 3; grid-row: 1; }
  .ziwei-mobile-grid .ziwei-mobile-pos-1-4 { grid-column: 4; grid-row: 1; }
  .ziwei-mobile-grid .ziwei-mobile-pos-2-1 { grid-column: 1; grid-row: 2; }
  .ziwei-mobile-grid .ziwei-mobile-pos-2-4 { grid-column: 4; grid-row: 2; }
  .ziwei-mobile-grid .ziwei-mobile-pos-3-1 { grid-column: 1; grid-row: 3; }
  .ziwei-mobile-grid .ziwei-mobile-pos-3-4 { grid-column: 4; grid-row: 3; }
  .ziwei-mobile-grid .ziwei-mobile-pos-4-1 { grid-column: 1; grid-row: 4; }
  .ziwei-mobile-grid .ziwei-mobile-pos-4-2 { grid-column: 2; grid-row: 4; }
  .ziwei-mobile-grid .ziwei-mobile-pos-4-3 { grid-column: 3; grid-row: 4; }
  .ziwei-mobile-grid .ziwei-mobile-pos-4-4 { grid-column: 4; grid-row: 4; }
  .fengshui-layout-shell,
  .fengshui-grid-shell {
    gap: 10px;
    padding: 0;
    border: 0;
    background: none;
  }
  .fengshui-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .fengshui-cell {
    grid-row: auto;
    grid-column: auto;
  }
  .layout-shell {
    margin-top: 16px;
  }
  .layout {
    grid-template-columns: 1fr;
    margin-top: 0;
    gap: 14px;
  }
  .control-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(92vw, 420px);
    max-width: 100%;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y pinch-zoom;
    z-index: 5;
    transform: translateX(-104%);
    border-radius: 0 24px 24px 0;
    padding-bottom: 110px;
    box-shadow: 0 24px 64px rgba(34, 24, 15, 0.24);
  }
  .mobile-panel-title {
    position: static;
    z-index: auto;
    margin: -15px -15px 8px;
    padding: 8px 15px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.98), rgba(250, 242, 229, 0.96));
    border-bottom: 1px solid rgba(91, 61, 31, 0.08);
    backdrop-filter: none;
  }
  .mobile-panel-title + .mobile-mode-grid {
    margin-top: 10px;
  }
  .mobile-panel-title .panel-heading {
    display: grid;
    gap: 0;
    min-width: 0;
  }
  .mobile-panel-title .panel-copy,
  .mobile-panel-title .panel-mark {
    display: none;
  }
  .mobile-panel-title h2 {
    font-size: 0.94rem;
    line-height: 1.16;
  }
  .mobile-panel-actions {
    position: static;
    justify-content: flex-end;
    align-self: start;
  }
  .layout-shell.panel-open .control-panel {
    transform: translateX(0);
  }
  .layout-shell.panel-collapsed .control-panel {
    pointer-events: none;
  }
  .layout-shell.panel-open .control-panel {
    pointer-events: auto;
  }
  .layout-shell.panel-collapsed .control-panel {
    display: block;
  }
  .layout-shell.panel-collapsed .panel-copy,
  .layout-shell.panel-collapsed .field small,
  .layout-shell.panel-collapsed .advanced,
  .layout-shell.panel-collapsed .submit-row .status,
  .layout-shell.panel-collapsed .control-section,
  .layout-shell.panel-collapsed .input-preview,
  .layout-shell.panel-collapsed .field-label,
  .layout-shell.panel-collapsed .field,
  .layout-shell.panel-collapsed #dynamic-fields,
  .layout-shell.panel-collapsed #advanced-fields,
  .layout-shell.panel-collapsed .control-panel h2 {
    display: revert;
  }
  .layout-shell.panel-collapsed .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }
  .layout-shell.panel-collapsed .mode-chip-full {
    display: inline;
  }
  .layout-shell.panel-collapsed .mode-chip-short {
    display: none;
  }
  .layout-shell.panel-collapsed .submit-btn {
    display: block;
  }
  .mobile-submit-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 18px -15px -30px;
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(245, 235, 220, 0), rgba(255, 249, 241, 0.96) 26%, rgba(255, 249, 241, 0.99));
    backdrop-filter: blur(10px);
  }
  .mobile-submit-row .submit-btn {
    min-height: 52px;
    box-shadow: 0 14px 28px rgba(159, 61, 30, 0.22);
  }
  .mobile-submit-row .status {
    min-height: 1.2em;
    padding-inline: 2px;
  }
  .result-tools {
    width: 100%;
    justify-content: stretch;
  }
  .mobile-edit-panel {
    display: inline-flex;
    position: relative;
    align-self: stretch;
    min-height: 48px;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    padding: 12px 13px;
  }
  .mobile-edit-panel-main {
    font-size: 0.94rem;
  }
  .workspace-strip {
    width: 100%;
  }
  .panel-toggle {
    width: 48px;
    min-width: 48px;
    min-height: 42px;
    gap: 0;
    padding: 0;
    justify-content: center;
  }
  .panel-toggle .panel-toggle-copy {
    display: none;
  }
  .hero-auth-actions {
    justify-content: stretch;
  }
  .hero-auth-actions .ghost-btn,
  .hero-auth-actions .auth-link-btn {
    flex: 1 1 160px;
  }
  .history-item strong {
    line-height: 1.45;
  }
  .history-item {
    gap: 10px;
  }
  .badge-pill,
  .workspace-state-pill,
  .tag,
  .history-label {
    font-size: 0.78rem;
  }
}

@media (max-width: 640px) {
  .page {
    padding-top: 0;
  }
  .hero {
    margin-top: 0;
  }
  .hero h1 {
    font-size: clamp(1.72rem, 8.2vw, 2.4rem);
    line-height: 1.04;
  }
  .hero p,
  .panel-title p,
  .result-top p,
  .workspace-header-copy p,
  .card-head p,
  .helper {
    font-size: 0.86rem;
    line-height: 1.62;
  }
  .hero-quick-facts {
    gap: 6px;
  }
  .submit-btn,
  .ghost-btn,
  .tool-btn,
  .mode-chip,
  .tab-chip {
    min-height: 46px;
  }
  .tab-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .history-item {
    padding: 11px;
  }
  .meta-shell,
  .result-card .card-body,
  .result-card .card-head,
  .empty-state,
  .raw-output {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 10px 8px 24px;
  }
  .hero,
  .panel,
  .control-panel,
  .result-panel {
    border-radius: 16px;
    padding: 14px;
  }
  .hero {
    gap: 14px;
    padding: 16px 14px;
  }
  .hero-copy {
    gap: 8px;
  }
  .hero .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }
  .hero h1 {
    font-size: clamp(1.48rem, 7vw, 2.02rem);
    line-height: 1.04;
  }
  .hero p {
    font-size: 0.84rem;
    line-height: 1.58;
  }
  .mobile-panel-title {
    margin: -14px -14px 10px;
    padding: 10px 14px 10px;
    min-height: 0;
  }
  .mobile-submit-row {
    margin: 16px -14px -14px;
    padding-inline: 14px;
  }
  .result-panel {
    min-height: auto;
  }
  .result-top {
    gap: 10px;
  }
  .result-top-copy {
    max-width: none;
  }
  .hero-auth-panel {
    padding: 12px;
    border-radius: 16px;
  }
  .hero-auth-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero-auth-actions .ghost-btn,
  .hero-auth-actions .auth-link-btn {
    width: 100%;
  }
  .result-tools,
  .workspace-actions,
  .inline-actions,
  .profile-history-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    width: 100%;
  }
  .result-tools > *,
  .workspace-actions > *,
  .inline-actions > *,
  .profile-history-actions > * {
    width: 100%;
  }
  .history-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .history-toolbar .ghost-btn {
    justify-self: end;
  }
  .result-tools {
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px;
  }
  .result-meta {
    margin: 10px 0;
  }
  .result-top-copy {
    gap: 4px;
  }
  .result-top-copy h2 {
    font-size: 1.06rem;
    line-height: 1.2;
  }
  .result-top-copy p {
    font-size: 0.8rem;
    line-height: 1.45;
  }
  .result-tools .badge-pill {
    justify-self: start;
  }
  .history-toolbar {
    gap: 6px;
  }
  .history-toolbar .ghost-select {
    min-width: 0;
  }
  .history-toolbar .ghost-btn {
    min-height: 40px;
    padding-inline: 12px;
  }
  .workspace-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-section-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    margin-inline: -2px;
    padding-inline: 2px;
  }
  .profile-section-nav .badge-pill {
    justify-content: center;
    text-align: center;
    min-height: 38px;
    padding-inline: 12px;
    flex: 0 0 max-content;
  }
  .profile-main-grid,
  .profile-overview-grid,
  .profile-secondary-grid,
  .profile-finance-stack,
  .profile-security-grid {
    grid-template-columns: 1fr;
  }
  .profile-quick-summary,
  .profile-overview-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-focus-panel {
    padding: 14px;
    border-radius: 18px;
  }
  .profile-focus-message {
    padding: 10px 12px;
    border-radius: 14px;
  }
  .profile-page .collapse-shell summary {
    padding: 11px 12px;
  }
  .profile-page .collapse-shell .table-list {
    padding: 0 10px 10px;
  }
  .profile-side,
  .profile-main,
  .profile-redeem,
  .profile-billing,
  .profile-ledger,
  .profile-history,
  .profile-security {
    gap: 12px;
  }

  .profile-finance-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-finance-actions .ghost-btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .profile-finance-quick-filters {
    width: 100%;
  }

  .profile-finance-quick-filters .ghost-btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .profile-history-actions {
    width: 100%;
  }

  .profile-history-actions .ghost-input,
  .profile-history-actions > .ghost-btn {
    width: 100%;
  }

  .profile-history-quick-filters {
    width: 100%;
  }

  .profile-history-quick-filters .ghost-btn {
    flex: 1 1 calc(33.33% - 8px);
    justify-content: center;
  }
  .tab-row {
    display: flex;
  }
.ziwei-mobile-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, 162px);
  gap: 4px;
}
.ziwei-mobile-core {
  padding: 6px 4px;
  gap: 3px;
}
.ziwei-mobile-core strong {
  font-size: 0.96rem;
}
.ziwei-mobile-core p,
.ziwei-mobile-core small,
.ziwei-mobile-core-eyebrow {
  font-size: 0.62rem;
}
.ziwei-mobile-head strong {
  font-size: 0.98rem;
}
.ziwei-mobile-head span,
.ziwei-mobile-palace small {
  font-size: 0.64rem;
}
.ziwei-mobile-palace {
  min-height: 162px;
  padding: 6px 5px 20px;
  gap: 3px;
}
.ziwei-mobile-palace .ziwei-meta-row > *,
.ziwei-mobile-palace .ziwei-stars span,
.ziwei-mobile-palace .ziwei-labels span {
  padding: 0;
  font-size: 0.7rem;
}
.ziwei-mobile-palace .ziwei-stars.major span {
  font-size: 0.88rem;
}
.ziwei-mobile-palace .ziwei-stars.minor span {
  font-size: 0.74rem;
}
.ziwei-mobile-palace .ziwei-stars.adjective span {
  font-size: 0.72rem;
}
.ziwei-mobile-corner {
  left: 4px;
  bottom: 4px;
  font-size: 0.56rem;
}
  .history-meta-tags {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .history-meta-tags > * {
    flex: 0 0 max-content;
  }
  .history-summary-strip,
  .hero-quick-facts,
  .workspace-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .hero-quick-facts .badge-pill,
  .workspace-strip .badge-pill,
  .history-summary-strip .badge-pill {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .mobile-mode-grid {
    min-height: 72px;
    padding-right: 18px;
    padding-bottom: 2px;
  }
  .mobile-mode-grid::after {
    width: 18px;
    top: 8px;
    bottom: 4px;
  }
}

@media (max-width: 420px) {
  .hero,
  .panel,
  .control-panel,
  .result-panel {
    padding: 12px;
    border-radius: 14px;
  }
  .mobile-panel-title {
    margin: -12px -12px 8px;
    padding: 7px 12px;
    min-height: 0;
  }
  .mobile-submit-row {
    margin: 14px -12px -12px;
    padding-inline: 12px;
  }
  .profile-main,
  .profile-side,
  .profile-redeem,
  .profile-billing,
  .profile-ledger,
  .profile-history,
  .profile-security {
    padding: 14px;
  }
  .profile-layout {
    gap: 14px;
    margin-top: 14px;
  }
  .profile-overview-grid,
  .profile-secondary-grid,
  .profile-finance-stack {
    gap: 14px;
  }
  .profile-overview-strip,
  .profile-quick-summary {
    grid-template-columns: 1fr;
  }
  .result-tools,
  .workspace-actions,
  .inline-actions,
  .profile-history-actions {
    grid-template-columns: 1fr;
  }
  .result-tools .badge-pill {
    justify-self: start;
  }
  .history-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .result-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .result-panel {
    gap: 10px;
  }
  .mobile-edit-panel {
    padding: 10px 11px;
    border-radius: 14px;
  }
  .mobile-edit-panel-caption {
    font-size: 0.7rem;
  }
  .workspace-actions {
    grid-template-columns: 1fr;
  }
  .history-toolbar {
    grid-template-columns: 1fr;
  }
  .history-toolbar .ghost-btn {
    justify-self: stretch;
  }
  .mobile-panel-actions {
    width: auto;
    justify-content: flex-end;
  }
  .mobile-edit-panel {
    justify-items: start;
  }
  .mobile-mode-grid .mode-chip {
    flex-basis: clamp(164px, 60vw, 210px);
    min-width: 164px;
    min-height: 54px;
    padding: 7px 10px 6px;
  }
  .mode-chip {
    flex-basis: clamp(168px, 58vw, 216px);
  }
  .tab-chip {
    flex-basis: min(62vw, 180px);
  }
  .history-item,
  .profile-page .row-card {
    padding: 12px;
    border-radius: 16px;
  }
}
