:root {
  /* Backgrounds */
  --bg: #09090f;
  --surface: #141422;
  --surface-light: #1e1f33;
  --card: #18182b;

  /* Brand */
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --secondary: #f59e0b;
  --accent: #ec4899;

  /* Cosmic */
  --violet: #7c3aed;
  --indigo: #4338ca;
  --gold: #fbbf24;
  --amber: #f59e0b;
  --cyan: #22d3ee;

  /* Text */
  --text: #f8fafc;
  --text-muted: #cbd5e1;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);

  /* Shadows */
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 30px rgba(139, 92, 246, 0.35);
  --radius: 18px;

  /* Compatibility tokens used by existing selectors */
  --surface-soft: var(--surface-light);
  --muted: var(--text-muted);
  --primary-soft: rgba(139, 92, 246, 0.2);
  --accent-soft: rgba(34, 211, 238, 0.2);
  --warm: var(--amber);
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #4c1d95 0%, transparent 40%),
    radial-gradient(circle at bottom right, #f59e0b33 0%, transparent 35%),
    linear-gradient(180deg, #09090f, #111827);
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.bg-orb-1 {
  width: 420px;
  height: 420px;
  background: #7c3aed;
  top: -150px;
  left: -120px;
}

.bg-orb-2 {
  width: 360px;
  height: 360px;
  background: #f59e0b;
  bottom: -120px;
  right: -120px;
}

.bg-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(139, 92, 246, 0.14) 1px, transparent 1px);
  background-size: 28px 28px, 56px 56px;
  background-position: 0 0, 14px 14px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.35) 68%, transparent 100%);
  animation: dots-drift 24s linear infinite;
}

@keyframes dots-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -18px, 0);
  }
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 72px;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 34, 0.8);
  backdrop-filter: blur(24px);
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 0.58rem;
}

.top-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8, var(--primary), var(--accent));
  font-family: "Syne", sans-serif;
  font-weight: 800;
  overflow: hidden;
}

.top-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-brand-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.top-brand-sub {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 0.46rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  min-height: 42px;
  padding: 0 0.72rem;
  background: #202339;
}

.top-search .material-icons {
  font-size: 1.04rem;
  color: var(--muted);
}

.top-search input {
  border: 0;
  outline: none;
  width: 100%;
  font: inherit;
  background: transparent;
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.46rem;
}

.nav-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.nav-icon-btn .material-icons {
  font-size: 1.18rem;
}

.top-user {
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d4ed8, var(--primary), var(--accent));
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.top-user-icon {
  display: block;
  width: 24px;
  height: 24px;
  margin: auto;
  object-fit: contain;
}

.app {
  width: min(1320px, 96vw);
  margin: 0.9rem auto 1.8rem;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.hero-title {
  margin: 0.28rem 0 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.16;
}

.subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 58ch;
}

.hero-notes {
  display: grid;
  gap: 0.52rem;
}

.hero-note {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.56rem 0.62rem;
  background: var(--surface-soft);
}

.hero-note-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hero-note-value {
  margin: 0.18rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.workspace {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: stretch;
  min-height: calc(100vh - 96px);
}

.workspace.sidebar-collapsed,
.workspace.sidebar-closed {
  grid-template-columns: 120px minmax(0, 1fr);
}

.sidebar {
  display: grid;
  gap: 0.7rem;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #16162b, #111827);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(30px);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
}

.side-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(24, 24, 43, 0.92), rgba(35, 37, 60, 0.88));
  box-shadow: var(--shadow), var(--glow);
  backdrop-filter: blur(16px);
}

.side-profile {
  padding: 0.88rem;
  text-align: center;
}

.side-card-merged .side-profile {
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.2rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.side-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, var(--accent));
  color: #ffffff;
  font-family: "Syne", sans-serif;
  font-weight: 800;
}

.side-profile-title {
  margin: 0.46rem 0 0;
  font-family: "Syne", sans-serif;
  font-size: 0.98rem;
}

.side-profile-copy {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.side-card {
  padding: 0.74rem;
}

.side-title {
  margin: 0 0 0.52rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.side-about {
  margin-bottom: 0.7rem;
  padding: 0.68rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.14), rgba(24, 24, 43, 0.92));
}

.side-about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.side-about-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.side-about-value {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.side-nav {
  display: grid;
  gap: 0.4rem;
}

.side-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.56rem;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.side-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(6px);
}

.side-option.is-active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 25px rgba(139, 92, 246, 0.45);
}

.side-option.is-active .side-icon,
.side-option.is-active .side-option-title {
  color: #ffffff;
}

.side-link {
  cursor: pointer;
}

.side-icon {
  color: #4b5563;
  font-size: 1.18rem;
}

.side-option-content {
  display: grid;
  gap: 0.06rem;
}

.side-option-title {
  font-size: 0.86rem;
  font-weight: 700;
}

.side-option-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.workspace.sidebar-collapsed .side-profile-title,
.workspace.sidebar-collapsed .side-profile-copy,
.workspace.sidebar-collapsed .side-title,
.workspace.sidebar-collapsed .side-option-content,
.workspace.sidebar-closed .side-profile-title,
.workspace.sidebar-closed .side-profile-copy,
.workspace.sidebar-closed .side-title,
.workspace.sidebar-closed .side-option-content {
  display: none;
}

.workspace.sidebar-collapsed .side-card,
.workspace.sidebar-closed .side-card {
  padding-inline: 0.42rem;
}

.workspace.sidebar-collapsed .side-option,
.workspace.sidebar-closed .side-option {
  grid-template-columns: 1fr;
  place-items: center;
}

.workspace.sidebar-collapsed .side-avatar,
.workspace.sidebar-closed .side-avatar {
  width: 42px;
  height: 42px;
}

.side-tips {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.side-tips li {
  margin: 0.3rem 0;
  font-size: 0.83rem;
}

.content-stack {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  min-height: 100%;
}

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

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.76rem;
  background: linear-gradient(145deg, rgba(24, 24, 43, 0.9), rgba(35, 37, 60, 0.85));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:nth-child(2) {
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.22), rgba(24, 24, 43, 0.9));
}

.stat-card:nth-child(3) {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.22), rgba(24, 24, 43, 0.9));
}

.stat-card:nth-child(4) {
  background: linear-gradient(145deg, rgba(236, 72, 153, 0.2), rgba(24, 24, 43, 0.9));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.4), 0 0 24px rgba(139, 92, 246, 0.28);
}

.stat-label {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.stat-value {
  margin: 0.32rem 0 0;
  font-family: "Syne", sans-serif;
  font-size: 1.24rem;
  font-weight: 700;
}

.stat-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.77rem;
}

.form-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  background: linear-gradient(145deg, rgba(24, 24, 43, 0.94), rgba(35, 37, 60, 0.9));
  box-shadow: var(--shadow), 0 0 26px rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(18px);
}

.form-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: "Syne", sans-serif;
}

.form-head p {
  margin: 0.24rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-grid {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.66rem;
}

label {
  font-size: 0.88rem;
  font-weight: 700;
}

.input-wrap {
  border: 2px solid transparent;
  border-radius: 16px;
  background: #202339;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 0.42rem;
  padding: 0 0.66rem;
}

.input-wrap .material-icons {
  font-size: 1rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 0;
  outline: none;
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: transparent;
}

input::placeholder {
  color: #94a3b8;
}

.input-wrap:focus-within {
  border-color: #8b5cf6;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35);
}

.cta {
  border: none;
  border-radius: 14px;
  min-height: 44px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  cursor: pointer;
  transition: 0.3s;
}

.cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4);
}

.form-actions {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  width: 100%;
}

.form-actions .cta {
  flex: 1;
  width: auto;
}

.reset-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: #25233a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.reset-action:hover {
  background: #302b48;
  border-color: rgba(251, 191, 36, 0.5);
}

.reset-action[hidden] {
  display: none !important;
}

.error {
  min-height: 1.2rem;
  margin: 0.34rem 0 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 600;
}

.result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.74rem;
}

.dob-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  gap: 0.74rem;
}

.dob-summary.has-special-date {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dob-summary-stack {
  display: grid;
  align-content: start;
  gap: 0.74rem;
}

.result[hidden] {
  display: none !important;
}

.result-max {
  grid-template-columns: 1fr;
}

.loshu-dashboard {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  align-items: start;
  gap: 0.85rem;
}

.loshu-grid-panel,
.loshu-stat-card,
.loshu-frequency-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(24, 24, 43, 0.96), rgba(35, 37, 60, 0.94));
  box-shadow: var(--shadow);
}

.loshu-panel-heading,
.loshu-stat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.loshu-panel-heading h2,
.loshu-panel-heading h3,
.loshu-stat-heading h3 {
  margin: 0;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 1rem;
}

.loshu-panel-heading p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.loshu-total-badge {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.loshu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  width: min(100%, 520px);
  margin: 1rem auto 0;
}

.loshu-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0.55rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  color: #fff;
  appearance: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.loshu-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.62);
  filter: brightness(1.12);
}

.loshu-cell:focus-visible,
.loshu-detail-close:focus-visible,
.loshu-accordion summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.loshu-cell[aria-pressed="true"] {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.24), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.loshu-cell-1 { background: #244b50; }
.loshu-cell-2 { background: #513c26; }
.loshu-cell-3 { background: #512e47; }
.loshu-cell-4 { background: #2c4169; }
.loshu-cell-5 { background: #403760; }
.loshu-cell-6 { background: #31523c; }
.loshu-cell-7 { background: #58354b; }
.loshu-cell-8 { background: #315056; }
.loshu-cell-9 { background: #51451f; }

.loshu-cell-number {
  position: absolute;
  top: 0.55rem;
  left: 0.62rem;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.75rem;
  font-weight: 800;
}

.loshu-cell-digits {
  max-width: 100%;
  color: #ffe08a;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.loshu-summary-column {
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.loshu-stat-card {
  padding: 0.9rem;
}

.loshu-total-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.65rem;
  border-color: rgba(251, 191, 36, 0.25);
}

.loshu-stat-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.loshu-stat-value {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--gold);
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.loshu-stat-note {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.loshu-stat-heading {
  align-items: center;
}

.loshu-stat-heading > span {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
}

.loshu-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.loshu-number-chip,
.loshu-empty-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 800;
}

.loshu-number-chip span,
.loshu-empty-state {
  color: var(--muted);
  font-weight: 600;
}

.loshu-frequency-panel {
  grid-column: 1 / -1;
}

.loshu-frequency-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
}

.loshu-frequency-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.loshu-frequency-number,
.loshu-frequency-count {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.loshu-frequency-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.loshu-frequency-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-light), var(--gold));
  transition: width 260ms ease;
}

.loshu-number-detail {
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 12px;
  background: rgba(15, 17, 31, 0.55);
  animation: rise 220ms ease both;
}

.loshu-number-detail[hidden] {
  display: none !important;
}

.loshu-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.loshu-detail-heading h3 {
  margin: 0.15rem 0 0;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.loshu-detail-eyebrow {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
}

.loshu-detail-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.loshu-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0;
}

.loshu-meaning-tag {
  padding: 0.28rem 0.48rem;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 7px;
  color: #d7ceff;
  background: rgba(139, 92, 246, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
}

.loshu-detail-sections,
.loshu-meaning-section-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.loshu-meaning-section,
.loshu-accordion {
  min-width: 0;
  border-top: 1px solid var(--border);
}

.loshu-meaning-section summary,
.loshu-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 0.1rem;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.loshu-meaning-section-body {
  padding: 0 0.1rem 0.75rem;
}

.loshu-meaning-item {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border-left: 2px solid rgba(167, 139, 250, 0.32);
  background: rgba(255, 255, 255, 0.025);
}

.loshu-meaning-item h4,
.loshu-expanded-meaning h4 {
  margin: 0 0 0.35rem;
  color: #ddd6fe;
  font-size: 0.74rem;
  font-weight: 800;
}

.loshu-meaning-item p,
.loshu-expanded-meaning p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.loshu-meaning-item ul,
.loshu-expanded-meaning ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding-left: 1rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.loshu-meaning-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.loshu-interpretations {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(24, 24, 43, 0.96), rgba(35, 37, 60, 0.94));
  box-shadow: var(--shadow);
}

.loshu-primary-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.65rem;
  min-width: 0;
}

.loshu-primary-numbers .loshu-accordion-content {
  grid-template-columns: minmax(0, 1fr);
}

.loshu-accordion summary {
  padding: 0.85rem 0.1rem;
}

.loshu-accordion summary > span {
  margin-left: auto;
  color: var(--gold);
  font-size: 0.74rem;
}

.loshu-accordion-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.1rem 0.1rem 0.85rem;
}

.loshu-expanded-meaning {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.65rem;
  border-left: 2px solid rgba(251, 191, 36, 0.35);
  background: rgba(255, 255, 255, 0.025);
}

.card {
  background: linear-gradient(145deg, #18182b, #23253c);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  padding: 0.84rem;
  transition: 0.35s;
}

.card.span-6 {
  grid-column: span 2;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(124, 58, 237, 0.35);
}

.card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: "Syne", sans-serif;
}

.card p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card ul {
  margin: 0.42rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.card li {
  margin: 0.24rem 0;
  font-size: 0.83rem;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #15803d;
  background: #ecfdf5;
}

.kpi {
  font-family: "Syne", sans-serif;
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.4rem;
}

.color-guide-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.sidebar .color-guide-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.color-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #202339;
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.48rem;
  align-items: start;
  transition: 0.3s;
}

.color-chip:hover {
  transform: scale(1.04);
  box-shadow: 0 15px 30px rgba(255, 255, 255, 0.08);
}

.color-dot {
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: var(--chip, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 12px var(--chip, #94a3b8);
}

.color-chip-title {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 700;
}

.color-chip-copy {
  margin: 0.14rem 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

.sidebar-backdrop {
  display: none;
  border: 0;
  background: rgba(15, 23, 42, 0.35);
}

.reveal {
  animation: rise 360ms ease both;
}

.reveal-delay-2 {
  animation-delay: 90ms;
}

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

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .top-nav {
    padding: 0 0.68rem;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .top-search {
    display: none;
  }

  .top-brand-sub {
    display: none;
  }

  .app {
    width: min(100%, 95vw);
    margin: 0.72rem auto 1.2rem;
  }

  .workspace {
    min-height: calc(100vh - 84px);
  }

  .workspace,
  .workspace.sidebar-collapsed,
  .workspace.sidebar-closed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, 84vw);
    padding: 0.72rem;
    border-radius: 0 20px 20px 0;
    z-index: 72;
    overflow-y: auto;
    transform: translateX(-105%);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
  }

  .workspace.sidebar-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .workspace.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 71;
  }

  .loshu-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .loshu-frequency-panel {
    grid-column: auto;
  }

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

  .loshu-detail-sections,
  .loshu-meaning-section-body,
  .loshu-accordion-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid,
  .result,
  .color-guide-list {
    grid-template-columns: 1fr;
  }

  .loshu-summary-column,
  .loshu-primary-numbers,
  .loshu-detail-sections,
  .loshu-meaning-section-body,
  .loshu-accordion-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .loshu-interpretations {
    padding: 0.8rem;
    border-radius: 12px;
  }

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

  .hero-notes {
    display: none;
  }

  .cta {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .top-nav-left,
  .top-brand {
    min-width: 0;
    gap: 0.35rem;
  }

  .top-brand-title {
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .nav-icon-btn,
  .top-user {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .hero,
  .stat-card,
  .form-shell,
  .card,
  .side-profile,
  .side-card {
    border-radius: 12px;
  }

  .hero-title {
    font-size: 1.24rem;
  }

  .side-option-title {
    font-size: 0.82rem;
  }

  .side-option-meta,
  .color-chip-copy {
    font-size: 0.7rem;
  }

  .color-guide-list {
    grid-template-columns: 1fr;
  }

  .loshu-grid-panel,
  .loshu-stat-card,
  .loshu-frequency-panel {
    padding: 0.8rem;
    border-radius: 12px;
  }

  .loshu-summary-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .loshu-frequency-grid {
    gap: 0.7rem 0.45rem;
  }

  .loshu-frequency-row {
    grid-template-columns: 18px minmax(0, 1fr) 22px;
    gap: 0.35rem;
  }

  .loshu-cell-digits {
    font-size: 1.2rem;
  }
}
