:root {
  color-scheme: light dark;
  --bg: #f7f6f4;
  --card-bg: #ffffff;
  --border: #e7e5e4;
  --text: #1c1917;
  --text-muted: #78716c;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --danger: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --card-bg: #211f1a;
    --border: #34302a;
    --text: #f2f0ec;
    --text-muted: #a8a29e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.login-page {
  max-width: 360px;
  padding-top: 6rem;
}

h1 { font-size: 1.5rem; margin: 0 0 0.25rem; }
.subtitle { color: var(--text-muted); font-size: 0.875rem; margin: 0 0 2rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.375rem; }

input, textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}

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

button {
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border: none; }
.btn-icon { background: transparent; border: none; color: var(--text-muted); padding: 0.3rem; }
.btn-icon:hover { color: var(--text); }

.top-bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.category-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 1.5rem 0 0.5rem; }
.entry-question { font-weight: 600; margin: 0 0 0.35rem; }
.entry-answer { color: var(--text-muted); font-size: 0.85rem; white-space: pre-wrap; margin: 0; }
.entry-row { display: flex; justify-content: space-between; gap: 0.75rem; }
.entry-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 999px; margin-top: 0.5rem; }
.badge-warn { background: rgba(217, 119, 6, 0.12); color: #b45309; }

.notice {
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: #0f766e;
  font-size: 0.8rem;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal { background: var(--card-bg); border-radius: 10px; padding: 1.5rem; width: 100%; max-width: 480px; }
.modal h2 { font-size: 0.95rem; margin: 0 0 1rem; }
.field { margin-bottom: 0.85rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.checkbox-row input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.hidden { display: none !important; }
.error-text { color: var(--danger); font-size: 0.8rem; margin-top: 0.5rem; min-height: 1em; }
.empty-state { color: var(--text-muted); font-size: 0.875rem; }
