.time-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}
.time-toolbar .time-view-options {
  margin: 0;
}
.time-panel[data-view="breeze"] .time-toolbar {
  order: 1;
  align-self: center;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: calc(100vw - 40px);
  margin: 0;
}
.time-panel[data-view="breeze"] .time-view-options {
  grid-column: 2;
  grid-row: 1;
}
.time-panel[data-view="breeze"] .time-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}
@media (max-width: 600px) {
  .time-panel[data-view="breeze"] .time-toolbar {
    grid-template-columns: auto auto;
    width: calc(100vw - 24px);
    gap: 6px;
  }
  .time-panel[data-view="breeze"] .time-view-options {
    grid-column: 1;
  }
  .time-panel[data-view="breeze"] .time-close {
    grid-column: 2;
  }
  .time-toolbar .time-view-options button,
  .time-toolbar .time-close {
    padding-inline: 8px;
  }
}
@media (max-width: 360px) {
  .time-panel[data-view] .time-toolbar .time-view-options button,
  .time-panel[data-view] .time-toolbar .time-close {
    font-size: 11px;
  }
}
.scene-clock:has(.clock-toggle[aria-expanded="true"]) {
  z-index: 6;
}

.scene-clock:has(.time-panel[data-view="breeze"]:not([hidden]))
  > .clock-toggle {
  visibility: hidden;
}

.time-view-options {
  display: flex;
  justify-content: center;
  gap: 4px;
  align-self: center;
  padding: 3px;
  margin: 14px 0;
  border: 1px solid #fff9ed55;
  border-radius: 24px;
  background: #102b3b8c;
}

.time-view-options button {
  min-height: 38px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0.9;
}

.time-view-options button[aria-pressed="true"] {
  background: #fff9ed;
  color: #193741;
  text-shadow: none;
  opacity: 1;
}

.time-panel[data-view="slider"] {
  position: fixed;
  inset: auto;
  top: max(112px, calc(50svh - 235px));
  left: clamp(16px, 4vw, 64px);
  width: min(410px, calc(100vw - 24px));
  padding-inline: 12px;
  max-height: calc(100svh - max(112px, calc(50svh - 235px)) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.time-panel[data-view="slider"] .time-panel-heading {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 28px;
  background: inherit;
}

.time-panel[data-view="breeze"] {
  --time-visible-tiles: 3;
  --time-tile-step: clamp(124px, calc((100svh - 300px) / 3), 148px);
  --time-tile-size: clamp(82px, 15vw, 110px);
  position: fixed;
  inset: auto;
  top: calc(50svh + 28px);
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(580px, calc(100vw - 24px));
  max-height: none;
  padding: 0 10px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  color: #fff9ed;
  box-shadow: none;
  backdrop-filter: none;
  text-shadow:
    0 2px 12px #10252dcc,
    0 1px 3px #172828a8;
  transform: translate(-50%, -50%);
  isolation: isolate;
}

.time-panel[data-view="breeze"]::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 22px;
  bottom: 24px;
  left: 50%;
  width: 176px;
  background: linear-gradient(
    180deg,
    #3b392e00,
    #3b392e28 20%,
    #3b392e32 70%,
    #3b392e00
  );
  backdrop-filter: blur(5px);
  mask-image: radial-gradient(ellipse at center, #000 20%, #0000 72%);
  transform: translateX(-50%);
  pointer-events: none;
}

.time-panel[data-view="breeze"] .time-panel-heading {
  position: absolute;
  top: 0;
  right: 0;
}

.time-panel[data-view="breeze"] .city-options {
  order: 0;
  justify-content: center;
  align-items: center;
  gap: 17px;
  margin: 0;
}

.time-panel[data-view="breeze"] .city-options::after {
  content: "·";
  order: 1;
  font-size: 16px;
  pointer-events: none;
}

.time-panel[data-view="breeze"] .city-options button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  text-shadow: inherit;
  font-size: 14px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.time-panel[data-view="breeze"] [data-city="san_francisco"] {
  order: 2;
}

.time-panel[data-view="breeze"] .city-options button[aria-pressed="true"] {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: #fff9ed88;
  text-underline-offset: 6px;
}

.time-panel[data-view="breeze"] [data-city="local"],
.time-panel[data-view="breeze"] .time-scrubber,
.time-panel[data-view="breeze"] .city-clocks {
  display: none;
}

.breeze-time-view {
  order: 2;
}

.breeze-time-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--time-tile-size) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.breeze-time-clock {
  min-width: 0;
  text-align: center;
  position: relative;
}

.breeze-time-clock::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -24px -8px;
  background: radial-gradient(ellipse, #0b24284d, #0b242800 72%);
  pointer-events: none;
}

.breeze-time-clock time {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.16em;
  font: 400 clamp(24px, 4.4vw, 36px) / 1.1 var(--sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.breeze-clock-period {
  font-size: 0.75em;
}

.breeze-city-label {
  display: block;
  margin-top: 6px;
  font: 500 clamp(14px, 2.5vw, 18px) / 1.2 var(--sans);
  white-space: nowrap;
}

.breeze-time-rail {
  position: relative;
  height: calc(var(--time-tile-step) * var(--time-visible-tiles));
  min-width: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.breeze-time-rail[data-dragging] {
  cursor: grabbing;
}

.breeze-time-rail:focus-visible::after {
  content: "";
  position: absolute;
  width: calc(var(--time-tile-size) - 8px);
  height: calc(var(--time-tile-size) - 8px);
  top: 50%;
  left: 50%;
  border: 1px solid #fff9edbb;
  border-radius: 12px;
  transform: translate(-50%, -50%);
  outline: 1px solid #15353588;
  outline-offset: 2px;
  pointer-events: none;
}

.breeze-block-stack {
  position: absolute;
  inset: 0 -10px;
  overflow: hidden;
  pointer-events: none;
}

.breeze-time-block {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--time-tile-size);
  height: var(--time-tile-size);
  max-width: none;
  object-fit: contain;
  opacity: var(--tile-opacity, 1);
  filter: drop-shadow(0 3px 3px #1825247a);
  transform: translate(
      -50%,
      calc(-50% + var(--tile-offset) * var(--time-tile-step))
    )
    scale(var(--tile-scale)) rotate(var(--tile-rotation, 45deg));
  transform-origin: center;
}

.time-panel[data-view="breeze"] .return-local {
  order: 3;
  align-self: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 8px 12px;
  color: inherit;
  text-shadow: inherit;
  text-decoration: none;
  font: 500 19px/1.3 var(--sans);
}

.time-panel[data-view="breeze"] .return-local:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.time-panel[data-view="breeze"] .time-view-options {
  order: 1;
  margin: 0;
}

.time-panel[data-view="breeze"] .time-view-options button {
  font-size: 12px;
}

.time-panel[data-view="breeze"] .time-panel-heading > span,
.time-panel[data-view="breeze"] .time-mode,
.breeze-time-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  .shophouse-hero:has(.time-panel[data-view="breeze"]:not([hidden]))
    .scene-sound {
    visibility: hidden;
  }
}

@media (max-width: 420px) {
  .time-panel[data-view="breeze"] {
    --time-tile-size: 82px;
    padding-inline: 0;
  }

  .breeze-time-stage {
    gap: 4px;
  }

  .breeze-time-clock time {
    font-size: clamp(21px, 6.1vw, 25px);
  }

  .breeze-city-label {
    font-size: 14px;
  }
}

@media (min-height: 1000px) {
  .time-panel[data-view="breeze"] {
    --time-visible-tiles: 5;
    --time-tile-step: 140px;
  }
}

@media (min-height: 1400px) {
  .time-panel[data-view="breeze"] {
    --time-visible-tiles: 7;
    --time-tile-step: 148px;
  }
}

@media (max-height: 650px) {
  .time-panel[data-view="breeze"] {
    --time-tile-step: 100px;
    --time-tile-size: 72px;
  }
}

@media (max-height: 550px) {
  .time-panel[data-view="breeze"] {
    --time-tile-step: clamp(66px, calc((100svh - 192px) / 3), 88px);
    --time-tile-size: 38px;
    top: calc(50svh + 28px);
    width: min(480px, calc(100vw - 24px));
  }

  .time-panel[data-view="breeze"] .return-local {
    margin-top: 4px;
    min-height: 32px;
    padding-block: 4px;
    font-size: 17px;
  }

  .time-panel[data-view="breeze"] .time-view-options button,
  .time-panel[data-view="breeze"] .city-options button {
    min-height: 30px;
    padding-block: 3px;
  }
}

.shophouse-hero:has(.time-panel[data-view="breeze"]:not([hidden]))
  .scene-scroll {
  visibility: hidden;
}

@media (max-height: 550px) {
  .time-toolbar .time-close {
    min-height: 38px;
    padding-block: 3px;
  }
}

@media (max-width: 600px) {
  .shophouse-hero:has(.time-panel:not([hidden])) .scene-sound,
  .shophouse-hero:has(.time-panel:not([hidden])) .scene-bottom {
    visibility: hidden;
  }

  .time-panel[data-view="slider"] {
    position: fixed;
    inset: auto 12px max(12px, env(safe-area-inset-bottom));
    width: auto;
    max-height: calc(100svh - 88px);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid #fff9ed38;
    border-radius: 22px;
    background: #082332f7;
    box-shadow: 0 24px 70px #00131e99;
    backdrop-filter: blur(20px);
  }

  .time-panel[data-view="slider"] .time-panel-heading {
    position: static;
    min-height: 0;
    background: none;
    font-size: 11px;
  }

  .time-panel[data-view="slider"] .time-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: block;
    margin: 0;
  }

  .time-panel[data-view="slider"] .time-view-options {
    display: none;
  }

  .time-panel[data-view="slider"] .time-close {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: #ffffff12;
    color: #fff9ed;
    font-size: 0;
  }

  .time-panel[data-view="slider"] .time-close span {
    font-size: 23px;
  }

  .time-panel[data-view="slider"] .city-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 20px 0 12px;
    padding-right: 48px;
  }

  .time-panel[data-view="slider"] .city-options button {
    min-height: 44px;
    padding: 8px;
    border-radius: 999px;
    font-size: 11px;
  }

  .time-panel[data-view="slider"] .time-scrubber {
    position: relative;
    height: auto;
    margin: 14px 0 10px;
  }

  .time-panel[data-view="slider"] .time-markers {
    position: static;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 9px;
  }

  .time-panel[data-view="slider"] .time-scrubber input {
    position: static;
    display: block;
    width: 100%;
    height: 46px;
    writing-mode: horizontal-tb;
    direction: ltr;
    touch-action: pan-x;
    cursor: ew-resize;
  }

  .time-panel[data-view="slider"]
    .time-scrubber
    input::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
  }

  .time-panel[data-view="slider"]
    .time-scrubber
    input::-webkit-slider-thumb {
    margin-top: -16px;
    margin-left: 0;
    width: 38px;
    height: 38px;
  }

  .time-panel[data-view="slider"] .time-scrubber input::-moz-range-track {
    width: 100%;
    height: 5px;
  }

  .time-panel[data-view="slider"] .city-clocks {
    gap: 12px;
    padding-top: 12px;
    font-size: 11px;
  }

  .time-panel[data-view="slider"] .return-local {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #fff9ed35;
    border-radius: 999px;
    text-decoration: none;
  }

  .time-panel[data-view="slider"] .time-mode {
    margin-top: 8px;
    text-align: center;
  }
}
