:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f5f2;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --added: #b8f3dd;
  --removed: #ffd2cc;
  --changed: #ffeab0;
  --font-display: "Space Grotesk", "Trebuchet MS", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #f0ece7, #f9fafb 45%, #f5f2ee 100%);
  color: var(--ink);
  font-family: var(--font-body);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 4vw 24px;
  align-items: flex-start;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 42px;
  margin: 0 0 8px;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-note {
  max-width: 420px;
  font-size: 14px;
  color: var(--muted);
}

.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 0 4vw 32px;
}


.top-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  align-items: start;
}

.actions-shell {
  min-width: 0;
}

.faq-top-wrap {
  display: flex;
  justify-content: flex-end;
}

.faq-top {
  width: 100%;
  min-width: 360px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 8px 10px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.05);
  overflow-y: auto;
  overflow-x: hidden;
}

.faq-lead {
  margin: 0 0 4px;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--muted);
}

.faq-top h2 {
  margin: 0 0 4px;
  font-size: 13px;
  font-family: var(--font-display);
}

.faq-list {
  margin: 0;
  padding-left: 14px;
  font-size: 10.8px;
  line-height: 1.2;
  color: #374151;
}

.faq-list li {
  margin: 0 0 3px;
}

.faq-list li:last-child {
  margin-bottom: 0;
}

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.06);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  align-items: center;
}

.actions-bar .primary,
.actions-bar .ghost {
  padding: 12px 20px;
  min-width: 150px;
  font-weight: 600;
}

.actions-bar #compare {
  min-width: 180px;
}

.actions-bar .status-card {
  flex: 0 0 auto;
  min-width: 180px;
  max-width: 260px;
  padding: 12px 16px;
  min-height: 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 25px rgba(17, 24, 39, 0.06);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

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

.panel-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-family: var(--font-display);
}

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

.editor {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0;
  height: 100%;
  min-height: 280px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fbfbfb;
}

.line-numbers {
  background: #f3f4f6;
  color: #9ca3af;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 12px 6px;
  text-align: right;
  line-height: 1.5;
  white-space: pre;
  overflow: hidden;
  user-select: none;
}

.code-pane {
  position: relative;
  height: 100%;
  overflow: hidden;
}

textarea,
.json-highlight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 12px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  background: transparent;
  resize: none;
  white-space: pre;
}

textarea {
  color: var(--ink);
  outline: none;
  z-index: 2;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.json-highlight {
  z-index: 1;
  margin: 0;
  pointer-events: none;
  overflow: hidden;
  color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.json-highlight span {
  color: transparent;
}

textarea::-webkit-scrollbar,
.json-highlight::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.json-highlight .diff-added {
  background: var(--added);
}

.json-highlight .diff-removed {
  background: var(--removed);
}

.json-highlight .diff-changed {
  background: var(--changed);
}

.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  background: #fff;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#sync-toggle {
  background: #e7f0ff;
  border-color: #bfd7ff;
  color: #1d4ed8;
}

#sync-toggle:hover {
  border-color: #7aa7ff;
  color: #1e40af;
}

.actions-bar .ghost {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #111827;
}

.actions-bar .ghost:hover {
  border-color: #9ca3af;
  color: #111827;
}

.status-card {
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #4b5563;
}

.status-card.neutral {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #4b5563;
}

.status-card.success {
  background: #e7f8f0;
  border-color: #b7ebd2;
  color: #166534;
}

.status-card.warn {
  background: #fff4e5;
  border-color: #ffd8a8;
  color: #9a3412;
}

.status-title {
  font-weight: 600;
}

.status-details summary {
  cursor: pointer;
  color: inherit;
  font-weight: 600;
}

.status-body {
  margin-top: 6px;
  color: inherit;
  word-break: break-word;
  white-space: pre-wrap;
}

.footer {
  padding: 8px 7vw 10px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.footer-meta {
  text-align: right;
}

.footer-links {
  margin: 6px 0 0;
  color: var(--muted);
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-links a:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}

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

  .top-row {
    grid-template-columns: 1fr;
  }

  .faq-top-wrap {
    justify-content: flex-start;
  }

  .faq-top {
    width: 100%;
    min-width: 100%;
  }
}

@media (max-width: 800px) {
  .hero {
    flex-direction: column;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .actions-bar {
    justify-content: stretch;
  }

  .action-buttons {
    width: 100%;
  }

  .actions-bar .primary,
  .actions-bar .ghost {
    min-width: 100%;
    width: 100%;
  }

  .actions-bar #compare {
    min-width: 100%;
  }

  .actions-bar .status-card {
    width: 100%;
    max-width: 100%;
  }

  .faq-top {
    height: auto;
    max-height: 180px;
  }

  .panel {
    min-height: 320px;
  }

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

  .footer-meta {
    text-align: left;
  }
}
