/* ============================================================
   KAMI OS — Cycle 6 · Human Record + Week in Review
   Mood sheet (.c6m-*) · mood strip · weekly review panel (.c6r-*)
   All tokens from core.css. Mobile-first, 393px primary.
   ============================================================ */

/* ---------- Nightly mood bottom sheet (non-blocking, no scrim) ---------- */
.c6m-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  transform: translate(-50%, 120%);
  width: min(420px, calc(100vw - 20px));
  z-index: 60; /* above tabbar (34) & sidebar (40), below modals (100) */
  background: var(--glass-2);
  border: 1px solid var(--glass-border-hot);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 14px 12px;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
  opacity: 0;
}
.c6m-sheet.in { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 880px) {
  .c6m-sheet { bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); } /* clear the tabbar */
}

.c6m-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.c6m-title {
  font-family: var(--font-head);
  font-size: 14px; font-weight: 600; color: var(--text);
}
.c6m-title span { color: var(--accent); }

.c6m-emoji-row { display: flex; gap: 6px; justify-content: space-between; }
.c6m-emoji {
  appearance: none; -webkit-appearance: none;
  flex: 1; min-width: 44px; height: 48px;
  display: grid; place-items: center;
  font-size: 24px; line-height: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  filter: grayscale(0.55);
  transition: transform 0.12s var(--ease), filter 0.12s var(--ease), border-color 0.12s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.c6m-emoji:active { transform: scale(0.9); }
.c6m-emoji.sel {
  filter: none;
  border-color: var(--accent);
  box-shadow: 0 0 14px -4px var(--accent-glow);
}

.c6m-note {
  width: 100%;
  margin-top: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 12px;
}
.c6m-note::placeholder { color: var(--text-faint); }
.c6m-note:focus { outline: none; border-color: var(--glass-border-hot); }

.c6m-actions { display: flex; gap: 8px; margin-top: 10px; }
.c6m-actions .btn { flex: 1; }

/* ---------- 14-day mood strip (Daily Log top) ---------- */
.c6m-strip {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.c6m-strip-label {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 1.6px;
  color: var(--text-faint);
  white-space: nowrap;
  flex: none;
}
.c6m-cells { display: flex; gap: 2px; flex: 1; justify-content: space-between; }
.c6m-cell {
  appearance: none; -webkit-appearance: none;
  background: none; border: none; padding: 0;
  min-width: 20px; height: 24px;
  display: grid; place-items: center;
  font-size: 15px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.c6m-cell.off, .c6m-cell.add { color: var(--text-faint); font-size: 16px; }
.c6m-cell.add { color: var(--accent); cursor: pointer; }
.c6m-cell.add:active { transform: scale(0.85); }

/* ---------- Per-day mood/note line + retro button ---------- */
.c6m-day {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 0 2px;
  font-size: 12.5px;
}
.c6m-day-emoji { font-size: 16px; line-height: 1; }
.c6m-day-note { font-style: italic; color: var(--text-dim); line-height: 1.5; }

.c6m-add-btn {
  appearance: none; -webkit-appearance: none;
  background: none;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.8px;
  padding: 4px 10px;
  margin: 6px 0 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.c6m-add-btn:hover, .c6m-add-btn:active { color: var(--accent); border-color: var(--glass-border-hot); }

/* ---------- Week in Review panel (AI Strategy) ---------- */
.c6r-range {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1.2px;
  color: var(--text-faint);
}
.c6r-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 480px) { .c6r-grid { grid-template-columns: repeat(2, 1fr); } }
.c6r-cell {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 10px 8px;
  min-width: 0;
}
.c6r-cell .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.c6r-cell .v {
  display: block;
  font-family: var(--font-display);
  font-size: 15px; color: var(--text);
  margin-top: 4px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.c6r-cell .d { font-family: var(--font-mono); font-size: 9.5px; margin-top: 3px; display: block; }
.c6r-cell .d.good { color: var(--good); }
.c6r-cell .d.bad { color: var(--bad); }
.c6r-cell .d.flat { color: var(--text-faint); }

.c6r-narrative {
  margin: 12px 0 0;
  font-size: 13px; line-height: 1.65;
  color: var(--text-dim);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
.c6r-pattern {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.55;
  color: var(--text-faint);
}
.c6r-pattern.found { color: var(--good); }
