/* Area: schedule — calendar, tours, showing log, homes, open houses.
   Tokens only (see next.css :root). No text under 14px. */

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.cal-side { position: sticky; top: 150px; }
button.ev { display: block; width: 100%; text-align: left; border: 0; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; color: inherit; }
button.ev.key { color: var(--on-dark); }
.ev svg { width: 16px; height: 16px; margin-left: 4px; }
.ev-sub { opacity: .85; font-weight: 500; }
.ev-flag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--card); color: var(--olive-deep); font-size: 14px; font-weight: 700; }
.ev.busy { background: repeating-linear-gradient(135deg, var(--sunk) 0 6px, var(--card-2) 6px 12px); color: var(--ink-2); }
.ev.tour { background: var(--olive); color: var(--on-dark); }
.day { position: relative; }
.day-add { margin-top: auto; align-self: flex-start; width: 34px; height: 34px; border-radius: 50%; border: 1.5px dashed var(--line); background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.day-add:hover { border-color: var(--ink-3); color: var(--ink); }
.day-add svg { width: 16px; height: 16px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.month-h { font-size: 14px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; padding: 0 6px; }
.mcell { min-height: 116px; background: var(--card); border-radius: var(--r-sm); padding: 10px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); min-width: 0; }
.mcell b { font-size: 18px; font-weight: 800; }
.mcell.out { background: var(--card-2); box-shadow: none; }
.mcell.out b { color: var(--ink-3); }
.mcell.today { outline: 2.5px solid var(--olive); }
.mdot { font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 6px; border-radius: 6px; background: var(--olive-tint); }
.mdot.task { background: var(--sunk); }
.mdot.tour { background: var(--olive); color: var(--on-dark); }
.mdot.key { background: var(--ink); color: var(--on-dark); }
.more-n { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.dayview { display: flex; flex-direction: column; gap: 16px; }
.hours { display: flex; flex-direction: column; }
.hour-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 0; border-top: 1.5px solid var(--line); }
.hour-row:first-child { border-top: 0; }
.hour-row .time { font-weight: 800; font-size: 15px; }

/* ---------- forms ---------- */
.seg { display: inline-flex; background: var(--sunk); border-radius: var(--pill); padding: 4px; gap: 4px; align-self: flex-start; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 10px 20px; border-radius: var(--pill); font-weight: 700; font-size: 15px; color: var(--ink-2); }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--olive); outline-offset: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 44px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--olive); flex: none; }
.field em, .field span em { font-style: normal; font-weight: 600; color: var(--ink-3); }
.form-err { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--alert-soft); color: var(--alert); font-weight: 700; font-size: 15px; }
.guests { border: 0; padding: 0; margin: 0; }
.guests legend { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.sched-form[data-kind="task"] .only-event, .sched-form[data-kind="event"] .only-task { display: none; }
.sched-form[data-allday="1"] .timed { display: none; }
.sched-form[data-video="1"] .not-video { display: none; }
.sched-form[data-person=""] .only-person { display: none; }
.sched-form[data-kind="showing"] .only-oh, .sched-form[data-kind="open_house"] .only-showing { display: none; }
.field-ta { width: 100%; min-height: 90px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); padding: 12px 14px; font-size: 16px; line-height: 1.5; resize: vertical; }
.field-ta:focus { outline: 0; border-color: var(--olive); }

/* ---------- tours ---------- */
.stop-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 46px; gap: 10px; align-items: end; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.stop { display: flex; gap: 14px; align-items: center; }
.stop .photo { border-radius: var(--r-sm); }
.stop .photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- homes ---------- */
.sent-row { padding: 10px 0; border-top: 1.5px solid var(--line); }
.sent-row:first-child { border-top: 0; padding-top: 0; }
.note-form { display: flex; gap: 8px; margin: 8px 0 0 50px; flex-wrap: wrap; }
.note-form input { flex: 1; min-width: 160px; min-height: 44px; border-radius: var(--pill); border: 1.5px solid var(--line); padding: 0 16px; background: var(--card); font-size: 15px; }
.note-form input:focus { outline: 0; border-color: var(--olive); }
.note-form .form-err { flex-basis: 100%; }
.link-photo img { max-width: 260px; border-radius: var(--r-sm); }
[aria-pressed="true"].btn-line { border-color: var(--olive); color: var(--olive-deep); background: var(--olive-tint); }

/* ---------- open houses ---------- */
.oh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.oh-photo { aspect-ratio: 4 / 3; border-radius: var(--r-lg); }
.qr-wrap { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 16px; max-width: 240px; margin: 0 auto 14px; }
.qr { display: block; width: 100%; height: auto; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.result-grid .stat { min-width: 0; padding: 14px; }
.result-grid .stat b { font-size: 28px; }
.visit-row { border-top: 1.5px solid var(--line); }
.visit-row:first-of-type { border-top: 0; }
.visit-row .visit { border-top: 0; }
.visit-row.open { background: var(--card-2); margin: 0 -16px; padding: 0 16px 16px; border-radius: var(--r-md); }
.visit-form { padding-top: 4px; }
.chip.radio { position: relative; cursor: pointer; }
.chip.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip.radio:has(input:checked) { background: var(--olive); border-color: var(--olive); color: var(--on-dark); }
.chip.radio:has(input:focus-visible) { outline: 3px solid var(--olive); outline-offset: 2px; }
.checkin fieldset { border: 0; padding: 0; margin: 0; }
.checkin legend { margin-bottom: 8px; }
.checkin legend.small { font-weight: 700; color: var(--ink-2); }

@media (max-width: 1180px) {
  .cal-grid, .oh-grid { grid-template-columns: 1fr; }
  .cal-side { position: static; }
}
.phone .stop-row { grid-template-columns: 1fr 46px; }
.phone .stop-row .field:first-child { grid-column: 1 / -1; }
.phone .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phone .hour-row { grid-template-columns: 76px 1fr; }
.phone .visit { grid-template-columns: 48px minmax(0, 1fr); }
.phone .visit > .actions { grid-column: 1 / -1; }

.link-row { display: flex; gap: 10px; align-items: flex-end; }
.link-row .btn { min-height: 50px; }
.field input.needs { border-color: var(--alert); box-shadow: 0 0 0 3px var(--alert-soft); }
.phone .link-row { flex-direction: column; align-items: stretch; }

/* sharing a home */
.share-row { background: var(--card-2); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.share-notes { display: flex; flex-direction: column; gap: 6px; }
.share-note { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); max-width: 90%; }
.share-note.out { align-self: flex-end; background: var(--sand); }
.share-note b { font-weight: 700; margin-right: 6px; }
.source-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; color: var(--olive); }
.home-hero .main-p { aspect-ratio: 4 / 3; border-radius: var(--r-lg); }

/* ============ Calendar (redesign, Tovah 2026-09-25: "this page looks like shit") ============ */
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: var(--card-2); border-radius: var(--r-xl); padding: 24px 28px; margin-bottom: 14px; }
.cal-head .display { font-size: clamp(40px, 4.4vw, 60px); }
.cal-head .display .soft { font-size: .7em; }
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-seg { display: inline-flex; background: var(--sunk); border-radius: var(--pill); padding: 4px; gap: 2px; }
/* a phone: the whole row scrolls sideways instead of clipping the last tab (audit 2026-09-27) */
.phone .cal-tools { max-width: 100%; min-width: 0; flex-wrap: wrap; }
.phone .cal-seg { display: flex; flex-wrap: wrap; max-width: 100%; border-radius: 22px; }
.cal-seg a { padding: 9px 16px; border-radius: var(--pill); text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.cal-seg a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.cal-seg .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--olive); color: var(--on-dark); font-size: 14px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 4px 12px; }
.leg { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.leg::before { content: ''; width: 12px; height: 12px; border-radius: 4px; background: var(--c); }

/* item colors: the one legend */
.k-event { --c: var(--sage); --cf: var(--ink); }
.k-task { --c: var(--butter); --cf: var(--ink); }
.k-key { --c: var(--ink); --cf: var(--on-dark); }
.k-tour { --c: var(--sky); --cf: var(--ink); }
.k-busy { --c: var(--sunk); --cf: var(--ink-2); }

.citem { display: flex; align-items: baseline; gap: 6px; width: 100%; min-width: 0; text-align: left; border: 0; font: inherit; font-size: 14px; line-height: 1.3;
  background: var(--c); color: var(--cf); border-radius: 8px; padding: 5px 8px; text-decoration: none; cursor: pointer; }
.citem .ct { flex: none; font-weight: 800; }
.citem .cx { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem svg { width: 14px; height: 14px; flex: none; align-self: center; }
.citem.past { opacity: .55; }
.citem.k-busy { background: repeating-linear-gradient(135deg, var(--sunk) 0 6px, var(--card-2) 6px 12px); cursor: default; }
.citem:hover:not(.k-busy) { filter: brightness(.97); }
.cm-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-dayview .citem .cx, .hour-row .citem .cx { white-space: normal; }

/* month */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.cm-h { padding: 12px 12px 10px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: var(--card-2); }
.cm-cell { min-height: 150px; padding: 8px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cm-cell:nth-child(7n + 1) { border-left: 0; }
.cm-cell.out { background: var(--card-2); }
.cm-cell.out .cm-num { color: var(--ink-3); }
.cm-cell.is-past:not(.out) { background: color-mix(in srgb, var(--card-2) 60%, var(--card)); }
.cm-num { align-self: flex-start; display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 16px; font-weight: 800; font-size: 16px; text-decoration: none; color: var(--ink); }
.cm-num:hover { background: var(--sunk); }
.cm-cell.is-today .cm-num { background: var(--olive); color: var(--on-dark); }
.cm-more { font-size: 14px; font-weight: 700; color: var(--olive); text-decoration: none; padding: 2px 8px; }

/* week */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cw-day { background: var(--card); border-radius: var(--r-md); padding: 10px; min-height: 360px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); min-width: 0; }
.cw-day.is-past { background: var(--card-2); box-shadow: none; }
.cw-day.is-today { outline: 2.5px solid var(--olive); }
.cw-h { display: flex; justify-content: space-between; align-items: baseline; text-decoration: none; color: var(--ink); padding: 2px 4px 6px; }
.cw-h span { font-size: 14px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.cw-h b { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.cw-day .citem .cx { white-space: normal; }

/* settings sheet rows */
.sync-row { display: flex; align-items: center; gap: 14px; background: var(--card-2); border-radius: var(--r-md); padding: 14px; flex-wrap: wrap; }
.sync-row .grow { flex: 1; min-width: 200px; }

.phone .cal-head { padding: 18px; }
.phone .cal-month { font-size: 14px; }
.phone .cm-cell { min-height: 76px; padding: 4px; }
.phone .cm-cell .citem .ct { display: none; }
.phone .cal-week { grid-template-columns: 1fr; }
.phone .cw-day { min-height: 0; }
/* month items: time on top, the title gets two full lines */
.cal-month .citem { flex-direction: column; align-items: stretch; gap: 1px; padding: 5px 8px 6px; }
.cal-month .citem .ct { font-size: 14px; font-weight: 800; opacity: .85; }
.cal-month .citem .cx { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.citem.past { opacity: .7; }
.leg::before { width: 14px; height: 14px; border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); }
/* Aero palette: tours in olive so they stand apart from the calm neutrals */
.k-tour { --c: var(--olive); --cf: var(--on-dark); }
.k-event { --c: var(--olive-soft); --cf: var(--ink); }

.citem .ck { flex: none; display: inline-grid; align-self: flex-start; }
.citem .ck svg { width: 14px; height: 14px; }
.cal-month .citem .ck { position: absolute; right: 6px; top: 6px; }
.cal-month .citem { position: relative; padding-right: 24px; }
.info-dl { display: grid; grid-template-columns: 110px 1fr; gap: 14px 18px; margin: 4px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.info-dl dt { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.info-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
/* clean pass: no extra box around the calendar head; the day view shows each time once */
.cal-head { background: transparent; padding: 0; border-radius: 0; }
.hour-row .citem .ct { display: none; }

/* ---------- tour stops: the home picker (Tovah, 2026-09-25) ---------- */
.stop-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--card); display: grid; gap: 14px; }
.stop-top { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 10px; align-items: center; }
.pick-btn { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 18px; border-radius: var(--r-md); border: 1.5px dashed var(--line); background: var(--card); text-align: left; font-weight: 800; font-size: 18px; color: var(--ink); min-width: 0; }
.pick-btn:hover { border-color: var(--ink-3); }
.pick-btn .pick-l { flex: 1; }
.pick-btn .chev { width: 20px; height: 20px; margin-left: auto; flex: none; }
.pick-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.pick-btn.picked { border-style: solid; font-size: 16px; padding: 8px 14px 8px 8px; }
.pick-list { max-height: 360px; overflow-y: auto; background: var(--card-2); border-radius: var(--r-md); padding: 8px; display: grid; gap: 4px; }
.pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-md); }
.pick-row:hover { background: var(--card); }
.pick-main { display: flex; align-items: center; gap: 16px; border: 0; background: transparent; text-align: left; padding: 0; min-width: 0; }
.pick-main[aria-pressed="true"] .pick-img { outline: 3px solid var(--accent); outline-offset: 2px; }
.pick-img { width: 88px; height: 66px; border-radius: var(--r-sm); object-fit: cover; flex: none; display: grid; place-items: center; background: var(--sunk); color: var(--ink-3); }
.pick-btn.picked .pick-img { width: 64px; height: 48px; }
.pick-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pick-t b { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-t span { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pick-details { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.pick-details:hover { border-color: var(--ink-3); }
.pick-empty { margin: 8px; }
.stop-fields { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.phone .stop-fields { grid-template-columns: 1fr; }
.phone .pick-img { width: 64px; height: 48px; }
.phone .pick-row { grid-template-columns: 1fr; }
.phone .pick-details { justify-self: start; }
.pick-arr svg { width: 16px; height: 16px; transform: rotate(-45deg); }
.sched-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cal-seg-top { margin-bottom: 24px; }
.cal-seg-top { display: flex; width: max-content; max-width: 100%; }

/* ---------- soft leads ---------- */
.soft-list { display: grid; }
.soft-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.soft-row:first-child { padding-top: 0; }
.soft-row:last-child { border-bottom: 0; padding-bottom: 0; }
.soft-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.soft-t b { font-size: 17px; }
.phone .soft-row { grid-template-columns: auto minmax(0, 1fr); }
.phone .soft-row .actions { grid-column: 1 / -1; }

/* ---------- open-house visitors: how to reach them ---------- */
.visit-contact { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; font-weight: 600; margin-top: 2px; }
.visit-contact a { color: var(--ink-2); }
.oh-welcome textarea { min-height: 140px; }
.tour-who { margin: -8px 0 20px; }
/* the back link sits above the title without pushing the head down, so the view switch lines up with the calendar's */
.tour-title { position: relative; }
.tour-back { position: absolute; left: 0; bottom: 100%; margin-bottom: 6px; white-space: nowrap; }

/* ===== calendar: simple lines, one row per item — icon · title · time (Tovah, 2026-09-25) ===== */
.leg::before { display: none; }
.leg { gap: 6px; }
.ci { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; color: var(--ink-2); }
.ci svg { width: 15px; height: 15px; }
.ci-key, .ci-tour { color: var(--accent); }
.ci-busy { color: var(--ink-3); }
.cal-month { box-shadow: none; border: 1px solid var(--line); border-radius: var(--r-lg); }
.cm-h { background: transparent; border-bottom: 1px solid var(--line); text-align: right; padding: 12px 12px 10px; }
.cm-cell { padding: 8px 8px 10px; gap: 2px; min-height: 140px; }
.cm-cell.out, .cm-cell.is-past:not(.out) { background: transparent; }
.cm-cell.out { opacity: .45; }
.cm-num { align-self: flex-end; min-width: 30px; height: 30px; font-size: 16px; }
.citem, .cal-month .citem { flex-direction: row; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 6px; background: transparent !important; color: var(--ink) !important; border: 0; box-shadow: none; }
.citem .cx, .cal-month .citem .cx { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; -webkit-line-clamp: unset; }
.citem .ct, .cal-month .citem .ct { flex: none; margin-left: auto; font-weight: 600; font-size: 14px; color: var(--ink-2); opacity: 1; font-variant-numeric: tabular-nums; }
.citem:hover:not(.k-busy) { background: var(--sunk) !important; filter: none; }
.citem.k-busy .cx { color: var(--ink-2); font-weight: 600; }
.citem.past { opacity: .5; }
.cw-day .citem, .hour-row .citem, .cal-dayview .citem { padding: 6px 8px; }
.cal-dayview .citem .cx, .hour-row .citem .cx, .cw-day .citem .cx { white-space: normal; }
.phone .cm-cell .citem .ct { display: none; }
.phone .cm-cell .citem .cx { font-size: 14px; }
