:root {
  --bg: #ecdfbd;
  --panel: #fffaf0;
  --panel-alt: #f3e6c4;
  --border: #c9a969;
  --border-soft: #ddc990;
  --text: #2e2318;
  --text-dim: #8a7350;
  --accent: #2f5233;
  --accent-dark: #1c3520;
  --accent-2: #c98a2c;
  --danger: #8b3a3a;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}

.m-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #142a1a, #234030);
  color: #f3e9d2;
  box-shadow: 0 2px 10px rgba(20, 42, 26, 0.35);
}
.m-month-label {
  flex: 1;
  text-align: center;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 600;
}
.m-nav-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: #f3e9d2;
  font-size: 1.1rem;
  padding: 10px 16px;
  border-radius: 999px;
}

.m-day-list {
  padding: 12px;
  padding-bottom: 60px;
}

.m-day-row {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(46, 35, 24, 0.08);
}
.m-day-row.today { border-color: var(--accent-2); border-width: 2px; }

.m-day-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.m-day-num { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--accent-dark); }
.m-day-name { font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; }

.m-entries { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.m-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-alt);
  font-size: 0.95rem;
  cursor: pointer;
}
.m-entry .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--accent); }
.m-entry .txt { flex: 1; word-break: break-word; }
.m-entry .span-label { font-size: 0.75rem; color: var(--text-dim); }

.m-quick-add {
  display: flex;
  gap: 8px;
}
.m-quick-add input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1rem;
}
.m-quick-add button {
  width: 44px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1.3rem;
}

/* ---------- bottom sheet ---------- */

.m-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 10, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 50;
}
.m-overlay.hidden { display: none; }

.m-sheet {
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: sheetSlideUp 0.22s ease;
}
@keyframes sheetSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.m-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.m-sheet-header h2 { margin: 0; font-family: var(--font-display); font-style: italic; color: var(--accent-dark); }
.m-close { background: none; border: none; font-size: 1.6rem; color: var(--text-dim); }

#m-edit-form label { display: block; margin-top: 12px; margin-bottom: 6px; color: var(--text-dim); font-size: 0.9rem; }
#m-edit-form input, #m-edit-form select, #m-edit-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
}

.m-sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.m-primary-btn {
  flex: 1;
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}
.m-danger-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 14px 18px;
  border-radius: 999px;
  font-size: 1rem;
}
