:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #3c7a6e;
  --accent-dark: #2f6258;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.app-topbar {
  margin-bottom: 24px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo-link {
  text-decoration: none;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-link:hover {
  color: var(--accent);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  flex: 1;
}

.tool-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-link {
  padding: 4px 0 6px;
  border-bottom: 2px solid transparent;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
}

.tool-link:hover {
  color: var(--accent);
}

.tool-link.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.vibecoder-link {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.vibecoder-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

h2 {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  margin: 18px 0 10px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(360px, 40%) minmax(480px, 60%);
  gap: 24px;
  align-items: start;
}

.left-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.right-panel {
  display: grid;
  gap: 18px;
}

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

.form-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.field-label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

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

input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
}

input[type="url"],
input[type="number"],
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #d1d5db;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.link-btn:focus-visible,
.link-subtle:focus-visible,
.btn-outline:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(60, 122, 110, 0.18);
}

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

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.files-count {
  font-size: 13px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  color: #374151;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-help {
  margin-top: 4px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fafafa;
}

.files-help p {
  margin: 0 0 6px;
  color: var(--text);
}

.files-help ul {
  margin: 0;
  padding-left: 18px;
}

.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: #fbfbfc;
}

.accordion > summary {
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.accordion > summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.accordion[open] > summary::after {
  content: "▴";
}

.prompt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.prompt-row h3 {
  margin: 0;
  font-size: 14px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-outline {
  border-radius: 12px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-secondary,
.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover,
.btn-outline:hover,
.btn-tertiary:hover {
  border-color: #cbd5e1;
  background: #fafafa;
}

.btn-tertiary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.link-btn,
.link-subtle {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  width: fit-content;
}

.link-subtle {
  font-size: 13px;
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.progress-track {
  width: 100%;
  height: 9px;
  background: #eceff3;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

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

.step-list {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-list li {
  font-size: 12px;
  color: #9ca3af;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px 8px;
}

.step-list li.active {
  color: #fff;
  background: var(--accent);
}

.empty-inline,
.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--muted);
  font-size: 15px;
  background: #fafafa;
}

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

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

.report-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tab-btn {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
  font-size: 14px;
}

.tab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #f5faf9;
}

.tab-panel {
  margin-bottom: 10px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  background: #fcfcfd;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  padding: 12px;
  color: #1f2937;
  line-height: 1.55;
}

.errors {
  margin-bottom: 10px;
  background: #fff2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 8px 12px;
  color: #991b1b;
}

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

.page-card {
  border: 1px solid #edf0f2;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.page-card h4 {
  margin: 0 0 6px;
}

.page-card p {
  margin: 6px 0;
  color: #374151;
}

.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1199px) {
  .layout-grid {
    grid-template-columns: minmax(340px, 45%) minmax(420px, 55%);
  }

  .left-panel {
    position: static;
    max-height: none;
  }
}

.help-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.help-icon-btn:hover {
  border-color: #cbd5e1;
  color: var(--text);
  background: #fafafa;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.24);
  border: 1px solid #e5e7eb;
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  font-size: 18px;
  font-weight: 600;
}

.modal-text {
  margin: 10px 0 0;
  color: #374151;
  line-height: 1.55;
}

@media (max-width: 767px) {
  .page {
    padding: 14px;
  }

  .app-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }

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

  .actions-row,
  .report-actions,
  .upload-row,
  .tool-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-secondary,
  .btn-outline,
  .btn-tertiary,
  .actions-row a,
  .actions-row button,
  .report-actions button,
  .upload-row button,
  .tool-link,
  .vibecoder-link {
    width: 100%;
  }

  .report-header {
    flex-direction: column;
    align-items: stretch;
  }
}
