:root {
  color-scheme: dark;
  --gold: #f1d27a;
  --amber: #d6a84f;
  --line: rgba(241, 210, 122, 0.18);
  --panel: rgba(8, 16, 18, 0.74);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(214, 168, 79, 0.16), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(49, 191, 180, 0.14), transparent 24rem),
    linear-gradient(135deg, #05070a 0%, #071112 46%, #0b0f14 100%);
}

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

.starfield {
  position: fixed;
  inset: 0;
  opacity: 0.55;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(241, 210, 122, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 210, 122, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.silk-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.35;
}

.silk-glow-a {
  left: -15rem;
  top: 20%;
  background: rgba(18, 135, 125, 0.42);
}

.silk-glow-b {
  right: -16rem;
  bottom: -8rem;
  background: rgba(214, 168, 79, 0.36);
}

.brand-seal {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(241, 210, 122, 0.5);
  background: linear-gradient(135deg, rgba(241, 210, 122, 0.2), rgba(12, 45, 46, 0.65));
  color: var(--gold);
  font-family: Songti SC, STSong, serif;
  font-size: 24px;
  box-shadow: 0 0 30px rgba(214, 168, 79, 0.2);
}

.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 32%),
    var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

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

.lang-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(241, 210, 122, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.lang-toggle button {
  min-width: 42px;
  border: 0;
  background: transparent;
  color: rgba(255, 244, 214, 0.66);
  padding: 9px 10px;
  font-size: 13px;
}

.lang-toggle button.active {
  background: rgba(241, 210, 122, 0.16);
  color: var(--gold);
}

.status-pill,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(241, 210, 122, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 244, 214, 0.82);
  padding: 9px 12px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 14px #f59e0b;
}

.status-pill.online .status-dot {
  background: #2dd4bf;
  box-shadow: 0 0 14px #2dd4bf;
}

.status-pill.offline .status-dot {
  background: #f87171;
  box-shadow: 0 0 14px #f87171;
}

.micro-orbit {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(241, 210, 122, 0.35);
  background: conic-gradient(from 90deg, transparent, rgba(241, 210, 122, 0.7), transparent 42%);
  animation: spin 7s linear infinite;
}

.field-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-block > span {
  color: rgba(255, 244, 214, 0.76);
  font-size: 13px;
}

.field-block input,
.field-block select,
.field-block textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(241, 210, 122, 0.2);
  background: rgba(3, 8, 10, 0.72);
  color: #f9f5ea;
  padding: 12px 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-block input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  min-height: 52px;
  font-size: 16px;
  line-height: 1.2;
}

.field-block input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}

.field-block input[type="date"]::-webkit-calendar-picker-indicator {
  margin-left: 4px;
  opacity: 0.72;
}

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

.field-block input:focus,
.field-block select:focus,
.field-block textarea:focus {
  border-color: rgba(241, 210, 122, 0.65);
  box-shadow: 0 0 0 3px rgba(214, 168, 79, 0.12);
  background: rgba(5, 12, 14, 0.92);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(241, 210, 122, 0.2);
  background: rgba(3, 8, 10, 0.66);
  color: rgba(255, 244, 214, 0.72);
  gap: 2px;
  padding: 7px 10px;
  text-align: center;
}

.segmented strong {
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

.segmented small {
  color: rgba(255, 244, 214, 0.46);
  font-size: 11px;
  line-height: 1.1;
}

.segmented input:checked + span {
  border-color: rgba(241, 210, 122, 0.7);
  background: linear-gradient(135deg, rgba(214, 168, 79, 0.24), rgba(12, 45, 46, 0.7));
  color: var(--gold);
}

.segmented input:checked + span small {
  color: rgba(255, 244, 214, 0.7);
}

.primary-btn {
  position: relative;
  display: flex;
  min-height: 52px;
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(241, 210, 122, 0.7);
  background: linear-gradient(135deg, #d6a84f, #f1d27a 44%, #8a6428);
  color: #140e05;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(214, 168, 79, 0.24);
}

.primary-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.7;
}

.btn-line {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff8d6, transparent);
  transform: translateX(-100%);
  animation: sweep 2.2s ease-in-out infinite;
}

.pillar-grid {
  display: block;
}

.chart-board {
  border: 1px solid rgba(241, 210, 122, 0.18);
  background:
    linear-gradient(135deg, rgba(241, 210, 122, 0.08), transparent 28%),
    rgba(3, 8, 10, 0.48);
}

.chart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(241, 210, 122, 0.14);
  padding: 12px 14px;
}

.chart-summary > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chart-summary-label,
.chart-summary span {
  border: 1px solid rgba(241, 210, 122, 0.2);
  background: rgba(241, 210, 122, 0.06);
  color: rgba(255, 244, 214, 0.76);
  padding: 4px 8px;
  font-size: 12px;
}

.chart-summary strong {
  color: var(--gold);
  font-family: Songti SC, STSong, serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.chart-table-wrap {
  overflow-x: auto;
}

.chart-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.chart-table th,
.chart-table td {
  border-right: 1px solid rgba(241, 210, 122, 0.12);
  border-bottom: 1px solid rgba(241, 210, 122, 0.12);
  text-align: center;
  vertical-align: middle;
}

.chart-table tr:last-child th,
.chart-table tr:last-child td {
  border-bottom: 0;
}

.chart-table th {
  width: 74px;
  background: rgba(241, 210, 122, 0.065);
  color: rgba(255, 244, 214, 0.64);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 8px;
}

.chart-table td {
  background: rgba(255, 255, 255, 0.018);
  color: rgba(250, 250, 249, 0.86);
  padding: 10px 8px;
}

.chart-table tr:first-child td {
  color: rgba(255, 244, 214, 0.72);
  font-weight: 700;
}

.stem-branch-cell {
  display: grid;
  min-height: 74px;
  place-items: center;
  gap: 4px;
}

.stem-branch-cell strong {
  color: var(--gold);
  font-family: Songti SC, STSong, serif;
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
}

.stem-branch-cell small {
  color: rgba(255, 244, 214, 0.58);
  font-size: 12px;
  line-height: 1;
}

.stem-branch-cell em {
  border: 1px solid rgba(45, 212, 191, 0.34);
  background: rgba(45, 212, 191, 0.1);
  color: rgba(204, 251, 241, 0.9);
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

.stem-branch-cell.branch strong {
  color: #f8dda1;
}

.hidden-stem {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin: 2px;
  border: 1px solid rgba(241, 210, 122, 0.14);
  background: rgba(241, 210, 122, 0.045);
  color: rgba(255, 244, 214, 0.88);
  padding: 4px 6px;
  font-size: 13px;
}

.hidden-stem small {
  color: rgba(255, 244, 214, 0.5);
  font-size: 10px;
}

.muted-cell {
  color: rgba(214, 211, 209, 0.38);
}

.chip {
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: rgba(45, 212, 191, 0.08);
  color: rgba(204, 251, 241, 0.9);
  padding: 7px 10px;
  font-size: 13px;
}

.api-config {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(241, 210, 122, 0.12);
  background: rgba(2, 6, 8, 0.42);
  padding: 10px 12px;
}

.api-config.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.api-config div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.api-config span {
  color: rgba(255, 244, 214, 0.48);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-config strong {
  overflow: hidden;
  color: rgba(255, 244, 214, 0.76);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-config button,
.test-unlock-btn {
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: rgba(45, 212, 191, 0.08);
  color: rgba(204, 251, 241, 0.92);
  padding: 7px 10px;
  font-size: 12px;
}

.report-shell {
  position: relative;
  display: flex;
  min-height: 360px;
  flex: 1;
}

.report {
  overflow: auto;
  border: 1px solid rgba(241, 210, 122, 0.1);
  background: rgba(2, 6, 8, 0.52);
  padding: 16px;
  color: rgba(250, 250, 249, 0.9);
  line-height: 1.85;
}

.report h1,
.report h2,
.report h3 {
  margin: 18px 0 8px;
  color: var(--gold);
  font-family: Songti SC, STSong, serif;
}

.report h1 {
  font-size: 24px;
}

.report h2 {
  font-size: 19px;
}

.report p {
  margin: 8px 0;
}

.report ul {
  margin: 8px 0 8px 1.1rem;
  list-style: disc;
}

.report table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: 14px;
}

.report th,
.report td {
  border: 1px solid rgba(241, 210, 122, 0.15);
  padding: 8px;
}

.report th {
  color: var(--gold);
  background: rgba(241, 210, 122, 0.06);
}

.empty-state {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: rgba(214, 211, 209, 0.48);
  text-align: center;
}

.paywall-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(3, 6, 8, 0.08), rgba(3, 6, 8, 0.84) 24%, rgba(3, 6, 8, 0.98)),
    radial-gradient(circle at 50% 30%, rgba(241, 210, 122, 0.22), transparent 21rem);
  backdrop-filter: blur(12px);
}

.paywall-overlay.hidden,
.modal-overlay.hidden {
  display: none;
}

.paywall-card {
  width: min(100%, 520px);
  border: 1px solid rgba(241, 210, 122, 0.52);
  background:
    linear-gradient(135deg, rgba(241, 210, 122, 0.16), rgba(12, 45, 46, 0.34) 42%, rgba(3, 7, 9, 0.92)),
    rgba(3, 7, 9, 0.92);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.46), 0 0 50px rgba(214, 168, 79, 0.18);
  padding: 24px;
  text-align: center;
}

.paywall-kicker {
  color: rgba(204, 251, 241, 0.86);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.paywall-card h3,
.payment-modal h2 {
  margin: 10px 0 0;
  color: var(--gold);
  font-family: Songti SC, STSong, serif;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.16;
}

.paywall-card p,
.payment-modal p {
  margin: 12px auto 0;
  max-width: 39rem;
  color: rgba(250, 250, 249, 0.82);
  line-height: 1.8;
}

.paywall-points {
  margin: 18px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.paywall-points span {
  border: 1px solid rgba(241, 210, 122, 0.22);
  background: rgba(241, 210, 122, 0.08);
  color: rgba(255, 244, 214, 0.84);
  padding: 7px 10px;
  font-size: 12px;
}

.unlock-btn {
  display: inline-flex;
  min-height: 48px;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 248, 214, 0.7);
  background: linear-gradient(135deg, #8a6428, #d6a84f 34%, #f1d27a 62%, #6d4b19);
  color: #120c04;
  font-weight: 800;
  box-shadow: 0 16px 42px rgba(214, 168, 79, 0.3);
}

.test-unlock-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 42px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 5, 7, 0.76);
  backdrop-filter: blur(16px);
}

.payment-modal {
  position: relative;
  width: min(100%, 560px);
  border: 1px solid rgba(241, 210, 122, 0.42);
  background:
    radial-gradient(circle at top, rgba(241, 210, 122, 0.16), transparent 18rem),
    linear-gradient(160deg, rgba(8, 16, 18, 0.98), rgba(3, 7, 9, 0.98));
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.54);
  padding: 26px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(241, 210, 122, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 244, 214, 0.86);
  font-size: 22px;
}

.modal-seal {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid rgba(241, 210, 122, 0.45);
  background: rgba(241, 210, 122, 0.1);
  color: var(--gold);
  padding: 0 12px;
  font-family: Songti SC, STSong, serif;
}

.payment-links {
  margin: 20px 0 14px;
  display: grid;
  gap: 10px;
}

.payment-links a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(241, 210, 122, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 244, 214, 0.92);
  text-decoration: none;
}

.payment-links a:hover {
  border-color: rgba(241, 210, 122, 0.62);
  background: rgba(241, 210, 122, 0.11);
}

.payment-note {
  margin-bottom: 14px;
  border: 1px solid rgba(45, 212, 191, 0.15);
  background: rgba(45, 212, 191, 0.06);
  color: rgba(204, 251, 241, 0.82);
  padding: 10px;
  font-size: 12px;
}

.payment-note code {
  color: var(--gold);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(1, 5, 7, 0.82);
  backdrop-filter: blur(18px);
}

.loading-overlay.hidden {
  display: none;
}

.astro-wrap {
  position: relative;
  width: min(58vw, 238px);
  aspect-ratio: 1;
}

.astro-halo,
.astro-ring,
.astro-pointer,
.astro-cardinals,
.astro-core {
  position: absolute;
  inset: 0;
}

.astro-halo {
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(241, 210, 122, 0.16), transparent 42%),
    radial-gradient(circle, rgba(45, 212, 191, 0.12), transparent 64%);
  filter: blur(4px);
}

.astro-ring {
  border-radius: 999px;
  border: 1px solid rgba(241, 210, 122, 0.3);
}

.astro-ring-slow {
  background:
    repeating-conic-gradient(from 0deg, rgba(241, 210, 122, 0.42) 0deg 1.4deg, transparent 1.4deg 15deg),
    radial-gradient(circle, transparent 58%, rgba(12, 45, 46, 0.42) 59%, transparent 72%);
  mask: radial-gradient(circle, transparent 56%, black 57%, black 72%, transparent 73%);
  animation: spin 18s linear infinite;
}

.astro-ring-fast {
  inset: 18%;
  border-color: rgba(45, 212, 191, 0.32);
  background:
    conic-gradient(from 0deg, transparent, rgba(241, 210, 122, 0.78) 16%, transparent 28%, rgba(45, 212, 191, 0.4) 46%, transparent 58%, rgba(241, 210, 122, 0.64) 74%, transparent);
  mask: radial-gradient(circle, transparent 58%, black 59%, black 66%, transparent 67%);
  animation: spinReverse 9s linear infinite;
}

.astro-pointer {
  inset: 10%;
  border-radius: 999px;
  background:
    conic-gradient(from -7deg, transparent 0deg, transparent 352deg, rgba(241, 210, 122, 0.95) 356deg, transparent 360deg);
  filter: drop-shadow(0 0 14px rgba(241, 210, 122, 0.28));
  animation: spin 5.8s cubic-bezier(0.42, 0, 0.2, 1) infinite;
}

.astro-cardinals span {
  position: absolute;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(241, 210, 122, 0.22);
  background: rgba(3, 8, 10, 0.72);
  color: rgba(241, 210, 122, 0.88);
  font-family: Songti SC, STSong, serif;
  font-size: 16px;
}

.astro-cardinals span:nth-child(1) {
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
}

.astro-cardinals span:nth-child(2) {
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
}

.astro-cardinals span:nth-child(3) {
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
}

.astro-cardinals span:nth-child(4) {
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
}

.astro-core {
  inset: 34%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 210, 122, 0.52);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 28%, rgba(241, 210, 122, 0.22), transparent 42%),
    rgba(8, 24, 23, 0.92);
  box-shadow: inset 0 0 28px rgba(241, 210, 122, 0.08), 0 0 36px rgba(45, 212, 191, 0.12);
  color: var(--gold);
  text-align: center;
}

.astro-core strong {
  font-family: Songti SC, STSong, serif;
  font-size: 18px;
  line-height: 1;
}

.astro-core small {
  color: rgba(255, 244, 214, 0.52);
  font-size: 10px;
  line-height: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

@media (max-width: 760px) {
  .chart-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-table {
    min-width: 560px;
  }

  .chart-table th {
    width: 62px;
    padding: 9px 6px;
  }

  .chart-table td {
    padding: 9px 6px;
  }

  .stem-branch-cell {
    min-height: 66px;
  }

  .stem-branch-cell strong {
    font-size: 34px;
  }

  .report {
    min-height: 420px;
    padding: 13px;
  }

  .astro-wrap {
    width: min(62vw, 224px);
  }

  .astro-cardinals span {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}
