:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(12, 26, 45, 0.45), rgba(12, 26, 45, 0.45)),
    url("https://images.unsplash.com/photo-1552674605-db6ffd4facb5?auto=format&fit=crop&w=1400&q=80") center/cover fixed no-repeat;
  color: #1f2933;
}

.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 14px 20px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.brand-banner {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.panel {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(217, 226, 236, 0.75);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(16, 42, 67, 0.16);
  backdrop-filter: blur(6px);
}

.controls .row {
  display: grid;
  gap: 8px;
}

label {
  font-size: 0.9rem;
  color: #486581;
}

select,
button {
  font: inherit;
}

select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #bcccdc;
  min-height: 44px;
}

.button-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

button {
  border: none;
  border-radius: 8px;
  padding: 12px 10px;
  min-height: 44px;
  background: #0b69ff;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #627d98;
}

button.danger {
  background: #d64545;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.action-btn {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: clamp(84px, 22vw, 128px);
  border-radius: 14px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  transform: translateY(0);
  transition: transform 140ms ease;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.action-btn img {
  width: clamp(38px, 12vw, 68px);
  height: clamp(38px, 12vw, 68px);
  display: block;
}

.action-btn.start {
  background: transparent;
}

.action-btn.pause {
  background: transparent;
}

.action-btn.reset {
  background: transparent;
}

.timer {
  text-align: center;
  touch-action: pan-y;
}

.swipe-nav-layout {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2px;
}

.swipe-stage {
  position: relative;
  overflow: hidden;
}

.swipe-arrow {
  position: static;
  transform: none;
  width: clamp(24px, 8vw, 40px);
  height: clamp(92px, 36vw, 168px);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.1rem, 10vw, 5.7rem);
  line-height: 1;
  font-weight: 700;
  color: rgba(72, 101, 129, 0.8);
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.swipe-arrow.left {
  justify-self: start;
}

.swipe-arrow.right {
  justify-self: end;
}

.timer-main,
.swipe-preview {
  will-change: transform, opacity;
}

.swipe-preview {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.weekly-summary {
  margin-top: 10px;
}

.stage {
  margin: 6px 0;
  font-size: 1.1rem;
  color: #334e68;
}

.time {
  margin: 8px 0;
  font-size: clamp(2.4rem, 13vw, 3.6rem);
  font-weight: bold;
  letter-spacing: 1px;
}

.status {
  margin: 8px 0 0;
  color: #486581;
}

.progress-group {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}

.progress-item .status {
  margin-top: 0;
}

.progress-bar {
  position: relative;
  height: 40px;
  border-radius: 999px;
  background: #d9e2ec;
  overflow: hidden;
}

.progress-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #102a43;
  z-index: 2;
  pointer-events: none;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b69ff 0%, #2f80ff 100%);
  transition: width 180ms ease;
}

.progress-fill.run-mask {
  left: auto;
  right: 0;
  background: rgba(217, 226, 236, 0.88);
  border-radius: 0 999px 999px 0;
}

.progress-fill.week {
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
}

.progress-fill.session {
  background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
}

@media (max-width: 380px) {
  .swipe-nav-layout {
    gap: 0;
  }

  .button-row {
    gap: 4px;
  }

  .action-btn {
    padding: 8px 4px;
  }
}

@media (min-width: 700px) {
  body {
    background:
      linear-gradient(rgba(12, 26, 45, 0.42), rgba(12, 26, 45, 0.42)),
      url("https://images.unsplash.com/photo-1552674605-db6ffd4facb5?auto=format&fit=crop&w=1800&q=80") center/cover fixed no-repeat;
  }

  .app {
    margin: 22px auto;
    min-height: auto;
    padding: 18px;
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.24);
    border: 1px solid rgba(217, 226, 236, 0.75);
    box-shadow: 0 10px 28px rgba(16, 42, 67, 0.22);
    backdrop-filter: blur(4px);
  }

  .button-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
