/* Veckostatistiken (shared/week-stats.js). Samma utseende i appen och mobilen. */
.wk {
  --wk-bar: 26px;       /* stapelns bredd, och lägsta höjd: noll bokningar är en cirkel */
  --wk-max: 76px;       /* högsta stapel */
  display: grid;
  gap: 14px;
  padding: 4px 0 8px;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.wk[hidden] { display: none; }
.wk.is-dragging { cursor: grabbing; }
.wk-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; }
.wk-arrow {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text);
  transition: opacity .15s ease, background .15s ease;
}
@media (hover: hover) and (pointer: fine) { .wk-arrow:hover { background: color-mix(in srgb, var(--text) 8%, transparent); } }
.wk-arrow:disabled { opacity: 0; pointer-events: none; }
.wk-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wk-title { position: relative; justify-self: center; }
.wk-week { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--text); }
.wk-today {
  position: absolute; left: 100%; top: 50%; margin-left: 10px; transform: translateY(-50%);
  height: 24px; padding: 0 10px; border: 0; border-radius: 999px;
  background: var(--brand-gradient); color: #fff;
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: transform .18s ease, opacity .18s ease;
}
.wk-today:active { transform: translateY(-50%) scale(.96); }
.wk-today[hidden] { display: none; }

.wk-chart { display: grid; gap: 8px; min-width: 0; }
.wk-labels {
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch;
}
.wk-labels::-webkit-scrollbar { display: none; }
.wk-label-track { display: flex; }
.wk-label-week {
  flex: 0 0 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  scroll-snap-align: start;
}
.wk-lab {
  display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 0;
  border: 0; background: transparent; color: var(--text); font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.wk-lab[aria-pressed="true"] .wk-dl { color: var(--text); }
.wk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wk-day {
  display: grid; justify-items: center; padding: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; -webkit-tap-highlight-color: transparent;
}
.wk-dd { font-size: 10px; font-weight: 500; letter-spacing: .03em; color: var(--text-tertiary); }
.wk-dl { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--text-secondary); }
/* Tomma dagar är nedtonade, utom den som är vald. */
.wk-col { transition: opacity .25s ease; }
.wk-day.is-zero .wk-col { opacity: .7; }
.wk-day.is-zero[aria-pressed="true"] .wk-col { opacity: 1; }
.wk-day.is-today .wk-col { opacity: 1; }
.wk-col { position: relative; width: 100%; height: calc(var(--wk-max) + 26px); display: grid; justify-items: center; }
.wk-bar {
  --p: 0;
  position: absolute; bottom: 0; left: 50%; width: var(--wk-bar); margin-left: calc(var(--wk-bar) / -2);
  height: calc(var(--wk-bar) + (var(--wk-max) - var(--wk-bar)) * var(--p));
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  transition: height .5s cubic-bezier(.2, .8, .2, 1), background .25s ease, opacity .25s ease, box-shadow .25s ease;
}
.wk-day.is-today .wk-bar { background: var(--brand-gradient); }
.wk-day.is-today:not([aria-pressed="true"]) .wk-bar { opacity: .5; }
.wk-day[aria-pressed="true"]:not(.is-today) .wk-bar {
  background: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}
.wk-n {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}

.wk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; text-align: center; }
.wk-stats > div { display: grid; gap: 2px; justify-items: center; }
.wk-stats strong { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.wk-stats span { font-size: 11.5px; line-height: 1.25; color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) {
  .wk-bar, .wk-arrow, .wk-today { transition: none; }
  .wk-labels { scroll-behavior: auto; }
}
