:root {
  --bg0: #f7f7f8;
  --bg1: #eef1f4;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.7);
  --faint: rgba(15, 23, 42, 0.5);
  --accent: #10a37f;
  --accent-2: #0ea5a4;
  --danger: #e11d48;
  --ring: rgba(16, 163, 127, 0.35);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --font-display: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 620px at 12% -10%, rgba(16, 163, 127, 0.08), transparent 60%),
    radial-gradient(900px 520px at 92% 12%, rgba(59, 130, 246, 0.08), transparent 65%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(15, 23, 42, 0.03),
      rgba(15, 23, 42, 0.03) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.25;
  pointer-events: none;
  mix-blend-mode: soft-light;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 720px at 50% -10%, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0.04));
  pointer-events: none;
  z-index: 0;
}

.header {
  padding: 34px 16px 16px;
  position: relative;
  z-index: 1;
}

.header-inner,
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  margin: 0;
  letter-spacing: -0.02em;
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font-display);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(16, 163, 127, 0.85);
  margin-bottom: 10px;
  font-weight: 600;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
  max-width: 640px;
}

.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 32px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  position: relative;
  z-index: 1;
  min-height: 65vh;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  animation: panelIn 600ms ease both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(16, 163, 127, 0.08),
    rgba(59, 130, 246, 0.06),
    transparent 60%
  );
  opacity: 0.5;
  pointer-events: none;
}

.panel:nth-of-type(2) {
  animation-delay: 120ms;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  max-height: min(52vh, 560px);
  overflow: auto;
  padding: 2px 8px 2px 2px;
}

.sections-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}

.sections-filter input[type="search"] {
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.sections-filter input[type="search"]:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.sections-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.sections-count {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.sections-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 23, 42, 0.15);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  animation: rise 500ms ease both;
}

.section:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 163, 127, 0.35);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.1);
}

.section label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.section-title {
  font-weight: 650;
  line-height: 1.2;
  font-family: var(--font-display);
}

.section-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.section-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-size: 12px;
  color: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
  padding: 4px 8px;
  border-radius: 999px;
}

.pill.accent {
  border-color: rgba(16, 163, 127, 0.35);
  background: rgba(16, 163, 127, 0.12);
}

.pill.warn {
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(225, 29, 72, 0.1);
}

.options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.option.inline {
  justify-content: space-between;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

input[type="number"] {
  width: 80px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

input[type="number"]:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
  border-color: rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(140deg, rgba(16, 163, 127, 0.98), rgba(16, 163, 127, 0.78));
  border-color: rgba(16, 163, 127, 0.6);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(16, 163, 127, 0.18);
}

.btn.primary:hover {
  background: linear-gradient(140deg, rgba(16, 163, 127, 1), rgba(16, 163, 127, 0.85));
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.prompt-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.link {
  color: var(--text);
  text-decoration: none;
}

.prompt {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0.03),
      rgba(15, 23, 42, 0.03) 1px,
      transparent 1px,
      transparent 28px
    ),
    rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 14px;
  line-height: 1.45;
  font-family: var(--font-mono);
  font-size: 13px;
}

.prompt:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.status {
  margin-top: 10px;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}

.footer {
  padding: 14px 16px 22px;
  color: var(--faint);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

.footer-inner p {
  margin: 0 0 0.5em;
}

.footer-inner p:last-child {
  margin-bottom: 0;
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--muted);
}

.footer-credit {
  font-size: 12px;
  color: var(--muted);
}

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

.footer-credit a:hover {
  text-decoration: underline;
}

.sections .section:nth-child(1) { animation-delay: 60ms; }
.sections .section:nth-child(2) { animation-delay: 110ms; }
.sections .section:nth-child(3) { animation-delay: 160ms; }
.sections .section:nth-child(4) { animation-delay: 210ms; }
.sections .section:nth-child(5) { animation-delay: 260ms; }
.sections .section:nth-child(6) { animation-delay: 310ms; }
.sections .section:nth-child(7) { animation-delay: 360ms; }

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

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .section {
    animation: none;
  }
  .btn {
    transition: none;
  }
}

@media (max-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
  .sections {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .prompt {
    min-height: 360px;
  }
}
