:root {
  --blue: #BDD7EE;
  --blue-text: #1c3a52;
  --brown: #D9B896;
  --brown-text: #4a2e14;
  --header-bg: #4B472B;
  --header-fg: #F4E6A1;
  --accent: #E1B908;
  --off-color: #c9c9c9;
  --border-color: #e5e5e5;
  --bg: #ffffff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: contain;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #222;
}

#app {
  height: 100dvh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#sticky-header {
  flex: 0 0 auto;
  background: var(--header-bg);
  color: var(--header-fg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 5;
}

#month-year {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  padding: 10px 8px 6px;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

#weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 4px 8px;
  gap: 0;
}

#weekday-row span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

#weekday-row span:last-child {
  border-right: none;
}

#scroller {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y proximity;
  overflow-anchor: none;
}

#top-sentinel, #bottom-sentinel {
  height: 1px;
}

.boundary-marker {
  text-align: center;
  font-size: 11px;
  color: #999;
  padding: 14px 0 6px;
  letter-spacing: 0.5px;
  scroll-snap-align: start;
}

.week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-color);
  scroll-snap-align: start;
}

.day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 70px;
  min-width: 0;
  padding: 4px 3px 6px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
}

.day-cell:last-child {
  border-right: none;
}

.day-num {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.day-cell.today {
  background: rgba(225, 185, 8, 0.22);
}

.day-cell.today .day-num {
  color: #3a2f00;
  font-weight: 700;
}

.day-cell.off .day-num {
  color: #aaa;
  font-weight: 500;
}

.shifts {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.shift-box {
  width: 100%;
  height: 22px;
  border-radius: 5px;
}

.shift-box.blue { background: var(--blue); }
.shift-box.brown { background: var(--brown); }

.shift-box:active {
  filter: brightness(0.92);
}

.off-dash {
  color: #ccc;
  font-size: 12px;
  padding-top: 6px;
}

.tooltip {
  position: fixed;
  z-index: 20;
  background: #2b2b2b;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  transition: opacity 0.15s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #2b2b2b;
}

#today-btn {
  position: absolute;
  right: 14px;
  bottom: 18px;
  z-index: 6;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  background: var(--header-bg);
  color: var(--header-fg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

#today-btn:active {
  transform: scale(0.96);
}
