:root {
  --oxblood: #640D09;
  --coral: #D84145;
  --coral-tint: #F7DEDD;
  --coral-border: #F0D0CF;
  --coral-light-text: #F0999B;
  --ink: #2A1616;
  --muted: #8A8482;
  --faint: #B9B2AE;
  --line: #EEE9E7;
  --paper: #FFFFFF;
  --shell: #FFFFFF;
  --note-bg: #FBEEED;
  --neutral-bg: #F1EDEB;
  --neutral-border: #E4DEDA;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-voice: Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --ink: #F1E9E7;
  --muted: #B0A29E;
  --faint: #7A6D69;
  --line: #35201D;
  --paper: #241413;
  --shell: #170D0C;
  --note-bg: #3A211E;
  --neutral-bg: #2A1917;
  --neutral-border: #402522;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--shell);
  font-size: 15px;
}

button, input, textarea { font-family: inherit; }
a { color: var(--coral); text-decoration: none; }
svg { display: inline-block; }

.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- sidebar / drawer nav ---------- */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--shell);
  border-right: 1px solid var(--line);
  padding: 40px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 40;
}

.sidebar.open { transform: translateX(0); }

.sidebar-top { display: flex; flex-direction: column; }
.sidebar-bottom { display: flex; flex-direction: column; }

.sidebar-brand { padding: 0 8px; margin-bottom: 32px; }
.sidebar-brand img { height: 27px; display: block; margin-bottom: 6px; }
.sidebar-brand span { font-size: 12px; color: var(--muted); }

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border-radius: 8px;
  text-align: left;
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active { background: var(--coral-tint); color: var(--oxblood); }
.nav-item .ext { margin-left: auto; color: var(--faint); display: flex; }
.nav-item .chip {
  font-size: 10px; font-weight: 700; color: var(--coral); background: var(--coral-tint);
  padding: 2px 5px; border-radius: 6px; text-transform: lowercase;
}

.sidebar-profile { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--coral-tint); color: var(--oxblood);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}

.theme-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 14px;
}
.theme-toggle-label { font-size: 12px; color: var(--muted); }
.theme-toggle {
  width: 38px; height: 22px; border-radius: 12px; background: var(--neutral-bg);
  border: 1px solid var(--neutral-border); position: relative; cursor: pointer; padding: 0;
  flex-shrink: 0;
}
.theme-toggle-knob {
  position: absolute; top: 1px; left: 1px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.15s ease; box-shadow: 0 0 0 1px var(--neutral-border);
}
.theme-toggle.on { background: var(--coral); border-color: var(--coral); }
.theme-toggle.on .theme-toggle-knob { transform: translateX(16px); }

.scrim {
  position: fixed; inset: 0; background: rgba(42,22,22,0.35);
  display: none; z-index: 35;
}
.scrim.open { display: block; }

/* ---------- main column ---------- */

.main { flex: 1; min-width: 0; }

.topbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar img { height: 16px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: none; border: none; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--coral-tint); }

.content {
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 28px 90px;
}

/* ---------- shared pieces ---------- */

.greeting { font-family: var(--font-body); font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.greeting-name { color: var(--coral); }
.greeting-sub { font-family: var(--font-body); font-size: 15px; font-weight: 400; color: var(--muted); margin-bottom: 32px; }

.eyebrow { font-size: 12px; font-weight: 600; color: var(--coral); margin-bottom: 4px; }
.page-title { font-family: var(--font-voice); font-size: 24px; font-weight: normal; margin: 4px 0 14px; }
.intention { font-family: var(--font-voice); font-size: 17px; line-height: 1.7; margin-bottom: 26px; }
.intention .tbd { font-family: var(--font-body); color: var(--faint); font-size: 12px; }

.card {
  border: 1px solid var(--coral-border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

/* name prompt (first login) */

.name-prompt-wrap { max-width: 380px; margin: 90px auto; padding: 0 20px; text-align: center; }
.name-prompt-title { font-size: 22px; font-weight: 600; margin: 18px 0 8px; color: var(--ink); }
.name-prompt-sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.name-prompt-input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; margin-bottom: 12px; text-align: center; background: var(--shell); color: var(--ink);
}

/* video / audio */

.video-card { border: 1px solid var(--coral-border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.video-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: none; border: none; cursor: pointer; text-align: left;
}
.video-row:hover { background: var(--note-bg); }
.video-row .play-btn { width: 30px; height: 30px; pointer-events: none; }
.video-chevron { margin-left: auto; color: var(--faint); display: flex; }
.video-expanded { padding: 0 14px 14px; }
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--oxblood), #7a1712);
  display: flex; align-items: center; justify-content: center;
}
.video-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play-btn { position: relative; z-index: 1; }
.play-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--coral); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}
.play-btn-lg { width: 56px; height: 56px; }
.play-btn-lg:hover, .play-btn:hover { background: var(--oxblood); }

.audio-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--coral-border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 22px;
}
.audio-body { flex: 1; }
.audio-track { height: 4px; background: var(--line); border-radius: 2px; margin: 8px 0 5px; overflow: hidden; }
.audio-progress { height: 100%; width: 0%; background: var(--coral); }
.audio-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }

.media-title { font-size: 14px; }
.media-sub { font-size: 12px; color: var(--faint); font-weight: normal; }

/* next live */

.live-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.live-info { display: flex; align-items: flex-start; gap: 12px; }
.live-icon {
  width: 40px; height: 40px; border-radius: 8px; background: var(--coral-tint); color: var(--oxblood);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.live-secondary-outer { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.live-secondary-outer strong { color: var(--coral); font-weight: 600; }
.rsvp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: none; border: 1px solid var(--coral); color: var(--coral);
}
.rsvp-btn.confirmed { background: var(--coral); color: #fff; border-color: var(--coral); }

/* today card */

.today-card {
  background: var(--oxblood);
  border-radius: 14px;
  padding: 26px 28px;
  margin: 24px 0 32px;
  color: #fff;
}
.today-label { font-size: 12px; color: var(--coral-light-text); margin-bottom: 8px; }
.today-title { font-family: var(--font-voice); font-size: 21px; margin-bottom: 10px; }
.today-body { font-size: 14px; color: #DCB2B0; line-height: 1.65; margin-bottom: 20px; }

.note-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--coral-light-text); margin-bottom: 8px;
}
.note-input {
  width: 100%; min-height: 90px; resize: vertical;
  background: var(--note-bg); border: 1.5px solid transparent;
  border-radius: 8px; padding: 14px; font-size: 14px; color: var(--ink);
  margin-bottom: 8px;
}
.note-input.saved { border-color: rgba(255,255,255,0.35); }
.note-status { font-size: 12px; color: var(--coral-light-text); margin-bottom: 8px; }

.complete-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px; border: none; border-radius: 8px;
  font-size: 14px; cursor: pointer; background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.5);
  transition: background 0.15s ease, color 0.15s ease;
}
.complete-btn.ready { background: var(--coral); color: #fff; cursor: pointer; }
.complete-btn.done { background: #7A231F; color: #fff; }
.complete-btn:disabled { cursor: not-allowed; }

/* weeks */

.section-label { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

.weeks { display: grid; gap: 12px; margin-bottom: 32px; }
@media (min-width: 720px) {
  .weeks { grid-template-columns: 1fr 1fr 1fr; }
}

.week-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.week-card.active { border: 1.5px solid var(--coral); }
.week-card.locked { opacity: 0.55; }
.week-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.week-head .name { font-size: 14px; }
.pill {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 4px;
}
.pill.done { background: var(--coral-tint); color: var(--oxblood); }
.pill.active { background: var(--coral); color: #fff; }
.pill.locked { background: var(--neutral-bg); color: var(--muted); }

.dots { display: flex; gap: 7px; flex-wrap: wrap; overflow: visible; }
.dot {
  position: relative;
  width: 27px; height: 27px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; background: var(--neutral-bg); color: var(--faint);
  border: 1px solid var(--neutral-border); flex-shrink: 0;
}
.dot.done { background: var(--coral); color: #fff; border-color: var(--coral); font-weight: 600; }
.dot.current { background: var(--shell); color: var(--oxblood); border: 2px solid var(--coral); font-weight: 600; }
.week-locked-note { font-size: 11px; color: var(--muted); margin-top: 10px; }

.chat-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--coral); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 30;
}

/* ---------- notes page ---------- */

.notes-intro { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 22px; }
.notes-list { display: flex; flex-direction: column; gap: 12px; }
.note-entry { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.note-entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.note-entry-day { font-size: 13px; font-weight: 600; color: var(--coral); }
.note-entry-date { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 4px; }
.note-entry-text { font-size: 14px; line-height: 1.65; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 14px; }

/* ---------- responsive ---------- */

@media (min-width: 900px) {
  .sidebar { position: sticky; transform: none; align-self: flex-start; }
  .scrim { display: none !important; }
  .topbar { display: none !important; }
  .content { padding: 56px 48px 100px; }
  body { font-size: 15px; }
}

@media (min-width: 1200px) {
  .content { max-width: 980px; padding: 64px 56px 110px; }
}

@media (max-width: 899px) {
  .topbar { display: flex; }
  .content { padding: 24px 18px 90px; }
  .greeting { font-size: 19px; }
}
