:root {
  color-scheme: dark;
  background: #050506;
}

* {
  box-sizing: border-box;
}

html,
body,
.slit-opening-lab {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050506;
}

.slit-opening-lab__frame {
  display: block;
  width: 100%;
  height: 100vh;
  height: 100svh;
  border: 0;
  background: #050506;
}

button,
input {
  font: inherit;
}

.timing-toggle,
.timing-panel {
  position: fixed;
  z-index: 3;
  color: #f5f7f8;
  font-family: Arial, "Noto Sans KR", sans-serif;
}

.timing-toggle {
  top: 1rem;
  right: 1rem;
  min-width: 5rem;
  min-height: 2.5rem;
  border: 1px solid rgb(255 255 255 / 18%);
  background: rgb(5 7 8 / 78%);
  box-shadow: 0 0.8rem 2.4rem rgb(0 0 0 / 24%);
  color: rgb(245 247 248 / 88%);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.slit-opening-lab[data-panel="open"] .timing-toggle,
.slit-opening-lab[data-opening-active="true"] .timing-toggle {
  visibility: hidden;
}

.timing-panel {
  top: 1rem;
  right: 1rem;
  width: min(20rem, calc(100vw - 2rem));
  max-height: calc(100svh - 2rem);
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 15%);
  background: rgb(5 7 8 / 88%);
  box-shadow: 0 1.4rem 4.5rem rgb(0 0 0 / 40%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
}

.timing-panel[hidden] {
  display: none;
}

.timing-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.timing-panel__header p,
.timing-panel__header output,
.timing-panel__hint {
  margin: 0;
}

.timing-panel__header p {
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.13em;
}

.timing-panel__header output {
  display: block;
  margin-top: 0.32rem;
  color: rgb(233 238 240 / 54%);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.timing-panel__header button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 12%);
  background: transparent;
  color: rgb(255 255 255 / 66%);
  cursor: pointer;
  font-size: 1.05rem;
}

.timing-panel__controls {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.timing-control {
  display: grid;
  gap: 0.52rem;
}

.timing-control > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: rgb(239 243 244 / 76%);
  font-size: 0.75rem;
}

.timing-control b {
  font-weight: 650;
}

.timing-control output {
  color: rgb(239 243 244 / 48%);
  font-variant-numeric: tabular-nums;
}

.timing-control input {
  width: 100%;
  margin: 0;
  accent-color: #dce3e6;
  cursor: pointer;
}

.timing-panel__actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0 1rem;
}

.timing-panel__actions button {
  min-height: 2.7rem;
  padding: 0 0.85rem;
  border: 1px solid rgb(255 255 255 / 16%);
  background: rgb(238 243 245 / 92%);
  color: #0b0d0e;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 720;
}

.timing-panel__actions button + button {
  background: transparent;
  color: rgb(239 243 244 / 66%);
}

.timing-panel__hint {
  padding: 0.75rem 1rem 1rem;
  color: rgb(232 237 239 / 40%);
  font-size: 0.66rem;
  line-height: 1.5;
}

.timing-toggle:focus-visible,
.timing-panel button:focus-visible,
.timing-control input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.slit-opening-lab__status {
  position: fixed;
  z-index: 1;
  top: 50%;
  left: 50%;
  margin: 0;
  color: rgb(255 218 218 / 74%);
  font: 600 10px/1.4 Arial, sans-serif;
  letter-spacing: 0.12em;
  transform: translate(-50%, -50%);
}

.slit-opening-lab[data-state="error"] .slit-opening-lab__status {
  display: block;
}

@media (max-width: 640px) {
  .timing-toggle {
    top: 6rem;
    right: 0.75rem;
  }

  .timing-panel {
    top: 6rem;
    right: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-height: calc(100svh - 6.75rem);
  }
}
