:root {
  --bg: #1C1F26;
  --panel: #20242C;
  --border: #33384455;
  --text: #EDEAE3;
  --muted: #8B8F98;
  --accent: #C9A24B;
  --danger: #B8574B;
  --good: #7C9A7E;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-weight: 300; margin: 0; }
html { scroll-behavior: smooth; }
button {
  font-family: inherit; font-size: 13px; cursor: pointer;
  border-radius: 4px; border: 1px solid transparent; padding: 8px 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
button:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--bg); font-weight: 600; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid #C9A24B55; }
.btn-plain { background: transparent; color: var(--muted); }
input, select, textarea {
  background: var(--bg); border: 1px solid #3A3F4A; border-radius: 4px;
  padding: 8px 10px; color: var(--text); font-size: 13px; font-family: inherit; outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card {
  border: 1px solid var(--border); border-radius: 6px; padding: 12px; background: var(--panel);
  transition: border-color 0.2s ease;
}
.empty {
  border: 1px dashed #3A3F4A; border-radius: 6px; padding: 16px; color: var(--muted);
  font-size: 13px; text-align: center;
}
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  padding: 2px 8px; border-radius: 3px; white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

#topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
#topbar .title { font-size: 15px; }
#tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.tabbtn {
  padding: 6px 12px; border-radius: 14px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0;
  background: var(--panel); color: var(--muted); border: 1px solid #33384455; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tabbtn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
#content { padding: 14px; overflow-y: auto; overflow-x: hidden; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0.4; } to { opacity: 1; } }

@media (min-width: 640px) {
  #topbar, #tabs, #content { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
  #content { padding: 20px 14px 40px; }
}
@media (min-width: 900px) {
  #topbar, #tabs, #content { max-width: 1040px; }
  #content { padding: 26px 20px 48px; }
}
@media (min-width: 1200px) {
  #topbar, #tabs, #content { max-width: 1180px; }
}

.stat { flex: 1 1 110px; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; background: var(--panel); transition: border-color 0.2s ease; }
.stat .label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat .value { font-size: 22px; font-family: "Fraunces", Georgia, serif; font-weight: 300; }

.task-row, .capture-box {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--panel); margin-bottom: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.task-title.done { color: var(--muted); text-decoration: line-through; }
.task-toggle { transition: background 0.15s ease, border-color 0.15s ease; }

.setup-screen { max-width: 380px; margin: 40px auto; padding: 0 16px; }
.setup-screen .card { margin-bottom: 14px; }
.setup-screen label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.setup-screen input { width: 100%; }

.section-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 6px; }

.stage-col { border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--panel); }
.stage-head { display: flex; justify-content: space-between; padding-bottom: 6px; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; }
.contact-card { background: var(--bg); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }

.fab {
  position: fixed; bottom: 22px; right: 22px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: var(--bg); font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.45); z-index: 30; border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.fab:active { transform: scale(0.95); }
.modal-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 60; animation: fadeIn 0.15s ease; }
.modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px; width: 360px; max-width: 90vw; max-height: 85vh; overflow-y: auto; z-index: 61;
  animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-weekdays { text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.cal-day {
  aspect-ratio: 1; border-radius: 4px; background: var(--panel); border: 1px solid var(--border);
  padding: 4px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cal-day.today { border-color: var(--accent); }
.cal-layout { display: flex; flex-direction: column; gap: 20px; }
.cal-left { width: 100%; max-width: 420px; }
.cal-right { min-width: 0; }
@media (min-width: 900px) {
  .cal-layout { flex-direction: row; align-items: flex-start; }
  .cal-left { flex: 0 0 380px; }
  .cal-right { flex: 1; padding-left: 8px; }
}
.cal-day.has-meeting { background: rgba(124, 154, 126, 0.16); border-color: #7C9A7E77; }
.cal-day.in-week { background: rgba(201, 162, 75, 0.10); }
.cal-day.selected { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cal-day.selected .cal-daynum { color: var(--bg); }
.cal-daynum { font-size: 11.5px; color: var(--text); }
.cal-dots { display: flex; gap: 3px; }
.cal-dots .dot { width: 5px; height: 5px; border-radius: 50%; }
