:root {
  --bg: #eef3f0;
  --paper: #ffffff;
  --paper-strong: #f5f8f6;
  --ink: #17211d;
  --muted: #66736e;
  --line: rgba(23, 33, 29, 0.13);
  --jade: #1f725e;
  --jade-dark: #173f35;
  --rust: #b0523f;
  --gold: #b48745;
  --blue: #2f6688;
  --metal: #6f7880;
  --shadow: 0 18px 44px rgba(25, 41, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 114, 94, 0.08), transparent 32%),
    linear-gradient(225deg, rgba(47, 102, 136, 0.08), transparent 36%),
    linear-gradient(180deg, #eef3f0 0%, #f7f4ee 100%);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 10px clamp(14px, 4vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  color: #fff8ec;
  background: var(--jade-dark);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 21px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.top-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 248, 246, 0.82);
  color: #26352f;
  font-size: 13px;
  font-weight: 800;
}

.h5-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

#intake,
#workspace {
  scroll-margin-top: 88px;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(390px, 520px);
  gap: 22px;
  align-items: start;
  min-height: 0;
}

.hero-copy,
.intake-panel,
.report-cover,
.oracle-strip,
.metric-card,
.report-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(22px, 4vw, 36px);
  min-height: 520px;
  padding: clamp(24px, 4vw, 46px);
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(23, 63, 53, 0.97), rgba(47, 102, 136, 0.72)),
    var(--jade-dark);
  color: #fff8ec;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 82px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 720px;
  margin: 20px 0 0;
  color: rgba(255, 248, 236, 0.82);
  font-size: clamp(15px, 1.9vw, 18px);
  line-height: 1.9;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-copy .eyebrow {
  color: #e4c27f;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.hero-badges span,
.soft-chip,
.qimen-meta span,
.line-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.hero-badges span {
  border: 1px solid rgba(255, 248, 236, 0.18);
  background: rgba(255, 248, 236, 0.09);
}

.hero-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 248, 236, 0.2);
  border-left: 1px solid rgba(255, 248, 236, 0.16);
}

.hero-ledger div {
  min-height: 86px;
  padding: 14px;
  border-right: 1px solid rgba(255, 248, 236, 0.16);
  border-bottom: 1px solid rgba(255, 248, 236, 0.16);
}

.hero-ledger strong,
.hero-ledger span {
  display: block;
}

.hero-ledger strong {
  color: #fff8ec;
  font-size: 17px;
  line-height: 1.2;
}

.hero-ledger span {
  margin-top: 8px;
  color: rgba(255, 248, 236, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.intake-panel {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.96);
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(23, 33, 29, 0.1);
  border-radius: 8px;
  background: var(--paper-strong);
}

.form-section h3 {
  margin: 0;
  color: #26352f;
  font-size: 15px;
  line-height: 1.2;
}

.panel-head,
.report-cover,
.palace-head,
.admin-bar,
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.report-cover h2,
.section-title h3,
.admin-head h1 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

.soft-chip {
  color: var(--jade-dark);
  background: rgba(31, 114, 94, 0.1);
}

label {
  display: grid;
  gap: 7px;
}

label span,
.focus-field legend,
.calendar-field legend {
  color: #4b4338;
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(23, 33, 29, 0.17);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  transition:
    border 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input,
select {
  min-height: 45px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 114, 94, 0.72);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 114, 94, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.focus-field,
.calendar-field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.focus-field legend,
.calendar-field legend {
  margin: 0;
  line-height: 1.35;
}

.choice-grid {
  display: grid;
  gap: 9px;
  padding-top: 6px;
}

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

.focus-field .choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.focus-field label,
.calendar-field label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(42, 35, 27, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #4b4338;
  font-size: 13px;
  font-weight: 900;
}

.focus-field input,
.calendar-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.focus-field label:has(input:checked),
.calendar-field label:has(input:checked) {
  border-color: rgba(31, 114, 94, 0.4);
  color: #fff8ec;
  background: var(--jade);
}

.inline-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.calendar-pane {
  display: none;
}

.calendar-pane.active {
  display: block;
}

.lunar-picker.active {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(31, 114, 94, 0.14);
  border-radius: 8px;
  background: rgba(31, 114, 94, 0.06);
}

.consent-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.consent-line input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.button-row,
.report-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button,
.report-actions button,
.admin-button {
  min-height: 44px;
  border: 1px solid rgba(31, 114, 94, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.primary-button {
  flex: 1;
  color: #fff8ec;
  background: var(--jade);
}

.ghost-button,
.report-actions button,
.admin-button {
  color: var(--jade-dark);
  background: rgba(255, 255, 255, 0.82);
}

.primary-button:hover,
.ghost-button:hover,
.report-actions button:hover,
.admin-button:hover,
.top-actions a:hover {
  transform: translateY(-1px);
}

.report-stage {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.report-cover {
  min-height: 118px;
  padding: 20px;
}

.report-cover h2 {
  font-size: clamp(28px, 5vw, 48px);
}

.report-cover p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.oracle-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 16px;
}

.oracle-strip strong,
.oracle-strip small {
  display: block;
}

.oracle-strip small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.coin-orbit {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.coin-orbit span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), transparent 26%),
    linear-gradient(135deg, #d1a65c, #805626);
  box-shadow: inset 0 0 0 2px rgba(66, 43, 18, 0.2);
}

.coin-orbit.casting span {
  animation: coinFlip 0.62s ease-in-out infinite;
}

.coin-orbit.casting span:nth-child(2) {
  animation-delay: 0.08s;
}

.coin-orbit.casting span:nth-child(3) {
  animation-delay: 0.16s;
}

@keyframes coinFlip {
  50% {
    transform: translateY(-6px) rotateY(180deg);
  }
}

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

.metric-card {
  min-height: 126px;
  padding: 16px;
  overflow: hidden;
}

.metric-card span,
.metric-card small,
.metric-card strong {
  display: block;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-card strong {
  margin: 12px 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.metric-card small {
  color: #5d554b;
  line-height: 1.45;
}

.accent-jade {
  border-top: 5px solid var(--jade);
}

.accent-rust {
  border-top: 5px solid var(--rust);
}

.accent-blue {
  border-top: 5px solid var(--blue);
}

.accent-gold {
  border-top: 5px solid var(--gold);
}

.section-tabs {
  position: sticky;
  top: 78px;
  z-index: 12;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(246, 238, 225, 0.9);
  backdrop-filter: blur(12px);
}

.section-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  color: #4b4338;
  background: transparent;
  font-weight: 900;
}

.section-tabs button.active,
.section-tabs button:hover {
  color: #fff8ec;
  background: var(--jade-dark);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.module-menu,
.module-view {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
}

.module-menu {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 6px;
  padding: 10px;
  align-self: start;
}

.module-menu button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #4b4338;
  background: transparent;
  text-align: left;
}

.module-menu button span,
.module-menu button small {
  display: block;
}

.module-menu button span {
  font-size: 16px;
  font-weight: 900;
}

.module-menu button small {
  color: var(--muted);
  font-size: 12px;
}

.module-menu button.active,
.module-menu button:hover {
  color: #fff8ec;
  background: var(--jade-dark);
}

.module-menu button.active small,
.module-menu button:hover small {
  color: rgba(255, 248, 236, 0.72);
}

.module-view {
  min-height: 560px;
  overflow: hidden;
}

.module-page {
  display: none;
  padding: 20px;
}

.module-page.active {
  display: block;
  animation: pageIn 0.18s ease-out;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(42, 35, 27, 0.12);
}

.subnav button {
  min-height: 36px;
  border: 1px solid rgba(42, 35, 27, 0.14);
  border-radius: 999px;
  padding: 0 13px;
  color: #4b4338;
  background: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  font-weight: 900;
}

.subnav button.active,
.subnav button:hover {
  color: #fff8ec;
  border-color: rgba(23, 63, 53, 0.32);
  background: var(--jade);
}

.sub-panel {
  display: none;
}

.sub-panel.active {
  display: block;
}

.focus-card {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.focus-card h4 {
  margin: 0 0 8px;
}

.focus-card p {
  margin: 0;
  color: #574f45;
  line-height: 1.8;
}

.report-section {
  padding: 20px;
}

.section-title {
  margin-bottom: 16px;
}

.section-title h3 {
  font-size: 24px;
}

.reading-block {
  color: #373028;
  font-size: 15px;
  line-height: 1.9;
}

.reading-block p {
  margin: 0 0 11px;
}

.reading-block p:last-child {
  margin-bottom: 0;
}

.insight-grid,
.pillar-grid,
.ten-god-grid,
.action-grid {
  display: grid;
  gap: 12px;
}

.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.insight-grid article,
.pillar-card,
.ten-god-card,
.action-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.insight-grid article,
.action-card {
  min-height: 128px;
  padding: 14px;
}

.insight-grid h4,
.action-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.insight-grid p,
.action-card p {
  margin: 0;
  color: #574f45;
  line-height: 1.72;
}

.pillar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.pillar-card {
  min-height: 174px;
  padding: 15px;
  text-align: center;
}

.pillar-card span,
.pillar-card small,
.ten-god-card span,
.ten-god-card small {
  display: block;
}

.pillar-card span,
.ten-god-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.pillar-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 40px;
  line-height: 1;
}

.pillar-card small,
.ten-god-card small {
  color: #5d554b;
  line-height: 1.55;
}

.ten-god-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.ten-god-card {
  min-height: 92px;
  padding: 12px;
}

.ten-god-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 20px;
}

.element-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.element-bars {
  display: grid;
  gap: 12px;
}

.element-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
}

.element-row b {
  font-size: 16px;
}

.bar-track {
  height: 17px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 28, 23, 0.08);
}

.bar-fill {
  height: 100%;
  min-width: 5px;
  border-radius: inherit;
}

.element-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

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

.phase-tile {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.phase-tile strong,
.phase-tile small {
  display: block;
}

.phase-tile strong {
  margin-bottom: 6px;
}

.phase-tile small {
  color: var(--muted);
  line-height: 1.45;
}

.iching-layout {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.hex-visual {
  display: grid;
  gap: 11px;
  min-height: 252px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 63, 53, 0.08);
}

.yao {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  min-height: 23px;
  align-items: center;
}

.yao span,
.yao i {
  display: block;
  height: 12px;
  border-radius: 3px;
  background: var(--jade-dark);
}

.yao.broken {
  grid-template-columns: 1fr 1fr;
}

.yao.changing span,
.yao.changing i {
  background: var(--rust);
}

.line-legend,
.qimen-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.line-legend span,
.qimen-meta span {
  border: 1px solid rgba(31, 114, 94, 0.18);
  color: var(--jade-dark);
  background: rgba(255, 255, 255, 0.56);
}

.qimen-meta {
  margin: 0 0 12px;
}

.qimen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(42, 35, 27, 0.18);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.palace {
  min-height: 150px;
  padding: 13px;
  border-right: 1px solid rgba(42, 35, 27, 0.13);
  border-bottom: 1px solid rgba(42, 35, 27, 0.13);
  background: rgba(255, 255, 255, 0.5);
}

.palace:nth-child(3n) {
  border-right: 0;
}

.palace:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.palace.best {
  background: rgba(31, 114, 94, 0.14);
}

.palace.watch {
  background: rgba(176, 82, 63, 0.1);
}

.palace-head {
  margin-bottom: 10px;
  font-weight: 900;
}

.palace small {
  display: block;
  color: var(--muted);
  line-height: 1.58;
}

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

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

.export-grid button {
  min-height: 48px;
  border: 1px solid rgba(31, 114, 94, 0.18);
  border-radius: 8px;
  color: var(--jade-dark);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.export-grid button:hover {
  color: #fff8ec;
  background: var(--jade-dark);
}

.report-preview {
  width: 100%;
  min-height: 220px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: #26312d;
  background: #fff;
  font-size: 14px;
  line-height: 1.75;
  overflow: hidden;
}

.report-document {
  display: grid;
  gap: 0;
}

.report-document > p {
  margin: 0;
  padding: 18px 22px;
  color: var(--muted);
}

.report-doc-cover {
  padding: 22px;
  color: #f9fbf9;
  background: linear-gradient(135deg, #173f35, #2f6688);
}

.report-doc-cover h2,
.report-doc-cover p {
  margin: 0;
}

.report-doc-cover h2 {
  font-size: clamp(24px, 4vw, 42px);
}

.report-doc-cover p {
  margin-top: 10px;
  color: rgba(249, 251, 249, 0.82);
}

.report-doc-section {
  padding: 18px 22px;
  border-top: 1px solid var(--line);
}

.report-doc-section h3 {
  margin: 0 0 10px;
  color: var(--jade-dark);
  font-size: 18px;
}

.report-doc-section p,
.report-doc-section li {
  margin: 0 0 8px;
}

.report-doc-section ul {
  margin: 0;
  padding-left: 18px;
}

.report-doc-kv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-doc-kv span {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid rgba(23, 33, 29, 0.1);
  border-radius: 8px;
  background: var(--paper-strong);
}

.report-doc-kv b {
  color: var(--jade-dark);
}

.report-type-tabs {
  margin-bottom: 12px;
}

.disclaimer {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(180, 135, 69, 0.26);
  border-radius: 8px;
  color: #6b5b40;
  background: rgba(180, 135, 69, 0.09);
  font-size: 13px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 12px;
  color: #fff8ec;
  background: var(--jade-dark);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.admin-head,
.admin-panel,
.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
}

.admin-head {
  min-height: 110px;
  padding: 20px;
}

.admin-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}

.admin-bar {
  align-items: end;
}

.admin-bar label {
  flex: 1;
}

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

.admin-stat {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.admin-stat span,
.admin-stat strong {
  display: block;
}

.admin-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-stat strong {
  margin-top: 8px;
  font-size: 30px;
}

.admin-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(42, 35, 27, 0.1);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.55;
}

.admin-table th {
  color: #4b4338;
  background: rgba(31, 114, 94, 0.08);
  font-weight: 900;
}

.admin-table td {
  color: #40382f;
}

@media (max-width: 980px) {
  .app-hero,
  .workspace-shell,
  .element-layout,
  .iching-layout {
    grid-template-columns: 1fr;
  }

  .module-menu {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .module-menu button {
    min-height: 52px;
    text-align: center;
  }

  .hero-copy {
    min-height: 0;
  }

  .metric-grid,
  .pillar-grid,
  .ten-god-grid,
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    padding-top: 4px;
  }

  .h5-shell,
  .admin-shell {
    width: min(100% - 20px, 680px);
    padding-top: 10px;
  }

  .app-hero {
    min-height: 0;
  }

  .hero-copy,
  .intake-panel,
  .report-cover,
  .report-section {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: 48px;
  }

  .hero-ledger {
    display: none;
  }

  .form-row,
  .lunar-picker.active,
  .metric-grid,
  .pillar-grid,
  .ten-god-grid,
  .insight-grid,
  .action-grid,
  .export-grid,
  .report-doc-kv,
  .admin-stats,
  .admin-bar {
    grid-template-columns: 1fr;
  }

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

  .admin-bar,
  .report-cover,
  .report-actions,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .section-tabs {
    top: 68px;
    overflow-x: auto;
  }

  .section-tabs button {
    min-width: 72px;
  }

  .qimen-grid {
    grid-template-columns: 1fr;
  }

  .palace,
  .palace:nth-child(3n),
  .palace:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid rgba(42, 35, 27, 0.13);
  }

  .palace:last-child {
    border-bottom: 0;
  }
}
