/* Gold Choice Booking — styles for the calendar screens (owned by that part of the app): the day / week /
   month calendar, dragging, "What's still open", the printed day sheet, Rooms & chairs, and the
   Today cards (days to close off, Jewish-calendar heads-up).
   Old-phone rules as app.css: no CSS grid, no flex gap, a literal colour before each var().
   Dark mode: the base calendar is in people.css; the lines for THESE classes are at the end. */

/* ---------- toolbar rows ---------- */
.cal-controls { margin-bottom: .35rem; -webkit-align-items: center; align-items: center; }
.cal-sep { display: inline-block; width: .35rem; margin: 0 !important; }
.cal-controls .btn-sm { padding-left: .6rem; padding-right: .6rem; }
.cal-jump { display: inline-block; margin: .25rem; white-space: nowrap; }
.cal-jump input { width: auto; min-height: 36px; padding-top: .3rem; padding-bottom: .3rem; display: inline-block; vertical-align: middle; max-width: 10rem; }
.cal-tools { margin-bottom: .6rem; }
.cal-tools form { margin: .25rem; }
.cal-back { margin: 0 0 .3rem; font-size: .9rem; }

/* ---------- Jewish calendar ---------- */
.heb { white-space: nowrap; }
.heb-under { display: block; font-weight: 400; font-size: .8rem; margin-top: .1rem; }
.heb-chip { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.3; padding: .05rem .45rem; border-radius: 999px; vertical-align: middle; white-space: nowrap; }
.heb-closed { background: #fbe8e8; color: #a12c2c; }
.heb-erev { background: #fff4d9; color: #7a5410; }
.heb-minor { background: #e7f0f9; color: #23507a; }

/* ---------- the 7-day strip under the day title ---------- */
.cal-strip { display: -webkit-flex; display: flex; margin: -.3rem -.15rem .7rem; }
.cal-sday { -webkit-flex: 1 1 0; flex: 1 1 0; min-width: 0; margin: 0 .15rem; padding: .3rem 0 .35rem; text-align: center; text-decoration: none; color: #241c22; color: var(--ink);
  background: #fff; background: var(--card); border: 1px solid #e7e0e4; border: 1px solid var(--line); border-radius: 10px; line-height: 1.15; }
.cal-sday span, .cal-sday small, .cal-sday i { display: block; font-size: .7rem; color: #6f6470; color: var(--muted); font-style: normal; white-space: nowrap; overflow: hidden; }
.cal-sday b { display: block; font-size: 1.05rem; }
.cal-sday i { font-weight: 600; margin-top: .1rem; }
.cal-sday.today { border-color: #b04a6f; border-color: var(--accent); }
.cal-sday.on { background: #2b2230; color: #fff; border-color: #2b2230; }
.cal-sday.on span, .cal-sday.on small, .cal-sday.on i { color: #e9dfe6; }
.cal-sday.closed { background: #fbe8e8; }
.cal-sday.closed.on { background: #7a2b3c; border-color: #7a2b3c; }
.cal-sday.hol { border-bottom: 3px solid #e0b354; }

/* ---------- time grid additions ---------- */
.cal-block small { display: block; padding: 2px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-appt.st-here { background: #efe6fb; }
.cal-appt.st-no b { text-decoration: line-through; }
.cal-tag { float: right; font-style: normal; font-size: .66rem; font-weight: 700; line-height: 1.35; padding: 0 .3rem; margin: 0 0 0 .2rem; border-radius: 6px; background: #ffffff; background: rgba(255,255,255,.75); color: #4a3f48; border: 1px solid #e2d8de; max-width: 4.5rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-tag-staff { color: #fff; border-color: transparent; }
.cal-tag-ok { color: #2f6b3a; }
.cal-noroom .cal-head { color: #6f6470; color: var(--muted); font-weight: 500; }
.cal-noroom .cal-body { background: #faf8f9; }
/* week grid: narrower day columns, taller headers with the Hebrew date */
.cal-wk .cal-col { -webkit-flex: 1 0 104px; flex: 1 0 104px; }
.cal-wk .cal-head { height: 60px; line-height: 1.2; padding: .3rem .2rem 0; white-space: normal; }
.cal-wk .cal-head a { color: inherit; text-decoration: none; display: block; white-space: nowrap; }
.cal-wk .cal-head small { display: block; font-weight: 400; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-wk .cal-head .heb-chip { display: inline-block; max-width: 100%; padding: 0 .3rem; font-size: .62rem; }
.cal-wk .cal-head .wk-n { display: inline; font-size: .75rem; color: #6f6470; color: var(--muted); }
.cal-wk .wk-today .cal-head { background: #f8edf1; background: var(--soft); }
.cal-wk .wk-closed .cal-body { background: #fdf3f3; }
.cal-wk .cal-appt { font-size: .72rem; padding: 2px 4px; }
/* "Best fit": the grid on wide screens, the list on phones */
.wk-grid.wk-auto { display: none; }
@media (min-width: 760px) {
  .wk-grid.wk-auto { display: block; }
  .weeklist.wk-auto { display: none; }
}

/* ---------- dragging (public/calendar.js) ---------- */
.cal-js .cal-appt[data-move] { cursor: move; cursor: -webkit-grab; cursor: grab; }
.cal-js .cal-appt { -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
.cal-rs { display: none; }
.cal-js .cal-rs { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.cal-js .cal-rs:after { content: ''; position: absolute; right: 6px; bottom: 3px; width: 18px; border-top: 2px solid #b9aeb5; border-bottom: 2px solid #b9aeb5; height: 2px; border-radius: 1px; opacity: .8; }
@media (pointer: coarse) { .cal-js .cal-rs { height: 16px; } }
.cal-appt.cal-dragging { z-index: 20; opacity: .92; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: -webkit-grabbing; cursor: grabbing; }
.cal-appt.cal-saving { opacity: .55; }
body.cal-busy, body.cal-busy * { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
body.cal-busy { cursor: -webkit-grabbing; cursor: grabbing; }
.cal-legend { margin-top: .5rem; }
.cal-tell { display: block; margin-top: .35rem; font-size: .87rem; cursor: pointer; }
.cal-tell input { width: auto; min-height: 0; margin-right: .35rem; vertical-align: middle; }
.cal-undo { position: fixed; left: 12px; right: 12px; bottom: 70px; z-index: 40; max-width: 560px; margin: 0 auto; padding: .6rem .7rem .6rem .9rem;
  border-radius: 12px; background: #2b2230; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.cal-undo span { -webkit-flex: 1; flex: 1; min-width: 0; font-size: .92rem; }
.cal-undo .btn { margin-left: .6rem; background: #fff; color: #2b2230; border-color: #fff; }
.cal-undo-err { background: #a12c2c; }
.cal-undo-x { margin-left: .4rem; background: none; border: 0; color: #fff; font-size: 1.4rem; line-height: 1; padding: .1rem .3rem; cursor: pointer; }
@media (min-width: 900px) { .cal-undo { bottom: 24px; } }

/* ---------- month ---------- */
.mo-wrap { background: #fff; background: var(--card); border: 1px solid #e7e0e4; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-month { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-month th { font-size: .75rem; font-weight: 600; color: #6f6470; color: var(--muted); padding: .35rem 0; text-align: center; border-bottom: 1px solid #e7e0e4; border-bottom: 1px solid var(--line); }
.mo-cell { padding: 0; vertical-align: top; border: 1px solid #f0eaee; height: 64px; }
.mo-cell a { display: block; min-height: 64px; padding: .25rem .25rem .3rem; text-decoration: none; color: #241c22; color: var(--ink); overflow: hidden; }
.mo-cell a:hover { background: #f8edf1; }
.mo-num { font-weight: 700; font-size: .95rem; }
.mo-heb { float: right; font-size: .68rem; color: #6f6470; color: var(--muted); }
.mo-note { display: block; font-size: .64rem; line-height: 1.2; color: #7a5410; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-count { display: inline-block; margin-top: .15rem; min-width: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: #b04a6f; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.mo-items { display: none; }
.mo-item { display: block; font-size: .7rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid #b04a6f; padding-left: .25rem; margin-top: .12rem; }
.mo-more { display: block; font-size: .68rem; color: #6f6470; color: var(--muted); margin-top: .1rem; }
@media (min-width: 760px) {
  .mo-cell { height: 96px; }
  .mo-cell a { min-height: 96px; }
  .mo-items { display: block; }
  .mo-count { display: none; }
}
.mo-out a { opacity: .45; }
.mo-today .mo-num { display: inline-block; min-width: 1.6rem; text-align: center; border-radius: 999px; background: #2b2230; color: #fff; }
.mo-on { box-shadow: inset 0 0 0 2px #b04a6f; }
.mo-yt { background: #fdf0f0; }
.mo-yt .mo-note { color: #a12c2c; }
.mo-closed { background: #f3f0f2; }
.mo-nowork a .mo-num { color: #9a8f98; }

/* ---------- What's still open ---------- */
.av-form .row3 .field { margin-bottom: .4rem; }
.av-card h2 { margin: 0 0 .5rem; }
.av-hours { display: block; font-weight: 400; font-size: .82rem; color: #6f6470; color: var(--muted); margin-top: .1rem; }
.av-gaps { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -.25rem .4rem; }
.av-gap { margin: .25rem; padding: .45rem .7rem; border-radius: 12px; border: 1px solid #cfe3d3; background: #e6f3e8; background: var(--ok-bg); color: #2f6b3a; color: var(--ok); text-decoration: none; line-height: 1.25; }
.av-gap b { display: block; font-size: .92rem; }
.av-gap small { display: block; font-size: .76rem; color: inherit; opacity: .85; }
.av-booked { margin: .3rem 0 0; line-height: 1.9; }
.av-chip { display: inline-block; font-size: .8rem; padding: .05rem .5rem; margin-right: .2rem; border-radius: 999px; background: #f3eef1; color: #4a3f48; text-decoration: none; white-space: nowrap; }

/* ---------- Rooms & chairs: colour swatches (radio buttons, no JS) ---------- */
.rm-swatches { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -.2rem; }
.rm-swatch { position: relative; margin: .2rem; cursor: pointer; }
.rm-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rm-swatch span { display: block; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #d9cfd5; }
.rm-swatch input:checked + span { box-shadow: 0 0 0 3px #2b2230; }
.rm-swatch input:focus + span { outline: 2px dotted #2b2230; outline-offset: 2px; }

/* ---------- Today cards ---------- */
.co-list > li { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.co-list > li .grow { -webkit-flex: 1; flex: 1; min-width: 0; text-decoration: none; color: inherit; margin-right: .6rem; }
.co-list > li form { -webkit-flex: none; flex: none; }
.today-heb { margin-bottom: .6rem; }
.today-tools { margin-top: -.3rem; }

/* ---------- the printed day sheet (/app/print) ---------- */
body.print-sheet { background: #fff; color: #111; padding: 1rem; max-width: 1100px; margin: 0 auto; }
.ps-bar { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 0 1rem; }
.ps-bar > * { margin: .2rem .5rem .2rem 0; }
.ps-head { display: -webkit-flex; display: flex; -webkit-justify-content: space-between; justify-content: space-between; border-bottom: 2px solid #111; padding-bottom: .5rem; margin-bottom: .6rem; }
.ps-biz { font-size: 1.25rem; }
.ps-meta { text-align: right; font-size: .85rem; color: #444; }
.print-sheet h2 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
.print-sheet h2 small { font-weight: 400; color: #555; }
.ps-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ps-table th, .ps-table td { border: 1px solid #bbb; padding: .3rem .4rem; text-align: left; vertical-align: top; }
.ps-table th { background: #f1f1f1; font-size: .78rem; }
.ps-time { white-space: nowrap; }
.ps-c { text-align: center !important; width: 3rem; }
.ps-box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid #333; border-radius: 3px; }
.ps-notes { font-size: .78rem; max-width: 18rem; }
.ps-foot { margin-top: 1.2rem; font-size: .75rem; color: #666; text-align: center; }
@media print {
  .no-print { display: none !important; }
  body.print-sheet { padding: 0; max-width: none; font-size: 11pt; }
  .ps-table { font-size: 9.5pt; }
  .ps-table tr { page-break-inside: avoid; }
  .print-sheet h2 { page-break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- dark mode (same two cases as people.css: the device is dark, or the person chose Dark) ---------- */
@media screen and (prefers-color-scheme: dark) {
  html:not(.theme-light) body.app .cal-sday.on { background: #e98fb2; border-color: #e98fb2; color: #16121a; }
  html:not(.theme-light) body.app .cal-sday.on span, html:not(.theme-light) body.app .cal-sday.on small, html:not(.theme-light) body.app .cal-sday.on i { color: #3a2531; }
  html:not(.theme-light) body.app .cal-sday.closed, html:not(.theme-light) body.app .mo-yt, html:not(.theme-light) body.app .cal-wk .wk-closed .cal-body { background: #3d1f22; }
  html:not(.theme-light) body.app .heb-closed { background: #3d1f22; color: #f3a1a1; }
  html:not(.theme-light) body.app .heb-erev { background: #3a2f17; color: #f0c674; }
  html:not(.theme-light) body.app .heb-minor { background: #1b2a3a; color: #9cc4ea; }
  html:not(.theme-light) body.app .cal-appt.st-here { background: #2e2445; }
  html:not(.theme-light) body.app .cal-tag { background: #221c26; color: #ece6ea; border-color: #3a3140; }
  html:not(.theme-light) body.app .cal-tag-staff { color: #fff; border-color: transparent; }
  html:not(.theme-light) body.app .cal-noroom .cal-body, html:not(.theme-light) body.app .mo-closed { background: #1b161e; }
  html:not(.theme-light) body.app .cal-wk .wk-today .cal-head { background: #3a2531; }
  html:not(.theme-light) body.app .mo-cell { border-color: #2e2733; }
  html:not(.theme-light) body.app .mo-cell a:hover { background: #2a2230; }
  html:not(.theme-light) body.app .mo-today .mo-num { background: #e98fb2; color: #16121a; }
  html:not(.theme-light) body.app .mo-note { color: #f0c674; }
  html:not(.theme-light) body.app .mo-yt .mo-note { color: #f3a1a1; }
  html:not(.theme-light) body.app .av-gap { background: #1d3323; border-color: #2c4a33; color: #8fd19e; }
  html:not(.theme-light) body.app .av-chip { background: #2e2733; color: #ece6ea; }
  html:not(.theme-light) body.app .rm-swatch span { border-color: #221c26; box-shadow: 0 0 0 1px #3a3140; }
  html:not(.theme-light) body.app .rm-swatch input:checked + span { box-shadow: 0 0 0 3px #ece6ea; }
  html:not(.theme-light) body.app .cal-undo { background: #ece6ea; color: #16121a; }
  html:not(.theme-light) body.app .cal-undo .btn { background: #16121a; color: #ece6ea; border-color: #16121a; }
  html:not(.theme-light) body.app .cal-undo-x { color: #16121a; }
  html:not(.theme-light) body.app .cal-undo-err { background: #f3a1a1; }
}
html.theme-dark body.app .cal-sday.on { background: #e98fb2; border-color: #e98fb2; color: #16121a; }
html.theme-dark body.app .cal-sday.on span, html.theme-dark body.app .cal-sday.on small, html.theme-dark body.app .cal-sday.on i { color: #3a2531; }
html.theme-dark body.app .cal-sday.closed, html.theme-dark body.app .mo-yt, html.theme-dark body.app .cal-wk .wk-closed .cal-body { background: #3d1f22; }
html.theme-dark body.app .heb-closed { background: #3d1f22; color: #f3a1a1; }
html.theme-dark body.app .heb-erev { background: #3a2f17; color: #f0c674; }
html.theme-dark body.app .heb-minor { background: #1b2a3a; color: #9cc4ea; }
html.theme-dark body.app .cal-appt.st-here { background: #2e2445; }
html.theme-dark body.app .cal-tag { background: #221c26; color: #ece6ea; border-color: #3a3140; }
html.theme-dark body.app .cal-tag-staff { color: #fff; border-color: transparent; }
html.theme-dark body.app .cal-noroom .cal-body, html.theme-dark body.app .mo-closed { background: #1b161e; }
html.theme-dark body.app .cal-wk .wk-today .cal-head { background: #3a2531; }
html.theme-dark body.app .mo-cell { border-color: #2e2733; }
html.theme-dark body.app .mo-cell a:hover { background: #2a2230; }
html.theme-dark body.app .mo-today .mo-num { background: #e98fb2; color: #16121a; }
html.theme-dark body.app .mo-note { color: #f0c674; }
html.theme-dark body.app .mo-yt .mo-note { color: #f3a1a1; }
html.theme-dark body.app .av-gap { background: #1d3323; border-color: #2c4a33; color: #8fd19e; }
html.theme-dark body.app .av-chip { background: #2e2733; color: #ece6ea; }
html.theme-dark body.app .rm-swatch span { border-color: #221c26; box-shadow: 0 0 0 1px #3a3140; }
html.theme-dark body.app .rm-swatch input:checked + span { box-shadow: 0 0 0 3px #ece6ea; }
html.theme-dark body.app .cal-undo { background: #ece6ea; color: #16121a; }
html.theme-dark body.app .cal-undo .btn { background: #16121a; color: #ece6ea; border-color: #16121a; }
html.theme-dark body.app .cal-undo-x { color: #16121a; }
html.theme-dark body.app .cal-undo-err { background: #f3a1a1; }
