:root {
  color-scheme: light;
  font-family: "Teko", sans-serif;
  color: #282828;
  background: #fff;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;

  --ink: #282828;
  --muted: #777;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  font-family: inherit;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  position: fixed;
  inset: 0;
}

button,
input {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

.app {
  position: relative;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: 17% 1fr 22%;
  overflow: hidden;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: #fff;
}

.header {
  position: relative;
  z-index: 3;
  min-height: 0;
}

.walk-control {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 16px;
  left: 16px;
  height: 48px;
}

.walk-trigger {
  position: absolute;
  z-index: 6;
  top: 8px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #000;
  border-radius: 50%;
  background: #fff;
  cursor: grab;
  touch-action: none;
  transition:
    left 360ms cubic-bezier(.2, .8, .2, 1),
    background 180ms ease,
    box-shadow 180ms ease;
}

.walk-trigger:active {
  cursor: grabbing;
}

.walk-control.is-dragging .walk-trigger {
  transition: none;
}

.walker-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: #000;
}

.walk-value {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 50px;
  height: 44px;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.walk-control::before {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: 54px;
  left: 8px;
  display: none;
  height: 4px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  content: "";
  pointer-events: none;
}

.walk-control.is-open::before {
  display: block;
}

.walk-control input[type="range"] {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 54px;
  left: 8px;
  width: calc(100% - 62px);
  height: 44px;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  touch-action: none;
  pointer-events: none;
}

.walk-control.is-open input[type="range"] {
  visibility: visible;
}

.walk-control:not(.is-open) input[type="range"] {
  display: none;
}

.walk-control.is-open .walk-trigger {
  border-color: #000;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}

.main-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 10px 22px;
  text-align: center;
}

.main-message {
  width: 100%;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 9.5vw, 64px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.main-message.is-relaxed {
  font-weight: 300;
}

.main-message.is-preparing {
  font-weight: 500;
}

.main-message.is-urgent {
  font-size: clamp(38px, 10vw, 70px);
  font-weight: 600;
}

.main-message.is-running {
  font-size: clamp(34px, 9vw, 62px);
  font-weight: 700;
  letter-spacing: -.025em;
}

.main-message.is-error {
  color: var(--muted);
  font-size: clamp(20px, 5.8vw, 32px);
  font-weight: 400;
}

.bottom-segment {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  padding: 16px 16px calc(28px + var(--safe-bottom));
  text-align: center;
}

.next-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: clamp(13px, 3.8vw, 16px);
  font-weight: 400;
}

.next-time {
  margin: 0;
  color: var(--ink);
  font-size: clamp(27px, 7.5vw, 42px);
  font-weight: 350;
  line-height: 1.08;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.is-hidden {
  display: none !important;
}

.status {
  position: absolute;
  right: 10px;
  bottom: 30px;
  left: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.status:empty {
  display: none;
}

.version {
  position: absolute;
  bottom: calc(8px + var(--safe-bottom));
  left: 0;
  width: 100%;
  margin: 0;
  color: #999;
  font-size: 10px;
  text-align: center;
}

@media (max-height: 650px) {
  .app {
    grid-template-rows: 15% 1fr 23%;
  }

  .main-message {
    font-size: clamp(30px, 8.5vw, 52px);
  }

  .main-message.is-urgent {
    font-size: clamp(34px, 9vw, 58px);
  }

  .bottom-segment {
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}
