/* Design tokens lifted from christianfounders.co */
:root {
  --cream: #f6eee1;
  --paper: #efe3cf;
  --ink: #1b1712;
  --ink-2: #4a4036;
  --forest: #15291c;
  --forest-2: #22432e;
  --sun: #f4a62a;
  --sun-2: #ffc95c;
  --ember: #e4572e;
  --rose: #f0a388;
  --night: #0f1a26;
  --radius: 18px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --f-sans: "Archivo", system-ui, sans-serif;
  --f-hand: "Caveat Brush", cursive;

  --st-active: #2f8a4f;
  --st-pending: var(--sun);
  --st-target: var(--ember);
  --st-declined: #9a8f80;
  --line: rgba(27, 23, 18, 0.14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.hand { font-family: var(--f-hand); font-weight: 400; }
.eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  font-stretch: 85%; color: var(--ink-2);
}

/* Buttons (same shape as the site's .btn) */
.btn {
  --bg: var(--sun); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; font-stretch: 85%;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--ink { --bg: var(--ink); --fg: var(--cream); box-shadow: 3px 3px 0 var(--sun); }
.btn--ink:hover { box-shadow: 4px 4px 0 var(--sun); }
.btn--cream { --bg: var(--cream); }
.btn--ghost { --bg: transparent; box-shadow: none; }
.btn--ghost:hover { box-shadow: none; background: var(--paper); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
.btn--icon { width: 34px; padding: 0; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Inputs */
.field { display: grid; gap: 4px; }
.field > span { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; font-stretch: 85%; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; background: #fffaf2; border: 2px solid var(--ink); border-radius: 12px;
  padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { box-shadow: 3px 3px 0 var(--sun); }
textarea { resize: vertical; min-height: 96px; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 420px 1fr; height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; min-height: 0; border-right: 2px solid var(--ink); background: var(--cream); position: relative; z-index: 2; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 2px solid var(--ink); background: var(--forest); color: var(--cream); }
.brand__mark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand__name { font-weight: 900; font-size: 19px; letter-spacing: -0.01em; font-stretch: 90%; }
.brand__tag { font-family: var(--f-hand); color: var(--sun-2); font-size: 20px; transform: rotate(-3deg); display: inline-block; }
.brand__user { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.85; }
.brand__user button { color: var(--cream); }

.tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.tab { flex: 1; height: 38px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-stretch: 85%; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--cream); }

.toolbar { padding: 12px 20px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.toolbar__row { display: flex; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fffaf2; font-size: 12px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.chips--filtered .chip[aria-pressed="false"] { opacity: 0.45; background: transparent; }
.chip b { font-weight: 900; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); flex: none; }
.dot--active { background: var(--st-active); }
.dot--pending { background: var(--st-pending); }
.dot--target { background: var(--st-target); }
.dot--declined { background: var(--st-declined); }

.list { flex: 1; overflow-y: auto; padding: 6px 12px 24px; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; border-radius: 10px; }
.row:hover, .row.is-hover { background: var(--paper); }
.row.is-selected { background: var(--paper); box-shadow: inset 4px 0 0 var(--sun); }
.row__name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.row__meta { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.row__right { font-size: 11px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.empty { padding: 32px 12px; text-align: center; color: var(--ink-2); }
.empty .hand { font-size: 26px; color: var(--ink); display: block; margin-bottom: 4px; }

/* Detail panel (slides over the sidebar list) */
.detail { position: absolute; inset: 0; background: var(--cream); display: flex; flex-direction: column; transform: translateX(-102%); transition: transform 0.5s var(--ease); z-index: 3; }
.detail.is-open { transform: none; }
.detail__head { padding: 14px 20px 16px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.detail__nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.detail__title { font-size: 26px; font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; font-stretch: 90%; margin: 0; }
.detail__sub { margin-top: 6px; color: var(--ink-2); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.detail__body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; display: grid; gap: 22px; align-content: start; }
.status-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.status-pick button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-stretch: 85%; cursor: pointer; }
.status-pick button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.approx { font-size: 12px; background: var(--sun-2); border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 8px; font-weight: 700; }

.section h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; font-size: 13.5px; }
.kv dt { color: var(--ink-2); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-stretch: 85%; padding-top: 2px; }
.kv dd { margin: 0; word-break: break-word; }
.bg-note { background: #fffaf2; border: 1.5px dashed var(--ink-2); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; }

.composer { background: #fffaf2; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--ink); padding: 12px; display: grid; gap: 10px; }
.composer textarea { border: 0; padding: 4px; min-height: 84px; background: transparent; box-shadow: none !important; }
.composer__bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer__bar select, .composer__bar input { width: auto; padding: 6px 10px; border-width: 1.5px; font-size: 13px; border-radius: 999px; }
.composer__hint { font-size: 12px; color: var(--ink-2); flex: 1; min-width: 120px; }

.timeline { display: grid; gap: 10px; }
.note { border: 1.5px solid var(--ink); border-radius: 14px; background: #fffaf2; padding: 12px 14px; }
.note__top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--ink-2); }
.note__kind { font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-stretch: 85%; }
.note__headline { font-weight: 800; margin: 4px 0 0; font-size: 15px; line-height: 1.3; }
.note ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.note__next { margin-top: 6px; font-size: 13px; }
.note__next b { font-family: var(--f-hand); font-weight: 400; font-size: 17px; color: var(--ember); }
.note__full { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); white-space: pre-wrap; font-size: 13.5px; display: none; }
.note.is-open .note__full { display: block; }
.note__actions { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; }

.person { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 900; font-size: 13px; background: var(--sun-2); }
.avatar--mentor { background: var(--rose); }
.avatar--peer { background: var(--sun-2); }
.avatar--contact { background: var(--paper); }
.due { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--ink); }
.due--late { background: var(--ember); color: var(--cream); }
.due--soon { background: var(--sun-2); }
.due--ok { background: transparent; }

/* Map */
.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #f2efe9; }
.leaflet-container { font-family: var(--f-sans); }
.legend { position: absolute; left: 16px; bottom: 16px; z-index: 500; background: var(--cream); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); padding: 10px 12px; display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.legend div { display: flex; align-items: center; gap: 8px; }
.maptitle { position: absolute; right: 16px; top: 14px; z-index: 500; pointer-events: none; text-align: right; }
.maptitle .hand { font-size: 30px; color: var(--forest); line-height: 1; text-shadow: 0 0 6px var(--cream), 0 0 12px var(--cream); }
.placing-banner { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 600; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: 13px; display: none; gap: 12px; align-items: center; box-shadow: 3px 3px 0 var(--sun); }
.placing-banner.is-on { display: flex; }
.placing-banner button { color: var(--sun-2); }

/* Pins */
.pin { position: relative; }
.pin__dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); transition: transform 0.3s var(--ease); }
.pin__label { position: absolute; left: 14px; top: -11px; white-space: nowrap; font-weight: 800; font-size: 12px; letter-spacing: -0.01em; background: rgba(246, 238, 225, 0.92); border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 8px; cursor: pointer; }
.pin--active .pin__dot { background: var(--st-active); }
.pin--pending .pin__dot { background: var(--st-pending); }
.pin--target .pin__dot { background: var(--st-target); }
.pin--declined .pin__dot { background: var(--st-declined); }
.pin--declined .pin__label { opacity: 0.7; }
.pin.is-hot .pin__dot { transform: scale(1.45); }
.pin.is-hot .pin__label { background: var(--ink); color: var(--cream); }
.pin.is-selected .pin__dot { transform: scale(1.6); }
.pin.is-selected .pin__label { background: var(--sun); }
.map--mid .pin--target .pin__label, .map--mid .pin--declined .pin__label { display: none; }
.map--mid .pin.is-hot .pin__label, .map--mid .pin.is-selected .pin__label { display: block; }
.map--zoomed-out .pin__label { display: none; }
.map--zoomed-out .pin.is-hot .pin__label, .map--zoomed-out .pin.is-selected .pin__label { display: block; }
.pin-count { width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--ink); color: var(--cream); display: grid; place-items: center; font-weight: 900; border: 2px solid var(--cream); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(27, 23, 18, 0.45); display: none; place-items: center; z-index: 2000; padding: 16px; }
.modal.is-open { display: grid; }
.modal__card { width: min(520px, 100%); max-height: 90vh; overflow-y: auto; background: var(--cream); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--ink); padding: 22px; display: grid; gap: 14px; }
.modal__card h2 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -0.02em; font-stretch: 90%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.err { color: var(--ember); font-weight: 700; font-size: 13px; min-height: 1em; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: var(--cream); border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 13px; z-index: 3000; transition: transform 0.5s var(--ease); box-shadow: 3px 3px 0 var(--sun); }
.toast.is-on { transform: translate(-50%, 0); }

.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile: map on top, panel below */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 42vh 1fr; height: 100dvh; }
  .mapwrap { grid-row: 1; }
  .side { grid-row: 2; border-right: 0; border-top: 2px solid var(--ink); }
  .brand { padding: 12px 16px; }
  .brand__tag { display: none; }
  .tabs, .toolbar { padding-left: 16px; padding-right: 16px; }
  .detail__head, .detail__body { padding-left: 16px; padding-right: 16px; }
  .maptitle, .legend { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}
