/* ============================================================================
   SocialY — soft-blue relationship keeper.
   Responsive: roomy multi-column on Mac/desktop, stacked single-column on phone.
   ========================================================================== */
:root {
  --bg-top: #eef3fa; --bg-bot: #e2eaf4;
  --ink: #22384f; --ink-soft: #64748b; --ink-faint: #8a99ad;
  --navy: #2b4a6e; --navy-btn: #234058; --navy-btn-hi: #2c5170;
  --card: #e7edf6; --card-2: #eef2f9; --card-line: #d3ddec;
  --pill: #d3dcea; --pill-ink: #5c6b81; --avatar: #c4cfe1;
  --seg: #eef2f8; --seg-sel: #b9c9e2; --field: #f4f7fb; --gold: #d3a34a;
  --dot-urgent: #2b4a6e; --dot-soon: #7d90ac; --dot-later: #b6c2d4;
  --radius: 18px; --radius-sm: 11px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(35, 64, 88, 0.05), 0 9px 26px rgba(35, 64, 88, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans); color: var(--ink);
  background: var(--bg-top); min-height: 100vh; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bot) 100%);
}
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--ink-faint); font-weight: 400; }
::selection { background: #c9d8ee; }

/* ---- top bar ------------------------------------------------------------ */
.nav { display: flex; align-items: center; gap: 26px; padding: 22px 44px; max-width: 1300px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand .logo { width: 46px; height: 46px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; }
.brand .word { font-family: var(--serif); font-size: 26px; color: var(--ink); letter-spacing: .2px; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { font-size: 16px; color: var(--ink-soft); text-decoration: none; cursor: pointer; padding: 4px 2px; border: none; background: none; }
.nav-links a.active { color: var(--navy); font-weight: 600; }
.btn-add { background: var(--navy-btn); color: #eef4fb; border: none; padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow); }
.btn-add:hover { background: var(--navy-btn-hi); }

/* ---- page --------------------------------------------------------------- */
.page { max-width: 1300px; margin: 0 auto; padding: 16px 44px 90px; }
.headrow { display: flex; align-items: flex-start; gap: 24px; margin-top: 24px; }
h1.title { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 50px; line-height: 1.05; letter-spacing: -0.5px; margin: 0; max-width: 680px; }
.subtitle { color: var(--ink-soft); font-size: 18px; margin: 16px 0 0; }
.ontrack { margin-left: auto; margin-top: 8px; white-space: nowrap; background: #d9e2ef; color: var(--navy); padding: 9px 17px; border-radius: 999px; font-size: 15px; font-weight: 500; }
.section-head { display: flex; align-items: baseline; gap: 13px; margin: 40px 0 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-weight: 600; color: var(--ink); font-size: 28px; margin: 0; white-space: nowrap; }
.section-head .hint { color: var(--ink-faint); font-size: 15px; }

/* ---- due cards (Today) — roomy, fill the width -------------------------- */
.due-grid { display: grid; grid-template-columns: repeat(auto-fill, 360px); gap: 22px; justify-content: start; }
.due-card { background: var(--card-2); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 26px 26px 24px; box-shadow: var(--shadow); }
.person-head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--avatar); color: var(--navy); display: grid; place-items: center; font-size: 14px; font-weight: 600; letter-spacing: .4px; flex: none; }
.due-card .avatar { width: 54px; height: 54px; font-size: 15px; }
.person-name { font-family: var(--serif); font-size: 20px; color: var(--ink); line-height: 1.12; }
.due-card .person-name { font-size: 24px; }
.tag { display: inline-block; margin-top: 6px; background: var(--pill); color: var(--pill-ink); font-size: 12.5px; padding: 3px 12px; border-radius: 999px; }
.meta-lines { margin: 20px 0 4px; }
.meta-lines .line { font-size: 15.5px; color: var(--ink-soft); margin: 6px 0; }
.meta-lines b { color: var(--ink); font-weight: 600; }
.field-label { font-size: 14px; color: var(--ink-soft); margin: 20px 0 8px; }

/* custom date field */
.datefield { display: flex; align-items: center; justify-content: space-between; width: 100%; background: var(--field); border: 1px solid var(--card-line); border-radius: var(--radius-sm); padding: 13px 15px; font-size: 16px; color: var(--ink); cursor: pointer; user-select: none; }
.datefield:hover { border-color: #b7c5da; }
.datefield .cal { color: var(--ink-faint); font-size: 12px; }

/* segmented method control — relaxed */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--seg); border: 1px solid var(--card-line); border-radius: var(--radius-sm); padding: 5px; gap: 2px; margin: 16px 0 20px; }
.seg button { border: none; background: none; padding: 11px 3px; border-radius: 9px; font-size: 13px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.seg button.sel { background: var(--seg-sel); color: var(--ink); }

.btn-primary { width: 100%; background: var(--navy-btn); color: #eef4fb; border: none; padding: 15px; border-radius: 13px; font-size: 16px; font-weight: 600; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--navy-btn-hi); }
.btn-snooze { width: 100%; margin-top: 8px; background: none; border: none; color: var(--ink-soft); font-size: 13.5px; padding: 8px; cursor: pointer; border-radius: 10px; }
.btn-snooze:hover { background: #e4ebf5; color: var(--ink); }
.overdue-lbl { color: #a8552f; font-weight: 600; }
.readonly-field { background: var(--field); border: 1px solid var(--card-line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; color: var(--ink); }

/* ---- everyone grid ------------------------------------------------------ */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, 244px); gap: 18px; justify-content: start; }
.mini { background: var(--card-2); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 20px 20px; box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .08s ease, box-shadow .12s ease; }
.mini:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(35,64,88,.08), 0 16px 34px rgba(35,64,88,.10); }
.mini .person-name { font-size: 18px; }
.mini .avatar { width: 40px; height: 40px; font-size: 13px; }
.mini .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.mini .when { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft); }
.mini .method { font-size: 14px; color: var(--ink-faint); }
.mini .gender { font-size: 14px; color: var(--ink-soft); }
.tag-empty { background: transparent; color: var(--ink-faint); border: 1px dashed var(--card-line); }
.tag-work { background: #dcdef5; color: #4d4e94; }
.tag-school { background: #cfe7e3; color: #2f6b64; }
.tag-university { background: #ece1cb; color: #8a6a3a; }
.tag-life { background: #f1d8e0; color: #9a4f68; }

/* drag & drop */
.dropzone { border-radius: 16px; padding: 6px 8px; margin: 0 -8px; transition: background .12s ease, box-shadow .12s ease; }
.dropzone.drop-hover { background: rgba(120, 144, 172, .12); box-shadow: inset 0 0 0 2px var(--dot-soon); }
.dropempty { color: var(--ink-faint); font-size: 15px; padding: 10px 4px 18px; }
.mini[draggable="true"] { cursor: grab; }
.mini[draggable="true"]:active { cursor: grabbing; }
.mini.dragging { opacity: .4; }
.circle-block .cnt { color: var(--ink-faint); font-weight: 400; }

/* filter bar (People view) */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 22px; }
.filter-chip { border: 1px solid var(--card-line); background: var(--card-2); color: var(--ink-soft); font-size: 14px; font-weight: 500; padding: 7px 15px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.filter-chip:hover { border-color: #b7c5da; }
.filter-chip .chip-cnt { font-size: 12px; opacity: .65; }
.filter-chip.chip-work { background: #dcdef5; color: #4d4e94; border-color: transparent; }
.filter-chip.chip-school { background: #cfe7e3; color: #2f6b64; border-color: transparent; }
.filter-chip.chip-university { background: #ece1cb; color: #8a6a3a; border-color: transparent; }
.filter-chip.chip-life { background: #f1d8e0; color: #9a4f68; border-color: transparent; }
.filter-chip.active { outline: 2px solid var(--navy); outline-offset: 1px; }

/* circles stepper (Circles → Gender) */
.stepper { margin-left: auto; display: flex; gap: 4px; background: var(--card-2); border: 1px solid var(--card-line); border-radius: 999px; padding: 4px; }
.step-tab { border: none; background: none; color: var(--ink-soft); font-size: 14px; font-weight: 500; padding: 7px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.step-tab.active { background: var(--navy-btn); color: #eef4fb; }

/* split layout: untagged pile (left) + category targets (right) */
.circles-split { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; margin-top: 24px; }
.circles-split.slide-l, .method-board.slide-l { animation: slideFromRight .22s ease; }
.circles-split.slide-r, .method-board.slide-r { animation: slideFromLeft .22s ease; }
.method-board { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; }
@keyframes slideFromRight { from { opacity: .25; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideFromLeft { from { opacity: .25; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.pile { position: sticky; top: 14px; max-height: calc(100vh - 30px); overflow-y: auto; background: var(--card-2); border: 1px solid var(--card-line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin: 0; }
.pile-head { font-family: var(--serif); font-size: 18px; color: var(--ink); margin: 2px 4px 12px; }
.pile-list { display: flex; flex-direction: column; gap: 10px; }
.pile-card { padding: 12px 14px; }
.pile-card .foot { display: none; }
.pile-sub { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
.circles-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.circ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.viewmore-tile { border: 1px dashed var(--card-line); background: transparent; border-radius: var(--radius); color: var(--ink-soft); font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; min-height: 90px; }
.viewmore-tile:hover { background: #e7eef8; color: var(--navy); }
@media (max-width: 900px) {
  .circles-split { grid-template-columns: 1fr; }
  .pile { position: static; max-height: 320px; }
  .circ-grid { grid-template-columns: repeat(2, 1fr); }
}
.circle-block > h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); margin: 30px 0 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.urgent { background: var(--dot-urgent); } .dot.soon { background: var(--dot-soon); } .dot.later { background: var(--dot-later); }
.when.overdue { color: #a8552f; } .when.overdue .dot { background: #b45a30; }

.empty { color: var(--ink-faint); font-size: 16px; padding: 22px 4px; }

/* recent catch-ups feed (Today) */
.recent-list { display: flex; flex-direction: column; gap: 2px; max-width: 640px; }
.recent-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: none; background: none; border-radius: 12px; cursor: pointer; text-align: left; }
.recent-row:hover { background: var(--card-2); }
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.rr-main { flex: 1; min-width: 0; font-size: 15px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-name { color: var(--ink); font-weight: 500; }
.rr-when { color: var(--ink-faint); font-size: 14px; white-space: nowrap; }

/* Upcoming — list */
.up-list { max-width: 660px; margin-top: 22px; }
.up-date { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 20px 0 6px; }
.up-date.wknd { color: #9a4f68; }
.up-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: none; background: none; border-radius: 12px; cursor: pointer; text-align: left; }
.up-row:hover { background: var(--card-2); }

/* Upcoming — calendar */
.up-cal { max-width: 900px; margin-top: 22px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; max-width: 300px; }
.cal-head b { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--ink-faint); padding-bottom: 2px; }
.cal-cell { min-height: 82px; background: var(--card-2); border: 1px solid var(--card-line); border-radius: 10px; padding: 6px 6px 7px; }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.wknd { background: #e7edf7; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--navy); }
.cal-num { font-size: 12px; color: var(--ink-soft); margin-bottom: 3px; }
.cal-chip { display: block; width: 100%; text-align: left; font-size: 11px; font-weight: 500; padding: 3px 7px; border-radius: 6px; margin-top: 3px; border: none; cursor: pointer; background: var(--pill); color: var(--pill-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.meet { box-shadow: inset 0 0 0 1.5px currentColor; }
@media (max-width: 760px) {
  .cal-cell { min-height: 60px; }
  .cal-chip { font-size: 10px; padding: 2px 4px; }
}

/* ---- date picker popover ------------------------------------------------ */
.dp-pop { position: fixed; z-index: 80; background: #fbfcfe; border: 1px solid var(--card-line); border-radius: 14px; box-shadow: 0 20px 50px rgba(28,44,64,.22); padding: 12px; width: 258px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-head b { font-size: 14px; color: var(--ink); font-weight: 600; }
.dp-nav { background: none; border: none; color: var(--ink-soft); font-size: 18px; line-height: 1; padding: 2px 9px; border-radius: 7px; }
.dp-nav:hover { background: #eaeff7; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { font-size: 11px; color: var(--ink-faint); text-align: center; padding: 3px 0; }
.dp-day { text-align: center; padding: 8px 0; font-size: 13px; border-radius: 8px; cursor: pointer; color: var(--ink); border: none; background: none; }
.dp-day:hover { background: #e7eef8; }
.dp-day.sel { background: var(--navy-btn); color: #fff; }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--navy); }
.dp-day.empty { visibility: hidden; cursor: default; }
.dp-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.dp-quick { background: none; border: none; color: var(--navy); font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.dp-quick:hover { background: #eaeff7; }

/* ---- modal -------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 44, 64, .34); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 24px; }
.modal { background: linear-gradient(160deg, #f2f6fb, #e9eff8); border: 1px solid #dbe4f0; border-radius: 22px; width: 100%; max-width: 470px; max-height: 88vh; overflow-y: auto; padding: 30px 30px 26px; box-shadow: 0 30px 70px rgba(28,44,64,.28); }
.modal h2 { font-family: var(--serif); font-weight: 600; font-size: 28px; margin: 0 0 4px; }
.modal .sub { color: var(--ink-soft); font-size: 15px; margin: 0 0 22px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 7px; }
.form-row input[type=text], .form-row input[type=number], .form-row select, .form-row textarea {
  width: 100%; background: var(--field); border: 1px solid var(--card-line); border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--ink); font-family: var(--sans); }
.form-row textarea { resize: vertical; min-height: 58px; }
.fieldnote { font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; line-height: 1.4; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
.modal-actions .spacer { margin-left: auto; }
.btn-ghost { background: none; border: 1px solid var(--card-line); color: var(--ink-soft); padding: 12px 18px; border-radius: 10px; font-size: 15px; }
.btn-ghost:hover { background: #e4ebf5; }
.btn-danger { background: none; border: none; color: #b45a30; font-size: 14px; padding: 8px; }
.btn-danger:hover { text-decoration: underline; }
.hist { margin-top: 18px; border-top: 1px solid var(--card-line); padding-top: 14px; }
.hist h4 { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; font-weight: 600; }
.hist .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft); padding: 4px 0; }
.hist .row .m { color: var(--ink); }

/* toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--navy-btn); color: #eef4fb; padding: 12px 22px; border-radius: 999px; font-size: 15px; box-shadow: 0 10px 30px rgba(28,44,64,.3); z-index: 60; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.toast.show { opacity: 1; }

/* ===== phone view ======================================================== */
@media (max-width: 680px) {
  .nav { padding: 16px 18px; gap: 14px; flex-wrap: wrap; }
  .brand .word { font-size: 23px; }
  .page { padding: 10px 18px 70px; }
  h1.title { font-size: 32px; }
  .subtitle { font-size: 16px; }
  .headrow { flex-direction: column; gap: 12px; }
  .ontrack { margin-left: 0; }
  .due-grid { grid-template-columns: 1fr; gap: 16px; }
  .people-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .due-card { padding: 22px 20px 20px; }
  .btn-add { width: 100%; text-align: center; margin-top: 2px; order: 3; }
  .nav-links { order: 2; }
}
@media (max-width: 430px) {
  .people-grid { grid-template-columns: 1fr; }
}
