/* ── Layout ───────────────────────────────────────────────────────────────── */
.editor-shell {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 57px);
  padding-top: 57px; /* nav height */
}

/* ── Shared panel chrome ─────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.panel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.panel-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}
.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Author panel ────────────────────────────────────────────────────────── */
.author-panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: calc(100vh - 57px);
  position: sticky;
  top: 57px;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.form-group-body {
  flex: 1;
  min-height: 140px;
}
.form-group-body .field-textarea {
  flex: 1;
  min-height: 120px;
  resize: vertical;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field-hint {
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0;
  text-transform: none;
}

.field-input {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field-textarea {
  display: flex;
  flex-direction: column;
  resize: vertical;
  line-height: 1.6;
}

/* ── Edges ───────────────────────────────────────────────────────────────── */
.edges-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.edge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  gap: 8px;
}
.edge-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--code-str);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edge-remove {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.edge-remove:hover { color: #f87171; }

.edge-adder {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #00f0c0;
  box-shadow: 0 0 12px rgba(0,212,170,0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* ── Preview panel ───────────────────────────────────────────────────────── */
.preview-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 40px;
}

.proj-block {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.proj-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.proj-hint {
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
}

.proj-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

/* Index meta row */
.index-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Size bar */
.size-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
}
.size-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.size-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
  max-width: 100%;
}
.size-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
}
.toast-visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-error {
  border-color: #f87171;
  color: #f87171;
}

/* ── Nav updates (from landing) ──────────────────────────────────────────── */
.nav-logo-link {
  text-decoration: none;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--accent); }