:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: rgba(10, 16, 30, 0.82);
  --panel-2: rgba(13, 22, 42, 0.72);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(34, 211, 238, 0.34);
  --text: #e7eefc;
  --muted: #97a6bc;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --violet: #a78bfa;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.12), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(167, 139, 250, 0.10), transparent 28%),
    linear-gradient(180deg, #060816 0%, var(--bg) 58%, #03050a 100%);
  color: var(--text);
  font-family: Rajdhani, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.optimizer-container {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.opt-hero {
  padding: clamp(28px, 5vw, 56px) 0 28px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.back-link::before {
  content: "<";
  margin-right: 8px;
  font-family: "JetBrains Mono", monospace;
}

.opt-kicker,
.section-kicker,
.hero-label {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.opt-hero h1 {
  max-width: 980px;
  margin: 0;
  color: #f8fbff;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.opt-strat-name {
  color: var(--cyan);
}

.opt-subtitle {
  max-width: 820px;
  margin: 18px 0 0;
  color: #a8b6ca;
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.45;
}

.opt-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.opt-hero-grid > div,
.opt-panel,
.opt-method {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.opt-hero-grid > div {
  min-height: 108px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.opt-hero-grid strong {
  display: block;
  color: #f8fbff;
  font-size: 26px;
  line-height: 1;
}

.opt-hero-grid small {
  color: var(--muted);
  font-size: 14px;
}

.opt-panel,
.opt-method {
  margin-top: 20px;
  padding: clamp(18px, 2.6vw, 28px);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 4px 0 0;
  color: #f8fbff;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.combo-chip,
.speed-chip {
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font: 800 18px/1 "JetBrains Mono", monospace;
  text-align: center;
}

.opt-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field,
.param-card {
  display: grid;
  gap: 8px;
}

.field span,
.param-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.72);
  color: var(--text);
  padding: 11px 12px;
  font: 700 16px/1 Rajdhani, sans-serif;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.params-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.param-card {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: var(--panel-2);
}

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

.opt-note,
.opt-disclaimer,
.opt-method p,
.opt-method li,
.opt-save-status {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.opt-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.opt-button-primary,
.opt-button-ghost {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 18px;
  font: 900 15px/1 Rajdhani, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.opt-button-primary {
  border: 1px solid rgba(34, 211, 238, 0.66);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.95), rgba(59, 130, 246, 0.92));
  color: #031018;
}

.opt-button-ghost {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.opt-button-primary:disabled,
.opt-button-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.opt-gpu {
  color: #dbeafe;
  font: 700 15px/1.2 "JetBrains Mono", monospace;
}

.opt-progress {
  position: relative;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 8px;
  background: rgba(3, 7, 18, 0.74);
}

.opt-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.94), rgba(52, 211, 153, 0.92));
  transition: width 0.16s ease;
}

.opt-progress-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f8fbff;
  font: 800 14px/1 "JetBrains Mono", monospace;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.52);
}

.opt-top {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 15px;
}

.opt-top th,
.opt-top td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
}

.opt-top th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.opt-top code {
  color: #c4b5fd;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  white-space: normal;
}

.pos {
  color: var(--green);
  font-weight: 900;
}

.neg {
  color: var(--red);
  font-weight: 900;
}

.opt-final {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.opt-method ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

@media (max-width: 820px) {
  .opt-hero-grid,
  .opt-row,
  .params-list {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .opt-top {
    display: block;
    overflow-x: auto;
  }
}
