/* The dial of dial.js, 358px across as on a 390px phone. The face is an SVG, and the numbers, the
   buttons over the hours and the middle are laid over it where dial.js puts them. */

.dial {
  position: relative;
  width: 358px;
  height: 358px;
  margin: 4px auto 0;
  -webkit-user-select: none;
  user-select: none;
}

.dial .face {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.dial .line.shut {
  stroke: var(--closed);
}

.dial .line.mine, .dial .line.hl {
  stroke: var(--edge);
  stroke-width: 1.8;
}

.dial .line.hl.in {
  stroke: var(--ink);
  stroke-width: 2;
  opacity: .75;
}

.dial .mk {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The guest's own check in ink on a white run, and cross in white. */
.dial .own {
  stroke-width: 2.6;
}

.dial .own.yes {
  stroke: var(--ink);
}

.dial .own.no {
  stroke: var(--edge);
}

/* With a mouse, the mark that a tap gives next in the hovered hour's box, in the muted colour. */
.dial .own.nxt {
  stroke: var(--muted);
}

/* Everyone's marks on an hour, inside the ring. */
.dial .tally {
  overflow: visible;
  color: var(--text);
}

.dial .tally .mk {
  stroke: currentColor;
  stroke-width: 1.6;
}

.dial g.lit .tally {
  color: var(--ink);
}

.dial .count {
  fill: currentColor;
  font-size: var(--size-count);
  font-weight: 800;
}

/* On the host's form: Klokkeslett's hours white once set, and Finn tid's hours up in white boxes over
   hours that are not up, which stay dim (dial.md, "Look"). */
.dial.host .line.shut {
  stroke: var(--line);
}

.dial.host .line.up, .dial.host .line.lit {
  stroke: var(--edge);
  stroke-width: 1.8;
}

.dial.host.apart .line.shut {
  stroke: var(--closed);
}

.dial.host.apart .line.lit {
  stroke: var(--hover);
  stroke-width: 1.5;
}

/* The numbers, each in the middle of its hour outside the ring. */
.dial .hr {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--text);
  font-size: var(--size-small);
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

/* .end comes after .shut: a range can end on an hour that is not up, and its number is lit. */
.dial .hr.shut {
  color: var(--line);
}

.dial .hr.end {
  color: var(--edge);
}

.dial button.hr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  pointer-events: auto;
  touch-action: pinch-zoom;
}

.dial button.hr:focus-visible {
  outline-offset: -2px;
}

.dial button.hr span {
  position: relative;
}

/* The two numbers of an open range, underlined as the calendar's today is. */
.dial .hr.from span::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -5px;
  height: 2px;
  background: var(--edge);
  transform: rotate(-2deg);
}

@media (hover: hover) {
  .dial button.hr:hover {
    color: var(--edge);
  }
}

/* The button over an hour's box, turned along it. */
.dial .seg {
  position: absolute;
  width: 30px;
  height: 40px;
  margin: -20px 0 0 -15px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dial .seg:focus-visible {
  outline-offset: 2px;
}

/* The guest's dial draws a key's focus on the face, as it draws the pointer's outline. */
.dial.ringed .seg:focus-visible {
  outline: none;
}

/* A drag across the hours marks them, so it does not scroll the page. */
.dial.drags .seg {
  touch-action: pinch-zoom;
}

/* What is marked, in words, in the middle of the face. */
.dial .mid {
  position: absolute;
  left: 84px;
  top: 104px;
  width: 190px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.dial .midtop {
  color: var(--muted);
  font-size: var(--size-small);
  font-weight: 700;
}

.dial .midline {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
}

.dial .clear {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: var(--size-small);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  cursor: pointer;
  pointer-events: auto;
}

.dial .clear:hover {
  color: var(--edge);
}
