/* Booked Solid — styles. Everything is scoped under .bs so the host page cannot leak in. */
.bs, .bs * { box-sizing: border-box; }
.bs [hidden] { display: none !important; }
.bs {
  --bg1: #2a5be0; --bg2: #5b2bc4; --ink: #1b2233; --muted: #5b6478; --line: #dfe3ee; --paper: #fff;
  --head: #d92d3f; --ring: #27304f; --ok: #15803d; --okbg: #e3f6e9; --bad: #dc2626; --gold: #ffd84a;
  --rh: clamp(46px, calc(408px / var(--rows, 8)), 68px);
  position: relative; max-width: 980px; margin: 0 auto 28px; padding: 14px 16px 18px; overflow: hidden;
  border-radius: 18px; background: linear-gradient(135deg, var(--bg1), var(--bg2));
  font: 14px/1.3 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; color: #fff; text-align: left;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.bs[data-layout="narrow"] { --rh: clamp(40px, calc(336px / var(--rows, 8)), 60px); padding: 10px 10px 14px; border-radius: 14px; }
.bs [role="button"] { cursor: pointer; }
.bs [role="button"]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bs svg { display: block; width: 100%; height: 100%; }

/* top bar */
.bs-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.bs-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bs-day { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.bs-date { font-size: 14px; opacity: 0.88; }
.bs-dots { display: inline-flex; gap: 3px; align-self: center; }
.bs-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.bs-dots i.on { background: var(--gold); }
.bs-skip { align-self: center; font-size: 12.5px; font-weight: 600; padding: 3px 11px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.75); white-space: nowrap; }
.bs-skip:hover { background: rgba(255, 255, 255, 0.18); }
.bs-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.bs-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; margin-right: 4px; }
.bs-ib { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.17); color: #fff; flex: none; transition: background 0.15s; }
.bs-ib { position: relative; }
.bs-ib::after { content: ""; position: absolute; inset: -5px; }
.bs-ib:hover { background: rgba(255, 255, 255, 0.3); }
.bs-ib.bs-dis { opacity: 0.38; pointer-events: none; }
.bs[data-layout="narrow"] .bs-day { font-size: 18px; }
.bs[data-layout="narrow"] .bs-ib { width: 32px; height: 32px; padding: 7px; }
.bs[data-layout="narrow"] .bs-tools { gap: 9px; }
.bs-sub { margin-top: 10px; padding: 9px 13px; border-radius: 12px; background: rgba(13, 18, 60, 0.32); font-size: 14.5px; line-height: 1.42; min-height: 39px; }
.bs-sub b { font-weight: 700; }
.bs-gt { display: block; font-size: 16.5px; font-weight: 700; margin-bottom: 2px; }
.bs-gt:empty { display: none; }
.bs[data-layout="narrow"] .bs-sub { font-size: 14px; min-height: 58px; padding: 8px 11px; }
.bs[data-kind="lesson"] .bs-sub { min-height: 0; }

/* layout */
.bs-main { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; margin-top: 22px; align-items: start; }
.bs[data-layout="narrow"] .bs-main { display: block; margin-top: 20px; }

/* calendar */
.bs-cal { position: relative; background: var(--paper); border-radius: 16px; padding: 0 8px 8px; color: var(--ink); box-shadow: 0 10px 24px rgba(12, 12, 60, 0.28); }
.bs-rings { position: absolute; left: 0; right: 0; top: -11px; display: flex; justify-content: space-around; padding: 0 16%; pointer-events: none; z-index: 3; }
.bs-rings i { width: 12px; height: 26px; border-radius: 6px; background: var(--ring); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.bs-head { display: grid; grid-template-columns: 26px repeat(5, minmax(0, 1fr)); margin: 0 -8px; padding: 0 8px; height: 38px; align-items: end; background: var(--head); border-radius: 16px 16px 0 0; color: #fff; font-weight: 700; font-size: 13px; transition: background 0.4s; }
.bs-dh { text-align: center; padding-bottom: 6px; }
.bs-cal.bs-won .bs-head { background: var(--ok); }
.bs-body { display: grid; grid-template-columns: 26px minmax(0, 1fr); margin-top: 6px; }
.bs-times { display: grid; grid-template-rows: repeat(var(--rows), var(--rh)); }
.bs-times span { font-size: 10.5px; color: var(--muted); text-align: right; padding: 1px 5px 0 0; line-height: 1; font-variant-numeric: tabular-nums; }
.bs-board { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), var(--rh)); border-top: 1.5px solid var(--line); border-left: 1.5px solid var(--line); border-radius: 4px; }
.bs-cell { border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); display: flex; align-items: flex-end; justify-content: flex-end; gap: 1px; padding: 2px; min-width: 0; transition: background 0.12s; }
.bs-cell.bs-no { background: repeating-linear-gradient(135deg, #e3e7f0 0 5px, #f6f7fa 5px 10px); }
.bs-cell.bs-yes { background: var(--okbg); }
.bs-cell.bs-dim { background: #f1f2f6; }
.bs-active .bs-cell.bs-yes { cursor: pointer; }
.bs-cell .bs-disc { width: 15px; height: 15px; font-size: 9px; background: #fff; box-shadow: 0 0 0 1px #c5cbd9; }

/* a meeting on the board, in the tray, or under the finger */
.bs-blk { position: absolute; width: 20%; padding: 3px; z-index: 2; touch-action: none; transition: left 0.16s, top 0.16s; }
.bs-in { display: flex; gap: 6px; height: 100%; padding: 4px 6px; border-radius: 9px; background: var(--c); color: var(--f); overflow: hidden; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.bs-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.bs-nm { font-size: 12.5px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-blk .bs-in[data-len="2"] .bs-nm, .bs-blk .bs-in[data-len="3"] .bs-nm { white-space: normal; overflow-wrap: anywhere; }
.bs-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.bs-meta em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600; opacity: 0.92; }
.bs-disc { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #fff; color: #1b2233; font-size: 10px; font-weight: 700; flex: none; line-height: 1; }
.bs-discs { display: contents; }
.bs-abc { display: none; align-items: center; padding: 1px 4px; border-radius: 7px; background: #fff; color: #1b2233; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.25; }
.bs[data-compact] .bs-blk .bs-discs { display: none; }
.bs[data-compact] .bs-blk .bs-abc { display: inline-flex; }
.bs[data-compact] .bs-blk .bs-in { padding: 3px 4px; }
.bs[data-compact] .bs-blk .bs-in[data-len="1"] .bs-nm { display: none; }
.bs[data-compact] .bs-blk .bs-in[data-len="1"] .bs-txt { justify-content: center; }
.bs[data-compact] .bs-blk .bs-nm { font-size: 11px; white-space: nowrap !important; text-overflow: clip; letter-spacing: -0.01em; }
.bs[data-compact] .bs-blk .bs-tag { width: 15px; height: 15px; font-size: 10px; }
.bs-disc.bs-more { background: rgba(255, 255, 255, 0.75); font-size: 9px; }
.bs-tag { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; flex: none; font-style: normal; font-size: 10.5px; font-weight: 800; line-height: 1; margin-left: 1px; }
.bs-num { border-radius: 50%; background: #1b2233; color: #fff; box-shadow: 0 0 0 1.5px #fff; }
.bs-num.bs-ch1 { border-radius: 4px; background: #fff; color: #1b2233; box-shadow: 0 0 0 1.5px #1b2233; }
.bs-rep { border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #1b2233; padding: 3px; }
.bs-lock { padding: 2px; opacity: 0.95; }
.bs-fixed { z-index: 1; }
.bs-fixed .bs-in { background: repeating-linear-gradient(135deg, #6b7389 0 7px, #626a80 7px 14px); color: #fff; box-shadow: none; }
.bs-blk:not(.bs-fixed) .bs-in, .bs-chip .bs-in { cursor: grab; }
.bs-lift { visibility: hidden; }
.bs-sel .bs-in { outline: 3px solid var(--ink); outline-offset: 1px; }
.bs-bad .bs-in { outline: 3px solid var(--bad); outline-offset: 1px; }
.bs-bad .bs-tag.bs-num, .bs-bad .bs-tag.bs-rep { background: var(--bad); color: #fff; box-shadow: 0 0 0 1.5px #fff; }
.bs-hinted .bs-in { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75); }
.bs-pop .bs-in { animation: bs-pop 0.22s ease-out; }
.bs-hop .bs-in { animation: bs-hop 0.5s ease-in-out both; animation-delay: inherit; }
.bs-shake { animation: bs-shake 0.32s; }
@keyframes bs-pop { 0% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes bs-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } }
@keyframes bs-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.bs-drop { position: absolute; width: 20%; padding: 3px; z-index: 1; pointer-events: none; }
.bs-drop::before { content: ""; display: block; height: 100%; border-radius: 9px; border: 3px dashed var(--ok); background: rgba(21, 128, 61, 0.14); }
.bs-drop.no::before { border-color: var(--bad); background: rgba(220, 38, 38, 0.1); }
.bs-drop.bs-hintdrop::before { border-color: #f08c00; background: #fff3d6; animation: bs-pulse 1.05s ease-in-out infinite alternate; }
@keyframes bs-pulse { from { opacity: 0.55; } to { opacity: 1; } }

.bs-ghost { left: 0; top: 0; z-index: 50; pointer-events: none; transition: none; filter: drop-shadow(0 10px 12px rgba(10, 10, 60, 0.38)); }
.bs-ghost .bs-in { transform: rotate(3deg) scale(1.04); cursor: grabbing; }
.bs-ghost.no .bs-in { outline: 3px solid var(--bad); filter: saturate(0.55); }

/* side: tray, team, result */
.bs-side { min-width: 0; }
.bs-label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.92; min-height: 16px; margin-bottom: 7px; }
.bs-tray { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; min-height: 58px; }
.bs-tray.bs-empty { min-height: 0; }
.bs-chip { width: calc(50% - 4px); height: 54px; touch-action: none; }
.bs-chip .bs-in { padding: 6px 8px 6px 6px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 3px 8px rgba(12, 12, 60, 0.25); }
.bs-chip .bs-txt { justify-content: center; gap: 5px; }
.bs-chip .bs-meta { flex-wrap: nowrap; }
.bs-pips { display: flex; flex-direction: column; justify-content: center; gap: 2px; flex: none; }
.bs-pips u { display: block; width: 9px; height: 11px; border-radius: 3px; background: currentColor; opacity: 0.5; text-decoration: none; }
.bs[data-layout="narrow"] .bs-side { margin-top: 12px; }
.bs[data-layout="narrow"] .bs-tray { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 46px); grid-auto-columns: 122px; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; min-height: 0; }
.bs[data-layout="narrow"] .bs-tray.bs-empty { display: none; }
.bs[data-layout="narrow"] .bs-tray::-webkit-scrollbar, .bs[data-layout="narrow"] .bs-people::-webkit-scrollbar { display: none; }
.bs[data-layout="narrow"] .bs-chip { width: auto; height: 46px; touch-action: pan-x; }
.bs[data-layout="narrow"] .bs-chip .bs-in { padding: 4px 7px 5px 5px; gap: 5px; }
.bs[data-layout="narrow"] .bs-chip .bs-txt { gap: 3px; }
.bs[data-layout="narrow"] .bs-top { gap: 6px 10px; }
.bs[data-layout="narrow"] .bs-main { margin-top: 20px; }

.bs-label.bs-label2 { margin: 14px 0 6px; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.bs-people { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-key { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12.5px; }
.bs-key span { display: inline-flex; align-items: center; gap: 5px; }
.bs-key i { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 4px; flex: none; font-style: normal; }
.bs-key .k-no { background: repeating-linear-gradient(135deg, #dfe3ee 0 4px, #f6f7fa 4px 8px); }
.bs-key .k-yes { background: var(--okbg); box-shadow: inset 0 0 0 2px var(--ok); }
.bs-key .k-fix { background: #6b7389; color: #fff; padding: 3px; }
.bs-key .k-num { background: #1b2233; color: #fff; border-radius: 50%; font-size: 10.5px; font-weight: 800; box-shadow: 0 0 0 1.5px #fff; }
.bs-key .k-rep { background: #fff; color: #1b2233; border-radius: 50%; padding: 3px; }
.bs[data-layout="narrow"] .bs-people { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.bs[data-layout="narrow"] .bs-label.bs-label2 { margin-top: 8px; }
.bs-person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.11); font-size: 12.5px; font-weight: 600; flex: none; transition: background 0.15s, opacity 0.15s; }
.bs-person .bs-disc { width: 20px; height: 20px; font-size: 11px; }
.bs-map { display: grid; grid-template-columns: repeat(5, 5px); gap: 1px; }
.bs-map i { width: 5px; height: 4px; border-radius: 1px; background: rgba(255, 255, 255, 0.6); }
.bs-map i.x { background: rgba(10, 12, 40, 0.55); }
.bs-person.bs-on { background: #fff; color: var(--ink); }
.bs-person.bs-on .bs-disc { background: var(--ink); color: #fff; }
.bs-person.bs-on .bs-map i { background: #ccd3e3; }
.bs-person.bs-on .bs-map i.x { background: var(--ink); }
.bs-person.bs-off { opacity: 0.45; }

.bs-result { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 14px 14px 12px; box-shadow: 0 10px 24px rgba(12, 12, 60, 0.28); }
.bs-result.bs-fresh { animation: bs-rise 0.45s 0.35s ease-out both; }
@keyframes bs-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.bs-rh { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.bs-ok { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--ok); color: #fff; flex: none; }
.bs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.bs-stats span { display: flex; flex-direction: column; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bs-stats b { font-size: 21px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.bs-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.bs-wd { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bs-wd i { width: 24px; height: 24px; padding: 5px; border-radius: 50%; border: 2px solid var(--line); color: #fff; }
.bs-wd.done i { background: var(--ok); border-color: var(--ok); }
.bs-wd.today i { border-color: #e0a800; }
.bs-wd.today.done i { box-shadow: 0 0 0 2px #e0a800; border-color: var(--ok); }
.bs-wd.cur span { color: var(--ink); }
.bs-wd.future { opacity: 0.4; }
.bs-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bs-btn { flex: 1 1 auto; text-align: center; padding: 10px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; border: 2px solid var(--ink); color: var(--ink); white-space: nowrap; }
.bs-btn.bs-primary { background: var(--ink); color: #fff; }
.bs-btn:hover { opacity: 0.88; }
.bs-result .bs-btn:focus-visible, .bs-box [role="button"]:focus-visible, .bs-wd:focus-visible { outline-color: var(--bg1); }
.bs-next { margin-top: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }

/* toast, hand, confetti */
.bs-toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; z-index: 60; transition: opacity 0.18s, transform 0.18s; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-toast.on { opacity: 1; transform: translate(-50%, 0); }
.bs-hand { position: absolute; left: 0; top: 0; width: 44px; height: 44px; z-index: 70; pointer-events: none; opacity: 0; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); }
.bs-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; border-radius: 16px; }
.bs-confetti i { position: absolute; top: -14px; width: 8px; height: 12px; border-radius: 2px; animation: bs-fall 1.4s ease-in both; }
@keyframes bs-fall { to { transform: translateY(520px) rotate(540deg); opacity: 0.2; } }

/* help and past puzzles */
.bs-modal { position: absolute; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(14, 18, 46, 0.6); }
.bs-box { width: 100%; max-width: 420px; max-height: 100%; overflow: auto; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 14px 16px 16px; }
.bs-mh { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.bs-x { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #eef0f6; font-size: 20px; line-height: 1; }
.bs-hr { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.bs-demo { flex: none; width: 104px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.bs-ht { font-size: 13.5px; line-height: 1.4; }
.bs-mini { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; background: var(--c); color: var(--f); font-size: 10.5px; font-weight: 700; }
.bs-minifixed { background: repeating-linear-gradient(135deg, #6b7389 0 6px, #626a80 6px 12px); color: #fff; }
.bs-minical { width: 30px; height: 26px; border-radius: 5px; border: 2px solid var(--ink); border-top-width: 7px; border-top-color: var(--head); }
.bs-ministripe { width: 44px; height: 30px; border-radius: 5px; border: 1.5px solid var(--line); background: repeating-linear-gradient(135deg, #e3e7f0 0 5px, #f6f7fa 5px 10px); display: flex; align-items: flex-end; justify-content: flex-end; padding: 2px; }
.bs-ministripe .bs-disc { box-shadow: 0 0 0 1px #c5cbd9; }
.bs-arrow { font-weight: 700; color: var(--muted); }
.bs-box .bs-dots i { background: #cfd6e6; }
.bs-box .bs-dots i.on { background: #e0a800; }
.bs-aw { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; justify-items: center; }
.bs-ah { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.bs-ad { position: relative; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--line); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bs-ad.done { background: var(--okbg); border-color: var(--ok); color: var(--ok); }
.bs-ad.done i { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; padding: 3px; border-radius: 50%; background: var(--ok); color: #fff; }
.bs-ad.today { border-color: #e0a800; box-shadow: 0 0 0 2px rgba(224, 168, 0, 0.3); }
.bs-ad.future { opacity: 0.32; }
.bs-ad small { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 0 3px; background: var(--paper); font-size: 9.5px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.bs-cell[tabindex]:focus-visible { outline: 3px solid var(--bg1); outline-offset: -3px; }
.bs-ad[role="button"]:hover { background: #eef0f6; }
.bs-ad.done[role="button"]:hover { background: #d3efdb; }

@media (prefers-reduced-motion: reduce) {
  .bs-blk { transition: none; }
  .bs-pop .bs-in, .bs-hop .bs-in, .bs-shake, .bs-result.bs-fresh { animation: none; }
}
