:root {
  color-scheme: dark;
  --bg: #07111a;
  --panel: rgba(12, 24, 36, 0.9);
  --panel-strong: rgba(16, 32, 48, 0.98);
  --border: rgba(120, 150, 176, 0.2);
  --text: #e5f1ff;
  --muted: #93abc3;
  --accent: #5eead4;
  --accent-strong: #14b8a6;
  --danger: #fda4af;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(96, 165, 250, 0.14), transparent 28%),
    linear-gradient(160deg, #030712, #07111a 45%, #0b1726 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 40px 28px;
  border-right: 1px solid var(--border);
  background: rgba(3, 10, 18, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 32px;
}

.content {
  padding: 40px;
  display: grid;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.intro,
.panel-copy {
  color: var(--muted);
  line-height: 1.6;
}

.tool-menu {
  display: grid;
  gap: 12px;
}

.tool-button {
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(17, 34, 51, 0.6);
  color: var(--text);
  text-align: left;
  padding: 16px 18px;
  cursor: pointer;
  transition: 180ms ease;
}

.tool-button:hover,
.tool-button.active {
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(18, 44, 62, 0.96);
  transform: translateY(-1px);
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.tool-form {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.tool-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.tool-form input,
.tool-form select,
.tool-form textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7, 17, 26, 0.95);
  color: var(--text);
  padding: 14px 16px;
}

.tool-form input:focus,
.tool-form select:focus,
.tool-form textarea:focus {
  outline: 2px solid rgba(94, 234, 212, 0.45);
  border-color: rgba(94, 234, 212, 0.6);
}

.tool-form textarea {
  resize: vertical;
  min-height: 240px;
}

.tool-form button {
  width: fit-content;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #06211e;
  font-weight: 700;
  cursor: pointer;
}

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

.secondary-button {
  background: rgba(17, 34, 51, 0.9);
  color: var(--text);
  border: 1px solid rgba(94, 234, 212, 0.28);
}

.prefill-button {
  width: auto;
}

.result-card {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  min-height: 180px;
  overflow: auto;
}

.result-card.empty {
  color: var(--muted);
}

.result-card.error {
  border-color: rgba(253, 164, 175, 0.45);
  color: #ffe4e6;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.meta-item {
  background: rgba(7, 17, 26, 0.86);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}

.meta-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

pre {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 16px;
  background: #02060d;
  border: 1px solid rgba(148, 163, 184, 0.15);
  white-space: pre-wrap;
  word-break: break-word;
}

.record-block {
  margin-top: 16px;
}

.record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-block h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.copy-button {
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  background: rgba(10, 28, 42, 0.9);
  color: var(--text);
  padding: 8px 14px;
  cursor: pointer;
  transition: 180ms ease;
}

.copy-button:hover,
.copy-button.copied {
  border-color: rgba(94, 234, 212, 0.55);
  background: rgba(18, 44, 62, 0.96);
}

.record-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: 20px;
  }

  .panel-header {
    align-items: start;
    flex-direction: column;
  }
}
