:root {
  --polaris-nav-gold-light: #fff8d6;
  --polaris-nav-gold: #e5c06f;
  --polaris-nav-gold-bright: #fff4bd;
  --polaris-nav-gold-dark: #b97b25;
  --polaris-nav-core: #fffdf3;
  --polaris-nav-glow: #e6b84d;
}

.polaris-animation-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

[data-polaris-animation-layer] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s cubic-bezier(.45, 0, .55, 1);
}

[data-polaris-animation-layer].is-active {
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
}

[data-polaris-animation-layer].is-leaving {
  z-index: 1;
}

[data-polaris-animation-layer][hidden] {
  display: none !important;
}

[data-polaris-animation-layer="classic"] svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.geometry-symbol {
  opacity: 0;
  transform-box: view-box;
  transform-origin: 50px 50px;
  animation: geometry-cycle 36s cubic-bezier(.45, 0, .55, 1) infinite;
  animation-delay: var(--delay);
}

.geometry-symbol:nth-child(1) { --delay: 0s !important; }
.geometry-symbol:nth-child(2) { --delay: 6s !important; }
.geometry-symbol:nth-child(3) { --delay: 12s !important; }
.geometry-symbol:nth-child(4) { --delay: 18s !important; }
.geometry-symbol:nth-child(5) { --delay: 24s !important; }
.geometry-symbol:nth-child(6) { --delay: 30s !important; }

.geometry-symbol .trace {
  stroke-width: 1.05px !important;
}

.geometry-symbol .trace:is(path, circle, ellipse, line, polyline, polygon),
.geometry-symbol .trace :is(path, circle, ellipse, line, polyline, polygon) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: geometry-trace 36s cubic-bezier(.45, 0, .55, 1) infinite;
  animation-delay: var(--delay);
}

.geometry-glow {
  transform-box: view-box;
  transform-origin: 50px 50px;
  animation: glow-drift 36s ease-in-out infinite;
}

.geometry-halo { animation: halo-pulse 36s ease-in-out infinite; }
.geometry-core { animation: core-pulse 6s ease-in-out infinite; }

@keyframes geometry-cycle {
  0% { opacity: 0; transform: rotate(-18deg) scale(.78); }
  8.333%, 16.667% { opacity: 1; transform: rotate(0) scale(1); }
  25% { opacity: 0; transform: rotate(18deg) scale(.78); }
  25.001%, 100% { opacity: 0; transform: rotate(-18deg) scale(.78); }
}

@keyframes geometry-trace {
  0% { stroke-dashoffset: 1; }
  8.333%, 16.667% { stroke-dashoffset: 0; }
  25%, 100% { stroke-dashoffset: 1; }
}

.polaris-classic-paused .geometry-symbol,
.polaris-classic-paused .geometry-symbol .trace,
.polaris-classic-paused .geometry-symbol .trace *,
.polaris-classic-paused .geometry-glow,
.polaris-classic-paused .geometry-halo,
.polaris-classic-paused .geometry-core {
  animation-play-state: paused !important;
}

.polaris-classic-reset .geometry-symbol,
.polaris-classic-reset .geometry-symbol .trace,
.polaris-classic-reset .geometry-symbol .trace *,
.polaris-classic-reset .geometry-glow,
.polaris-classic-reset .geometry-halo,
.polaris-classic-reset .geometry-core {
  animation: none !important;
}

@keyframes glow-drift {
  0%, 100% { transform: translate(0, 0); }
  16.667% { transform: translate(1.5px, -1px); }
  33.333% { transform: translate(-1px, 1.5px); }
  50% { transform: translate(1px, 1px); }
  66.667% { transform: translate(-1.5px, -.5px); }
  83.333% { transform: translate(.5px, -1.5px); }
}

@keyframes halo-pulse {
  0%, 100% { opacity: .62; }
  16.667% { opacity: .82; }
  33.333% { opacity: .5; }
  50% { opacity: .9; }
  66.667% { opacity: .58; }
  83.333% { opacity: .76; }
}

@keyframes core-pulse {
  0%, 100% { opacity: .9; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

.polaris-nav-host,
.polaris-nav-host svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.polaris-nav-svg {
  filter: drop-shadow(0 4px 13px rgba(18, 12, 3, .48));
}

.polaris-nav-root {
  transform-box: view-box;
  transform-origin: 50px 50px;
  transform: scale(var(--polaris-nav-pulse, 1));
}

.polaris-nav-path {
  stroke-width: 1.05px !important;
  vector-effect: non-scaling-stroke;
  transition: opacity 120ms linear;
}

.polaris-nav-glow {
  pointer-events: none;
  transform-box: view-box;
  transform-origin: 50px 50px;
  animation: polaris-nav-glow-drift 12s ease-in-out infinite;
}

.polaris-nav-halo {
  opacity: .68;
  animation: polaris-nav-halo-pulse 6s ease-in-out infinite;
}

.polaris-nav-core {
  opacity: .96;
  transform-box: fill-box;
  transform-origin: center;
  animation: polaris-nav-core-pulse 3s ease-in-out infinite;
}

@keyframes polaris-nav-glow-drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(1.2px, -1px); }
  50% { transform: translate(-.8px, 1.3px); }
  75% { transform: translate(-1.1px, -.6px); }
}

@keyframes polaris-nav-halo-pulse {
  0%, 100% { opacity: .56; }
  50% { opacity: .86; }
}

@keyframes polaris-nav-core-pulse {
  0%, 100% { transform: scale(.92); opacity: .9; }
  50% { transform: scale(1.12); opacity: 1; }
}

.polaris-animation-setting {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 340px);
  gap: 16px;
  align-items: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line, #dfe6ec);
}

.polaris-animation-setting label {
  font-weight: 800;
}

.polaris-animation-setting small {
  display: block;
  margin-top: 5px;
  color: var(--muted, #68798c);
  line-height: 1.45;
}

.polaris-animation-setting select {
  width: 100%;
}

.polaris-studio-kicker {
  margin: 0 0 6px;
  color: #9b7626;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.admin-head h2 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -.035em;
}

.admin-head .admin-warning {
  margin: 0;
}

.polaris-studio {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  margin-top: 26px;
  border: 1px solid var(--line, #dfe6ec);
  border-radius: 18px;
  overflow: hidden;
  background: #f8fafb;
}

.polaris-studio-settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 24px;
  border-right: 1px solid var(--line, #dfe6ec);
  background: #fff;
}

.polaris-studio h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.polaris-studio-settings p,
.polaris-danger-zone p {
  margin: 0;
  color: var(--muted, #68798c);
  font-size: 13px;
  line-height: 1.55;
}

.polaris-studio-field {
  display: grid;
  gap: 8px;
}

.polaris-studio-field span,
.polaris-size-control > span {
  color: var(--muted, #68798c);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.polaris-studio-field select {
  width: 100%;
}

.polaris-studio-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border-radius: 13px;
  background: #fff8e2;
  color: #8a6414;
}

.polaris-studio-note > span {
  color: #c09532;
}

.polaris-studio-note p {
  color: inherit;
  font-size: 12px;
}

.polaris-studio-preview {
  min-width: 0;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 38%, rgba(64, 105, 142, .22), transparent 34%),
    linear-gradient(145deg, #0f2139, #081426 72%);
  color: #fff;
}

.polaris-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 42px;
}

.polaris-size-control {
  display: grid;
  grid-template-columns: auto minmax(100px, 180px) 52px;
  align-items: center;
  gap: 10px;
}

.polaris-size-control > span {
  color: #b7c4d1;
}

.polaris-size-control input {
  width: 100%;
  padding: 0;
  accent-color: var(--polaris-nav-gold);
}

.polaris-size-control output {
  color: #d8e1e9;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

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

.polaris-preview-actions .secondary {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.polaris-preview-actions .secondary:hover {
  background: rgba(255, 255, 255, .14);
}

.polaris-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 500px;
  overflow: hidden;
}

.polaris-preview-stage::before,
.polaris-preview-stage::after,
.polaris-preview-orbit {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(231, 199, 116, .11);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.polaris-preview-stage::before {
  width: min(68vw, 440px);
  height: min(68vw, 440px);
}

.polaris-preview-stage::after {
  width: min(50vw, 320px);
  height: min(50vw, 320px);
}

.polaris-preview-orbit {
  width: min(86vw, 560px);
  height: min(86vw, 560px);
}

.polaris-preview-host {
  z-index: 1;
  width: min(var(--polaris-preview-size), 100%);
  height: min(var(--polaris-preview-size), 68vw);
  max-height: var(--polaris-preview-size);
  filter: drop-shadow(0 0 24px rgba(226, 184, 77, .18));
  transition: width 180ms ease, height 180ms ease;
}

.polaris-preview-host .polaris-nav-svg {
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, .42));
}

.polaris-preview-host [data-polaris-animation-layer="classic"] svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, .42));
}

.polaris-studio-animation-stack.is-paused .geometry-symbol,
.polaris-studio-animation-stack.is-paused .trace,
.polaris-studio-animation-stack.is-paused .geometry-glow,
.polaris-studio-animation-stack.is-paused .geometry-halo,
.polaris-studio-animation-stack.is-paused .geometry-core {
  animation-play-state: paused !important;
}

.polaris-stage-readout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  text-align: center;
}

.polaris-stage-readout span {
  color: #91a3b4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.polaris-stage-readout span:first-child {
  text-align: left;
}

.polaris-stage-readout span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.polaris-stage-readout strong {
  color: #fff3bf;
  font-size: 18px;
  font-weight: 700;
}

.polaris-stage-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.polaris-stage-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 7%;
  left: 7%;
  height: 1px;
  background: rgba(255, 255, 255, .18);
}

.polaris-stage-timeline button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: #91a3b4;
  font: inherit;
  font-size: 10px;
  line-height: 1.3;
  cursor: pointer;
}

.polaris-stage-timeline button span {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: #0b1a2e;
  color: #91a3b4;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.polaris-stage-timeline button[aria-current="step"] {
  color: #fff4bd;
}

.polaris-stage-timeline button[aria-current="step"] span {
  border-color: #e5c06f;
  background: #e5c06f;
  color: #132136;
  box-shadow: 0 0 0 4px rgba(229, 192, 111, .12), 0 0 18px rgba(229, 192, 111, .44);
}

.polaris-stage-timeline button:hover {
  color: #fff;
}

.polaris-stage-timeline.is-inactive {
  opacity: .42;
}

.polaris-stage-timeline button:disabled {
  cursor: default;
}

.polaris-danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line, #dfe6ec);
}

.polaris-danger-zone h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

@media (max-width: 620px) {
  .polaris-animation-setting {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .polaris-studio {
    grid-template-columns: 1fr;
  }

  .polaris-studio-settings {
    border-right: 0;
    border-bottom: 1px solid var(--line, #dfe6ec);
  }

  .polaris-studio-note {
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .polaris-studio-preview {
    padding: 16px 12px;
  }

  .polaris-preview-toolbar,
  .polaris-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .polaris-size-control {
    grid-template-columns: auto 1fr 48px;
  }

  .polaris-preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .polaris-preview-stage {
    min-height: 360px;
  }

  .polaris-preview-host {
    height: min(var(--polaris-preview-size), 82vw);
  }

  .polaris-stage-readout {
    grid-template-columns: auto 1fr auto;
  }

  .polaris-stage-readout strong {
    font-size: 14px;
  }

  .polaris-stage-timeline button {
    font-size: 0;
  }

  .polaris-stage-timeline button span {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .geometry-symbol,
  .geometry-symbol .trace,
  .geometry-glow,
  .geometry-halo,
  .geometry-core,
  .polaris-nav-glow,
  .polaris-nav-halo,
  .polaris-nav-core {
    animation: none !important;
  }

  .geometry-symbol { opacity: 0; }
  .geometry-symbol:first-of-type { opacity: 1; }
  .geometry-symbol:first-of-type .trace,
  .geometry-symbol:first-of-type .trace * { stroke-dashoffset: 0; }
}
