:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #273449;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-fg: #082f49;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.brand:hover { text-decoration: none; }

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
}

.btn:hover { border-color: var(--primary); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: transparent;
}
.btn-primary:hover { opacity: 0.92; border-color: transparent; }

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
}

.btn-sm { padding: 6px 10px; font-size: 0.8rem; border-radius: 8px; }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
}
.textarea { resize: vertical; min-height: 76px; }

.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.muted { color: var(--muted); font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.badge-warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.5);
  color: var(--warning);
}

.badge-ok {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--success);
}

.badge-err {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
}

.flash {
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--text);
  font-size: 0.9rem;
}

.flash-err {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--danger);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}

.tab.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: transparent;
}
.tab:hover { text-decoration: none; }

.idea-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  color: var(--text);
  transition: border-color 0.15s;
}
.idea-card:hover { border-color: var(--primary); text-decoration: none; }

.capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 600px) {
  .capture-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.capture-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.capture-btn:hover { border-color: var(--primary); }
.capture-btn.recording {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.14);
  color: var(--danger);
}

.capture-icon { font-size: 1.35rem; line-height: 1; }

.media-img {
  max-width: 100%;
  max-height: 460px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin-top: 8px;
}

.media-video {
  width: 100%;
  max-height: 440px;
  border-radius: 10px;
  background: #000;
  margin-top: 8px;
}

.media-audio {
  width: 100%;
  margin-top: 8px;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  font-weight: 700;
  font-size: 0.96rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.hidden { display: none !important; }
