/* TimeSheet — iOS-inspired, mobile-first vertical shell */

:root {
  --bg-0: #cfdced;
  --bg-1: #e8eef7;
  --bg-2: #edf1f8;
  --ink: #1c1c1e;
  --ink-secondary: #636366;
  --ink-tertiary: #8e8e93;
  --separator: rgba(60, 60, 67, 0.12);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.65);
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.14);
  --cell: rgba(255, 255, 255, 0.55);
  --cell-filled: rgba(0, 122, 255, 0.18);
  --cell-pressed: rgba(0, 122, 255, 0.28);
  --nonwork: rgba(255, 59, 48, 0.07);
  --nonwork-border: rgba(255, 59, 48, 0.14);
  --nonwork-strong: rgba(255, 59, 48, 0.1);
  --shadow-soft: 0 10px 40px rgba(28, 45, 80, 0.1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shell-width: 390px;
  --action-size: 42px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Manrope", "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  touch-action: none;
}

html,
body {
  margin: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Lock to viewport: no page scroll, no pull-to-refresh bounce */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  /* none (not manipulation): blocks pan/scroll gestures on Android Chrome too */
  touch-action: none;
  display: grid;
  place-items: center;
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Atmosphere behind the phone shell (desktop / large screens) */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 10% -10%, #a9c4ec 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, #c5d6f0 0%, transparent 50%),
    radial-gradient(80% 60% at 50% 100%, #b7c8e4 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  animation: ambient-shift 18s ease-in-out infinite alternate;
}

@keyframes ambient-shift {
  from {
    filter: saturate(1);
  }
  to {
    filter: saturate(1.08);
  }
}

/* Constrained vertical “device” — stays phone-like in desktop Teams */
.phone-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--shell-width));
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
  padding:
    calc(12px + var(--safe-top))
    14px
    calc(12px + var(--safe-bottom));
  animation: shell-in 0.55s var(--ease-out) both;
}

.screen {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.screen.is-active {
  display: flex;
}

.screen--calendar.is-active {
  animation: screen-in-left 0.35s var(--ease-out) both;
}

.screen--jobs.is-active {
  animation: screen-in-right 0.4s var(--ease-out) both;
}

.screen--jobs {
  position: relative;
}

.screen--jobs.is-edge-back {
  transform: translateX(var(--edge-back-x, 0px));
  transition: none;
}

.jobs-edge-back {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  z-index: 8;
  touch-action: none;
}

@keyframes screen-in-right {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes screen-in-left {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shell-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 480px) {
  body {
    padding: 24px 16px;
  }

  .phone-shell {
    height: min(844px, calc(100dvh - 48px));
    max-height: min(844px, calc(100dvh - 48px));
    border-radius: 36px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(28px) saturate(1.35);
    -webkit-backdrop-filter: blur(28px) saturate(1.35);
    padding: 18px 16px 16px;
  }
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 0;
  flex-shrink: 0;
}

.top-bar__title {
  min-width: 0;
  flex: 1;
}

.top-bar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: default;
}

.top-bar__date {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  letter-spacing: -0.01em;
}

.top-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  animation: actions-in 0.55s var(--ease-out) 0.08s both;
}

@keyframes actions-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.action-btn {
  width: var(--action-size);
  height: var(--action-size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px dashed rgba(60, 60, 67, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  color: var(--accent);
  transition:
    transform 0.2s var(--ease-spring),
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.action-btn--filled {
  border-style: solid;
  border-color: rgba(0, 122, 255, 0.22);
  background: rgba(255, 255, 255, 0.78);
}

.action-btn:active {
  transform: scale(0.9);
  background: var(--accent-soft);
  border-style: solid;
  border-color: rgba(0, 122, 255, 0.35);
}

.action-btn:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.action-btn__icon {
  display: grid;
  place-items: center;
  line-height: 0;
}

.sheet {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  overflow: hidden;
  padding: 7px;
}

.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(64px, 0.88fr) repeat(3, 1fr);
  grid-template-rows: auto repeat(5, 1fr);
  gap: 5px;
  touch-action: none;
}

.grid__corner {
  display: grid;
  place-items: center;
}

.info-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(120, 120, 128, 0.12);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
  font-style: italic;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}

.info-btn:active {
  transform: scale(0.92);
  background: var(--accent-soft);
}

.grid__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: var(--radius-md);
  text-align: center;
}

.grid__day--today {
  background: transparent;
}

.grid__day--holiday {
  background: rgba(255, 59, 48, 0.06);
}

.grid__day--halfday {
  background: rgba(255, 59, 48, 0.04);
}

.grid__day-name {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}

.grid__day--today .grid__day-name {
  color: var(--ink-secondary);
}

.grid__day--holiday .grid__day-name,
.grid__day--halfday .grid__day-name {
  color: #ff3b30;
}

.grid__day-date {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.grid__slot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px 2px 2px;
  border-radius: var(--radius-md);
}

.grid__slot-num {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.grid__slot-time {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--ink-secondary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.grid__slot--ot .grid__slot-num {
  font-size: 0.85rem;
  color: var(--ink);
}

.grid__slot--ot .grid__slot-time {
  font-size: 0.5rem;
}

.cell {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--cell);
  border: 1px solid var(--separator);
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.cell.is-assigned {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 122, 255, 0.22);
}

.cell--nonwork {
  background: var(--nonwork);
  border-color: var(--nonwork-border);
}

.cell--nonwork.is-assigned {
  background: var(--nonwork-strong);
  border-color: rgba(255, 59, 48, 0.18);
}

.cell--nonwork.is-armed {
  background: rgba(255, 59, 48, 0.14);
  border-color: rgba(255, 59, 48, 0.22);
}

.cell--now {
  border-width: 2px;
  border-color: rgba(0, 122, 255, 0.55);
}

.cell--now.cell--nonwork {
  border-color: rgba(255, 59, 48, 0.42);
}

.cell--now.is-assigned {
  border-color: rgba(0, 122, 255, 0.65);
}

.cell--now.cell--nonwork.is-assigned {
  border-color: rgba(255, 59, 48, 0.5);
}

.job-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 3px 4px 2px;
  text-align: center;
  gap: 1px;
  pointer-events: none;
}

.job-lines__row {
  display: block;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-lines--calendar .job-lines__row--address {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.job-lines__row--gap {
  display: block;
  height: 0.3em;
  min-height: 0.3em;
  overflow: hidden;
  pointer-events: none;
}

.job-lines__row--travel {
  color: var(--ink-secondary);
  font-weight: 650;
  font-size: 0.48rem;
}

.job-lines__row--ot {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.55rem;
}

.job-lines--picker {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  padding: 8px 10px;
  text-align: left;
}

.job-lines--picker .job-lines__main,
.job-lines--picker .job-lines__meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.job-lines--picker .job-lines__main {
  flex: 1;
  text-align: left;
  align-items: stretch;
}

.job-lines--picker .job-lines__meta {
  flex: 0 0 auto;
  text-align: right;
  align-items: flex-end;
}

.job-lines--picker .job-lines__row {
  font-size: 0.78rem;
  line-height: 1.2;
  max-width: 100%;
}

.job-lines--picker .job-lines__meta .job-lines__row {
  font-variant-numeric: tabular-nums;
}

.job-lines--picker .job-lines__row--travel {
  font-size: 0.7rem;
}

.cell.cell--enter {
  animation: cell-in 0.45s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}

@keyframes cell-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cell.is-armed {
  background: var(--cell-pressed);
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.12);
  transform: scale(0.97);
}

.cell.is-pulsing {
  animation: cell-pulse 0.38s var(--ease-out);
}

.cell.is-pulsing::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: cell-pulse-dot 0.38s var(--ease-out) both;
  pointer-events: none;
}

@keyframes cell-pulse {
  0% {
    transform: scale(1);
    background: var(--cell);
    border-color: var(--separator);
    box-shadow: none;
  }
  35% {
    transform: scale(0.94);
    background: var(--cell-pressed);
    border-color: rgba(0, 122, 255, 0.35);
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.12);
  }
  100% {
    transform: scale(1);
    background: var(--cell);
    border-color: var(--separator);
    box-shadow: none;
  }
}

@keyframes cell-pulse-dot {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 6px rgba(0, 122, 255, 0.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
  }
}

.cell:active:not(.is-pulsing):not(.is-armed) {
  transform: scale(0.96);
  background: var(--cell-pressed);
}

.cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* —— Jobs screen —— */
.jobs-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 0 0;
}

.nature-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.nature-chip {
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--separator);
  color: var(--ink-secondary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.nature-chip.is-selected {
  background: var(--accent-soft);
  border-color: rgba(0, 122, 255, 0.35);
  color: var(--accent);
}

.nature-chip:active {
  transform: scale(0.97);
}

.pill-btn {
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 122, 255, 0.18);
  box-shadow: var(--shadow-soft);
  color: var(--accent);
  font-weight: 750;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition:
    transform 0.2s var(--ease-spring),
    background 0.2s ease;
}

.pill-btn:active {
  transform: scale(0.97);
  background: var(--accent-soft);
}

.pill-btn.is-pulsing {
  animation: control-pulse 0.38s var(--ease-out);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--separator);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.2s var(--ease-spring),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.94);
  background: rgba(60, 60, 67, 0.1);
  color: var(--ink);
}

.icon-btn--danger {
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.28);
  background: rgba(255, 59, 48, 0.08);
}

.icon-btn--danger:active {
  background: rgba(255, 59, 48, 0.18);
  color: #d70015;
  border-color: rgba(255, 59, 48, 0.4);
}

@keyframes control-pulse {
  0% {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
  }
  35% {
    transform: scale(0.96);
    background: var(--cell-pressed);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16);
  }
  100% {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
  }
}

.jobs-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-xl);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  overflow: hidden;
}

.job-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-section__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: var(--ink-secondary);
}

.job-section__list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-slot {
  flex: 1;
  min-height: 36px;
  border-radius: var(--radius-md);
  background: var(--cell);
  border: 1px solid var(--separator);
  text-align: left;
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.job-slot:active {
  transform: scale(0.985);
  background: var(--cell-pressed);
  border-color: rgba(0, 122, 255, 0.28);
}

.job-slot.is-pulsing {
  animation: job-slot-pulse 0.38s var(--ease-out);
}

@keyframes job-slot-pulse {
  0% {
    transform: scale(1);
    background: var(--cell);
  }
  35% {
    transform: scale(0.98);
    background: var(--cell-pressed);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.16);
  }
  100% {
    transform: scale(1);
    background: var(--cell);
  }
}

.job-section__empty {
  margin: 0;
  padding: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-tertiary);
}

/* Confirm dialog (copy yesterday, etc.) */
.confirm-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.confirm-sheet[hidden] {
  display: none;
}

.confirm-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 30, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.25s ease both;
}

.confirm-sheet__panel {
  position: relative;
  width: min(100%, 300px);
  padding: 22px 18px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  animation: confirm-pop 0.3s var(--ease-out) both;
  text-align: center;
}

@keyframes confirm-pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.confirm-sheet__panel h2 {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.confirm-sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-sheet__btn {
  height: 46px;
  border-radius: 14px;
  font-weight: 750;
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease-spring), filter 0.2s ease;
}

.confirm-sheet__btn:active {
  transform: scale(0.97);
}

.confirm-sheet__btn--cancel {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.28);
}

.confirm-sheet__btn--cancel:active {
  background: rgba(255, 59, 48, 0.2);
}

.confirm-sheet__btn--ok {
  background: var(--accent);
  color: #fff;
}

.confirm-sheet__btn--ok:active {
  filter: brightness(0.95);
}

.advanced-gate__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.advanced-gate__hint {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.advanced-gate__hint.is-error {
  color: #ff3b30;
}

.advanced-gate__input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--separator);
  background: rgba(120, 120, 128, 0.08);
  padding: 0 14px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--ink);
  outline: none;
}

.advanced-gate__input:focus {
  border-color: rgba(0, 122, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* OT end-time interim popup */
.ot-sheet {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 20px;
}

.ot-sheet[hidden] {
  display: none;
}

.ot-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 30, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}

.ot-sheet__panel {
  position: relative;
  width: min(100%, 300px);
  padding: 18px 16px 14px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  animation: sheet-up 0.28s var(--ease-out) both;
}

.ot-sheet__panel h2 {
  margin: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ot-sheet__hint {
  margin: 4px 0 10px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.ot-wheel {
  position: relative;
  height: 168px;
  margin: 0 4px 12px;
  border-radius: 14px;
  background: rgba(120, 120, 128, 0.08);
  overflow: hidden;
  touch-action: pan-y;
}

.ot-wheel__viewport {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 66px 0;
  scrollbar-width: none;
  cursor: grab;
}

.ot-wheel__viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.ot-wheel__viewport::-webkit-scrollbar {
  display: none;
}

.ot-wheel__option {
  height: 36px;
  width: 100%;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-tertiary);
  transition: color 0.15s ease, font-size 0.15s ease;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.ot-wheel__option.is-active {
  color: var(--ink);
  font-size: 1.28rem;
}

.ot-wheel__highlight {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 36px;
  margin-top: -18px;
  border-radius: 10px;
  border: 1px solid rgba(0, 122, 255, 0.28);
  background: rgba(0, 122, 255, 0.08);
  pointer-events: none;
}

.ot-wheel__fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 1;
  pointer-events: none;
}

.ot-wheel__fade--top {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0)
  );
}

.ot-wheel__fade--bottom {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0)
  );
}

.ot-sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.ot-sheet__actions.has-entry {
  grid-template-columns: auto auto 1fr 1fr;
}

.ot-sheet__btn {
  height: 46px;
  border-radius: 14px;
  font-weight: 750;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    transform 0.18s var(--ease-spring),
    background 0.2s ease,
    border-color 0.2s ease;
}

.ot-sheet__btn:active {
  transform: scale(0.97);
}

.ot-sheet__btn--back {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-soft);
  padding: 0 12px;
}

.ot-sheet__actions.has-entry .ot-sheet__btn--back {
  padding: 0 10px;
  font-size: 0.82rem;
}

.ot-sheet__btn--back:active {
  background: rgba(255, 255, 255, 0.85);
}

.ot-sheet__btn--save {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-soft);
}

.ot-sheet__btn--save:active {
  filter: brightness(0.95);
}

.ot-sheet__actions.has-entry #ot-end-ok {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-soft);
}

.ot-sheet__actions.has-entry #ot-end-ok:active {
  filter: none;
  background: rgba(255, 255, 255, 0.85);
}

.ot-sheet__trash[hidden],
.ot-sheet__btn--save[hidden] {
  display: none;
}

/* Info bottom sheet */
.info-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  justify-items: center;
}

.info-sheet[hidden] {
  display: none;
}

.info-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 30, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.25s ease both;
}

.info-sheet__panel {
  position: relative;
  width: min(100%, var(--shell-width));
  margin: 0;
  padding: 10px 20px calc(20px + var(--safe-bottom));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
  animation: sheet-up 0.35s var(--ease-out) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

.info-sheet__handle {
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.18);
  margin: 4px auto 16px;
}

.info-sheet__panel h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.info-sheet__panel p {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-secondary);
  font-weight: 500;
}

.info-sheet__note {
  color: var(--ink-tertiary) !important;
  font-size: 0.85rem !important;
}

.info-sheet__done {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s var(--ease-spring), filter 0.2s ease;
}

.info-sheet__done:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

/* Very small phones */
@media (max-width: 360px) {
  .grid {
    gap: 6px;
    grid-template-columns: minmax(64px, 0.9fr) repeat(3, 1fr);
  }

  .grid__slot-time {
    font-size: 0.58rem;
  }

  .top-bar__actions {
    gap: 6px;
  }

  .action-btn {
    width: 38px;
    height: 38px;
  }

  .top-bar h1 {
    font-size: 1.35rem;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
