:root {
  --bg: #eef6ff;
  --bg-soft: #dfeefe;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --text: #102b4d;
  --muted: #4f6f96;
  --line: rgba(49, 111, 198, 0.2);
  --line-soft: rgba(73, 127, 201, 0.14);
  --accent: #2f7ff8;
  --accent-alt: #64b5ff;
  --accent-ink: #ffffff;
  --math-bg: #eef5ff;
  --focus: rgba(74, 146, 255, 0.26);
  --shadow: 0 20px 44px rgba(31, 93, 178, 0.13);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Segoe UI", "Helvetica Neue", "Noto Sans", "Liberation Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 12%, rgba(125, 189, 255, 0.36), transparent 34%),
    radial-gradient(circle at 88% 78%, rgba(124, 203, 255, 0.26), transparent 30%),
    linear-gradient(140deg, var(--bg), var(--bg-soft));
  overflow-x: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.65;
  z-index: 0;
  animation: float 11s ease-in-out infinite;
}

.orb-a {
  width: 260px;
  height: 260px;
  top: -70px;
  right: -70px;
  background: linear-gradient(145deg, #c3e3ff, #7cb7ff);
}

.orb-b {
  width: 220px;
  height: 220px;
  bottom: -90px;
  left: -70px;
  background: linear-gradient(145deg, #d6ebff, #81ceff);
  animation-delay: 1.4s;
}

.layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.panel {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.form-panel {
  padding: 22px;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #13386b;
}

.subtitle {
  margin-top: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.subtitle code {
  color: #21579f;
  background: #e9f3ff;
  border: 1px solid #c8ddf9;
  border-radius: 7px;
  padding: 1px 5px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 650;
  color: #274b74;
}

textarea,
input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #b7d0f2;
  background: #f7fbff;
  color: #14395e;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 0.93rem;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: #5a9eff;
  box-shadow: 0 0 0 4px var(--focus);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

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

.examples-row {
  margin-top: 12px;
}

.examples-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.examples-controls select {
  flex: 1 1 auto;
  min-height: 44px;
}

.secondary-btn {
  margin-top: 0;
  width: auto;
  min-height: 44px;
  border-radius: 12px;
  padding: 11px 14px;
  box-shadow: none;
  background: #e6f1ff;
  color: #1f538f;
  border: 1px solid #bfd8f8;
}

.secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(79, 142, 224, 0.2);
  background: #dcedff;
}

details {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #a5c6ef;
  background: #f3f9ff;
}

summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.92rem;
  color: #28548b;
}

summary::marker {
  content: "▸  ";
}

details[open] summary::marker {
  content: "▾  ";
}

ul {
  margin: 10px 0 0 18px;
  padding: 0;
}

li {
  margin-bottom: 6px;
  line-height: 1.35;
  color: #43658f;
}

button {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--accent), var(--accent-alt));
  color: var(--accent-ink);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 11px 22px rgba(47, 127, 248, 0.24);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 28px rgba(47, 127, 248, 0.3);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.result-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.result-header {
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 8px 14px;
}

.result-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #174a84;
}

#status {
  margin: 6px 0 0;
  color: var(--muted);
}

.results {
  padding: 14px 8px 8px;
  overflow: visible;
}

.results.empty {
  color: #587aa4;
}

.step {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fcfeff;
  animation: rise 280ms ease;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #204f85;
}

.math-line {
  margin: 7px 0;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--math-bg);
  border: 1px solid #d7e7fb;
  overflow-x: auto;
}

.info-line {
  font-family: var(--mono);
  font-size: 0.87rem;
  margin: 6px 0;
  color: #32527c;
}

.warning {
  margin-top: 8px;
  color: #8a3f19;
  font-size: 0.9rem;
  background: #fff1e9;
  border: 1px solid #ffd7c2;
  border-radius: 10px;
  padding: 8px 10px;
}

.dependency-note {
  margin-top: 8px;
  font-size: 0.9rem;
  color: inherit;
}

.report-actions-outside {
  margin-top: 4px;
  margin-bottom: 8px;
}

.report-btn {
  margin-top: 0;
  width: auto;
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 2px 18px 20px;
}

.site-footer a {
  color: #1f5ea8;
  text-decoration: none;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(0, 11px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .examples-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .secondary-btn {
    width: 100%;
  }
}
