/* Claude Memory Cloud — minimal mobile-first stylesheet */

* { box-sizing: border-box; }
:root {
  --bg: #0f1115;
  --panel: #161922;
  --panel-2: #1d2230;
  --line: #262b3a;
  --text: #e7e9ee;
  --muted: #8b93a7;
  --accent: #6aa6ff;
  --accent-2: #9b8cff;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --user: #6aa6ff;
  --claude: #c08bff;
  --radius: 12px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-2: #f0f2f8;
    --line: #e3e6ee;
    --text: #1a1d24;
    --muted: #5e6573;
    --accent: #2563eb;
    --accent-2: #7c3aed;
    --good: #16a34a;
    --warn: #d97706;
    --bad: #dc2626;
    --user: #2563eb;
    --claude: #7c3aed;
  }
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

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

.container { max-width: 760px; margin: 0 auto; padding: 14px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .title { font-weight: 600; }
.topbar .nav { display: flex; gap: 10px; flex-wrap: wrap; }
.topbar .nav a {
  color: var(--muted); padding: 4px 8px; border-radius: 8px; font-size: 14px;
}
.topbar .nav a.active, .topbar .nav a:hover { color: var(--text); background: var(--panel-2); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.card h2 { font-size: 16px; margin: 0 0 10px; }
.card h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 500; }

.grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.metric {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px;
}
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 22px; font-weight: 600; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--accent); color: white; border: none;
  padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 10px; font-size: 13px; }

input, textarea, select {
  width: 100%;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px; border-radius: 10px;
  font: inherit;
}
textarea { resize: vertical; min-height: 80px; }
label { display: block; color: var(--muted); font-size: 13px; margin: 8px 0 4px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row .grow-2 { flex: 2; }
.muted { color: var(--muted); font-size: 13px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); margin: 2px 4px 2px 0;
}
.cat {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: rgba(106, 166, 255, 0.15); color: var(--accent);
  margin-right: 6px;
}
.imp { color: var(--warn); font-size: 12px; }

.list-item {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.list-item:last-child { border-bottom: none; }

.actions { display: flex; gap: 6px; margin-top: 6px; }

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

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 10px;
  z-index: 100; max-width: 90vw;
}
.toast.error { border-color: var(--bad); }
.toast.ok { border-color: var(--good); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
}

/* Mood */
.mood-bubble {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0;
}
.mood-bubble.user { border-left: 3px solid var(--user); }
.mood-bubble.claude { border-left: 3px solid var(--claude); }
.mood-bubble .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.mood-bubble .who.user { color: var(--user); }
.mood-bubble .who.claude { color: var(--claude); }
.mood-bubble .emoji { font-size: 22px; margin-right: 6px; }
.mood-replies { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--line); }
.mood-reply { font-size: 13px; color: var(--muted); margin: 4px 0; }
.mood-reply .who.user { color: var(--user); }
.mood-reply .who.claude { color: var(--claude); }

/* Login */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.login-box { width: 100%; max-width: 360px; }
.login-box h1 { margin: 0 0 16px; font-size: 20px; text-align: center; }

/* Calendar / mini stripe (for future) */
.streak-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.streak-dots .d {
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.streak-dots .d.on { background: var(--good); border-color: transparent; }

@media (max-width: 480px) {
  .topbar .nav a { padding: 4px 6px; font-size: 13px; }
  .container { padding: 10px; }
}
