:root {
  --purple: #6b3fa0;
  --purple-dark: #4a2a73;
  --blue: #3b6fd4;
  --lavender: #f1ebfa;
  --sky: #e6effc;
  --ink: #2c2340;
  --muted: #7a7092;
  --rainbow: linear-gradient(90deg, #e53935, #fb8c00, #fdd835, #43a047, #1e88e5, #8e24aa);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: #eef0fb; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--lavender) 0%, var(--sky) 100%) fixed;
  min-height: 100vh;
  line-height: 1.5;
}
.rainbow-bar { height: 6px; background: var(--rainbow); }
.wrap { max-width: 560px; margin: 0 auto; padding: 22px 16px 60px; }

.greeting {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 2.2rem;
  text-align: center;
  margin: 8px 0 4px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.greeting-line { width: 120px; height: 4px; border-radius: 4px; background: var(--rainbow); margin: 6px auto 14px; }
.datebar { text-align: center; color: var(--muted); font-size: .98rem; margin-bottom: 14px; }
.notice {
  text-align: center; background: #fff; border: 1px dashed #b9a6dc; color: var(--purple-dark);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: .95rem;
}

.card {
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(80, 50, 140, .16);
  position: relative;
}
.card::before { content: ""; display: block; height: 5px; background: var(--rainbow); }
.photo { display: block; width: 100%; max-height: 70vh; object-fit: cover; background: var(--lavender); }
.card-body { padding: 18px 18px 22px; }

.play {
  display: flex; align-items: center; gap: 14px; width: 100%;
  border: 0; border-radius: 999px; padding: 12px 18px 12px 12px; cursor: pointer;
  background: linear-gradient(90deg, var(--purple), var(--blue)); color: #fff;
  font-size: 1.05rem; font-weight: 600; text-align: left;
  box-shadow: 0 4px 14px rgba(80, 60, 190, .35);
}
.play .circle {
  width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--purple);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex: none;
}
.play .meta { flex: 1; }
.play .time { font-weight: 400; font-size: .85rem; opacity: .9; }
.progress { height: 6px; background: rgba(255,255,255,.35); border-radius: 6px; margin-top: 6px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: #fff; border-radius: 6px; }

.note { white-space: pre-wrap; font-size: 1.12rem; margin: 16px 2px 0; }
.note:empty { display: none; }

.nav { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1; border: 2px solid var(--purple); background: #fff; color: var(--purple);
  border-radius: 999px; padding: 11px 14px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn.solid { background: linear-gradient(90deg, var(--purple), var(--blue)); color: #fff; border-color: transparent; }
.btn.danger { border-color: #c0392b; color: #c0392b; }
.btn:disabled { opacity: .4; cursor: default; }

/* calendar */
.cal { background: #fff; border-radius: 22px; padding: 14px; margin-top: 18px; box-shadow: 0 8px 30px rgba(80,50,140,.12); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h3 { margin: 0; font-size: 1.15rem; color: var(--purple-dark); }
.cal-head button { border: 0; background: var(--lavender); color: var(--purple); width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }
.cal-head button:disabled { opacity: .3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--muted); padding: 2px 0; }
.cal-day {
  aspect-ratio: 1; border: 0; border-radius: 12px; background: transparent; color: #b9b2c9;
  font-size: .95rem; display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.cal-day.has { background: var(--lavender); color: var(--purple-dark); font-weight: 700; cursor: pointer; }
.cal-day.has::after { content: ""; width: 14px; height: 3px; border-radius: 3px; background: var(--rainbow); margin-top: 2px; }
.cal-day.current { background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; }
.cal-day.current::after { background: #fff; }
.cal-day.today { outline: 2px solid var(--blue); outline-offset: -2px; }
.empty { text-align: center; padding: 40px 20px; color: var(--purple-dark); font-size: 1.15rem; }
.err { color: #c0392b; text-align: center; padding: 20px; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 26px; }
.foot a { color: var(--muted); }
.hidden { display: none !important; }

/* admin */
.panel { background: #fff; border-radius: 18px; padding: 16px; margin-bottom: 16px; box-shadow: 0 6px 22px rgba(80,50,140,.12); }
.panel h2 { margin: 0 0 10px; font-size: 1.1rem; color: var(--purple-dark); }
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=date], textarea {
  width: 100%; padding: 12px; font-size: 1rem; border: 2px solid #d9cdee; border-radius: 12px; font-family: inherit; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1 1 140px; }
.thumb { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; margin-top: 10px; }
.status { margin-top: 10px; font-size: .95rem; color: var(--purple-dark); min-height: 1.3em; }
.status.bad { color: #c0392b; }
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #e53935; margin-right: 6px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.daylist button {
  display: flex; justify-content: space-between; width: 100%; text-align: left; background: var(--lavender);
  border: 0; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; font-size: .98rem; color: var(--ink); cursor: pointer;
}
.daylist small { color: var(--muted); }
audio { width: 100%; margin-top: 10px; }

/* admin calendar: every day is tappable, days already done are marked */
.cal-day.pick { cursor: pointer; background: transparent; color: var(--ink); }
.cal-day.pick.has { background: var(--lavender); color: var(--purple-dark); font-weight: 700; }
.cal-day.pick.current { background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; }
.cal-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.cal-key i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 4px; }
