:root {
  --advanced-violet: #9676ff;
  --advanced-cyan: #42d7e8;
  --advanced-gold: #f3c66b;
  --advanced-red: #f26376;
}

.app-rail.has-advanced-nav {
  overflow: hidden;
}

.app-rail.has-advanced-nav .rail-main {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  gap: 3px;
}

.app-rail.has-advanced-nav .rail-main::-webkit-scrollbar {
  display: none;
}

.app-rail.has-advanced-nav .rail-main > :is(a, button) {
  min-height: 50px;
  flex: 0 0 auto;
}

.app-rail.has-advanced-nav .rail-main .rail-icon {
  width: 29px;
  height: 29px;
}

.mobile-more-item-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-more-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-more-item-copy strong {
  color: #e7eaff;
  font-size: 11px;
}

.mobile-more-item-copy small {
  overflow: hidden;
  color: #687792;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-more-item-arrow {
  margin-left: auto;
  color: #6559b6;
}

.advanced-profile-bar {
  min-width: 0;
  max-width: 720px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(118, 146, 206, .15);
  border-radius: 13px;
  background: rgba(8, 20, 40, .68);
}

.advanced-profile-bar > i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--advanced-cyan);
  box-shadow: 0 0 14px rgba(66, 215, 232, .75);
}

.advanced-profile-bar > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.advanced-profile-bar strong,
.advanced-profile-bar small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advanced-profile-bar strong {
  color: #e8edff;
  font-size: 11px;
}

.advanced-profile-bar small {
  color: #73809a;
  font-size: 9px;
}

.advanced-page {
  max-width: 1600px;
  margin: 0 auto;
}

.advanced-page-heading {
  min-height: 78px;
  margin: 0 2px 10px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.advanced-heading-mark {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(142, 112, 255, .35);
  border-radius: 19px;
  color: #c2b4ff;
  background: radial-gradient(circle at 34% 28%, rgba(118, 94, 255, .37), rgba(8, 19, 42, .92) 66%);
  box-shadow: 0 14px 30px rgba(40, 24, 105, .28), inset 0 1px rgba(255, 255, 255, .08);
}

.advanced-heading-mark::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(75, 214, 231, .34);
  border-radius: 50%;
  animation: advancedOrbit 12s linear infinite;
}

.advanced-heading-mark svg {
  position: relative;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.advanced-page-heading > div:nth-child(2) > span {
  display: block;
  margin-bottom: 3px;
  color: #7f70d8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .22em;
}

.advanced-page-heading h1 {
  margin: 0;
  font-size: clamp(21px, 2vw, 31px);
  font-weight: 650;
  letter-spacing: -.035em;
}

.advanced-page-heading p {
  max-width: 850px;
  margin: 4px 0 0;
  color: #77849d;
  font-size: 10px;
  line-height: 1.5;
}

.advanced-method-chip {
  display: grid;
  justify-items: end;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid rgba(79, 206, 221, .18);
  border-radius: 11px;
  background: rgba(7, 27, 45, .62);
}

.advanced-method-chip strong {
  color: #a7eff5;
  font-size: 9px;
}

.advanced-method-chip small {
  color: #60718b;
  font-size: 8px;
}

.advanced-loading,
.advanced-empty,
.advanced-error {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.advanced-loading-orbit {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}

.advanced-loading-orbit::before,
.advanced-loading-orbit::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(142, 110, 255, .52);
  border-radius: 50%;
  animation: advancedOrbit 2.4s linear infinite;
}

.advanced-loading-orbit::after {
  inset: 21px 5px;
  border-color: rgba(64, 211, 230, .48);
  animation-direction: reverse;
  animation-duration: 1.7s;
}

.advanced-loading-orbit i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 20px #8b6cff;
}

.advanced-loading strong,
.advanced-empty h2,
.advanced-error h2 {
  margin: 0;
  color: #eef1ff;
  font-size: 18px;
}

.advanced-loading span,
.advanced-empty p,
.advanced-error p {
  max-width: 570px;
  margin: 0;
  color: #74819a;
  font-size: 11px;
  line-height: 1.65;
}

.advanced-card-header {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 11px;
  border-bottom: 1px solid rgba(112, 141, 202, .12);
}

.advanced-card-header span,
.advanced-section-title span {
  display: block;
  color: #8d78e4;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .18em;
}

.advanced-card-header h2,
.advanced-section-title h2 {
  margin: 3px 0 0;
  color: #eef1ff;
  font-size: 15px;
  font-weight: 620;
}
.advanced-note-card {
  padding: 15px;
}

.advanced-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.advanced-section-title small {
  color: #64718a;
  font-size: 8px;
}

.advanced-note-card {
  margin-top: 9px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: #76839c;
  font-size: 9px;
  line-height: 1.65;
}

.advanced-note-card > i {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(137, 109, 255, .3);
  border-radius: 8px;
  color: #a28dff;
  font-style: normal;
}

.advanced-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.advanced-field > span {
  color: #707e97;
  font-size: 8px;
  font-weight: 700;
}

.advanced-field :is(input, select) {
  width: 100%;
  height: 40px;
  min-width: 0;
  border: 1px solid rgba(111, 141, 203, .17);
  border-radius: 10px;
  outline: 0;
  padding: 0 10px;
  color: #e5e9f7;
  background: rgba(6, 18, 37, .85);
  font-size: 10px;
}

.advanced-field :is(input, select):focus {
  border-color: rgba(134, 105, 255, .62);
  box-shadow: 0 0 0 3px rgba(110, 82, 244, .09);
}

.house-system-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(104, 137, 197, .14);
  border-radius: 9px;
  background: rgba(7, 19, 39, .7);
}

.house-system-control > span:not(.af-control-wrap) {
  color: #67758d;
  font-size: 8px;
  white-space: nowrap;
}

.house-system-control select {
  max-width: 116px;
  border: 0;
  outline: 0;
  color: #cbd4e8;
  background: transparent;
  font-size: 8px;
}

.house-system-control select option { background: #071427; }

.cosmo-houses-layer {
  pointer-events: none;
}

.cosmo-house-cusp {
  stroke: rgba(144, 167, 215, .34);
  stroke-width: 1;
}

.cosmo-house-cusp.angular {
  stroke: rgba(243, 198, 107, .74);
  stroke-width: 1.8;
  filter: drop-shadow(0 0 3px rgba(243, 198, 107, .35));
}

.cosmo-house-number {
  fill: rgba(194, 207, 234, .72);
  font-size: 10px;
  font-weight: 760;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(3, 10, 23, .88);
  stroke-width: 3px;
}

.cosmo-angle-label {
  fill: #f3c66b;
  font-size: 9px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: #061126;
  stroke-width: 3px;
}

.cosmogram-house-meta {
  color: #a6b3cb !important;
}

.cosmogram-house-meta b {
  color: #f0c66f !important;
}

.cosmogram-house-notice {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 12px;
  width: min(480px, calc(100% - 24px));
  transform: translateX(-50%);
  padding: 9px 12px;
  border: 1px solid rgba(241, 191, 93, .28);
  border-radius: 10px;
  color: #c7a862;
  background: rgba(17, 20, 31, .9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .36);
  text-align: center;
  font-size: 8px;
  line-height: 1.45;
}

@media (max-width: 767px) {
  .advanced-profile-bar {
    height: 38px;
    padding: 0 9px;
  }

  .advanced-profile-bar > i,
  .advanced-profile-bar small { display: none; }

  .advanced-profile-bar strong { font-size: 9px; }

  .advanced-page-heading {
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr);
    padding: 0 2px;
  }

  .advanced-heading-mark,
  .advanced-method-chip { display: none; }

  .advanced-page-heading h1 { font-size: 21px; }
  .advanced-page-heading p { font-size: 9px; }

  .house-system-control > span:not(.af-control-wrap) { display: none; }
  .house-system-control { padding: 0 5px; }
  .house-system-control select { max-width: 98px; }

  .cosmo-house-number { font-size: 8px; }
  .cosmo-angle-label { font-size: 8px; }}

@media (prefers-reduced-motion: reduce) {
  .advanced-heading-mark::before,
  .advanced-loading-orbit::before,
  .advanced-loading-orbit::after {
    animation: none !important;
  }
}

/* Audit: readable type, flexible cards and reliable touch targets. */
.advanced-page { min-width: 0; }
.advanced-page-heading > div{ min-width: 0; }
.advanced-page-heading p,
.advanced-note-card { color: #a7b4cc; font-size: 12px; line-height: 1.6; }
.advanced-card-header h2,
.advanced-section-title h2 { font-size: 16px; line-height: 1.3; }
.advanced-section-title { flex-wrap: wrap; }
.advanced-section-title small{ color: #a0aec6; font-size: 11px; line-height: 1.5; }
.advanced-field > span { color: #aab8d0; font-size: 11px; }
.advanced-field :is(input, select) { min-height: 44px; font-size: 14px; }
.advanced-field select option{ color: #e5e9f7; background: #08152b; }
.advanced-field :is(input, select):disabled { opacity: .75; }
.advanced-page .calculate-button:focus-visible { outline: 2px solid #b7a3ff; outline-offset: 3px; }
@media (max-width: 767px) {
  .advanced-page-heading p { font-size: 12px; }
  .advanced-card-header { flex-wrap: wrap; gap: 10px; }
  .advanced-field :is(input, select){ font-size: 16px; }}