:root {
  --bg: #0a0e14;
  --panel: rgba(14, 20, 30, 0.92);
  --line: rgba(74, 222, 128, 0.2);
  --accent: #4ade80;
  --accent2: #38bdf8;
  --gold: #facc15;
  --txt: #e8eef7;
  --muted: #94a3b8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.55;
}

.geom-hero {
  padding: 40px 24px 28px;
  text-align: center;
  background: radial-gradient(ellipse 70% 50% at 50% -20%, rgba(74, 222, 128, 0.14), transparent);
}

.cdn-box {
  display: inline-block;
  max-width: min(960px, 96vw);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--accent2);
  word-break: break-all;
}

.app-toolbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.nav-pill.active {
  border-color: var(--accent) !important;
  background: rgba(74, 222, 128, 0.08) !important;
  color: var(--txt) !important;
}

.main-container {
  max-width: 1400px !important;
  margin: 0 auto;
  padding: 32px 20px 48px !important;
}

.math-block {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.method-sketch-block {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.panel-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin-bottom: 12px !important;
}

.sketch-host {
  width: 100%;
  height: 280px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  background: #0a0e14;
  overflow: hidden;
  cursor: crosshair;
  position: relative;
}

.sketch-host.sketch-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
}

.sketch-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0e14;
  display: block;
}

.sketch-panel-actions {
  margin-top: 10px;
}

.manim-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.manim-panel.manim-pending {
  border-color: rgba(148, 163, 184, 0.2);
}

.manim-pending-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.manim-source {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.manim-source code {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
}

.manim-video {
  width: 100%;
  max-height: 280px;
  border-radius: 10px;
  background: #000;
  display: block;
}

.hero-accent {
  color: #4ade80;
}

.panel-hint {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent2);
}

/* SweetAlert2 + CodeMirror modal */
.swal-geom-popup {
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 16px !important;
}

.swal-geom-deny {
  background: #38bdf8 !important;
  color: #0a0e14 !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
}

.swal-cm-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}

.swal-cm-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.swal-cm-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.swal-cm-tab.active {
  color: var(--accent2);
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.1);
}

.swal-cm-host {
  position: relative;
  text-align: left;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
  min-height: 340px;
  background: #1e1e1e;
}

.swal-cm-pane {
  display: none;
  width: 100%;
}

.swal-cm-pane.active {
  display: block;
}

.swal-cm-host .CodeMirror {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  height: 340px !important;
}

.cm-ta {
  display: none;
}

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

.method-actions .link-btn iconify-icon,
.chip-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-label iconify-icon {
  flex-shrink: 0;
}

.method-card-highlight {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.3) !important;
}

.site-foot {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-foot a {
  color: var(--accent2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-foot a:hover { text-decoration: underline; }

.toolbar-links {
  margin-left: auto;
}

@media (max-width: 700px) {
  .toolbar-links {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}
