/* App shell */
#app {
  display: flex; flex-direction: column;
  height: 100vh; max-width: 480px; margin: 0 auto;
  position: relative;
}

/* Bottom nav */
#nav {
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--text-dim); font-size: 11px; font-weight: 500;
  transition: color .15s; cursor: pointer;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent); }

/* Screen container */
.screen {
  flex: 1; overflow-y: auto; padding: 16px 16px 8px;
  display: flex; flex-direction: column;
}
.screen-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-shrink: 0;
}
.screen-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

/* ── RECORD SCREEN ── */
#capture-methods {
  display: flex; gap: 10px; margin-bottom: 20px;
}
.capture-method {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); font-size: 12px; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.capture-method svg { width: 26px; height: 26px; }
.capture-method.active, .capture-method:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(245,158,11,.07);
}

/* Record button */
#record-btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; transition: all .2s; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(245,158,11,.4);
}
#record-btn.recording {
  background: var(--red);
  animation: pulse-ring 1.2s ease infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  70%  { box-shadow: 0 0 0 16px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
#record-btn svg { width: 32px; height: 32px; }

#record-area { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#record-status { font-size: 13px; color: var(--text-muted); }
#transcript-preview {
  width: 100%; font-size: 14px; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; min-height: 60px;
  font-style: italic; display: none;
}

/* AI enrichment result */
#enrichment-result {
  background: var(--surface); border: 1px solid var(--accent-dim);
  border-radius: var(--radius); padding: 16px; display: none;
}
#enrichment-result .enrich-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px;
}
#enrich-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
#enrich-meta  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
#enrich-details { font-size: 14px; color: var(--text-muted); }

/* Photo preview */
#photo-preview { display: none; position: relative; }
#photo-preview img { width: 100%; border-radius: var(--radius); max-height: 200px; object-fit: cover; }
#photo-remove {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.6); border-radius: 50%; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* ── MANAGE SCREEN ── */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 16px; flex-shrink: 0;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.capture-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  transition: border-color .15s;
}
.capture-card:hover { border-color: var(--accent-dim); }
.capture-card.done { opacity: .5; }

.capture-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.capture-card-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.capture-card-meta  {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.capture-card-body  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.capture-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.capture-time { font-size: 12px; color: var(--text-dim); }

/* Edit panel inside modal */
.edit-section { margin-bottom: 18px; }
.edit-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 10px;
}

/* Route buttons */
.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  font-size: 13px; color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.route-btn:hover { border-color: var(--accent); color: var(--accent); }
.route-btn svg { width: 22px; height: 22px; }

/* ── ASK SCREEN ── */
#ask-input-area {
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 0; flex-shrink: 0;
}
#ask-input { flex: 1; min-height: 44px; max-height: 120px; }
#ask-send {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--accent); color: #000; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
#ask-send:hover { background: #d97706; }
#ask-send svg { width: 20px; height: 20px; }

.ask-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }

.msg {
  max-width: 85%; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.5;
}
.msg-user {
  align-self: flex-end;
  background: var(--accent); color: #000; border-bottom-right-radius: 4px;
}
.msg-ai {
  align-self: flex-start;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg-ai .msg-sources {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.msg-source-item {
  padding: 6px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.msg-source-item:last-child { border-bottom: none; }
.msg-source-item:hover { color: var(--accent); }

/* Quick prompts */
.quick-prompts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.quick-prompt {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-muted); cursor: pointer; text-align: left;
  transition: all .15s;
}
.quick-prompt:hover { border-color: var(--accent); color: var(--text); }
.quick-prompt-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }

/* Empty state */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: var(--text-muted); text-align: center; padding: 40px;
}
.empty-state svg { width: 48px; height: 48px; opacity: .3; }
.empty-state p { font-size: 14px; }
