* {
  box-sizing: border-box;
}
:root {
  --bg: #0f0f12;
  --surface: #18181c;
  --border: #2a2a2e;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
}
body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
.sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}
.main {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 720px;
}
header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.hint {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.context-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.context-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s;
}
.context-item:hover {
  background: rgba(255,255,255,0.04);
}
.context-item.selected {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
}
label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
input, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 100px;
}
.actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
button {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--text-muted);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.tab {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.output {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
}
.output.hidden {
  display: none;
}
.output.empty {
  color: var(--text-muted);
}
.output.loading {
  color: var(--text-muted);
  font-style: italic;
}

/* Add context / voice */
.voice-row {
  margin-bottom: 0.5rem;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.icon-btn.recording {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}
.icon-btn.recording .mic-icon {
  animation: pulse 1s infinite;
}
@keyframes pulse {
  50% { opacity: 0.6; }
}
.suggest-section {
  margin-top: 0.75rem;
}
.suggest-section button {
  margin-bottom: 0.5rem;
}
.suggest-section .path-label {
  margin-top: 0.5rem;
}
.add-context-panel #note-text {
  margin-bottom: 0;
}
.add-context-panel #note-path {
  margin-top: 0.25rem;
}
.add-context-panel #save-note-btn {
  margin-top: 0.75rem;
}
