/*
 * How busy it is (busy-view.js): the dialog on /account.
 * The week's shades are heat colors, pale yellow to deep red, so a square's
 * color says how busy it is without comparing darkness. Now is outlined in ink.
 */

.busy-modal {
  --busy-0: rgba(11, 11, 10, 0.07);
  --busy-1: #f8d77a;
  --busy-2: #f3a347;
  --busy-3: #e2582a;
  --busy-4: #a8201a;
  --busy-bar-0: rgba(11, 11, 10, 0.16);
  --busy-now: var(--color-ink);
  --busy-muted: rgba(11, 11, 10, 0.62);
  --busy-rule: 1px solid rgba(11, 11, 10, 0.18);
}

.busy-card[hidden] { display: none; }

.busy-card section { padding: 0; }

.busy-card section > * { width: auto; }

.busy-card p { width: auto; margin: 0; }

.busy-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  letter-spacing: 0;
}

.busy-card .busy-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--busy-muted);
}

.busy-card .busy-word {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 11vw, 3rem);
  font-weight: 700;
  line-height: 1;
}

.busy-meter {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.busy-meter i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--busy-0);
}

.busy-meter i.is-on { background: var(--color-ink); }

.busy-card .busy-sentence { margin-top: 10px; }

.busy-card .busy-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: var(--busy-rule);
}

.busy-card .busy-section h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}

.busy-bars,
.busy-ticks,
.busy-row {
  display: grid;
  grid-template-columns: repeat(var(--busy-cols, 19), minmax(0, 1fr));
  gap: 3px;
}

.busy-bars {
  align-items: end;
  height: 64px;
  border-bottom: var(--busy-rule);
}

.busy-bars i {
  border-radius: 2px 2px 0 0;
  background: var(--busy-bar-0);
}

.busy-bars i[data-shade="0"] { height: 8%; }
.busy-bars i[data-shade="1"] { height: 30%; }
.busy-bars i[data-shade="2"] { height: 52%; }
.busy-bars i[data-shade="3"] { height: 76%; }
.busy-bars i[data-shade="4"] { height: 100%; }

.busy-ticks {
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--busy-muted);
}

.busy-ticks span { white-space: nowrap; }

.busy-week {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  row-gap: 3px;
  align-items: center;
}

.busy-week .busy-ticks { margin: 0 0 2px; }

.busy-day {
  font-size: 0.7rem;
  color: var(--busy-muted);
}

.busy-day.is-today {
  color: var(--color-ink);
  font-weight: 700;
}

.busy-row i,
.busy-legend i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--busy-0);
}

.busy-card i[data-shade="1"] { background: var(--busy-1); }
.busy-card i[data-shade="2"] { background: var(--busy-2); }
.busy-card i[data-shade="3"] { background: var(--busy-3); }
.busy-card i[data-shade="4"] { background: var(--busy-4); }
.busy-card .busy-bars i[data-shade="0"] { background: var(--busy-bar-0); }

.busy-bars i.is-now,
.busy-row i.is-now {
  outline: 2px solid var(--busy-now);
  outline-offset: 1px;
}

.busy-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.7rem;
  color: var(--busy-muted);
}

.busy-legend i { width: 12px; }

.busy-card .busy-summary { margin-top: 12px; }

.busy-card .busy-sentence,
.busy-card .busy-summary { font-size: 0.9rem; }

.busy-card .busy-waiting { color: var(--busy-muted); }

/* While the history is thin (busy-view.js EARLY_NOTE). */
.busy-card .busy-early {
  margin-top: 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--busy-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(243, 163, 71, 0.14);
  font-size: 0.85rem;
}

.busy-card .busy-fine {
  margin-top: 18px;
  padding-top: 12px;
  border-top: var(--busy-rule);
  font-size: 0.72rem;
  color: var(--busy-muted);
}

/* The dialog on /account: the panel is the card, scrolling on short screens. */
.busy-modal__panel {
  width: min(480px, 100%);
  max-height: calc(100dvh - 2 * var(--space-md));
  overflow-y: auto;
}

.busy-modal .busy-modal__panel h2 {
  margin: 0 0 var(--space-sm);
  padding-right: 44px;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
}
