:root {
    --shofar-navy: #2c4a5e;
    --shofar-blue: #4a7c9e;
    --shofar-gold: #c9a227;
    --shofar-bg: #f5f6f8;
    --shofar-border: #d8dce0;
    --shofar-confirmed: #2e7d32;
    --shofar-tentative: #f9a825;
    --shofar-available: #eceff1;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--shofar-bg);
    color: #222;
}

.shofar-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--shofar-navy);
    color: #fff;
    padding: 12px 20px;
}
.shofar-brand-link { color: inherit; text-decoration: none; display: block; }
.shofar-brand-link:hover .shofar-title { text-decoration: underline; }
.shofar-title { font-size: 20px; font-weight: 700; margin-right: 8px; }
.shofar-subtitle { font-size: 13px; opacity: 0.8; }
.shofar-nav-links a { color: #fff; text-decoration: none; margin-left: 16px; font-size: 14px; }
.shofar-nav-links a:hover { text-decoration: underline; }

/* Two columns now: one browse pane on the left that drills district ->
   churches, and the calendar. (Was districts | calendar | churches — Sept
   2026: "maybe we just make the left list drill".) The browse pane is a bit
   wider than the old districts-only column so church cards fit comfortably. */
#shofar-app {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1px;
    background: var(--shofar-border);
    height: calc(100vh - 52px);
}

.browse-pane, .calendar-pane {
    background: #fff;
    padding: 16px;
    overflow-y: auto;
    min-height: 0; /* grid items default to min-height:auto, which lets them grow past the row and defeats overflow-y — this pins each column to the row height so it scrolls on its own instead of the whole page. */
}

.browse-pane h2, .calendar-pane h2 { font-size: 15px; margin: 0 0 10px; color: var(--shofar-navy); }

.country-picker { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.country-picker label { font-size: 12px; color: #555; }
.country-picker select { padding: 6px; border: 1px solid var(--shofar-border); border-radius: 4px; }

#district-filter, #church-search { width: 100%; padding: 6px 8px; margin-bottom: 10px; border: 1px solid var(--shofar-border); border-radius: 4px; }

.hint { font-size: 12px; color: #777; }

/* "?" icon + popover — replaces a long always-visible .hint paragraph with
   a small toggle so the calendar header doesn't eat half the screen (Sept
   2026: "I need a way to have this text pop up as a tool tip... it is
   taking more than half of the page"). wireHintPopovers() in shofar.js
   shows/hides .hint-popover on click, closes others, and closes on an
   outside click or Escape. */
.hint-wrap { position: relative; display: inline-flex; align-items: center; margin: 2px 4px 2px 0; }
.hint-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 19px; height: 19px; border-radius: 50%; flex-shrink: 0;
    border: 1px solid var(--shofar-blue); background: #fff; color: var(--shofar-blue);
    font-size: 12px; font-weight: bold; line-height: 1; padding: 0; cursor: pointer;
}
.hint-icon-btn:hover, .hint-icon-btn.active { background: var(--shofar-blue); color: #fff; }
.hint-popover {
    position: absolute; top: 24px; left: 0; z-index: 40;
    width: 280px; max-width: min(80vw, 320px);
    background: #fff; border: 1px solid var(--shofar-border); border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18); padding: 10px 12px;
    font-size: 12.5px; line-height: 1.45; color: #555;
}
/* The Outlook-link hint sits at the right end of its row — open it leftward
   so it doesn't run off the edge of the calendar pane. */
.ics-link-row .hint-popover { left: auto; right: 0; }

#district-list { list-style: none; padding: 0; margin: 0; }
#district-list li { padding: 6px; border-radius: 4px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
#district-list li.district-group-heading {
    display: block;
    padding: 10px 4px 2px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    font-weight: 700;
}
#district-list li.district-group-heading:first-child { padding-top: 2px; }
#district-list li:hover { background: var(--shofar-available); }
#district-list li.active { background: var(--shofar-blue); color: #fff; }
#district-list li .district-name { flex: 1; cursor: pointer; }
#district-list li .count { opacity: 0.7; font-size: 12px; }
.district-contact-btn { background: none; border: none; cursor: pointer; font-size: 13px; opacity: 0.6; padding: 2px 4px; }
.district-contact-btn:hover { opacity: 1; }

/* "›" at the end of each district row — signals that clicking the name
   drills into that district's churches. */
.district-drill-arrow { cursor: pointer; font-size: 18px; line-height: 1; opacity: 0.45; padding: 0 2px 0 4px; }
#district-list li:hover .district-drill-arrow { opacity: 0.9; }
#district-list li.active .district-drill-arrow { opacity: 0.9; }

/* "Search all churches for "x" →" at the bottom of a filtered district list. */
#district-list li.district-search-all { display: block; padding: 10px 6px 4px; border-top: 1px solid var(--shofar-border); margin-top: 6px; border-radius: 0; }
#district-list li.district-search-all:hover { background: none; }

/* ---------------- Drilled-in church view (inside the browse pane) ---------------- */
.churches-view-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.churches-view-header h2 { margin: 0; }
.drill-back-btn {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 4px;
    border: none; background: none; color: var(--shofar-blue);
    font-size: 13px; cursor: pointer; padding: 0;
}
.drill-back-btn:hover { text-decoration: underline; }
.drill-district-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.drill-district-actions .link-btn { padding: 0; font-size: 12px; }
#church-list .empty-hint { list-style: none; }

.church-cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.church-card {
    position: relative;
    border: 1px solid var(--shofar-border);
    border-radius: 6px;
    padding: 10px 38px 10px 10px;
    cursor: grab;
    background: #fafbfc;
}
.schedule-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--shofar-blue);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.schedule-btn:hover { opacity: 0.9; }
.church-card:active { cursor: grabbing; }
.church-card .name { font-weight: 600; font-size: 14px; }
.church-card .addr { font-size: 12px; color: #555; margin-top: 2px; }
.church-card .stage-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--shofar-available);
    margin-top: 4px;
}
.church-card .stage-badge.confirmed { background: var(--shofar-confirmed); color: #fff; }
.church-card .stage-badge.follow_up, .church-card .stage-badge.letter_sent { background: var(--shofar-tentative); }
.church-card .stage-badge.declined { background: #c62828; color: #fff; }

.link-btn { background: none; border: none; color: var(--shofar-blue); cursor: pointer; font-size: 13px; padding: 4px 0; text-align: left; }
.link-btn:hover { text-decoration: underline; }

.calendar-pane-header { margin-bottom: 14px; }
.calendar-pane-header h2 { margin-bottom: 4px; }

.public-share-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    background: #eef6ff; border: 1px solid #bcdcff; border-radius: 6px;
    padding: 8px 10px; margin-bottom: 10px; font-size: 12px;
}
.public-share-label { font-weight: 600; color: var(--shofar-navy); }
#public-link-box, #ics-link-input {
    flex: 1 1 220px; min-width: 160px; padding: 5px 7px; font-size: 12px;
    border: 1px solid var(--shofar-border); border-radius: 4px; background: #fff;
}
.public-share-box .link-btn { white-space: nowrap; }

/* Private Outlook/phone subscription link — slightly different tint from the
   public link box above so the two don't get confused (this one shows
   church names and lodging). */
.ics-share-box { background: #f3f0ff; border-color: #d4c9f5; }
.ics-link-row { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; }

.tour-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tour-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--shofar-border);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    background: #fafbfc;
    cursor: pointer;
}
.tour-tab:hover { background: var(--shofar-available); }
.tour-tab.active { background: var(--shofar-blue); color: #fff; border-color: var(--shofar-blue); }
.tour-tab .tour-delete { background: none; border: none; color: inherit; opacity: 0.7; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.tour-tab .tour-delete:hover { opacity: 1; }
.tour-tab.active .tour-delete:hover { color: #ffcdd2; }

#add-tour-form { display: flex; flex-direction: column; gap: 6px; font-size: 12px; margin-bottom: 14px; border: 1px solid var(--shofar-border); border-radius: 4px; padding: 10px; background: #fafbfc; width: min(320px, 100%); }
#add-tour-form input { padding: 5px; border: 1px solid var(--shofar-border); border-radius: 4px; }
#add-tour-form button { align-self: flex-start; }

.district-blocks-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.district-block-chip {
    display: flex; align-items: center; gap: 6px;
    background: #fff3d6; border: 1px solid var(--shofar-gold); border-radius: 14px;
    padding: 4px 10px; font-size: 12px; color: #6b5416;
}
.district-block-chip button { background: none; border: none; color: #a5771a; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.district-block-chip button:hover { color: #c62828; }

/* Small color dot in front of each chip's label, matching the district's
   band/legend color (set inline via JS — see shofarDistrictColor() in
   shofar.js) so the chip list reads as a legend of its own. */
.district-block-chip-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    border: 1px solid rgba(0,0,0,0.15);
}

.district-band {
    /* Per-district background now comes from an inline style (see
       shofar_district_color()/shofarDistrictColor()) so every tour gets its
       own distinguishable color; this class just fixes the text to a
       readable white against any of those darker palette colors. */
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: 3px;
    padding: 1px 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 2px;
}
.district-band-label { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.district-band-handle {
    cursor: grab;
    flex: 0 0 auto;
    padding: 0 1px;
    font-weight: 900;
    border-radius: 2px;
}
.district-band-handle:hover, .district-band-handle:active { background: rgba(0,0,0,0.15); }

.district-tour-btn { background: none; border: none; cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1; }

/* While placing/resizing a district tour (tap-to-place or drag), the
   calendar's day cells become the drop/tap target. */
.placing-district .cal-cell:not(.cal-pad) { cursor: pointer; }
.cal-cell.dragover { outline: 2px dashed var(--shofar-blue); }
.cal-cell.dragover-district { outline: 2px dashed var(--shofar-gold); }

.view-toggle { display: inline-flex; border: 1px solid var(--shofar-border); border-radius: 6px; overflow: hidden; margin: 4px 0 10px; }
.view-toggle-btn { background: #fafbfc; border: none; padding: 7px 14px; font-size: 13px; cursor: pointer; color: #555; }
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--shofar-border); }
.view-toggle-btn:hover { background: var(--shofar-available); }
.view-toggle-btn.active { background: var(--shofar-blue); color: #fff; }

/* Map view: a tall map with the numbered list of visits beside it. */
.tour-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: stretch; }
#tour-map { height: 72vh; min-height: 460px; border-radius: 6px; border: 1px solid var(--shofar-border); z-index: 1; }
.shofar-map-pin {
    background: var(--shofar-navy);
    color: #fff;
    border-radius: 14px;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
.shofar-map-pin-wide { background: var(--shofar-blue); }
.map-popup strong { display: block; margin-bottom: 4px; font-size: 13.5px; }
.map-popup-num { display: inline-block; min-width: 18px; font-weight: 700; color: var(--shofar-navy); }
.map-popup-sub { color: #666; font-size: 12px; margin-top: 2px; }
.map-popup .link-btn { margin-top: 6px; padding: 0; }

#tour-route-summary { margin: 0 0 8px; }
#tour-route-list { list-style: none; padding: 0; margin: 0; height: 72vh; min-height: 460px; overflow-y: auto; border: 1px solid var(--shofar-border); border-radius: 6px; background: #fff; }
.map-stop + .map-stop { border-top: 1px solid var(--shofar-border); }
.map-stop button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; background: none; border: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.map-stop button:hover:not(:disabled) { background: var(--shofar-available); }
.map-stop button:disabled { cursor: default; }
.map-stop-num { flex: 0 0 auto; min-width: 24px; height: 24px; border-radius: 12px; background: var(--shofar-navy); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.map-stop-missing .map-stop-num { background: #9aa3a9; }
.map-stop-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.map-stop-date { color: #666; font-size: 11.5px; }
.map-stop-sub { color: #777; font-size: 12px; }
.map-stop-missing .map-stop-sub { color: #8a5a00; }
@media (max-width: 900px) {
    .tour-map-layout { grid-template-columns: 1fr; }
    #tour-map { height: 60vh; min-height: 340px; }
    #tour-route-list { height: auto; min-height: 0; max-height: 50vh; }
}

.empty-hint { font-size: 13px; color: #888; font-style: italic; }

/* Real finger-dragging on touch (church cards, district cards, district-band
   edge handles) — see the touch-drag section near the end of shofar.js. */
.touch-dragging { opacity: 0.3; }
.shofar-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.cal-month { margin-bottom: 20px; }
.cal-month h3 { font-size: 14px; color: var(--shofar-navy); margin: 0 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { font-size: 11px; text-transform: uppercase; color: #888; text-align: center; padding-bottom: 2px; }
.cal-cell {
    min-height: 70px;
    border: 1px solid var(--shofar-border);
    border-radius: 4px;
    padding: 4px;
    font-size: 11px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.cal-cell.cal-pad { background: transparent; border: none; }
.cal-day-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-daynum { font-weight: 600; }

/* The "⋯" button that opens the rest-day / housing / transportation modal
   for one date, plus the at-a-glance emoji badges for whatever's already
   filled in (see buildDayCell()/renderDayModal() in shofar.js), and the
   subtle styling that marks a whole cell as a rest day. */
.day-detail-btn {
    background: none; border: none; cursor: pointer; padding: 0 2px;
    font-size: 13px; line-height: 1; color: var(--shofar-navy); opacity: 0.6;
}
.day-detail-btn:hover { opacity: 1; }
.cal-day-badges { font-size: 12px; line-height: 1.2; margin: 1px 0; }
.cal-rest-note {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
    color: #5a5a5a; margin-bottom: 2px;
}
.cal-cell.rest-day { background: repeating-linear-gradient(135deg, #f3f3f3, #f3f3f3 8px, #ececec 8px, #ececec 16px); }

.cal-slot {
    position: relative;
    background: var(--shofar-available);
    border-radius: 3px;
    padding: 3px 34px 3px 3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cal-slot.confirmed { background: #e8f5e9; outline: 1px solid var(--shofar-confirmed); }
.cal-slot.dragover { outline: 2px dashed var(--shofar-blue); }
.cal-slot .slot-time { border: 1px solid var(--shofar-border); border-radius: 3px; font-size: 10px; padding: 1px 2px; width: 100%; }
.cal-church { cursor: grab; font-size: 11px; line-height: 1.3; word-break: break-word; }
.cal-church:active { cursor: grabbing; }
.cal-church.cal-empty { cursor: default; color: #999; font-style: italic; }
.cal-clear { position: absolute; top: 2px; right: 2px; background: none; border: none; color: #c62828; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px; }
.cal-move { position: absolute; top: 2px; right: 16px; background: none; border: none; color: var(--shofar-blue); cursor: pointer; font-size: 12px; line-height: 1; padding: 3px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal.hidden { display: none; }
#church-modal { z-index: 200; }
.modal-content { background: #fff; border-radius: 8px; padding: 20px; width: 420px; max-height: 80vh; overflow-y: auto; position: relative; }
.modal-content.modal-content-wide { width: min(900px, 92vw); }
.modal-close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 20px; cursor: pointer; }
.modal-content h3 { margin-top: 0; }
.modal-content label { display: block; font-size: 12px; margin-top: 10px; margin-bottom: 3px; color: #555; }
.modal-content input, .modal-content select, .modal-content textarea { width: 100%; padding: 6px; border: 1px solid var(--shofar-border); border-radius: 4px; }
.modal-content .modal-actions { margin-top: 14px; display: flex; gap: 8px; }
.modal-content button.primary { background: var(--shofar-blue); color: #fff; border: none; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.contact-log-item { font-size: 12px; border-top: 1px solid var(--shofar-border); padding: 6px 0; }
.modal-content .hint { font-size: 11px; color: #888; margin: 2px 0 8px; }
table.visit-history { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
table.visit-history th { text-align: left; color: #777; font-weight: 600; font-size: 11px; padding: 4px 4px; border-bottom: 1px solid var(--shofar-border); }
table.visit-history td { padding: 4px; border-bottom: 1px solid var(--shofar-border); vertical-align: middle; }
table.visit-history input.visit-amount { width: 90px; padding: 4px; }
.modal-content details { font-size: 12px; }
.modal-content summary { cursor: pointer; color: var(--shofar-blue); margin-top: 10px; }

/* ---------------- Tap-to-schedule placement banner ---------------- */
/* Alternative to drag-and-drop: tap the + on a church card (closes the
   mobile browse sheet so the calendar is fully visible), then tap a date's
   slot to schedule it there. Solves the problem drag has on phones, where
   the church list and the calendar can't both be on screen at once. */
#placement-banner {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 70;
    background: var(--shofar-gold);
    color: #2c2c2c;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
#placement-banner button {
    background: rgba(0,0,0,0.15);
    border: none;
    color: inherit;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
#placement-banner button:hover { background: rgba(0,0,0,0.25); }

/* ---------------- Touch-friendly tap targets ---------------- */
/* Mouse users get native HTML5 drag/drop; touch users get a hand-rolled
   equivalent (see the touch-drag section near the end of shofar.js) since
   most phone browsers don't fire real drag events from a finger — plus,
   for anyone who'd rather not drag, the tap-then-tap flow (+ / 📅 / ⇄
   buttons plus the placement banner). touch-action: none on the
   draggable items stops the page from trying to scroll while one is being
   dragged; the other rules stop a long tap from popping an OS
   text-selection or callout menu. */
.church-card, .cal-church, #district-list li[draggable="true"], .district-band-handle {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

/* ---------------- Mobile layout ---------------- */
/* The calendar is the most important part of the screen, so on narrow
   viewports it takes the full width and the browse pane collapses into a
   slide-up sheet you open on demand. The same district -> churches drill
   happens inside the sheet as on desktop. */
.mobile-browse-btn, .mobile-close-btn { display: none; }

@media (max-width: 860px) {
    #shofar-app {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .calendar-pane { grid-column: 1; grid-row: 1; }

    .mobile-browse-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--shofar-blue);
        color: #fff;
        border: none;
        border-radius: 20px;
        padding: 9px 16px;
        font-size: 13px;
        cursor: pointer;
        margin: 4px 0 10px;
    }

    #drawer-scrim {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 40;
    }
    #drawer-scrim.open { display: block; }

    .browse-pane {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        height: 68vh;
        max-height: 68vh;
        width: auto;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -6px 24px rgba(0,0,0,0.3);
        transform: translateY(105%);
        transition: transform 0.25s ease;
        z-index: 50;
        padding-top: 34px;
    }
    .browse-pane.open { transform: translateY(0); }

    .browse-pane::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: #ccc;
    }

    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 6px;
        right: 10px;
        border: none;
        background: none;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
        color: #777;
        padding: 6px;
    }
}

/* ---------------- Public pages (public.php, profile.php) ---------------- */
/* Standalone, share-worthy pages reachable with no login — deliberately no
   app navbar here, since a stranger following the link shouldn't see
   internal Shofar navigation (or a "Home" link that just bounces them to
   a login screen). */
body.public-page {
    display: block;
    min-height: 100vh;
    background: var(--shofar-bg);
}
.public-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    text-align: center;
}
.public-calendar-page .public-wrap { max-width: 900px; }
.public-wrap h1 { color: var(--shofar-navy); font-size: 1.5rem; margin: 4px 0 6px; }
.public-wrap h2 { color: var(--shofar-navy); font-size: 1.05rem; margin: 22px 0 8px; text-align: left; }
.public-wrap .hint { text-align: left; }
.public-back { text-align: left; }
.public-back a, .public-profile-link a { color: var(--shofar-blue); text-decoration: none; font-weight: 600; }
.public-back a:hover, .public-profile-link a:hover { text-decoration: underline; }
.public-district { font-size: 14px; color: #444; }
.public-countries { font-size: 14px; color: #444; }
.public-ministries { font-size: 13px; color: #666; }
.public-bio { font-size: 14px; color: #444; text-align: left; white-space: pre-line; margin: 14px 0; }
.public-profile-link { margin-top: 28px; font-size: 15px; }

.public-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 4px 0 16px; font-size: 12px; color: #555; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--shofar-border); }
.legend-swatch.legend-taken { background: var(--shofar-tentative); border-color: var(--shofar-tentative); }
.legend-swatch.legend-open { background: var(--shofar-available); }
.legend-swatch.legend-district { background: var(--shofar-gold); border-color: var(--shofar-gold); }

.public-cal-cell { align-items: center; text-align: center; justify-content: flex-start; }
.public-taken { background: #fdecc8; border-color: var(--shofar-tentative); }
.public-open { background: #fff; }
.public-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; color: #888; }
.public-taken .public-status { color: #a5771a; font-weight: 600; }

.profile-photo-wrap { margin: 0 auto 14px; }
.profile-photo {
    width: 160px; height: 160px; object-fit: cover; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.profile-photo-placeholder {
    width: 160px; height: 160px; border-radius: 50%; margin: 0 auto;
    background: var(--shofar-available); color: #999; font-size: 12px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.open-slot-list { list-style: none; padding: 0; margin: 0; text-align: left; }
.open-slot-list li {
    background: #fff; border: 1px solid var(--shofar-border); border-left: 3px solid var(--shofar-confirmed);
    border-radius: 4px; padding: 8px 12px; margin-bottom: 6px; font-size: 14px;
}

.public-wrap form { text-align: left; }
.public-wrap form label { display: block; font-size: 12px; color: #555; margin: 12px 0 3px; }
.public-wrap form input[type="file"],
.public-wrap form select,
.public-wrap form textarea { width: 100%; padding: 6px; border: 1px solid var(--shofar-border); border-radius: 4px; font-family: inherit; font-size: 13px; box-sizing: border-box; }
.public-wrap form textarea { resize: vertical; }
.public-wrap form select[multiple] { padding: 0; }
.public-wrap form select[multiple] option { padding: 5px 8px; }
.public-wrap button.primary { margin-top: 14px; background: var(--shofar-blue); color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
.save-ok { color: var(--shofar-confirmed); font-weight: 600; text-align: left; }
.save-error { color: #c62828; text-align: left; }
.public-link-box { width: 100%; padding: 8px; border: 1px solid var(--shofar-border); border-radius: 4px; font-size: 13px; background: #fafbfc; }

/* coordinator.php — one form-style card per date, no drag-and-drop (see
   js/coordinator.js for why: this page is for someone who has never used
   Shofar before). Reuses the same public-page look as public.php/profile.php. */
.coordinator-page .public-wrap { max-width: 640px; }
.coord-day-card {
    text-align: left; background: #fff; border: 1px solid var(--shofar-border); border-radius: 6px;
    padding: 14px 16px; margin-bottom: 14px;
}
.coord-day-card.coord-rest-day { background: #f7f7f7; }
.coord-day-card h3 { margin: 0 0 8px; color: var(--shofar-navy); font-size: 15px; }
.coord-day-card h4 { margin: 14px 0 4px; font-size: 13px; color: var(--shofar-navy); }
.coord-day-card label { display: block; font-size: 13px; color: #444; margin: 6px 0; }
.coord-day-card select, .coord-day-card textarea {
    width: 100%; padding: 6px; border: 1px solid var(--shofar-border); border-radius: 4px;
    font-family: inherit; font-size: 13px; box-sizing: border-box; margin-bottom: 4px;
}
.coord-day-card textarea { resize: vertical; }
.coord-slots { margin: 8px 0; }
.coord-slot-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.coord-slot-label { font-size: 12px; color: #666; width: 60px; flex: 0 0 auto; }
.coord-slot-row select { flex: 1; margin-bottom: 0; }
.coord-day-card .modal-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.coord-day-card .modal-actions button { padding: 6px 12px; border: 1px solid var(--shofar-border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.coord-day-card .modal-actions button.primary { background: var(--shofar-blue); color: #fff; border-color: var(--shofar-blue); }

/* "I'm at this church" — save the phone's GPS as the church's map spot. */
.church-gps { margin: 4px 0 12px; padding: 8px 10px; background: var(--shofar-bg); border: 1px solid var(--shofar-border); border-radius: 6px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.church-gps #church-gps-confirm { flex-basis: 100%; }
.church-gps #church-gps-confirm button { margin-left: 4px; }

/* A church already on the calendar lets a finger scroll past it; it only
   becomes draggable after a press-and-hold (see armTouchDrag in shofar.js). */
.cal-slot .cal-church { touch-action: pan-x pan-y; }
.cal-church.touch-hold-ready { outline: 2px solid var(--shofar-gold); outline-offset: 2px; border-radius: 3px; background: #fff8e1; }

/* ---------------------------------------------------------------------
   The deputation record (Oct 2026). A date that has passed keeps its
   churches as a record: the day is toned down, a booked church shows a
   lock instead of the move / remove buttons, and a visit that didn't
   happen can be marked cancelled. "cal-frozen" is a date whose deputation
   ended more than a month ago — nothing on it can be changed. The same
   classes are used by the coordinator page (js/coordinator.js).
   --------------------------------------------------------------------- */
.cal-cell.cal-locked { background: #f4f5f6; }
.cal-cell.cal-locked .cal-daynum { color: #7a8085; }
.cal-cell.cal-frozen { background: #ececee; }
.cal-slot.slot-locked { padding-right: 20px; }
.cal-slot.slot-locked.confirmed { background: #eef3ee; outline-color: #9bb89d; }
.cal-slot.slot-locked .cal-church.cal-empty { color: #aaa; }
.cal-church.cal-church-locked { cursor: pointer; }
.cal-church.cal-church-locked:active { cursor: pointer; }
.cal-lock { position: absolute; top: 2px; right: 3px; font-size: 10px; line-height: 1; opacity: 0.55; cursor: help; }
.cal-slot.slot-cancelled.confirmed { background: #fbeeee; outline: 1px dashed #c98a8a; }
.cal-slot.slot-cancelled .cal-church { text-decoration: line-through; color: #8a5a5a; }
.cal-cancelled-tag { font-size: 10px; font-weight: 700; color: #a23b3b; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.2; }
.cal-cancel-btn { align-self: flex-start; background: none; border: none; padding: 0; font-size: 10px; color: var(--shofar-blue); cursor: pointer; text-decoration: underline; }
.cal-cancel-btn:hover { color: var(--shofar-navy); }
.record-note { background: #f4f5f6; border-left: 3px solid var(--shofar-gold); padding: 6px 10px; font-size: 12px; color: #444; margin: 6px 0 10px; }
tr.visit-cancelled td:first-child { color: #8a5a5a; }

/* Coordinator page (coordinator.php keeps its own co- styles inline; these
   are the few extra ones for the record lock, kept here with the rest). */
.co-day.co-locked { background: #f4f5f6; }
.co-day.co-frozen { background: #ececee; }
.co-slot.co-locked { padding-right: 22px; }
.co-slot.co-locked.co-booked { background: #eef3ee; }
.co-slot.co-locked .co-church.co-church-locked { cursor: default; }
.co-slot .co-lock { position: absolute; top: 4px; right: 5px; font-size: 11px; line-height: 1; opacity: 0.55; cursor: help; }
.co-slot.co-cancelled.co-booked { background: #fbeeee; outline: 1px dashed #c98a8a; }
.co-slot.co-cancelled .co-church { text-decoration: line-through; color: #8a5a5a; }
