:root {
  --bg-1: #fff7ef;
  --bg-2: #f5fff8;
  --bg-3: #f1f8ff;
  --card: rgba(255, 255, 255, 0.92);
  --text: #2f2a3d;
  --muted: #6f6a7d;
  --line: #e6e2ef;
  --primary: #ff7f9f;
  --primary-2: #7fd6c2;
  --accent: #88b5ff;
  --danger: #dc4f7a;
  --shadow: 0 12px 32px rgba(88, 98, 130, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 183, 204, 0.42), transparent 35%),
    radial-gradient(circle at 88% 18%, rgba(138, 237, 209, 0.35), transparent 40%),
    radial-gradient(circle at 70% 88%, rgba(157, 194, 255, 0.26), transparent 40%),
    linear-gradient(145deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  min-height: 100vh;
  position: relative;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  filter: blur(6px);
  opacity: 0.34;
  pointer-events: none;
}

.bg-shape-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(145deg, #ff9db6, #ffd5a6);
  top: -120px;
  right: -70px;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  background: linear-gradient(145deg, #87d8c7, #a7c8ff);
  bottom: -120px;
  left: -90px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(230, 226, 239, 0.9);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.2px;
  color: #4e4865;
}

.nav-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.nav-links a,
.button-link {
  text-decoration: none;
  color: #2c2a38;
  background: linear-gradient(135deg, #ffd6e3, #c8f5ea);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(124, 110, 154, 0.14);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 16px auto;
  padding: 0 14px 26px;
  display: grid;
  gap: 12px;
  animation: fadeIn 0.45s ease-out;
}

.card {
  background: var(--card);
  border: 1px solid rgba(230, 226, 239, 0.95);
  border-radius: 18px;
  padding: 15px;
  box-shadow: var(--shadow);
}

.narrow-card {
  max-width: 520px;
}

h2 {
  margin: 0 0 8px;
  color: #564f75;
  font-size: 18px;
}

p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.result-line {
  font-size: 17px;
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.alert-success {
  border: 1px solid #bfe9dc;
  background: #eefcf6;
  color: #0d7356;
}

.alert-error {
  border: 1px solid #f6bed1;
  background: #fff0f5;
  color: #ab2c58;
}

.form-grid {
  display: grid;
  gap: 8px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wrap-form {
  flex-wrap: wrap;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.checkbox-item {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff, #f7faff);
  border: 1px solid var(--line);
}

input,
select,
button,
textarea {
  border: 1px solid #d7d0e5;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

button {
  cursor: pointer;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

button:hover {
  filter: brightness(0.98);
}

.danger {
  background: linear-gradient(135deg, #eb6a90, var(--danger));
}

.danger-form {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 9px 7px;
  vertical-align: top;
}

thead th {
  background: linear-gradient(135deg, #fef5fb, #f4fbff);
  color: #5f587c;
  position: sticky;
  top: 54px;
  z-index: 2;
}

.json-preview {
  margin: 0;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.4;
  background: #faf9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  max-width: 320px;
}

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

@media (max-width: 768px) {
  .topbar-inner {
    padding: 10px 12px;
  }

  .brand {
    font-size: 17px;
  }

  .nav-links a {
    font-size: 12px;
    padding: 6px 10px;
  }

  th,
  td {
    font-size: 12px;
    padding: 7px 5px;
  }

  .inline-form {
    flex-wrap: wrap;
  }

  thead th {
    top: 48px;
  }
}
