html {
  --active-link-color: var(--color);
  --inactive-link-color: var(--color);
  --visited-link-color: var(--color);
  --label-gap: 0.5em;
  line-height: 1.1;
}
html,
body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
}
.hidden {
  display: none;
}
#screen {
  font-size: 0.9rem;
  flex: auto;
  overflow: hidden;
}
#screen svg {
  font: inherit;
  color: inherit;
}
#screen > svg {
  width: 100%;
  height: 100%;
}
#screen .under {
  stroke: none;
  fill: none;
  fill-opacity: 0.15;
}
#screen .above {
  stroke: none;
  fill: var(--color);
  fill-opacity: 0.15;
}
html[data-color-scheme="light"] #screen .under {
  fill: var(--color);
}
html[data-color-scheme="light"] #screen .above {
  fill: none;
}
#screen text {
  --ls: 0.1em;
  fill: var(--color);
  line-height: 1;
  letter-spacing: var(--ls);
  transform: translateX(calc(0.45 * var(--ls)));
}
#screen .twilight-label {
  fill-opacity: 0.35;
  font-variant: all-small-caps;
}
#screen .horizon-label {
  --ls: 0.5em;
  fill-opacity: 0.07;
  font-size: 24px;
  font-weight: bold;
  text-transform: uppercase;
}
#screen .directions .tick {
  stroke: var(--color);
  stroke-width: var(--border-width);
  fill: none;
}
#screen .directions .tick-label {
  font-size: 0.8em;
  text-anchor: middle;
  fill: var(--emphatic-color);
}
#screen .directions .leftmost.tick-label {
  text-anchor: start;
}
#screen .directions .rightmost.tick-label {
  text-anchor: end;
}
#screen .directions .secondary.tick-label {
  font-weight: normal;
  fill: var(--color);
  fill-opacity: 0.5;
}
#screen .track {
  stroke: var(--color);
  stroke-opacity: 0.5;
  stroke-width: var(--border-width);
  fill: none;
}
#screen .tracks .tick {
  fill: var(--color);
  stroke: none;
}
#screen .tracks .tick-label {
  font-size: 0.8em;
  dominant-baseline: text-top;
  text-anchor: middle;
  fill: var(--color);
  fill-opacity: 0.5;
  transform: translateY(0.2em);
}
#screen .marker-lines line {
  stroke: var(--color);
  stroke-width: var(--dashed-border-width);
  stroke-dasharray: 2 4;
  fill: none;
}
#screen .grid line {
  stroke: var(--color);
  stroke-width: var(--dashed-border-width);
  stroke-dasharray: 1 3;
  stroke-opacity: 0.5;
  fill: none;
}
#screen .grid line[data-alt="0"] {
  stroke-width: var(--border-width);
  stroke-dasharray: none;
  stroke-opacity: 1;
}
#screen .phase-shadow {
  fill: black;
  fill-opacity: 0.7;
  stroke: none;
}
.pos {
  --x: 0;
  flex: none;
  font-size: 0.9rem;
  color: rgb(from var(--color) r g b / 0.55);
  height: 2em;
  position: relative;
}
.pos > span {
  display: inline-block;
  white-space: nowrap;
  padding: 0.2em 0;
  position: absolute;
  left: var(--x);
}
.pos > span > span + span,
.pos .event + .event {
  margin-inline-start: var(--label-gap);
}
.pos .value {
  color: var(--emphatic-color);
  font-weight: bold;
}
.pos[data-id="sun"] > span {
  bottom: 0;
}
.pos[data-id="moon"] > span {
  top: 0;
}
.pos .icon {
  height: 1.1em;
  vertical-align: bottom;
  color: var(--emphatic-color);
  margin-inline-end: calc(0.5 * var(--label-gap));
  stroke-width: 0.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
form {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 4em;
  padding: 0.75em 0;
  box-sizing: border-box;
}
form > span {
  margin: 0 0.25em;
}
form > span.field + span.field {
  margin-left: 0.75em;
}
form .field {
  display: inline-block;
  width: 15em;
  max-width: 42%;
}
form input {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: center;
  background: none transparent;
  border: none;
  border-bottom: var(--input-border-width) solid;
  padding: 0.1em;
  box-sizing: border-box;
}
form input:focus {
  outline: none;
  border-bottom-color: var(--focus-color);
}
form button {
  font: inherit;
  color: inherit;
  background: none transparent;
  border: none;
  cursor: pointer;
}
form button img,
form button svg {
  height: 1.2em;
  transform: translateY(0.15em);
}
html.error .pos,
html.error #screen {
  display: none;
}
html.error .error {
  display: flex;
  flex: auto;
  align-items: center;
  justify-content: center;
}
footer {
  border-radius: 0.5em 0 0 0;
  position: absolute;
  padding: 0.2em 0.65em 0.3em 0.75em;
  right: 0;
  bottom: 0;
}
@media (max-width: 500px) {
  html {
    --label-gap: 0.3em;
  }
  footer {
    display: none;
  }
}
