:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
}

body {
  background: #111827;
  color: #f9fafb;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #374151;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.1rem;
}

.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

#status {
  font-size: 0.8rem;
  color: #9ca3af;
}

nav {
  display: flex;
  gap: 0.5rem;
}

button {
  border: 1px solid #4b5563;
  background: #1f2937;
  color: #f9fafb;
  padding: 0.45rem 0.7rem;
  border-radius: 0.45rem;
  cursor: pointer;
}

button:hover {
  background: #374151;
}

#main-content {
  flex: 1;
  min-height: 0;
}

.editor {
  display: flex;
  flex-direction: column;
  height: 45vh;
}

.editor-meta {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #1f2937;
  color: #d1d5db;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  resize: none;
  outline: none;
  padding: 1rem;
  font: 16px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #f9fafb;
  background: #0b1020;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-item {
  border-bottom: 1px solid #1f2937;
}

.list-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.8rem 1rem;
}

.list-item button:hover {
  background: #0b1020;
}

.muted {
  color: #9ca3af;
  font-size: 0.85rem;
}

.error {
  margin: 1rem;
  border: 1px solid #7f1d1d;
  background: #450a0a;
  color: #fecaca;
  border-radius: 0.5rem;
  padding: 0.8rem;
}
