/* Cognitive behavioral therapy for insomnia. Everything scoped under .cbi-*. */

.cbi-sc { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cbi-note { font-size: 13px; color: var(--dim); text-align: center; max-width: 310px; }
.cbi-read { min-height: 22px; text-align: center; font: 600 15px var(--sans); color: var(--dim); }
.cbi-read b { color: var(--text); }
.cbi-key { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; font: 600 13px var(--sans); color: var(--dim); }
.cbi-key span { display: flex; align-items: center; gap: 6px; }
.cbi-key i { width: 12px; height: 12px; border-radius: 3px; }
.cbi-key i.cbi-sl { background: var(--violet-bright); }
.cbi-key i.cbi-aw { background: var(--streak); }
.cbi-key i.cbi-k-win { border: 2px solid var(--gold); background: rgba(252, 192, 80, .15); }

/* the dial */
.cbi-dial { position: relative; }
.cbi-dial svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cbi-big { width: 268px; max-width: 76vw; aspect-ratio: 1; touch-action: none; }
.cbi-mini { width: 42px; aspect-ratio: 1; }
.cbi-mid { width: 132px; aspect-ratio: 1; }
.cbi-face { fill: rgba(255, 255, 255, .035); stroke: rgba(255, 255, 255, .08); stroke-width: 1.5; }
.cbi-track { fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: 18; }
.cbi-mini .cbi-track, .cbi-mini .cbi-arc, .cbi-mini .cbi-win { stroke-width: 34; }
.cbi-mid .cbi-track, .cbi-mid .cbi-arc, .cbi-mid .cbi-win { stroke-width: 24; }
.cbi-win { fill: none; stroke: rgba(252, 192, 80, .22); stroke-width: 26; }
.cbi-s-win .cbi-win { stroke: rgba(252, 192, 80, .38); }
.cbi-arc { fill: none; stroke-width: 18; }
.cbi-arc.cbi-sl { stroke: var(--violet-bright); }
.cbi-arc.cbi-aw { stroke: var(--streak); }
.cbi-tick { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.cbi-num { font: 700 13px var(--sans); fill: var(--dim); }
.cbi-num.cbi-up { fill: var(--gold); font-weight: 800; }
.cbi-hand { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.cbi-word { font: 800 30px var(--sans); fill: var(--text); }
.cbi-hit { fill: transparent; }
.cbi-kn { fill: var(--gold); stroke: #2A1B00; stroke-width: 2; filter: drop-shadow(0 2px 6px rgba(252, 192, 80, .6)); }
.cbi-kg { stroke: #2A1B00; stroke-width: 1.6; stroke-linecap: round; }
.cbi-knob { cursor: grab; }

/* the week */
/* 4 + 3: at seven across the orange slivers were too thin to see shrink. */
.cbi-week { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; width: 100%; max-width: 372px; }
.cbi-day { flex: 0 0 calc((100% - 36px) / 4); max-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 13px var(--sans); color: var(--dim); }
.cbi-day .cbi-mini { width: 100%; }

/* the couch */
.cbi-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 370px; padding: 10px; box-sizing: border-box; }
.cbi-pic { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 10px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 2px solid transparent; transition: border-color .4s, box-shadow .4s; }
.cbi-pic img { display: block; width: 100%; height: 110px; object-fit: contain; }
.cbi-pic figcaption { text-align: center; font: 600 14px var(--sans); color: var(--dim); line-height: 1.3; }
.cbi-pic figcaption b { color: var(--text); }
.cbi-pic figcaption span { display: block; font-weight: 800; color: var(--text); }
.cbi-p1 figcaption span { color: var(--violet-bright); }
.cbi-p2 figcaption span { color: var(--streak); }
.cbi-p2 { animation: cbi-in .5s .7s ease-out backwards; }
.cbi-pic.cbi-s-hot { border-color: var(--streak); box-shadow: 0 0 12px rgba(251, 150, 121, .35); }
@keyframes cbi-in { from { opacity: 0; transform: translateY(10px); } }

/* the get-up rule */
.cbi-rooms { width: 100%; max-width: 370px; padding: 0 18px; box-sizing: border-box; display: flex; flex-direction: column; gap: 10px; }
.cbi-clock { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.cbi-ct { font: 800 30px var(--sans); color: var(--text); font-variant-numeric: tabular-nums; }
.cbi-cs { font: 600 15px var(--sans); color: var(--dim); min-height: 20px; }
.cbi-cs b { color: var(--streak); }
.cbi-rpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 8px; }
.cbi-room { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 10px; min-height: 44px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 2px solid rgba(255, 255, 255, .1); transition: border-color .4s, box-shadow .4s, opacity .4s; }
.cbi-ph { display: block; width: 100%; height: 118px; border-radius: 10px; overflow: hidden; }
.cbi-room img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* An empty card is its half of the two-room picture: the bedroom for Bed, the lounge for Other room. */
.cbi-room.cbi-s-empty img { width: 200%; max-width: none; object-fit: cover; object-position: 50% 55%; opacity: .55; }
.cbi-r-other.cbi-s-empty img { margin-left: -100%; }
.cbi-rl { font: 800 15px var(--sans); color: var(--text); }
/* The two cards look alike until one is picked: where Jess is shows in the picture, never in a border. */

/* pill or CBT-I */
.cbi-mpair { display: flex; justify-content: center; gap: 22px; }

@media (max-height: 700px) {
  .cbi-big { width: 224px; }
  .cbi-mid { width: 112px; }
  .cbi-pic img { height: 92px; }
  .cbi-ph { height: 96px; }
  .cbi-ct { font-size: 26px; }
  .cbi-day { max-width: 70px; }
}
