/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --dark: #1c1c1e;
  --dark-surface: #2c2c2e;
  --dark-elevated: #3a3a3c;
  --text-primary: #1c1c1e;
  --text-secondary: #6d6d72;
  --text-tertiary: #aeaeb2;
  --red: #e53935;
  --today-bg: #fffbea;
  --sunday-bg: #f7f9fc;
  --selected-bg: #ececf2;
  --streak: #22c55e;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  --panel-radius: 28px;
}

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell: two-row stacked layout ───────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

/* ── Calendar section ─────────────────────────────────────────── */
.calendar-section {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 8px;
  background: var(--bg);
  position: relative;
}
.calendar-month-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
}

.calendar-month-header {
  padding: 52px 24px 20px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.month-name {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.month-year {
  font-size: 2.6rem;
  font-weight: 300;
  color: var(--text-tertiary);
  letter-spacing: -0.02em;
}
.calendar-month-header { flex-wrap: wrap; }

/* ── Calendar grid ────────────────────────────────────────────── */
.calendar-grid-wrap {
  background: var(--surface);
  border-radius: 16px;
  margin: 0 16px;
  overflow: hidden;
}

.calendar-grid {
  width: 100%;
  border-collapse: collapse;
}

.calendar-grid thead th {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-align: center;
  padding: 12px 8px 8px;
  text-transform: uppercase;
}
.calendar-grid thead th.col-day,
.calendar-grid thead th.col-dow { width: 32px; }
.calendar-grid thead th.col-tracker { min-width: 72px; }

.cal-row {
  border-top: 1px solid #f0f0f0;
}
.cal-row:first-child { border-top: none; }
.cal-row--future .cal-day,
.cal-row--future .cal-dow { color: var(--text-tertiary); }
.cal-row--today { background: var(--today-bg); }

.cal-day {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  padding: 4px 4px 4px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cal-dow {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 4px 12px 4px 6px;
  width: 24px;
  line-height: 1.1;
}

.today-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--red);
  color: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.cal-cell {
  text-align: center;
  padding: 4px 4px;
  line-height: 1.1;
}
.cal-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.5;
}
.cal-value {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── Today panel ──────────────────────────────────────────────── */
.today-panel {
  background: var(--dark);
  border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  flex-shrink: 0;
  padding: 24px 20px 0;
  display: flex;
  flex-direction: column;
  max-height: 55vh;
}

.today-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.today-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}
.today-date-badge {
  background: var(--red);
  border-radius: 10px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}
.today-date-day {
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  line-height: 1;
}
.today-date-month {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.05em;
}

/* ── Tracker rows ─────────────────────────────────────────────── */
.today-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}
.today-list::-webkit-scrollbar { display: none; }

.tracker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--dark-surface);
  border-radius: 14px;
  padding: 18px 16px;
  text-decoration: none;
  color: white;
  cursor: pointer;
  transition: opacity 0.15s;
}
.tracker-row:active { opacity: 0.7; }
.tracker-row--logged { background: var(--dark-elevated); }

.tracker-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--dark-elevated);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.tracker-row--logged .tracker-check {
  background: var(--red);
  border-color: var(--red);
}
.tracker-check svg { width: 14px; height: 14px; }

.tracker-label {
  font-size: 1.1rem;
  font-weight: 500;
  flex: 1;
}
.tracker-logged-value {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  font-variant-numeric: tabular-nums;
}

/* ── Bottom nav bar ───────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 max(16px, env(safe-area-inset-bottom));
  gap: 8px;
  margin-top: 8px;
}
.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark-surface);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.nav-btn:active { opacity: 0.7; }
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn--add { background: var(--dark-elevated); }

.nav-date-pill {
  flex: 1;
  background: var(--dark-elevated);
  border-radius: 99px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  color: white;
  letter-spacing: 0.04em;
}

/* ── Modal backdrop & sheet ───────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
}
.modal-sheet {
  background: var(--dark);
  border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 28px 20px max(24px, env(safe-area-inset-bottom));
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dark-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.modal-close svg { width: 16px; height: 16px; color: rgba(255,255,255,0.7); }

/* ── Form fields ──────────────────────────────────────────────── */
.modal-form { display: flex; flex-direction: column; gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.9rem; color: white; font-weight: 500; }
.form-input {
  background: var(--dark-surface);
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: white;
  outline: none;
  width: 100%;
  font-family: var(--font);
}
.form-input:focus { background: var(--dark-elevated); }
.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-hint { font-size: 0.72rem; color: rgba(255,255,255,0.35); }
.form-static {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  padding: 6px 0 0;
}

/* ── Type pill selector ───────────────────────────────────────── */
.type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.type-pill { cursor: pointer; }
.type-pill-input { display: none; }
.type-pill-label {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 99px;
  background: var(--dark-surface);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.type-pill-input:checked + .type-pill-label {
  border-color: white;
  color: white;
  background: transparent;
}

/* ── Submit button ────────────────────────────────────────────── */
.submit-btn {
  display: block;
  width: 100%;
  background: white;
  color: var(--dark);
  border: none;
  border-radius: 99px;
  padding: 17px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: var(--font);
  transition: opacity 0.15s;
}
.submit-btn:active { opacity: 0.8; }

/* ── Drum picker ──────────────────────────────────────────────── */
.drum-wrap {
  position: relative;
  background: var(--dark-surface);
  border-radius: 14px;
  height: 200px;
  overflow: hidden;
}
.drum-cols {
  display: flex;
  height: 100%;
  justify-content: center;
}
.drum-col {
  flex: 1;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 0;
}
.drum-col--ampm { flex: 0.7; }
.drum-col::-webkit-scrollbar { display: none; }
.drum-item {
  font-size: 1.5rem;
  font-weight: 400;
  color: rgba(255,255,255,0.3);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  width: 100%;
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.1s;
}
.drum-selector {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 40px;
  transform: translateY(-50%);
  border-top: 1px solid rgba(255,255,255,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
}
.drum-fade--top, .drum-fade--bottom {
  position: absolute;
  left: 0; right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 2;
}
.drum-fade--top {
  top: 0;
  background: linear-gradient(to bottom, var(--dark-surface), transparent);
}
.drum-fade--bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--dark-surface), transparent);
}

/* ── Numpad ───────────────────────────────────────────────────── */
.numpad-display {
  background: var(--dark-surface);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 8px;
}
.numpad-unit {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.numpad-value {
  font-size: 3rem;
  font-weight: 300;
  color: white;
  font-variant-numeric: tabular-nums;
}
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--dark-elevated);
  border-radius: 14px;
  overflow: hidden;
}
.numpad-key {
  background: var(--dark-surface);
  border: none;
  color: white;
  font-size: 1.6rem;
  font-weight: 300;
  padding: 18px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.1s;
}
.numpad-key:active { background: var(--dark-elevated); }

/* ── Completion ───────────────────────────────────────────────── */
.completion-display {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}
.completion-icon { width: 80px; height: 80px; }

/* ── Notes ────────────────────────────────────────────────────── */
.notes-input {
  background: var(--dark-surface);
  border: none;
  border-radius: 14px;
  padding: 16px;
  color: white;
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  resize: none;
  width: 100%;
}
.notes-input::placeholder { color: rgba(255,255,255,0.3); }

/* ── Calendar cell interaction ────────────────────────────────── */
.cal-cell-link,
.cal-cell-link:hover,
.cal-cell-link:visited,
.cal-cell-link:focus,
.cal-cell-link:active {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 22px;
  text-decoration: none !important;
  color: inherit;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.cal-cell-link:active { background: rgba(0,0,0,0.06); }
.cal-cell-link .cal-value { text-decoration: none; }
.cal-row--selected { background: var(--selected-bg); }
.cal-row--selected .cal-day { font-weight: 600; }
.cal-row--sunday:not(.cal-row--selected):not(.cal-row--today) { background: var(--sunday-bg); }

/* ── Month nav (subtle, right side of header) ─────────────────── */
.month-nav {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.month-nav-btn {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-tertiary);
  opacity: 0.55;
  transition: opacity 0.15s ease;
  text-decoration: none;
}
.month-nav-btn:hover { opacity: 1; background: rgba(0,0,0,0.04); }
.month-nav-btn svg { width: 12px; height: 12px; }
.month-nav-label { font-variant-numeric: tabular-nums; }

/* ── Streak wave under column header ──────────────────────────── */
.col-tracker {
  vertical-align: bottom;
  padding-bottom: 4px;
}
.tracker-sym,
.tracker-sym:hover,
.tracker-sym:visited,
.tracker-sym:active {
  display: block;
  text-align: center;
  line-height: 1.1;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.streak-wave {
  display: block;
  width: 100%;
  height: 12px;
  margin-top: 2px;
  opacity: 0.85;
}
.streak-wave--empty { height: 12px; }

/* ── Clear-entry link (subtle, below TRACK) ───────────────────── */
.clear-form { margin: 10px 0 0; text-align: center; }
.clear-link {
  background: none;
  border: none;
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.clear-link:active { color: var(--red); }

/* ── Disabled nav placeholder ─────────────────────────────────── */
.nav-btn--disabled { opacity: 0.25; pointer-events: none; }

/* ── Countdown header ─────────────────────────────────────────── */
.countdown-header {
  padding: 16px 24px 0;
  font-family: var(--font);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary, #8e8e93);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
}
.countdown-header .countdown-date { font-weight: 600; color: var(--text-primary); }
.countdown-header .countdown-sep { opacity: 0.4; }

/* ── Tablet layout (Daylight DC-1 ~820px) ─────────────────────── */
@media (min-width: 600px) {
  .app-shell {
    max-width: 100%;
    flex-direction: row;
    align-items: stretch;
  }

  .calendar-section {
    flex: 1;
    border-right: 1px solid rgba(0,0,0,0.08);
  }

  .calendar-month-header { padding: 40px 32px 20px; }
  .calendar-grid-wrap { margin: 0 24px; }
  .calendar-grid thead th.col-tracker { min-width: 100px; }
  .cal-value { font-size: 0.85rem; }

  .today-panel {
    width: 360px;
    flex-shrink: 0;
    border-radius: 0;
    max-height: 100dvh;
    padding: 40px 24px 0;
  }

  .modal-sheet {
    max-width: 400px;
    border-radius: var(--panel-radius);
    margin: auto;
  }
  .modal-backdrop { align-items: center; }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
