/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0f14;
  --surface:     #111827;
  --surface-alt: #1a2233;
  --border:      #1f2d40;
  --primary:     #10d98e;
  --primary-dim: #0b9e68;
  --accent:      #f59e0b;
  --error:       #ef4444;
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --font-sans:   'Segoe UI', system-ui, sans-serif;
  --font-mono:   'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --radius:      8px;
  --radius-sm:   4px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--primary);
  font-weight: 700;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  height: calc(100vh - 54px);
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; height: auto; }
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.panel {
  padding: 24px;
  overflow-y: auto;
}

.form-panel {
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.result-panel {
  background: var(--bg);
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.req { color: var(--error); }

input, textarea {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  transition: border-color 0.15s;
  resize: vertical;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

textarea[id="stackTrace"],
textarea[id="code"] {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: #0a0f14;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover  { background: #0cf8a5; }
.btn-primary:active { background: var(--primary-dim); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-copy {
  margin-top: 8px;
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-copy:hover { border-color: var(--primary); color: var(--primary); }

/* ── Error ───────────────────────────────────────────────────────────────── */
.error-msg {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 12px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 12px;
  color: var(--text-muted);
  padding: 40px;
}

.empty-icon {
  font-family: var(--font-mono);
  font-size: 48px;
  color: var(--border);
  line-height: 1;
}

.empty-sub { font-size: 12px; max-width: 320px; }

/* ── Result blocks ───────────────────────────────────────────────────────── */
.result-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.result-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: var(--primary);
  color: #0a0f14;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

.result-text {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

/* ── Fix plan list ───────────────────────────────────────────────────────── */
.fix-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fix-list li {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.fix-list li::marker { color: var(--primary); font-weight: 700; }

/* ── Code block ──────────────────────────────────────────────────────────── */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── Memory list ─────────────────────────────────────────────────────────── */
.memory-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.memory-item strong { color: var(--accent); display: block; margin-bottom: 2px; }

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  background: rgba(16, 217, 142, 0.1);
  border: 1px solid var(--primary-dim);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
