* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; color: #1a1a2e; background: #f6f7fb; }
header { background: #16213e; color: #fff; padding: 0.9rem 1rem 0.7rem; }
header h1 { margin: 0; font-size: 1.25rem; }
.tagline { margin: 0.2rem 0 0; font-size: 0.85rem; opacity: 0.85; }
#tabs { display: flex; background: #16213e; padding: 0 0.5rem; }
#tabs button { flex: 1; background: none; border: none; color: #cdd3e0; padding: 0.6rem 0.3rem; font-size: 0.85rem; cursor: pointer; border-bottom: 3px solid transparent; }
#tabs button.active { color: #fff; border-bottom-color: #e0a458; }
.tab { display: none; padding: 0.8rem; }
.tab.active { display: block; }
#tab-map { padding: 0; }
#map { width: 100%; height: 62vh; }
.legend { font-size: 0.75rem; color: #555; padding: 0.5rem 0.8rem; margin: 0; }
form { max-width: 30rem; margin: 0 auto; display: flex; flex-direction: column; gap: 0.7rem; }
label { display: flex; flex-direction: column; font-size: 0.85rem; gap: 0.25rem; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
fieldset { border: 1px solid #d5d9e2; border-radius: 6px; font-size: 0.85rem; }
fieldset label { margin: 0.3rem 0; flex-direction: row; align-items: center; gap: 0.5rem; }
fieldset label input { margin: 0; }
#demo-banner { background: #b3541e; color: #fff; text-align: center; font-size: 0.8rem; padding: 0.45rem 0.6rem; display: none; }
#demo-banner.show { display: block; }
input { padding: 0.45rem; border: 1px solid #c3c9d4; border-radius: 6px; font-size: 1rem; }
button[type=submit] { background: #16213e; color: #fff; border: none; border-radius: 6px; padding: 0.7rem; font-size: 1rem; cursor: pointer; }
.privacy { font-size: 0.75rem; color: #555; background: #eef1f7; padding: 0.5rem; border-radius: 6px; margin: 0; }
#pin-result, #minyan-result { font-size: 0.85rem; margin: 0; min-height: 1.2em; }
#minyan-list { list-style: none; padding: 0; max-width: 30rem; margin: 0 auto 1rem; }
#minyan-list li { background: #fff; border: 1px solid #e1e4ec; border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; }
#minyan-list .m-time { color: #16213e; font-weight: 600; }
#minyan-list .m-access { font-size: 0.8rem; color: #555; }
.maplibregl-popup-content { font-size: 0.85rem; }

#purpose-note {
  background: #fff8e6;
  border: 1px solid #e0c878;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Preview mode: forms visible but non-submitting while registration is closed */
button:disabled { opacity: .55; cursor: not-allowed; }

/* Find-the-next-mincha results */
#nearest { margin-bottom: 1rem; }
#nearest button { padding: .6rem 1rem; }
.nearest-head { font-weight: 600; margin: .75rem 0 .25rem; }
.nearest-toggle { margin: 0 0 .5rem; font-size: .9rem; }
.nearest-card { border: 1px solid #d8d3c8; border-radius: 8px; padding: .6rem .8rem; margin-bottom: .6rem; background: #fff; }
.nearest-card div { margin: .15rem 0; }
.nearest-note { font-style: italic; font-size: .9rem; color: #6b5d43; }

.public-preview { padding: 1rem; border: 2px solid #1a7f4b; border-radius: 8px; background: #f4faf6; display: grid; gap: .6rem; }
.public-preview h3 { font-size: 1rem; margin: 0; }
.preview-badge { margin: 0; color: #315840; font-size: .75rem; }
.public-preview-card { background: white; border: 1px solid #c5d9cb; border-radius: 6px; padding: .8rem; display: grid; gap: .4rem; overflow-wrap: anywhere; }

.private-preview { padding: 1rem; border: 1px dashed #8a94a8; border-radius: 8px; background: #eef1f7; }
.private-preview h3 { margin: 0; font-size: .95rem; }
.private-preview p { font-size: .85rem; }

.suggest-link { display: inline-block; padding: .6rem .8rem; border: 1px solid #16213e; border-radius: 6px; color: #16213e; background: #fff; font-weight: 600; }
#minyan-form { scroll-margin-top: 1rem; }
.suggest-fields { min-width: 0; display: grid; gap: .65rem; padding: .8rem; }
.suggest-fields label:not(.check) { flex-direction: column; align-items: stretch; }
.suggest-fields input:not([type=checkbox]), .suggest-fields textarea { width: 100%; box-sizing: border-box; min-width: 0; }
.suggest-fields textarea { padding: .45rem; border: 1px solid #c3c9d4; border-radius: 6px; font: inherit; resize: vertical; }
.suggest-fields .check { align-items: flex-start; }

.minyan-resources { max-width: 30rem; margin: 1rem auto 1.5rem; padding: 1rem; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; }
.minyan-resources h3 { margin-top: 0; }
.minyan-resources ul { padding-left: 1.2rem; }
.minyan-resources li { margin: .8rem 0; line-height: 1.5; overflow-wrap: anywhere; }
.minyan-resources a { color: #163d78; text-decoration: underline; }

/* Header with project logo */
header { display: flex; align-items: center; gap: 0.75rem; }
header .logo { width: 48px; height: 48px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.35); flex: none; }
header .title-block { min-width: 0; }

/* Minyanim table */
.table-wrap { overflow-x: auto; max-width: 62rem; margin: 0 auto 0.5rem; border: 1px solid #e1e4ec; border-radius: 8px; background: #fff; }
#minyan-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 40rem; }
#minyan-table th { text-align: left; background: #16213e; color: #fff; padding: 0.5rem 0.6rem; font-size: 0.78rem; letter-spacing: 0.02em; position: sticky; top: 0; }
#minyan-table td { padding: 0.5rem 0.6rem; border-top: 1px solid #e8ebf2; vertical-align: top; }
#minyan-table tbody tr:nth-child(even) { background: #f4f6fa; }
#minyan-table .m-addr { color: #555; font-size: 0.78rem; }
#minyan-table .m-time { font-weight: 600; color: #16213e; white-space: nowrap; }
#minyan-table .m-days { white-space: nowrap; }
#minyan-table .m-notes { font-size: 0.78rem; color: #555; }
.pill { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.pill-school { background: #fdf0dc; color: #8a5a12; border: 1px solid #e8c98a; }
.pill-regular { background: #e5f4ea; color: #1a6b3d; border: 1px solid #b3d9c1; }
.pill-seasonal { background: #e3ecf9; color: #274b86; border: 1px solid #b9cbe8; }
.table-note { max-width: 62rem; margin: 0.4rem auto 1rem; font-size: 0.75rem; color: #555; padding: 0 0.2rem; }

/* Manage-your-pin */
.manage-pin { max-width: 30rem; margin: 1.2rem auto 0; padding: 1rem; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; display: grid; gap: 0.65rem; }
.manage-pin h3 { margin: 0; font-size: 1rem; }
.manage-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.manage-actions button { padding: 0.55rem 0.9rem; border-radius: 6px; border: 1px solid #16213e; background: #fff; color: #16213e; font-size: 0.9rem; cursor: pointer; }
.manage-actions button.danger { border-color: #a33327; color: #a33327; }
.manage-actions button.danger:not(:disabled) { background: #a33327; color: #fff; }
#manage-status { font-size: 0.85rem; }
.manage-card { border: 1px solid #c5d9cb; background: #f4faf6; border-radius: 6px; padding: 0.7rem 0.8rem; display: grid; gap: 0.3rem; }
.manage-card .mc-label { font-size: 0.72rem; color: #555; }
.manage-card .mc-inactive { color: #8a5a12; font-weight: 600; }
#pin-result a { color: #163d78; overflow-wrap: anywhere; }

/* Schedule labels per the printed-list legend */
.pill-year { background: #e5f4ea; color: #1a6b3d; border: 1px solid #b3d9c1; }
.sched-plain { font-size: 0.75rem; color: #666; }

/* Invite-mode address confirmation */
.confirm-bar { border: 2px solid #1a7f4b; border-radius: 8px; background: #f4faf6; padding: 0.8rem; display: grid; gap: 0.6rem; margin-top: 0.4rem; }
.confirm-bar p { margin: 0; font-size: 0.88rem; }
.confirm-bar button { padding: 0.55rem 0.9rem; border-radius: 6px; border: 1px solid #16213e; font-size: 0.9rem; cursor: pointer; }
.confirm-bar button:first-of-type { background: #16213e; color: #fff; }
.confirm-bar button:last-of-type { background: #fff; color: #16213e; }

/* Address suggestions dropdown (as-you-type, Geoapify via our worker) */
.addr-wrap { position: relative; }
.addr-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid #b9c2d0; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15); overflow: hidden; }
.addr-opt { display: block; width: 100%; text-align: left; padding: 0.5rem 0.6rem; background: #fff; border: 0; border-bottom: 1px solid #e7ebf2; font-size: 0.85rem; cursor: pointer; }
.addr-opt:last-child { border-bottom: 0; }
.addr-opt:hover, .addr-opt:focus { background: #eef1f7; outline: none; }

/* honeypot: invisible to humans, bots fill it */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
