:root {
  --bg: #f4ede0;
  --paper: #fbf7ec;
  --ink: #2b2418;
  --ink-soft: #6b5e4a;
  --ink-light: #a89876;
  --line: #d6c8a8;
  --line-strong: #b8a780;
  --accent: #8b5a2b;
  --accent-2: #c97b4a;
  --shadow: rgba(60, 50, 35, 0.08);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
textarea, input { font-family: inherit; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }

/* COLOR & TAG PILLS */
.tag {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-right: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.tag:hover { background: var(--accent); color: white; border-color: var(--accent); }
.tag.active { background: var(--accent); color: white; border-color: var(--accent); }

/* APP */
.app { max-width: 900px; margin: 0 auto; padding: 24px; }

/* HEADER */
header { text-align: center; padding: 32px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
header h1 { margin: 0 0 6px; font-size: 30px; font-weight: 400; letter-spacing: 1px; color: var(--ink); }
header .sub { margin: 0; font-style: italic; color: var(--ink-soft); font-size: 14px; }

/* NAV */
nav.tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
nav.tabs button {
  background: transparent; border: 1px solid var(--line-strong); padding: 8px 18px;
  border-radius: 20px; font-size: 13px; color: var(--ink-soft);
  transition: all 0.15s;
}
nav.tabs button:hover { border-color: var(--accent); color: var(--accent); }
nav.tabs button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* SECTIONS */
section.tab { display: none; animation: fadeIn 0.3s ease; }
section.tab.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* CAPTURE FORM */
.capture-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 12px var(--shadow);
  margin-bottom: 24px;
}
.capture-card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 400; color: var(--ink); }
.capture-card .hint { margin: 0 0 16px; font-size: 13px; color: var(--ink-soft); font-style: italic; }
.capture-card textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}
.capture-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1); }
.capture-card .row { display: flex; gap: 12px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.capture-card input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 14px;
}
.capture-card input[type="file"] { font-size: 13px; color: var(--ink-soft); }
.capture-card .submit {
  padding: 10px 22px;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
}
.capture-card .submit:hover { background: var(--accent-2); }
.capture-card .submit:disabled { background: var(--ink-light); cursor: not-allowed; }
.flash {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(139, 90, 43, 0.08);
  border-radius: 6px;
  font-size: 14px;
  color: var(--accent);
  display: none;
}
.flash.show { display: block; }
.flash.error { background: rgba(180, 50, 30, 0.08); color: #b43232; }

/* IDEAS LIST */
.idea-list { display: flex; flex-direction: column; gap: 12px; }
.idea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px var(--shadow);
  cursor: pointer;
  transition: border-left-color 0.15s, transform 0.1s;
  position: relative;
}
.idea:hover { border-left-color: var(--accent); }
.idea.from-screenshot { border-left-color: #6b8aa5; }
.idea.from-clipboard { border-left-color: #8a6ba5; }
.idea.from-voice { border-left-color: #a58a6b; }
.idea.from-cli { border-left-color: #6ba58a; }
.idea .source {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.idea .content {
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--ink);
}
.idea .meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-light);
  align-items: center;
  flex-wrap: wrap;
}
.idea .tags { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.idea .delete {
  background: transparent;
  border: 0;
  color: var(--ink-light);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 8px;
}
.idea .delete:hover { color: #b43232; }

/* CURATOR */
.curator-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 6px var(--shadow);
}
.curator-card h3 { margin: 0 0 10px; font-size: 16px; color: var(--accent); font-weight: 400; }
.curator-card p { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); font-style: italic; }
.pair {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.pair .badge {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 1px 8px;
  color: var(--ink-soft);
}
.pair .shared {
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent);
  font-style: italic;
}
.cluster {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 6px 14px;
  border-radius: 16px;
  margin: 4px 6px 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.cluster:hover { background: var(--accent); color: white; }
.cluster .count {
  background: rgba(255,255,255,0.6);
  padding: 0 6px;
  border-radius: 8px;
  margin-left: 4px;
  font-weight: bold;
}
.cluster:hover .count { background: rgba(255,255,255,0.2); color: white; }

/* RESURFACED */
.resurface {
  background: linear-gradient(180deg, rgba(139,90,43,0.05), transparent);
  border-left: 4px solid var(--accent);
  padding: 14px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.resurface .when { font-size: 11px; color: var(--ink-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.resurface .content { font-size: 14px; line-height: 1.5; margin-bottom: 6px; }
.resurface button {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* SEARCH/FILTER */
.searchbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.searchbar input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 14px;
}
.searchbar input:focus { outline: none; border-color: var(--accent); }
.searchbar .stats { font-size: 13px; color: var(--ink-soft); padding: 8px 0; }

/* EMPTY */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); font-style: italic; }

/* FOOTER */
footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-light);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}

@media (max-width: 600px) {
  .app { padding: 16px; }
  header h1 { font-size: 24px; }
  .capture-card { padding: 16px; }
}
