:root {
  --bg-0: #14111b;
  --bg-1: #1a1621;
  --bg-2: #231f32;
  --bg-3: #2a2540;
  --ink: #eee9fc;
  --muted: #9a90b3;
  --line: #3f3951;
  --accent: #b3f4f3;
  --accent-2: #e192ef;
  --accent-3: #b1f2a7;
  --warn: #f0c27b;
  --danger: #e965a5;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  background:
    radial-gradient(1000px 600px at 10% -20%, #2b2436, transparent),
    radial-gradient(700px 500px at 90% -10%, #1c2a35, transparent),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 40%, var(--bg-0));
  color: var(--ink);
  min-height: 100vh;
  padding: 24px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(255, 255, 255, 0.03)),
    linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.02));
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.38;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  margin-bottom: 32px;
}

.hero h1,
.section-head h2 {
  font-family: "Space Grotesk", sans-serif;
  text-transform: lowercase;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 74px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--accent);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  text-transform: lowercase;
}

.hero-markers {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(44, 39, 61, 0.58);
  color: var(--accent-3);
  font-size: 11px;
  text-transform: lowercase;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(44, 39, 61, 0.7);
  color: var(--muted);
  font-size: 12px;
  text-transform: lowercase;
}

.main-grid,
.field-grid,
.axis-grid {
  display: grid;
  gap: 18px;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 22px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(134, 199, 255, 0.06), transparent 70%),
    var(--bg-2);
  box-shadow: 0 12px 30px var(--shadow);
}

.main-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
  align-items: start;
}

.share-focus {
  margin-bottom: 22px;
}

.visual-stack {
  display: grid;
  gap: 18px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

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

.top-grid {
  margin-bottom: 16px;
  align-items: end;
}

.compact-head {
  margin-bottom: 12px;
}

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

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px var(--shadow);
}

.card {
  padding: 22px;
}

.summary-label,
.field span,
.axis-block-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: lowercase;
}

.summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.summary-value {
  color: var(--accent-2);
  font-size: 14px;
  line-height: 1.5;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 6px;
}

.section-head p,
.graph-stats {
  color: #bbb2ce;
  font-size: 12px;
  line-height: 1.7;
}

.field {
  display: block;
}

.field span {
  display: block;
  margin-bottom: 6px;
}

select,
input[type="number"],
input[type="text"],
textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  padding: 11px 13px;
  resize: vertical;
}

textarea {
  min-height: 120px;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.toggle-pill input {
  accent-color: var(--accent);
}

.standalone-toggle {
  width: 100%;
  justify-content: flex-start;
}

.axis-block {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(44, 39, 61, 0.46);
}

.setup-card,
.graph-card,
.workflow-card,
.throttle-panel {
  position: relative;
  overflow: hidden;
}

.setup-card::before,
.graph-card::before,
.workflow-card::before,
.throttle-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(147, 241, 198, 0.045), transparent 55%);
  pointer-events: none;
}

.throttle-card {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(44, 39, 61, 0.46);
}

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

.throttle-preview {
  margin-top: 16px;
}

.axis-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.axis-block-title {
  color: var(--ink);
  font-size: 14px;
  text-transform: lowercase;
}

.axis-block-label {
  color: var(--accent-3);
}

.axis-fields {
  display: grid;
  gap: 10px;
}

.input-pair {
  display: grid;
  gap: 6px;
}

.input-pair label {
  color: var(--muted);
  font-size: 11px;
  text-transform: lowercase;
}

.graph-stats {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(64, 56, 90, 0.72);
  background: rgba(18, 16, 25, 0.72);
}

.graph-stat {
  white-space: nowrap;
}

.share-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.share-rate-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(44, 39, 61, 0.46);
}

.share-rate-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  line-height: 1;
  text-transform: lowercase;
  color: var(--ink);
  margin-bottom: 14px;
}

.share-rate-rows {
  display: grid;
  gap: 10px;
}

.share-rate-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(64, 56, 90, 0.72);
}

.share-rate-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.share-rate-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: lowercase;
}

.share-rate-row strong {
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
}

#curveCanvas,
#throttleCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(64, 56, 90, 0.9);
  background: #0b0a11;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.throttle-stats {
  margin-top: 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.import-card {
  grid-column: 1 / -1;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-family: inherit;
  text-transform: lowercase;
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-btn {
  background: var(--accent);
  color: var(--bg-1);
}

.secondary-btn {
  background: var(--accent-3);
  color: var(--bg-1);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.share-label {
  margin-top: 12px;
  color: var(--accent-3);
  font-size: 12px;
  line-height: 1.6;
}

code {
  color: var(--accent-3);
}

.footer {
  margin-top: 22px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

body.share-view .editor-only {
  display: none;
}

body.share-view .shell {
  max-width: 980px;
}

body.share-view .summary-strip {
  margin-bottom: 18px;
}

body.share-view .main-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 980px) {
  .main-grid,
  .field-grid,
  .axis-grid,
  .share-focus-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .card,
  .summary-strip {
    padding: 16px;
  }

  .action-row > * {
    width: 100%;
  }
}
