:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --muted: #8b949e;
  --link: #58a6ff;
  --accent: #238636;
  --danger: #f85149;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(1200px 700px at 20% -5%, #1d2530, #0d1117 45%);
  color: var(--text);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.95);
  position: sticky;
  top: 0;
}

.brand { font-weight: 700; letter-spacing: 0.3px; }
.nav { display: flex; gap: 0.65rem; justify-content: center; flex-wrap: wrap; }
.nav a { color: var(--link); text-decoration: none; font-size: 0.95rem; }
.user { text-align: right; }

.container { width: min(1120px, 94vw); margin: 1rem auto 2rem; }
.quick-add-top-nav {
  margin-bottom: 0.9rem;
}
.quick-add-help {
  margin-top: 0.4rem;
}
.app-footer {
  border-top: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.95);
}
.footer-inner {
  margin: 0 auto;
  padding: 0.65rem 0;
  display: flex;
  justify-content: flex-end;
}

.panel {
  background: linear-gradient(180deg, #161b22, #11161d);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.project-actions-panel {
  padding: 1.25rem;
}

.narrow { width: min(540px, 100%); margin: 1rem auto; }

h1, h2, h3 { margin: 0 0 0.7rem; line-height: 1.2; }
h1 { font-size: clamp(1.35rem, 2.1vw, 1.8rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.04rem; }

a { color: var(--link); }

.stack { display: grid; gap: 0.7rem; }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.end { justify-content: flex-end; }

input, textarea, select {
  width: 100%;
  margin-top: 0.35rem;
  background: #0d1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.62rem;
  font-size: 0.96rem;
}

textarea { resize: vertical; min-height: 90px; }

.button {
  display: inline-block;
  text-decoration: none;
  border: 1px solid rgba(240, 246, 252, 0.12);
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 0.5rem 0.78rem;
  cursor: pointer;
  font-weight: 600;
}
.button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.button.secondary {
  background: #21262d;
  color: var(--text);
}

.button.danger {
  background: var(--danger);
  color: #fff;
  border-color: rgba(240, 246, 252, 0.12);
}

.button.small { padding: 0.35rem 0.55rem; font-size: 0.86rem; }
.icon-btn {
  min-width: 2rem;
  text-align: center;
  padding: 0.35rem 0.55rem;
}
.rec-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.rec-dot {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  background: #8b949e;
  border: 1px solid rgba(240, 246, 252, 0.2);
  display: inline-block;
}
.rec-dot.active {
  background: #f85149;
  box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.2);
}
.rec-label {
  white-space: nowrap;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: #0d1117;
}
.toggle-row.compact {
  padding: 0.3rem 0.5rem;
  gap: 0.6rem;
  border-radius: 999px;
}
.toggle-row.compact span:first-child {
  font-size: 0.83rem;
  color: var(--muted);
}
.toggle-switch-wrap {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-flex;
  align-items: center;
}
.toggle-switch-wrap input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}
.toggle-switch {
  width: 44px;
  height: 24px;
  background: #30363d;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}
.toggle-switch::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9d1d9;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}
.toggle-switch-wrap input:checked + .toggle-switch {
  background: var(--accent);
}
.toggle-switch-wrap input:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.list-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem;
  display: grid;
  gap: 0.5rem;
}

.grid { display: grid; gap: 0.65rem; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 0.65rem; }
#audioMeter {
  width: min(100%, 520px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1117;
}

.badge, .status {
  border: 1px solid var(--border);
  background: #21262d;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
}

.markdown p { margin: 0.2rem 0 0.6rem; }
.markdown pre, .markdown code { background: #0d1117; border-radius: 5px; }
.note { border: 1px solid var(--border); border-radius: 9px; padding: 0.7rem; margin-bottom: 0.7rem; }

.muted { color: var(--muted); }
.tiny { color: var(--muted); font-size: 0.83rem; }
.warning { color: #ffb86a; }
.success { color: #3fb950; min-height: 1.1rem; }

@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr; text-align: center; }
  .user { text-align: center; }
}
