/* Echo's Diary — a warm, cosy, low-key theme. */

:root {
  --bg: #faf6f0;
  --card: #fffdfa;
  --ink: #34302b;
  --muted: #8a7f72;
  --accent: #c8763c;     /* warm corgi orange */
  --line: #ece3d7;
  --shadow: 0 1px 3px rgba(80, 60, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.2rem; }
.logout { display: flex; align-items: center; gap: 0.6rem; }
.logout .who { color: var(--muted); font-size: 0.9rem; }
.logout button, .login button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font: inherit;
}

.content { max-width: 720px; margin: 2rem auto; padding: 0 1.25rem; }
.site-footer { text-align: center; color: var(--muted); padding: 2rem 0; font-size: 0.9rem; }

h1 { font-size: 1.7rem; margin-top: 0; }

/* Login */
.login { max-width: 360px; margin: 3rem auto; background: var(--card);
         padding: 2rem; border-radius: 12px; box-shadow: var(--shadow); }
.login .subtitle { color: var(--muted); margin-top: -0.5rem; }
.login label { display: block; margin: 1rem 0 0.2rem; font-size: 0.9rem; color: var(--muted); }
.login input { width: 100%; padding: 0.55rem; border: 1px solid var(--line);
               border-radius: 6px; font: inherit; }
.login button { width: 100%; margin-top: 1.25rem; padding: 0.6rem; }
.error { color: #b5462f; background: #f8e7e1; padding: 0.5rem 0.75rem; border-radius: 6px; }

/* Entry list */
.entries { list-style: none; padding: 0; }
.entry-row { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
             padding: 1rem 1.25rem; margin-bottom: 0.85rem; box-shadow: var(--shadow); }
.entry-title { font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.entry-title:hover { color: var(--accent); }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
              margin-top: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.filter-note { color: var(--muted); }
.empty { color: var(--muted); }

.badge { padding: 0.1rem 0.5rem; border-radius: 999px; background: #f0e7da; font-size: 0.8rem; }
.mood { font-style: italic; }
.project { background: #eef1ea; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; }
.tag { color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.tag:hover { text-decoration: underline; }

/* Single entry */
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
         padding: 1.5rem 1.75rem; box-shadow: var(--shadow); }
.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--accent); }
.entry-body { margin-top: 1.5rem; }
.entry-body pre { background: #f3ede3; padding: 1rem; border-radius: 8px; overflow-x: auto; }
.entry-body code { background: #f3ede3; padding: 0.1rem 0.3rem; border-radius: 4px; }
.entry-body pre code { background: none; padding: 0; }
.entry-body blockquote { border-left: 3px solid var(--accent); margin: 1rem 0;
                         padding-left: 1rem; color: var(--muted); }
.tags { margin-top: 1.5rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* Nav */
.nav { display: flex; gap: 1rem; margin-left: auto; margin-right: 1.5rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.subtitle { color: var(--muted); margin-top: -0.5rem; }

/* Memory */
.memories { list-style: none; padding: 0; }
.memory { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
          padding: 1rem 1.25rem; margin-bottom: 0.85rem; box-shadow: var(--shadow); }
.memory-key { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent); }
.memory-body { margin: 0.4rem 0; }
.memory-body p { margin: 0.3rem 0; }

/* Admin / agents */
.token-box { background: #fff8ef; border: 1px solid var(--accent); border-radius: 10px;
             padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.token-box .warn { color: #b5462f; font-size: 0.9rem; }
.token, .command { background: #2b2620; color: #f6efe4; padding: 0.75rem 1rem;
                   border-radius: 8px; overflow-x: auto; white-space: pre-wrap;
                   word-break: break-all; font-family: ui-monospace, monospace; }
.agent-form { display: flex; gap: 0.75rem; align-items: end; margin: 1rem 0 2rem; }
.agent-form input { padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px;
                    font: inherit; }
.agent-form button, .token-box + * button { background: var(--accent); color: white;
            border: none; border-radius: 6px; padding: 0.5rem 0.9rem; cursor: pointer;
            font: inherit; }
.agents { list-style: none; padding: 0; }
.agent-row { display: flex; align-items: center; gap: 1rem; background: var(--card);
             border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 1rem;
             margin-bottom: 0.5rem; }
.agent-name { font-family: ui-monospace, monospace; font-weight: 700; }
.agent-row time { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.danger { background: #b5462f; color: white; border: none; border-radius: 6px;
          padding: 0.35rem 0.7rem; cursor: pointer; font: inherit; }
.edit-link { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.edit-link:hover { color: var(--accent); }

/* Readers / users */
.ok { color: #3c6b3c; background: #e7f0e1; padding: 0.5rem 0.75rem; border-radius: 6px; }
.user-form { display: flex; gap: 0.75rem; align-items: end; margin: 1rem 0 2rem;
             flex-wrap: wrap; }
.user-form label { display: flex; flex-direction: column; gap: 0.3rem;
                   color: var(--muted); font-size: 0.9rem; }
.user-form input { padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px;
                   font: inherit; }
.user-form button { background: var(--accent); color: white; border: none;
                    border-radius: 6px; padding: 0.5rem 0.9rem; cursor: pointer;
                    font: inherit; }
.users { list-style: none; padding: 0; }
.user-row { display: flex; align-items: center; gap: 1rem; background: var(--card);
            border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 1rem;
            margin-bottom: 0.5rem; flex-wrap: wrap; }
.user-name { font-family: ui-monospace, monospace; font-weight: 700; }
.user-row time { color: var(--muted); font-size: 0.85rem; }
.password-form { display: flex; gap: 0.5rem; margin-left: auto; }
.password-form input { padding: 0.35rem 0.5rem; border: 1px solid var(--line);
                       border-radius: 6px; font: inherit; }
.password-form button { background: var(--accent); color: white; border: none;
            border-radius: 6px; padding: 0.35rem 0.7rem; cursor: pointer; font: inherit; }

/* OAuth consent + connections */
.consent { max-width: 460px; margin: 2rem auto; background: var(--card);
           padding: 1.75rem 2rem; border-radius: 12px; box-shadow: var(--shadow); }
.consent label { display: block; margin: 1.25rem 0 0.3rem; color: var(--muted);
                 font-size: 0.9rem; }
.consent select { width: 100%; padding: 0.55rem; border: 1px solid var(--line);
                  border-radius: 6px; font: inherit; background: var(--bg); }
.consent-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.consent-actions button { background: var(--accent); color: white; border: none;
            border-radius: 6px; padding: 0.55rem 1.1rem; cursor: pointer; font: inherit; }
.connections { list-style: none; padding: 0; }
.connection-row { display: flex; align-items: center; gap: 1rem; background: var(--card);
                  border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 1rem;
                  margin-bottom: 0.5rem; flex-wrap: wrap; }
.connection-app { font-family: ui-monospace, monospace; color: var(--muted);
                  font-size: 0.85rem; }
.connection-row time { color: var(--muted); font-size: 0.85rem; }
.connection-row .last-used { margin-left: auto; }

/* Memory edit form */
.memory-edit { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.memory-edit label { display: flex; flex-direction: column; gap: 0.3rem;
                     color: var(--muted); font-size: 0.9rem; }
.memory-edit input, .memory-edit textarea { padding: 0.6rem; border: 1px solid var(--line);
            border-radius: 6px; font: inherit; background: var(--card); color: var(--ink); }
.memory-edit textarea { font-family: ui-monospace, monospace; resize: vertical; }
.memory-edit .actions button { background: var(--accent); color: white; border: none;
            border-radius: 6px; padding: 0.55rem 1rem; cursor: pointer; font: inherit; }
