/*
 * Radar — Consulting Intelligence Tool
 * Dark theme with warm gold accent
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #14141e;
  --bg-raised: #1a1a26;
  --bg-surface: #20202e;
  --bg-hover: #26263a;
  --border: #2a2a3e;
  --border-light: #222232;

  --text: #d4d0cc;
  --text-sec: #9a9690;
  --text-muted: #6a6662;

  --gold: #c49362;
  --gold-dim: rgba(196, 147, 98, 0.15);
  --gold-hover: #d4a372;

  --red: #e05a52;
  --red-dim: rgba(224, 90, 82, 0.12);
  --green: #5caa6f;
  --green-dim: rgba(92, 170, 111, 0.12);
  --blue: #5c8fd4;
  --purple: #9382dc;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ── Layout ─────────────────────────────────────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg-raised);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-light);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--gold);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.brand-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-sec);
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--gold-dim);
  color: var(--gold);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-count {
  margin-left: auto;
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--gold-dim);
  color: var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.logout-link {
  font-size: 12px;
  color: var(--text-muted);
}

.content {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.header-action {
  margin-left: auto;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-sec);
  padding: 8px;
  cursor: pointer;
}

.menu-toggle svg { width: 20px; height: 20px; }

.content-body {
  flex: 1;
  padding: 24px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

/* ── Mobile Tabs ────────────────────────────────────────────────────────── */

.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-light);
  z-index: 100;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.mobile-tabs .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.mobile-tabs .tab.active { color: var(--gold); }
.mobile-tabs .tab svg { width: 20px; height: 20px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: #fff;
}
.btn-primary:hover { background: var(--gold-hover); color: #fff; }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-sec);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-dim); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.optional {
  font-weight: 400;
  text-transform: none;
  color: var(--text-muted);
}

input[type="text"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

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

/* ── Login ──────────────────────────────────────────────────────────────── */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 360px;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-form {
  background: var(--bg-raised);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.login-error {
  background: var(--red-dim);
  color: var(--red);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Capture ────────────────────────────────────────────────────────────── */

.capture-container {
  max-width: 500px;
  margin: 0 auto;
}

.capture-form {
  background: var(--bg-raised);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.capture-url-input {
  font-size: 16px;
  padding: 14px;
}

.title-input-wrap {
  display: flex;
  gap: 8px;
}

.title-input-wrap input { flex: 1; }

.capture-success {
  text-align: center;
  padding: 48px 24px;
}

.success-icon {
  color: var(--green);
  margin-bottom: 16px;
}

.success-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ── Story Cards ────────────────────────────────────────────────────────── */

.story-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
  cursor: pointer;
}

.story-card:hover {
  border-color: var(--border);
}

.story-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.story-card-title {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.story-card-source {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.story-card-note {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.story-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* ── Tags ───────────────────────────────────────────────────────────────── */

.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-surface);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec);
}

.tag-pill[style*="--tag-color"] {
  background: color-mix(in srgb, var(--tag-color) 15%, transparent);
  color: var(--tag-color);
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-checkbox {
  cursor: pointer;
}

.tag-checkbox input {
  display: none;
}

.tag-checkbox input:checked + .tag-pill {
  background: var(--gold-dim);
  color: var(--gold);
}

/* ── Status Toggle ──────────────────────────────────────────────────────── */

.status-toggle {
  display: flex;
  gap: 8px;
}

.radio-pill {
  cursor: pointer;
}

.radio-pill input { display: none; }

.radio-pill span {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-sec);
  transition: all 0.15s;
}

.radio-pill input:checked + span {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Curate ─────────────────────────────────────────────────────────────── */

.curate-container {
  max-width: 700px;
}

.curate-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
}

.curate-url {
  display: flex;
  align-items: center;
  gap: 4px;
}

.curate-date {
  color: var(--text-muted);
}

.curate-quick-note {
  background: var(--bg-raised);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border-left: 3px solid var(--gold);
}

.curate-quick-note label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.curate-quick-note p {
  color: var(--text-sec);
  font-size: 13px;
}

.curate-form {
  background: var(--bg-raised);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.curate-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.curate-actions .btn-danger {
  margin-left: auto;
}

/* ── Story Detail ───────────────────────────────────────────────────────── */

.story-detail {
  max-width: 700px;
}

.story-header {
  margin-bottom: 20px;
}

.story-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.story-source {
  display: flex;
  align-items: center;
  gap: 4px;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.story-section {
  margin-bottom: 24px;
}

.story-section h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.story-content {
  color: var(--text-sec);
  line-height: 1.7;
}

.story-quotes blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--text-sec);
  font-style: italic;
}

.story-actions {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  margin-top: 32px;
}

/* ── Stats ──────────────────────────────────────────────────────────────── */

.inbox-stats {
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.stat-loading {
  color: var(--text-muted);
}

/* ── Empty & Loading States ─────────────────────────────────────────────── */

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  margin-bottom: 20px;
}

/* ── Toast Notifications ────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}

.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ── Library Filters ────────────────────────────────────────────────────── */

.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-input {
  width: 200px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* ── Cards & Sources ────────────────────────────────────────────────────── */

.inbox-section {
  margin-bottom: 32px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 12px;
}

.section-title svg {
  opacity: 0.6;
}

.section-count {
  font-weight: 400;
  color: var(--text-muted);
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-item {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.source-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-link a {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.source-domain {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.source-title {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-contributor {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 500;
  flex-shrink: 0;
}

.contributor-sara { background: var(--gold-dim); color: var(--gold); }
.contributor-project-claude { background: rgba(147, 130, 220, 0.15); color: var(--purple); }
.contributor-claude-code { background: rgba(92, 143, 212, 0.15); color: var(--blue); }

.source-date {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

.source-annotation {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 10px;
  border-left: 2px solid var(--border-light);
  margin-top: 4px;
  line-height: 1.4;
}

.source-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-item {
  display: block;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.card-item:hover {
  border-color: var(--border);
}

.card-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.card-item-title {
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.card-item-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-item-summary {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag-sm {
  font-size: 10px;
  padding: 2px 8px;
}

.card-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.library-card {
  padding: 16px 20px;
}

.empty-text {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.new-card-input {
  display: flex;
  gap: 8px;
}

.new-card-input input {
  flex: 1;
}

.divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border-light);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.card-select-list {
  max-height: 200px;
  overflow-y: auto;
}

.card-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: left;
  color: var(--text);
}

.card-select-item:hover {
  border-color: var(--gold);
}

/* ── Card Assignment (Capture) ─────────────────────────────────────────── */

.card-assignment select {
  cursor: pointer;
}

.new-card-inline {
  margin-top: 8px;
}

/* ── Card Status & Confidence ──────────────────────────────────────────── */

.card-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-inbox { background: var(--bg-surface); color: var(--text-muted); }
.status-curated { background: var(--green-dim); color: var(--green); }
.status-archived { background: var(--bg-surface); color: var(--text-muted); }

.confidence-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}

.confidence-speculation { background: rgba(224, 90, 82, 0.12); color: var(--red); }
.confidence-developing { background: rgba(212, 149, 92, 0.15); color: #d4955c; }
.confidence-likely { background: rgba(92, 143, 212, 0.15); color: var(--blue); }
.confidence-confirmed { background: var(--green-dim); color: var(--green); }

/* ── Card Detail ───────────────────────────────────────────────────────── */

.card-detail {
  max-width: 800px;
}

.card-header {
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.card-date {
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.card-section {
  margin-bottom: 24px;
}

.card-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.card-section h3 svg {
  opacity: 0.6;
}

.card-content {
  color: var(--text-sec);
  line-height: 1.7;
  white-space: pre-wrap;
}

.card-list-content {
  white-space: pre-wrap;
}

.sources-section .source-list {
  gap: 4px;
}

.sources-section .source-item {
  padding: 8px 12px;
}

.related-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.related-card-link:hover {
  background: var(--bg-hover);
}

.card-actions {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  margin-top: 32px;
}

/* ── Card Edit ─────────────────────────────────────────────────────────── */

.card-edit-container {
  max-width: 800px;
}

.card-edit-form {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.form-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
  border-bottom: none;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.confidence-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.confidence-toggle .radio-pill span {
  padding: 5px 10px;
  font-size: 11px;
}

.sources-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.source-edit-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.source-edit-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.source-url-link {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-remove {
  flex-shrink: 0;
}

.source-annotation-input {
  min-height: 60px;
  font-size: 13px;
}

.add-source-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.add-source-form input,
.add-source-form textarea {
  margin-bottom: 8px;
}

.add-source-actions {
  display: flex;
  gap: 8px;
}

.related-cards-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.related-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.related-card-title {
  font-size: 13px;
}

.related-remove {
  font-size: 16px;
}

.related-card-select {
  cursor: pointer;
}

.card-edit-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
}

.card-edit-actions .btn-danger {
  margin-left: auto;
}

/* ── Inbox Stats ───────────────────────────────────────────────────────── */

.inbox-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.inbox-stats .stat {
  font-size: 13px;
  color: var(--text-muted);
}

.inbox-stats .stat strong {
  color: var(--text);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .content {
    margin-left: 0;
  }

  .content-body {
    padding: 16px;
    padding-bottom: 100px;
  }

  .menu-toggle {
    display: block;
  }

  .mobile-tabs {
    display: flex;
  }

  .capture-form {
    padding: 16px;
  }

  .story-card-actions {
    flex-wrap: wrap;
  }

  .curate-actions {
    flex-wrap: wrap;
  }

  .curate-actions .btn-danger {
    margin-left: 0;
    width: 100%;
    margin-top: 8px;
  }

  .library-filters {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }
}
