:root {
  --bg: #f6f7f4;
  --ink: #17201c;
  --muted: #63706a;
  --line: #dce3dd;
  --panel: #ffffff;
  --accent: #126b5b;
  --accent-2: #b2402f;
  --blue: #315c9a;
  --shadow: 0 18px 50px rgba(28, 42, 35, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, textarea {
  font: inherit;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
}
.brand { font-weight: 800; letter-spacing: 0; }
nav { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
nav a:hover { color: var(--ink); }
main { max-width: 1440px; margin: 0 auto; padding: 24px; }
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.calendar-panel, .entry-panel, .summary-page, .settings-page, .login-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.calendar-panel { padding: 18px; }
.month-head, .entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.month-head h1, .entry-head h1, .entry-head h2 {
  margin: 0;
  font-size: 24px;
}
.icon-link {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.weekdays, .calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.weekdays {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.day-cell {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fbfcfa;
}
.day-cell.muted { opacity: .42; }
.day-cell.active {
  border-color: var(--accent);
  outline: 2px solid rgba(18,107,91,.18);
}
.date-num { font-weight: 700; }
.dots { display: flex; gap: 4px; min-height: 7px; }
.dots i { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.plan { background: var(--blue); }
.actual { background: var(--accent); }
.reading { background: var(--accent-2); }
.entry-panel { padding: 22px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions a, button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
.actions a { background: white; color: var(--accent); }
.entry-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 650;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.check-row input { width: 18px; height: 18px; }
textarea, input[type="password"], input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fbfcfa;
}
textarea { resize: vertical; line-height: 1.5; }
.upload-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.artifact-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.artifact-list h3 { margin: 0 0 10px; font-size: 16px; }
.artifact-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.artifact-list span, .artifact-list p { color: var(--muted); }
.summary-page, .settings-page { padding: 24px; }
.summary-text { margin-top: 18px; min-height: 65vh; }
.success, .error {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 14px 0;
}
.success { background: #e8f5ee; color: #155d45; }
.error { background: #fae7e3; color: #9b2e1f; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(18,107,91,.18), rgba(178,64,47,.12)),
    var(--bg);
}
.login-shell { width: min(92vw, 420px); padding: 0; }
.login-box { padding: 28px; display: grid; gap: 16px; }
.login-box h1 { margin: 0; font-size: 34px; }
.login-box p { margin: 0; color: var(--muted); }

@media (max-width: 860px) {
  .topbar {
    height: auto;
    padding: 14px 16px;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
  nav { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  main { padding: 14px; }
  .workspace { grid-template-columns: 1fr; }
  .upload-form { grid-template-columns: 1fr; }
  .entry-head { align-items: flex-start; flex-direction: column; }
  .day-cell { min-height: 52px; padding: 7px; }
}
