@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&display=swap');

/* ── Variables ── */
:root {
  --pink:   #F9B2D7;
  --blue:   #CFECF3;
  --yellow: #fef9c3;
  --text:   #100c08;
  --muted:  #6b6460;
  --border: #e0dbd6;
  --white:  #ffffff;
  --bg:     #C2E4F5;

  /* State colours — single source of truth (communicate attendance state) */
  --green:  #daf9de;  /* attending, confirmed */
  --grey:   #f5f5f5;  /* whitesmoke — not confirmed, unset */
  --red:    #fee2e2;  /* not going */
  /* yellow (#fef9c3) = maybe */
  --confirmed-text: #166534;  /* the one exception: Confirmed chip keeps green text */

  --shadow: 0 2px 12px rgba(16,12,8,0.08);
  --radius-card: 12px;
  --radius-btn:  8px;
  --nav-height:  64px;
  --bunting-height: 56px;
  --t: 150ms ease;
}

[x-cloak] { display: none !important; }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-size: 21px; }
body {
  font-family: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  animation: fadeIn 200ms ease;
}

/* Bunting rope across the top of every page */
body::before {
  content: '';
  position: fixed; 
  top: 0; left: 0; right: 0;
  height: var(--bunting-height);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='56'%3E%3Cpolygon points='12,11 28,14 20,42' fill='%23F9B2D7' stroke='%23d98db5' stroke-width='0.8'/%3E%3Cpolygon points='52,17 68,19 60,48' fill='%23CFECF3' stroke='%2390c5d0' stroke-width='0.8'/%3E%3Cpolygon points='92,20 108,20 100,50' fill='%23DAF9DE' stroke='%2398d49d' stroke-width='0.8'/%3E%3Cpolygon points='132,19 148,17 140,48' fill='%23F6FFDC' stroke='%23b5c98a' stroke-width='0.8'/%3E%3Cpolygon points='172,14 188,11 180,42' fill='%23CFECF3' stroke='%2390c5d0' stroke-width='0.8'/%3E%3Cpolygon points='212,11 228,14 220,42' fill='%23DAF9DE' stroke='%2398d49d' stroke-width='0.8'/%3E%3Cpolygon points='252,17 268,19 260,48' fill='%23F6FFDC' stroke='%23b5c98a' stroke-width='0.8'/%3E%3Cpolygon points='292,20 308,20 300,50' fill='%23F9B2D7' stroke='%23d98db5' stroke-width='0.8'/%3E%3Cpolygon points='332,19 348,17 340,48' fill='%23CFECF3' stroke='%2390c5d0' stroke-width='0.8'/%3E%3Cpolygon points='372,14 388,11 380,42' fill='%23F6FFDC' stroke='%23b5c98a' stroke-width='0.8'/%3E%3Cpath d='M0,8 Q100,32 200,8 Q300,32 400,8' stroke='%239B7050' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 400px 56px;
  background-repeat: repeat-x;
  background-position: -100px top;
  pointer-events: none;
  z-index: 1;
}

/* ── Animations ── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulseRed { 0%, 100% { color: var(--text); } 50% { color: #b91c1c; } }

.slide-up { animation: slideUp 220ms ease; }
.label-pulse-red { animation: pulseRed 220ms ease-in-out 2; }

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem;    font-weight: 600; }
p  { line-height: 1.5; }

/* ── Page layout ── */
.page {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  padding: 48px 16px calc(var(--nav-height) + 24px);
  min-height: 100vh;
}
.page--centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 24px;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card--blue   { background: var(--blue); }
.card--green  { background: var(--green); }
.card--pink   { background: var(--pink); }
.card--yellow { background: var(--yellow); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t), transform var(--t), opacity var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn:active        { transform: scale(0.96); }
.btn:disabled      { opacity: 0.55; cursor: not-allowed; }
.btn--primary      { background: var(--pink); color: var(--text); }
.btn--primary:hover { background: #f79ec8; }
.btn--secondary    { background: var(--blue); color: var(--text); }
.btn--ghost        { background: transparent; text-decoration: underline; color: var(--text); }
.btn--sm           { min-height: 36px; font-size: 0.875rem; padding: 8px 14px; }
.btn--auto         { width: auto; }

/* ── Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
label {
  font-size: 0.875rem;
  font-weight: 600;
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--t);
  appearance: none;
  box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--pink);
}
textarea { min-height: 88px; resize: vertical; }

/* Android Chrome sizes date/time inputs to content unless we force block + min-width */
input[type="date"],
input[type="time"] {
  display: block;
  min-width: 100%;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  padding-right: 40px;
}

/* Calendar icon for date inputs */
input[type="date"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b6460' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
}

/* Clock icon for time inputs */
input[type="time"] {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b6460' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>");
}

/* Hide the native picker glyph — we paint our own via background-image for consistency across platforms */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 0;
  width: 40px;
  height: 100%;
  cursor: pointer;
}

/* Restore a dropdown chevron on selects (appearance: none strips the native arrow) */
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%236b6460' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

/* ── Alerts ── */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  margin-bottom: 16px;
  line-height: 1.4;
}
.alert--error   { background: #fee2e2; color: #b91c1c; }
.alert--success { background: var(--green); color: #166534; }
.alert--info    { background: var(--blue); color: var(--text); }

/* ── Bottom nav ── */
app-nav { display: contents; }
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(16,12,8,0.06);
}
.nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 8px 4px;
  transition: color var(--t);
  -webkit-tap-highlight-color: transparent;
}
.nav__item--active { color: var(--text); }
.nav__item--active span {
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.nav__item svg { width: 22px; height: 22px; stroke-width: 2; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* ── Status badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge--attending     { background: var(--green); }
.badge--maybe         { background: var(--yellow); }
.badge--not-attending { background: var(--red); }
.badge--unset         { background: var(--grey); }
.badge--confirmed     { background: var(--green); color: var(--confirmed-text); }
.badge--unconfirmed   { background: var(--grey); }
.badge--tentative     { background: var(--yellow); }

/* ── Stat blocks ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  background: var(--white);
  border-radius: var(--radius-btn);
  padding: 14px;
  box-shadow: var(--shadow);
}
.stat__value { font-size: 1.4rem; font-weight: 700; }
.stat__label { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ── Utilities ── */
.flex             { display: flex; }
.flex-col         { flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.justify-center   { justify-content: center; }
.gap-2            { gap: 8px; }
.gap-3            { gap: 12px; }
.w-full           { width: 100%; }
.mt-2             { margin-top: 8px; }
.mt-3             { margin-top: 12px; }
.mt-4             { margin-top: 16px; }
.mt-6             { margin-top: 24px; }
.mb-2             { margin-bottom: 8px; }
.mb-3             { margin-bottom: 12px; }
.mb-4             { margin-bottom: 16px; }
.text-center      { text-align: center; }
.text-right       { text-align: right; }
.text-sm          { font-size: 0.875rem; }
.text-xs          { font-size: 0.75rem; }
.text-muted       { color: var(--muted); }
.font-bold        { font-weight: 700; }
.truncate         { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── Range tabs ── */
.range-tabs {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-btn);
  padding: 3px;
  gap: 2px;
  box-shadow: var(--shadow);
}
.range-tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  -webkit-tap-highlight-color: transparent;
}
.range-tab--active {
  background: var(--pink);
  color: var(--text);
  font-weight: 700;
}

/* ── Sticky header (tabs + optional nav) — used on calendar and list ── */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  margin: 0 -16px;
  padding: 8px 16px 10px;
}
.sticky-header > .range-tabs { margin-bottom: 10px; }
.sticky-header > .range-tabs:last-child { margin-bottom: 0; }
.sticky-header > .cal-nav    { margin-bottom: 0; }
/* Fade the scrolling content as it passes under the sticky header */
.sticky-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 18px;
  background: linear-gradient(to bottom, var(--bg), rgba(194, 228, 245, 0));
  pointer-events: none;
}

/* ── Calendar grid ── */
.cal-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 2px;
}
.cal-day-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 2px 2px;
  border-radius: 6px;
  min-height: 38px;
  min-width: 0;
  overflow: hidden;
  transition: transform var(--t);
}
.cal-day--has-market {
  background: var(--yellow);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.cal-day--has-market:active { transform: scale(0.93); }
.cal-day__num {
  font-size: 0.8rem;
  font-weight: 500;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cal-day--today .cal-day__num {
  background: var(--text);
  color: var(--white);
  font-weight: 700;
}
.cal-markers {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 3px;
}
.cal-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  min-width: 34px;
  height: 28px;
}
.cal-marker--attending     { background: var(--green);  color: var(--text); }
.cal-marker--maybe         { background: var(--yellow); color: var(--text); }
.cal-marker--not-attending { background: var(--red);    color: var(--text); }
.cal-marker--unset         { background: var(--grey);   color: var(--text); }

.cal-wx-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.cal-grid--month .cal-marker {
  font-size: 1.1rem;
  height: 34px;
  min-width: 40px;
  padding: 3px 8px;
  border-radius: 6px;
}

.list-avatars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.list-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  flex-shrink: 0;
}

/* ── 3-column weekends header / grid (Fri Sat Sun) ── */
.cal-header--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cal-grid--weekends { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── Weekends year view: each day is a vertical stack of full-size square nodes ── */
.cal-grid--weekends .cal-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;   /* don't stretch when a sibling stack makes the row taller */
  min-width: 0;
}
.cal-grid--weekends .cal-node {
  width: 100%;
  aspect-ratio: 1;     /* always the same square size, single or stacked */
  flex: 0 0 auto;
  position: relative;
  padding: 8px 4px 6px;
  border-radius: 6px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  min-width: 0;
  transition: transform var(--t);
}
.cal-grid--weekends .cal-node--market { cursor: pointer; }
.cal-grid--weekends .cal-node--market:active { transform: scale(0.95); }
.cal-grid--weekends .cal-node--attending     { background: var(--green); }
.cal-grid--weekends .cal-node--maybe         { background: var(--yellow); }
.cal-grid--weekends .cal-node--not_attending { background: var(--red); }
.cal-grid--weekends .cal-node--unset         { background: var(--grey); }
.cal-grid--weekends .cal-node .cal-day__num {
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
}
.cal-grid--weekends .cal-node__name {
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  margin-top: 3px;
  width: 100%;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cal-grid--weekends .cal-node .cal-avatar {
  position: absolute;
  bottom: 5px;
  right: 4px;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  line-height: 30px;
  margin-top: 0;
}

/* ── Small attendance avatar for compact year view ── */
.cal-avatar--sm {
  width: 18px;
  height: 18px;
  font-size: 0.55rem;
  line-height: 18px;
  margin-top: 3px;
}

/* ── Attendee avatar cluster (all attending members) ── */
.cal-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
}
/* Weekends node: cluster flows at the bottom of the square (overrides the old
   single absolute-positioned avatar). Circles shrink so several fit the square. */
.cal-grid--weekends .cal-node .cal-avatars {
  margin-top: auto;
  padding-top: 2px;
}
.cal-grid--weekends .cal-node .cal-avatars .cal-avatar {
  position: static;
  width: 22px;
  height: 22px;
  font-size: 0.8rem;
  line-height: 22px;
  margin-top: 0;
}
/* Full view: pair each market chip with its attendees, stacked */
.cal-grid--full .cal-marker-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.cal-grid--full .cal-marker-group .cal-avatars .cal-avatar {
  margin-top: 0;
}

/* ── Full calendar view adjustments ── */
.cal-grid--full {
  grid-auto-rows: minmax(80px, auto);  /* rows grow when a day stacks multiple markets */
}
.cal-grid--full .cal-day {
  aspect-ratio: unset;
}
/* Stack chips one above the other (same size); the row grows to fit */
.cal-grid--full .cal-markers {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}
.cal-grid--full .cal-marker {
  font-size: 0.7rem;
  height: 22px;
  min-width: 26px;
}
/* Full-view cell is a neutral container; the chip carries the state colour */
.cal-grid--full .cal-day--has-market { background: var(--white); }

/* ── Expanded month grid (kept for reference, unused in new views) ── */
.cal-grid--month {
  height: calc(100vh - 258px);
  height: calc(100dvh - 258px);
  grid-auto-rows: 1fr;
}
.cal-grid--month .cal-day {
  aspect-ratio: unset;
  min-height: unset;
  padding: 8px 4px 6px;
}
.cal-grid--month .cal-day__num {
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
}

/* ── Jump to today (calendar scrolling area) ── */
.cal-jump-today {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  padding: 12px 0 0;
}

/* ── Month label (multi-month views) ── */
.month-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin: 40px auto 20px;
  padding: 3px 12px;
  text-align: center;
  background: var(--white);
  border-radius: 8px;
}

/* ── Bottom sheet overlay ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(16,12,8,0.45);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sheet-body {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  max-height: 88vh;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 250ms ease;
}
.sheet-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  border-radius: 20px 20px 0 0;
  background: var(--white);
}
.sheet-content {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 16px 16px 48px;
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ── Attendance status buttons ── */
.status-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.status-row--2 { grid-template-columns: 1fr 1fr; }
.status-btn {
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
  line-height: 1.3;
}
.status-btn:active { transform: scale(0.95); }
.status-btn--attending     { border-color: #22c55e; background: var(--green); }
.status-btn--maybe         { border-color: #f59e0b; background: var(--yellow); }
.status-btn--not-attending { border-color: #ef4444; background: var(--red); }

/* ── Info rows ── */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.info-row:last-child { border-bottom: none; }
.info-row__icon { flex-shrink: 0; width: 20px; text-align: center; color: var(--muted); margin: 0px 0px 0px 5px; }
.info-row a { color: var(--text); text-decoration: underline; min-width: 0; overflow-wrap: anywhere; }
.info-row span:not(.info-row__icon) { min-width: 0; overflow-wrap: anywhere; }

/* ── Section heading ── */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Month picker (active months selector) ── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.month-btn {
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--white);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
  color: var(--muted);
}
.month-btn--active {
  border-color: var(--pink);
  background: var(--pink);
  color: var(--text);
}

/* ── Schedule pill ── */
.sched-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  font-size: 0.875rem;
}
.sched-pill:last-child { margin-bottom: 18px; }

/* Schedule form: Cancel + Add to schedule sit on one row, 50/50 */
.sched-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.sched-btn-row > .btn { flex: 1 1 0; }

/* ── Toggle ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.toggle {
  position: relative;
  width: 48px; height: 28px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--t);
}
.toggle input:checked + .toggle__track { background: #22c55e; }
.toggle__track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 22px; height: 22px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--t);
}
.toggle input:checked + .toggle__track::after { transform: translateX(20px); }

/* ── Checkbox row (big checkbox left, label right) ── */
.check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 26px; height: 26px;
  accent-color: #22c55e;
  cursor: pointer;
  margin: 0;
}
.check-row__label {
  font-weight: 700;
  font-size: 0.875rem;
}

/* ── Star rating (vibes) ── */
.star-row {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}
.star-btn {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  padding: 4px 6px;
  color: var(--border);
  cursor: pointer;
  transition: color var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.star-btn:active      { transform: scale(0.88); }
.star-btn--filled     { color: #f59e0b; }

/* ── Profit preview ── */
.profit-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--yellow);
  border-radius: var(--radius-btn);
}
.profit-pos { color: #166534; }
.profit-neg { color: #b91c1c; }

/* ── Weather forecast line ── */
.weather-line {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Visit timeline ── */
.visit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.visit-row:last-child { border-bottom: none; }
.visit-row__info { flex: 1; }
.visit-row__date {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.visit-row__stats {
  display: flex;
  gap: 20px;
}
.visit-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.visit-row__delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  padding: 6px 8px;
  flex-shrink: 0;
  transition: color var(--t);
  -webkit-tap-highlight-color: transparent;
}
.visit-row__delete:hover { color: #b91c1c; }

/* ── Vibes stars on visit timeline ── */
.visit-stars { display: flex; gap: 1px; }
.visit-star { font-size: 0.75rem; color: var(--border); line-height: 1; }
.visit-star--filled { color: #f59e0b; }

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(16,12,8,0.15);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 3-column stat grid (Reports page) ── */
.stat-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.stat-grid--3 .stat { padding: 10px 12px; }
.stat__value--sm { font-size: 1.05rem; }

/* ── Report table ── */
.report-table-wrap { overflow-x: auto; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}
.report-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0 6px 8px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.report-table th.text-right { text-align: right; }
.report-table th.sortable { cursor: pointer; user-select: none; transition: color 150ms ease; }
.report-table th.sortable:hover { color: var(--text); }
.sortable__arrow { font-size: 0.7rem; margin-left: 2px; display: inline-block; }
.report-table td {
  padding: 10px 6px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.report-table tr:last-child td { border-bottom: none; }
.report-table__name {
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.25;
  max-width: 110px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
