/* Redbird Calendar. Same look as Redbird Books. */
:root {
  --bg: #f6f5f2; --card: #fff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e4e2dc;
  --accent: #c62828; --accent-soft: rgba(198, 40, 40, .10); --on-accent: #fff;
  --red: #c62828; --red-soft: #fdecea; --green: #1b7f4b; --green-soft: #e6f4ec;
  --amber: #a15c00; --amber-soft: #fff3e0; --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416; --card: #1e1e21; --ink: #ececee; --muted: #9a9aa1; --line: #2e2e33;
    --accent: #ef5350; --accent-soft: rgba(239, 83, 80, .16);
    --red: #ef5350; --red-soft: #3a1f1f; --green: #4cc38a; --green-soft: #183326;
    --amber: #ffb74d; --amber-soft: #3a2c16;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 900px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.center { text-align: center; }
.gap { margin-top: 20px; }
[hidden] { display: none !important; }

.top { background: var(--card); border-top: 5px solid var(--accent); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 10px 24px; flex-wrap: wrap; max-width: 1400px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; align-items: flex-start; gap: 10px; line-height: 1.2; }
.brand .dot { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.brand .who { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; }
nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.nav-btn { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nav-btn.signout { background: transparent; color: var(--muted); }
@media (max-width: 720px) {
  .top-row { padding: 10px 16px; }
  nav { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
  nav .inline { display: contents; }
  .nav-btn { text-align: center; padding: 12px 6px; font-size: .95rem; }
}
.inline { display: inline; margin: 0; }
.foot { color: var(--muted); font-size: .85rem; padding: 32px 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid2 .card { margin-bottom: 0; }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head-row h1 { margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.flash { background: var(--green-soft); color: var(--green); padding: 10px 14px; border-radius: 8px; }
.error { background: var(--red-soft); color: var(--red); padding: 10px 14px 10px 30px; border-radius: 8px; }
p.error { padding-left: 14px; }
.error a { color: inherit; font-weight: 700; }

input, select, button, textarea { font: inherit; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; font-size: .9rem; font-weight: 600; }
label input, label select, label textarea { margin-top: 4px; font-weight: normal; }
.stack { display: grid; gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.grid-form .wide2 { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form label { flex: 1 1 200px; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.bad { background: transparent; border-color: var(--red); color: var(--red); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.big { padding: 12px 20px; font-size: 1.05rem; }
.btn.disabled { opacity: .35; cursor: default; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; font: inherit; }
.auth { max-width: 440px; margin: 40px auto; }
.empty { padding: 16px 0; text-align: center; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .82rem; white-space: nowrap; }
.tag.in { background: var(--green-soft); color: var(--green); }
.tag.out { background: var(--amber-soft); color: var(--amber); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
input.copy { font-size: .9rem; margin: 6px 0 0; }
.opt { display: flex; gap: 8px; align-items: center; }
.opt input { width: auto; margin: 0; }

/* Dashboard */
.share { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.share > div:first-child { flex: 1 1 420px; min-width: 0; }
.share h2 { margin-bottom: 4px; }
.day-head { margin: 22px 0 8px; font-size: 1rem; }
.card.list { padding: 6px 20px; }
.booking { border-bottom: 1px solid var(--line); }
.booking:last-child { border-bottom: 0; }
.booking summary { display: flex; gap: 16px; align-items: baseline; padding: 12px 0; cursor: pointer; list-style: none; }
.booking summary::-webkit-details-marker { display: none; }
.booking summary::after { content: "\203A"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.booking[open] summary::after { transform: rotate(90deg); }
.booking .time { font-weight: 800; min-width: 76px; font-variant-numeric: tabular-nums; }
.booking .what { min-width: 0; overflow-wrap: anywhere; }
.booking-body { padding: 0 0 14px 92px; }
.booking-body p { margin: 0 0 8px; }
.notes { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.cancel-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cancel-row input { flex: 1 1 220px; width: auto; }
.past summary { cursor: pointer; }
.past table { margin-top: 12px; }
@media (max-width: 600px) { .booking-body { padding-left: 0; } .booking summary { gap: 10px; } .booking .time { min-width: 64px; } }

/* Appointment types */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.event-list li:last-child { border-bottom: 0; }
.event-list li > div { min-width: 0; overflow-wrap: anywhere; }
.event-list li.off strong { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Hours */
.week { display: grid; gap: 4px; }
.day-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.day-name { width: 130px; font-weight: 700; }
.windows { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.window { display: inline-flex; gap: 8px; align-items: center; }
.window input { width: 128px; }
.closed-note { display: none; }
.day-row.closed .window, .day-row.closed .add-window { display: none; }
.day-row.closed .closed-note { display: inline; }
.off-list { list-style: none; padding: 0; margin: 14px 0 0; }
.off-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.slug-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.slug-field input { flex: 1 1 160px; width: auto; margin: 0; }

/* Public booking pages */
.book-head { text-align: center; margin: 8px 0 24px; }
.book-head .intro { max-width: 560px; margin: 10px auto 0; }
.event-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.event-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; border-left: 5px solid var(--accent); transition: transform .12s, border-color .12s; }
.event-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.event-card .go { margin-top: 8px; color: var(--accent); font-weight: 700; }
.book-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 20px; align-items: start; }
.book-info h1 { font-size: 1.4rem; margin: 4px 0 10px; }
.facts { display: grid; gap: 6px; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.picked { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal .dow { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal .day { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; max-height: 52px; border-radius: 50%; color: var(--muted); opacity: .55; font-variant-numeric: tabular-nums; }
.cal .day.open { opacity: 1; background: var(--accent-soft); color: var(--accent); font-weight: 800; text-decoration: none; }
.cal .day.open:hover { background: var(--accent); color: var(--on-accent); }
.cal .day.sel { background: var(--accent); color: var(--on-accent); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--line); }
.tz-note { margin: 12px 0 0; }
#times { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.slot { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border: 1px solid var(--accent); border-radius: 8px; color: var(--accent); font-weight: 700; text-decoration: none; }
.slot:hover { background: var(--accent); color: var(--on-accent); }
.slot small { font-weight: 500; font-size: .75rem; opacity: .8; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 720px) { .book-grid { grid-template-columns: 1fr; } }

/* Guest's booking page */
.confirm { max-width: 620px; margin: 10px auto 20px; }
.confirm h1 { font-size: 1.4rem; }
.badge { display: inline-block; font-weight: 800; padding: 4px 12px; border-radius: 999px; margin: 0 0 10px; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.facts-list { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 16px 0 20px; }
.facts-list dt { color: var(--muted); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.cancel-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cancel-box summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.cancel-box form { margin-top: 12px; }
.is-cancelled h1 { color: var(--muted); }

/* Redbird HQ bar, shown while a super admin is in from HQ */
.hq-bar { position: fixed; left: 12px; bottom: 12px; z-index: 1000; display: flex; gap: 2px; align-items: center; background: #1d1d1f; color: #fff;
  border-radius: 999px; padding: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.25); font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hq-bar b { background: #c62828; border-radius: 999px; padding: 6px 10px; }
.hq-bar a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 999px; }
.hq-bar a:hover { background: rgba(255,255,255,.15); }
.hq-bar a.here { background: rgba(255,255,255,.2); }
@media print { .hq-bar { display: none; } }

/* The organization's brand */
.brand.has-logo { align-items: center; gap: 14px; }
.brand-logo { display: block; max-height: 64px; max-width: 240px; width: auto; height: auto; }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-text strong { font-size: 1.25rem; line-height: 1.15; }
.brand-text small { display: flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.brand-text small .dot { width: 9px; height: 9px; margin: 0; }
@media (max-width: 720px) { .brand-logo { max-height: 48px; max-width: 170px; } }
.logo-preview { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 12px; background: #fff; }
.logo-preview img { display: block; max-height: 90px; max-width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--ink); }
.color-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.color-form input[type=color] { width: 56px; height: 36px; padding: 2px; }
h3.sub { font-size: .98rem; margin: 14px 0 4px; }
.gap-sm { margin: 8px 0; }
/* Add event */
.add-event summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.add-event summary::-webkit-details-marker { display: none; }
.add-event[open] summary .btn { opacity: .6; }
.event-form { margin-top: 16px; }
.event-form .opt input { width: auto; }

/* Month calendar on the home page */
.month .cal-head h2 { display: flex; align-items: baseline; gap: 10px; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mgrid .dow { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 6px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mday { min-height: 104px; padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.mday.blank { background: var(--bg); }
.mday.closed, .key.closed { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--bg) 6px 12px); }
.mday.off, .key.off { background: var(--amber-soft); }
.mday.past > :not(.mnum) { opacity: .6; }
.mnum { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.mnum:hover { background: var(--accent-soft); color: var(--accent); }
.mday.today .mnum { background: var(--accent); color: var(--on-accent); }
.mnote { font-size: .72rem; color: var(--amber); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: block; font-size: .74rem; line-height: 1.3; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); border-left: 3px solid var(--accent); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.chip:hover { background: var(--accent); color: var(--on-accent); }
.chip.mine { background: var(--green-soft); color: var(--green); border-left-color: var(--green); }
a.chip.mine:hover { background: var(--green); color: #fff; }
.chip.busy { background: var(--bg); color: var(--muted); border-left-color: var(--muted); font-weight: 500; }
.mmore { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.mcount { display: none; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; }
.legend .chip { display: inline-block; }
.key { display: inline-block; width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 4px; vertical-align: middle; }
@media (max-width: 640px) {
  .card.month { padding: 14px 10px; }
  .mday { min-height: 56px; align-items: center; padding: 4px 2px; }
  .mnum { align-self: center; }
  .mday .chip, .mday .mmore, .mday .mnote { display: none; }
  .mcount { display: inline-block; font-size: .7rem; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 6px; }
}

/* Clients with more than one job: each gets a color (--rc) */
.rdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rc); margin-right: 5px; vertical-align: 1px; flex: none; }
.chip.rep { box-shadow: inset 0 0 0 1px var(--rc); }
.booking.rep .rtag { background: color-mix(in srgb, var(--rc) 14%, transparent); color: var(--rc); font-weight: 700; text-decoration: none; margin-left: 4px; }
.repeat h2 { margin-bottom: 8px; }
.repeat-list { list-style: none; margin: 0; padding: 0; }
.repeat-list li { display: flex; gap: 8px 16px; align-items: baseline; flex-wrap: wrap; padding: 10px 0 10px 10px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--rc); margin-bottom: 6px; border-radius: 4px; }
.repeat-list li:last-child { border-bottom: 0; }
.repeat-list .who { min-width: 200px; }
.rcount { font-size: .82rem; font-weight: 700; color: var(--rc); }
.repeat-list .when { display: flex; flex-wrap: wrap; gap: 6px; }
.rjob { font-size: .85rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rc); color: var(--rc); text-decoration: none; font-weight: 600; white-space: nowrap; }
.rjob:hover { background: var(--rc); color: #fff; }
/* Pointing at one: dim the rest, light up all of that client's jobs */
body.lighting .mgrid .chip:not(.lit), body.lighting .booking:not(.lit) { opacity: .35; }
.chip.lit { background: var(--rc); color: #fff; }
.booking.lit, .repeat-list li.lit { background: color-mix(in srgb, var(--rc) 10%, transparent); }

/* + Add event: pick a Redbird Books client */
.books-pick { position: relative; }
.bc-list { display: grid; gap: 2px; margin-top: 6px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--card); }
.bc-item { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.bc-item:hover, .bc-item:focus { background: var(--bg); outline: none; }
.bc-list > p { margin: 6px 8px; }
