/* ─── LineItUp — App Styles ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display:ital@0;1&display=swap');

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

:root {
  --bg:        #f0ede8;
  --bg-card:   #ffffff;
  --bg-dark:   #1a1a1a;
  --green:     #2d6a4f;
  --green-lt:  #52b788;
  --green-bg:  #e0f0e8;
  --text:      #1a1a1a;
  --text-mid:  #555;
  --text-dim:  #999;
  --border:    #e5e2dc;
  --border-lt: #f0ede8;
  --shadow:    0 2px 16px rgba(0,0,0,.08);
  --shadow-md: 0 8px 32px rgba(0,0,0,.12);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}

.screen {
  width: 100%; max-width: 680px; height: 100dvh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  padding-top: env(safe-area-inset-top);
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
/* Allow text selection in inputs and text areas */
.screen input, .screen textarea, .screen .msgin { -webkit-user-select: text; user-select: text; }

/* ── Pull to refresh ──────────────────────────────────────────────────────── */
.ptr-indicator {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%) translateY(-40px);
  z-index: 100; transition: transform .2s, opacity .2s; opacity: 0;
}
.ptr-indicator .spinner {
  width: 24px; height: 24px; border: 2.5px solid var(--border);
  border-top-color: var(--green); border-radius: 50%;
}
.ptr-indicator.pulling { opacity: 1; }
.ptr-indicator.refreshing .spinner { animation: spin .7s linear infinite; }

/* ── Views ─────────────────────────────────────────────────────────────────── */
.view {
  display: none; flex-direction: column; flex: 1; overflow: hidden;
  opacity: 0; transform: translateX(12px);
}
.view.active {
  display: flex;
  animation: viewFadeIn .28s cubic-bezier(.2,.8,.4,1) forwards;
}
.view.slide-back {
  display: flex;
  animation: viewFadeBack .24s cubic-bezier(.2,.8,.4,1) forwards;
}

/* ── Common ────────────────────────────────────────────────────────────────── */
.logo { font-family: 'DM Serif Display', Georgia, serif; font-size: 21px; color: var(--text); letter-spacing: -.3px; }
.logo em { color: var(--green); font-style: normal; }

.topnav { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 8px; flex-shrink: 0; }

.back-btn { display: flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; font-size: 13px; color: var(--green); font-weight: 600; font-family: inherit; padding: 0; }

.icon-btn { width: 34px; height: 34px; background: var(--bg-dark); border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s, background .15s; }
.icon-btn:active { transform: scale(.88); }
.icon-btn:hover { background: #333; }
.icon-btn svg path { stroke: #f0ede8; }

.text-btn { background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text-mid); font-family: inherit; padding: 4px; }

.pill { background: var(--green); color: white; font-size: 9px; font-weight: 700; border-radius: 20px; padding: 3px 10px; letter-spacing: .3px; }

.scroll-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll-body::-webkit-scrollbar { display: none; }

.hero-kicker { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--green); text-transform: uppercase; padding: 4px 20px; flex-shrink: 0; }
.hero-h { font-family: 'DM Serif Display', Georgia, serif; font-size: 28px; line-height: 1.1; color: var(--text); padding: 0 20px 12px; flex-shrink: 0; }

.sec-label { font-size: 10px; font-weight: 700; color: #bbb; letter-spacing: 1.5px; text-transform: uppercase; flex-shrink: 0; }

.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.full { width: 100%; }
.dim-text { font-size: 12px; color: var(--text-dim); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-green {
  background: var(--green); color: white; border: none; border-radius: 14px;
  font-size: 14px; font-weight: 600; font-family: inherit; padding: 15px;
  cursor: pointer; transition: opacity .15s;
}
.btn-green:active { opacity: .85; }

.btn-dark {
  background: var(--bg-dark); color: #f0ede8; border: none; border-radius: 14px;
  font-size: 14px; font-weight: 600; font-family: inherit; padding: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s;
}
.btn-dark:active { opacity: .85; }

.btn-ghost {
  background: transparent; color: var(--text); border: 1.5px solid var(--border);
  border-radius: 14px; font-size: 13px; font-weight: 500; font-family: inherit;
  padding: 13px; cursor: pointer; transition: border-color .15s;
}
.btn-ghost:hover { border-color: #ccc; }

.btn-find {
  background: var(--green); color: white; border: none; border-radius: 10px;
  font-size: 13px; font-weight: 600; font-family: inherit; padding: 10px 16px;
  cursor: pointer; margin-top: 10px; width: 100%;
}

.link-btn { background: none; border: none; color: var(--green); font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; padding: 4px 0; }

/* ── Loading / Empty ───────────────────────────────────────────────────────── */
.loading-row { padding: 32px 20px; color: var(--text-dim); font-size: 13px; text-align: center; animation: pulseIn .3s ease-out; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 32px; gap: 8px; animation: pulseIn .4s ease-out; }
.empty-ico { font-size: 40px; animation: heroFloat 3s ease-in-out infinite; }
.empty-t { font-size: 16px; font-weight: 700; }
.empty-s { font-size: 13px; color: var(--text-dim); line-height: 1.5; max-width: 260px; }

/* ── Auth Screen ───────────────────────────────────────────────────────────── */
.auth-shell { display: flex; flex-direction: column; justify-content: space-between; flex: 1; padding: 0 0 calc(32px + env(safe-area-inset-bottom)); }

.auth-hero {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; padding: 32px 32px 0;
  gap: 16px;
}

.auth-logo {
  font-family: 'DM Serif Display', Georgia, serif; font-size: 38px; color: var(--text); letter-spacing: -.5px;
  animation: pulseIn .5s cubic-bezier(.2,.8,.4,1) both;
}
.auth-logo em { color: var(--green); font-style: normal; }

.auth-tagline {
  font-size: 22px; font-weight: 300; line-height: 1.3; color: var(--text);
  font-family: 'DM Serif Display', Georgia, serif; font-style: italic;
  animation: pulseIn .5s .1s cubic-bezier(.2,.8,.4,1) both;
}

.auth-bullets {
  display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
  align-items: flex-start; width: 100%; max-width: 260px;
  animation: pulseIn .5s .2s cubic-bezier(.2,.8,.4,1) both;
}
.ab { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-mid); }
.ab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

.auth-foot {
  padding: 0 24px; display: flex; flex-direction: column; gap: 12px;
  animation: pulseIn .5s .35s cubic-bezier(.2,.8,.4,1) both;
}

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: white; border: 1.5px solid var(--border); border-radius: 14px;
  padding: 15px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: var(--text); cursor: pointer; box-shadow: var(--shadow);
  transition: all .15s;
}
.google-btn:hover { border-color: #bbb; box-shadow: var(--shadow-md); }
.google-btn:active { transform: scale(.98); }
.google-btn:disabled { opacity: .6; pointer-events: none; }

.auth-divider {
  display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.auth-alt-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: white; border: 1.5px solid var(--border); border-radius: 14px;
  padding: 15px; font-size: 15px; font-weight: 600; font-family: inherit;
  color: var(--text); cursor: pointer; width: 100%;
  transition: all .15s;
}
.auth-alt-btn:hover { border-color: #bbb; }
.auth-alt-btn:active { transform: scale(.98); }

.auth-form-group {
  background: white; border-radius: 16px; padding: 16px;
  border: 1px solid var(--border-lt); box-shadow: var(--shadow);
  animation: pulseIn .25s ease-out;
}
.auth-form-group .field-input { margin-bottom: 0; }
.auth-form-group .field-input + .field-input { margin-top: 8px; }
.auth-form-group .btn-green { margin-top: 12px; }
.auth-form-group .link-btn { margin-top: 6px; width: 100%; text-align: center; }

.auth-verify-group {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  animation: pulseIn .2s ease-out;
}
.auth-verify-group .field-input, #auth-phone-code { letter-spacing: 6px; text-align: center; font-size: 20px; font-weight: 600; }

/* Hide reCAPTCHA badge */
.grecaptcha-badge { visibility: hidden !important; }

/* Google Places Autocomplete styling */
.pac-container { border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-md); font-family: 'DM Sans', system-ui, sans-serif; margin-top: 4px; z-index: 10000; }
.pac-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.pac-item:hover { background: var(--green-bg); }
.pac-item-selected { background: var(--green-bg); }
.pac-icon { display: none; }
.pac-item-query { font-weight: 600; }

.auth-legal { font-size: 10px; color: var(--text-dim); text-align: center; line-height: 1.5; }

/* ── Group Cards ───────────────────────────────────────────────────────────── */
.group-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border-radius: 18px; padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.4,1), box-shadow .18s;
  border: 1px solid var(--border-lt);
  animation: pulseIn .35s cubic-bezier(.2,.8,.4,1) both;
}
.group-card:nth-child(2) { animation-delay: .06s; }
.group-card:nth-child(3) { animation-delay: .12s; }
.group-card:nth-child(4) { animation-delay: .18s; }
.group-card:nth-child(5) { animation-delay: .24s; }
.group-card:active { transform: scale(.97); box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.group-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }

.gc-left { display: flex; align-items: center; gap: 14px; }
.gc-icon { width: 46px; height: 46px; background: var(--green-bg); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.gc-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.gc-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.gc-window { font-size: 11px; color: var(--green); font-weight: 600; }
.gc-window.dim { color: var(--text-dim); font-weight: 400; }
.gc-arrow { color: var(--text-dim); font-size: 20px; line-height: 1; }

/* ── Group Detail ──────────────────────────────────────────────────────────── */
.gd-name { font-family: 'DM Serif Display', Georgia, serif; font-size: 26px; color: var(--text); margin-top: 8px; }
.gd-meta { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.window-card {
  background: var(--bg-card); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--border-lt);
  transition: transform .2s, box-shadow .2s;
}
.window-card.green {
  border-color: rgba(45,106,79,.25); background: linear-gradient(135deg, #f0fff8, white);
  box-shadow: 0 4px 20px rgba(45,106,79,.1);
}
.window-card.dim { background: #fafaf8; border: 1px dashed var(--border); }
.wc-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--green); margin-bottom: 6px; }
.wc-date { font-size: 16px; font-weight: 700; color: var(--text); }
.wc-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.wc-members { display: flex; gap: 4px; margin-top: 10px; }
.wdot { width: 24px; height: 24px; border-radius: 50%; font-size: 8px; font-weight: 700; color: white; display: flex; align-items: center; justify-content: center; }

.members-list { display: flex; flex-direction: column; gap: 4px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-lt); }
.member-row:last-child { border-bottom: none; }
.mav { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; flex-shrink: 0; }
.mname { font-size: 14px; font-weight: 600; }
.msub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.cal-ok { color: var(--green); }
.cal-no { color: var(--text-dim); }
.role-badge { margin-left: auto; font-size: 10px; font-weight: 700; background: var(--green-bg); color: var(--green); border-radius: 20px; padding: 2px 9px; }

.invite-actions { display: flex; gap: 8px; }
.invite-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 8px; background: var(--green-bg); border: 1.5px solid rgba(45,106,79,.15);
  border-radius: 12px; font-size: 11px; font-weight: 600; font-family: inherit;
  color: var(--green); cursor: pointer; transition: all .15s;
}
.invite-btn:active { transform: scale(.94); }
.invite-btn:hover { background: rgba(45,106,79,.12); border-color: var(--green); }
.invite-btn svg { color: var(--green); }

/* ── Calendar ──────────────────────────────────────────────────────────────── */
.wknav { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 8px; flex-shrink: 0; }
.wklbl { font-size: 13px; font-weight: 700; color: var(--text); }
.arrbtn { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-dark); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.cal-wrap { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 10px; }
.cal-wrap::-webkit-scrollbar { display: none; }

.cal-grid-inner { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.cal-hrow, .cal-row { display: grid; grid-template-columns: 30px repeat(7, 1fr); gap: 0; margin: 0; padding: 0; }
.cal-row-half .cal-tlbl { line-height: 14px; }
.cal-dhdr { display: flex; flex-direction: column; align-items: center; font-size: 9px; font-weight: 700; color: var(--text-dim); letter-spacing: .4px; padding: 2px 0; }
.cal-dhdr.today { color: var(--green); }
.cal-date { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 1px; }
.cal-dhdr.today .cal-date { background: var(--green); color: white; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.cal-tlbl { font-size: 9px; color: #ccc; text-align: right; padding-right: 6px; font-weight: 500; line-height: 14px; }
/* Calendar cell states */
.cal-cell { height: 14px; border-radius: 4px; margin: 0 1px; position: relative; background: rgba(0,0,0,.03); }
.cal-cell[data-date] { user-select: none; -webkit-tap-highlight-color: transparent; transition: background .08s; }
.paint-mode .cal-cell[data-date] { cursor: crosshair; }
.paint-mode .cal-cell[data-date]:hover { background: rgba(45,106,79,.08); }

/* Edit toggle button */
.cal-edit-btn {
  background: transparent; border: 1.5px solid var(--green); color: var(--green);
  font-size: 12px; font-weight: 600; font-family: inherit;
  padding: 4px 14px; border-radius: 20px; cursor: pointer;
  transition: all .15s;
}
.cal-edit-btn.on { background: var(--green); color: white; }
.cal-free {
  background: linear-gradient(135deg, rgba(82,183,136,.35), rgba(45,106,79,.2));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.4), 0 1px 2px rgba(45,106,79,.1);
  border: 1px solid rgba(45,106,79,.12);
}
.cal-free:hover { background: linear-gradient(135deg, rgba(82,183,136,.45), rgba(45,106,79,.3)); }

/* ── Calendar summary ─────────────────────────────────────────────────────── */
.cal-summary { padding: 16px 20px 20px; flex-shrink: 0; }
.cal-stat-row { display: flex; gap: 10px; margin-bottom: 12px; }
.cal-stat {
  flex: 1; background: var(--bg-card); border-radius: 14px; padding: 14px;
  border: 1px solid var(--border-lt); box-shadow: var(--shadow);
  text-align: center;
}
.cal-stat-num { font-size: 22px; font-weight: 700; color: var(--green); font-family: 'DM Serif Display', Georgia, serif; }
.cal-stat-label { font-size: 10px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.cal-best-block {
  background: linear-gradient(135deg, #f0fff8, white);
  border: 1px solid rgba(45,106,79,.15); border-radius: 14px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 12px rgba(45,106,79,.06); margin-bottom: 10px;
}
.cal-best-accent { width: 4px; height: 36px; border-radius: 2px; background: var(--green); flex-shrink: 0; }
.cal-best-label { font-size: 10px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .5px; }
.cal-best-val { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }
.cal-best-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

/* Save bar */
.cal-save-bar {
  position: sticky; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg-dark); color: #f0ede8;
  border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  animation: slideUp .25s cubic-bezier(.16,1,.3,1);
  flex-shrink: 0;
}

.cal-leg-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.leg-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-mid); }
.leg-dot { width: 9px; height: 9px; border-radius: 2px; }

/* ── Calendar mode toggle ─────────────────────────────────────────────────── */
.cal-nav-center { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.cal-mode-toggle { display: flex; background: var(--bg-dark); border-radius: 20px; padding: 2px; }
.cmt-btn { border: none; background: transparent; color: var(--text-dim); font-size: 11px; font-weight: 600; padding: 3px 13px; border-radius: 16px; cursor: pointer; transition: background .15s, color .15s; font-family: inherit; }
.cmt-btn.active { background: var(--green); color: white; }

/* ── Month grid ───────────────────────────────────────────────────────────── */
.cal-month-wrap { padding: 0 4px 8px; }
.cal-month-hrow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 3px; }
.cal-mhdr { font-size: 9px; font-weight: 700; color: var(--text-dim); text-align: center; padding: 2px 0; letter-spacing: .4px; }
.cal-month-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-mday { min-height: 52px; background: var(--card); border-radius: 6px; padding: 5px 4px 4px; display: flex; flex-direction: column; gap: 3px; }
.cal-mday.has-window { background: #2d6a4f1a; outline: 1.5px solid #2d6a4f55; }
.cal-mday.other-month { opacity: .28; }
.cal-mnum { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1; }
.cal-mday.today .cal-mnum { background: var(--green); color: white; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.cal-mdots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
.cal-mdot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* ── Nearby places strip ──────────────────────────────────────────────────── */
.nearby-hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 20px 4px;
  margin: 0 -20px;
  cursor: grab;
}
.nearby-hscroll:active { cursor: grabbing; }
.nearby-hscroll::-webkit-scrollbar { display: none; }
.ncard {
  flex-shrink: 0;
  width: 140px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  transition: transform .15s, box-shadow .15s;
}
.ncard:active { transform: scale(.96); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ncard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.ncard-img {
  height: 82px;
  position: relative;
  overflow: hidden;
}
.ncard-img svg { display: block; }
.ncard-emoji {
  position: absolute;
  bottom: 7px;
  right: 9px;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}
.ncard-tag {
  position: absolute;
  top: 7px;
  left: 8px;
  background: rgba(0,0,0,.45);
  color: white;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
}
.ncard-info { padding: 8px 9px 10px; }
.ncard-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ncard-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ncard-meta {
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ncard-rating { color: var(--green); font-weight: 600; }
.ndot { opacity: .4; }
.ncard-featured { background: linear-gradient(135deg, #d4a017, #b8860b); color: white; }
.ncard-promoted { box-shadow: 0 2px 12px rgba(212,160,23,.2); border: 1px solid rgba(212,160,23,.15); }
.ccard-featured { box-shadow: 0 2px 12px rgba(212,160,23,.25); }
.course-row-featured { background: #fffdf5; border-left: 3px solid #d4a017; }

.wins-sec { padding: 10px 20px 0; flex-shrink: 0; border-top: 1px solid var(--border); }
.ws-t { font-size: 9px; font-weight: 700; color: #bbb; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.wcard { background: var(--bg-dark); border-radius: 14px; padding: 13px 14px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.wcard:active { transform: scale(.98); }
.wcard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.14); }
.wcd { font-size: 13px; font-weight: 600; color: #f0ede8; }
.wct { font-size: 10px; color: #888; margin-top: 2px; }
.wcarr { color: var(--green-lt); font-size: 20px; }

/* ── Tee Times ─────────────────────────────────────────────────────────────── */
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 20px 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-shrink: 0; cursor: grab; }
.tt-filter-bar { padding: 10px 20px 4px; flex-shrink: 0; border-top: 1px solid var(--border-lt); }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll::-webkit-scrollbar { display: none; }

.ccard { flex-shrink: 0; width: 152px; background: var(--bg-dark); border-radius: 18px; overflow: hidden; cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.4,1), box-shadow .18s; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.ccard:active { transform: scale(.95); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.ccard:hover { box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.cimg { width: 100%; height: 90px; position: relative; overflow: hidden; }
.cpill { position: absolute; top: 7px; right: 7px; background: rgba(45,106,79,.92); border-radius: 7px; padding: 2px 7px; font-size: 8px; font-weight: 700; color: white; }
.ctop { position: absolute; top: 0; left: 0; right: 0; background: var(--green); text-align: center; font-size: 8px; font-weight: 700; color: white; letter-spacing: .8px; padding: 2.5px 0; text-transform: uppercase; }
.cinfo { padding: 9px 12px 12px; }
.cname { font-size: 12px; font-weight: 600; color: #f0ede8; line-height: 1.3; margin-bottom: 6px; }
.cmeta { display: flex; justify-content: space-between; align-items: center; }
.ctime { font-size: 10px; color: #777; }
.cprice { font-size: 12px; font-weight: 700; color: var(--green-lt); }

.course-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border-lt); cursor: pointer; transition: background .12s; }
.course-row:active { background: #f8f6f2; }
.cr-icon { flex-shrink: 0; }
.cr-info { flex: 1; min-width: 0; }
.cr-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-meta { font-size: 11px; color: var(--text-dim); }
.cr-stars { font-size: 11px; color: #d4a017; margin-top: 2px; }
.cr-rc { font-size: 10px; color: var(--text-dim); font-style: normal; }
.cr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.cr-price { font-size: 12px; font-weight: 700; color: var(--green); }
.cr-arr { font-size: 18px; color: var(--text-dim); }

/* ── Course Detail ─────────────────────────────────────────────────────────── */
.dhero { width: calc(100% - 40px); height: 155px; margin: 4px 20px 16px; border-radius: 20px; overflow: hidden; position: relative; flex-shrink: 0; }
.dhero-ov { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 16px; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.dhero-name { font-family: 'DM Serif Display', Georgia, serif; font-size: 21px; color: white; line-height: 1.2; }
.dhero-sub { font-size: 10px; color: rgba(255,255,255,.7); margin-top: 2px; }

.drow { padding: 14px 0; border-bottom: 1px solid var(--border-lt); }
.drow:last-child { border-bottom: none; }
.drl { font-size: 9px; font-weight: 700; color: var(--green); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 4px; }
.drv { font-size: 13px; color: var(--text); line-height: 1.4; }
.drv.big { font-size: 18px; font-weight: 700; }

.adots { display: flex; gap: 5px; margin-top: 6px; }
.adot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: white; }

.act-row { padding: 12px 20px 20px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

/* ── Chat ──────────────────────────────────────────────────────────────────── */
/* ── Chat list ────────────────────────────────────────────────────────────── */
.chat-list-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border-radius: 16px; padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer;
  border: 1px solid var(--border-lt); transition: transform .15s, box-shadow .15s;
}
.chat-list-item:active { transform: scale(.97); }
.chat-list-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--green-bg); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name { font-size: 15px; font-weight: 700; color: var(--text); }
.chat-list-preview { font-size: 12px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chat-list-time { font-size: 10px; color: var(--text-dim); }
.chat-list-badge { width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: white; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.chat-top { padding: 10px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.gav-stack { display: flex; }
.gs { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg); display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: white; margin-left: -7px; }
.gs:first-child { margin-left: 0; }
.chat-grp-name { font-size: 14px; font-weight: 700; }
.chat-grp-sub { font-size: 10px; color: var(--text-dim); }

.pinned { margin: 8px 14px 4px; background: var(--bg-dark); border-radius: 14px; padding: 10px 13px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; cursor: pointer; }
.picon { width: 36px; height: 36px; background: var(--green); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.pt { font-size: 12px; font-weight: 600; color: #f0ede8; }
.ps { font-size: 10px; color: #888; margin-top: 1px; }

.msgs { flex: 1; padding: 10px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; scrollbar-width: none; }
.msgs::-webkit-scrollbar { display: none; }
.chat-empty { font-size: 12px; color: var(--text-dim); text-align: center; padding: 24px; }

.mg { display: flex; flex-direction: column; gap: 2px; }
.mg.me { align-items: flex-end; }
.mg.them { align-items: flex-start; }
.mmeta { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.sav { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 7px; font-weight: 700; color: white; flex-shrink: 0; }
.sname { font-size: 10px; font-weight: 600; color: var(--text-dim); }
.bub { padding: 9px 13px; border-radius: 18px; font-size: 13px; line-height: 1.45; max-width: 230px; animation: pulseIn .2s ease-out; }
.bub.them { background: white; color: var(--text); border-bottom-left-radius: 5px; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.bub.me { background: var(--green); color: white; border-bottom-right-radius: 5px; box-shadow: 0 2px 8px rgba(45,106,79,.2); }
.bub.sys { background: var(--border); color: #666; font-size: 10px; border-radius: 10px; text-align: center; max-width: 280px; }
.msg-time { font-size: 9px; color: var(--text-dim); margin-top: 1px; }

.inp-area { padding: 8px 14px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 7px; background: var(--bg); flex-shrink: 0; }
.msgin { flex: 1; background: white; border: 1px solid var(--border); border-radius: 22px; padding: 10px 14px; font-size: 13px; font-family: inherit; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.msgin:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,79,.08); }
.sendbtn { width: 34px; height: 34px; background: var(--green); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform .15s, background .15s; }
.sendbtn:active { transform: scale(.88); }
.sendbtn:hover { background: #246b45; }
.plusbtn { width: 34px; height: 34px; background: var(--border); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* ── Profile ───────────────────────────────────────────────────────────────── */
.profile-header { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-email { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.setting-card { background: white; border-radius: 14px; padding: 16px; border: 1px solid var(--border-lt); box-shadow: var(--shadow); margin-top: 6px; }

.hist-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-lt); cursor: pointer; }
.hist-item:last-child { border-bottom: none; }
.hist-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--green-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.hist-name { font-size: 13px; font-weight: 600; }
.hist-sub { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

/* ── Tab Bar ───────────────────────────────────────────────────────────────── */
.tabbar {
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--border); flex-shrink: 0;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(240,237,232,.92);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; padding: 4px 16px; border-radius: 12px;
  transition: background .15s, transform .15s;
  position: relative;
}
.tab:active { background: #e5e2dc; transform: scale(.92); }
.tab.on::after {
  content: ""; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; background: var(--green); border-radius: 2px;
  animation: pulseIn .2s ease-out;
}
.tab svg { width: 22px; height: 22px; transition: transform .2s; }
.tab.on svg { transform: scale(1.08); }
.tlb { font-size: 9px; font-weight: 600; letter-spacing: .3px; color: var(--text-dim); transition: color .2s; }
.tlb.on { color: var(--green); font-weight: 700; }
.ticon path, .ticon rect, .ticon circle, .ticon line, .ticon polyline { stroke: var(--text-dim); transition: stroke .2s; }
.ticon.on path, .ticon.on rect, .ticon.on circle, .ticon.on line, .ticon.on polyline { stroke: var(--green); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.open { display: block; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); animation: fadeIn .2s; }

.modal-sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg); border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  max-height: 90dvh; overflow-y: auto;
  animation: slideUp .3s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
}

.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 8px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-dim); padding: 4px; }

body.modal-active .screen { pointer-events: none; }
body.modal-active .modal { pointer-events: all; }

/* ── Create Group Form ─────────────────────────────────────────────────────── */
.field-label { font-size: 12px; font-weight: 700; color: var(--text-mid); letter-spacing: .3px; display: block; margin-bottom: 6px; }
.field-input {
  width: 100%; background: white; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 13px 14px; font-size: 14px; font-family: inherit; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,106,79,.1); }
.field-input.error { border-color: #c0392b; }
.field-input.error:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.1); }
.field-error { font-size: 11px; color: #c0392b; margin-top: 4px; display: none; }
.field-error.show { display: block; }

.act-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: white; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 10px 4px 8px; font-size: 18px; cursor: pointer; transition: all .15s;
}
.act-opt span { font-size: 9px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .3px; }
.act-opt.on { border-color: var(--green); background: var(--green-bg); }
.act-opt.on span { color: var(--green); }

.create-note { font-size: 11px; color: var(--text-dim); text-align: center; margin-top: 8px; }

/* ── Multi-step flow ─────────────────────────────────────────────────────── */
.step-dots { display: flex; justify-content: center; gap: 6px; padding: 0 20px 12px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .2s, transform .2s; }
.sdot.on { background: var(--green); transform: scale(1.2); }
.sdot.done { background: var(--green-lt); }

.cg-step { display: none; animation: viewFadeIn .25s ease-out forwards; }
.cg-step.active { display: block; }

.step-btns { display: flex; gap: 10px; margin-top: 20px; }
.step-btns .btn-ghost { padding: 15px 20px; }

/* ── Chip selector ───────────────────────────────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  background: white; border: 1.5px solid var(--border); color: var(--text-mid);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--green-bg); border-color: var(--green); color: var(--green); font-weight: 600; }

/* ── Day picker (specific days) ──────────────────────────────────────────── */
.day-picker {
  display: flex; gap: 6px; margin-top: 10px; justify-content: center;
  animation: pulseIn .2s ease-out;
}
.day-tog {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; font-family: inherit;
  background: white; border: 1.5px solid var(--border); color: var(--text-mid);
  cursor: pointer; transition: all .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.day-tog:active { transform: scale(.9); }
.day-tog.on { background: var(--green); border-color: var(--green); color: white; }

/* ── Review card ─────────────────────────────────────────────────────────── */
.review-card {
  background: white; border-radius: 16px; padding: 16px; border: 1px solid var(--border-lt);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.rv-row { display: flex; justify-content: space-between; align-items: center; }
.rv-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.rv-val { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.global-toast {
  position: fixed; bottom: calc(80px + env(safe-area-inset-bottom));
  left: 20px; right: 20px; z-index: 2000;
  background: var(--bg-dark); color: #f0ede8;
  border-radius: 14px; padding: 13px 18px;
  font-size: 13px; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity .25s cubic-bezier(.2,.8,.4,1), transform .25s cubic-bezier(.2,.8,.4,1);
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.global-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.global-toast.error { background: #8b1a1a; }
.global-toast.success { background: var(--green); }

/* ── Skeleton loading ─────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8e5e0 25%, #f0ede8 50%, #e8e5e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 10px;
}
.skel-card { height: 80px; border-radius: 18px; margin-bottom: 12px; }
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-line.short { width: 60%; }
.skel-line.xs { width: 35%; height: 10px; }
.skel-avatar { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; }
.skel-row { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg-card); border-radius: 18px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-lt); }
.skel-text { flex: 1; }

/* ── Focus & Accessibility ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, .tab:focus-visible, .act-opt:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ── Enhanced button states ──────────────────────────────────────────────── */
.btn-green:hover { filter: brightness(1.08); }
.btn-dark:hover { filter: brightness(1.15); }
.google-btn:active svg { transform: scale(.92); }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes viewFadeIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes viewFadeBack { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulseIn { 0% { opacity: 0; transform: scale(.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.app-loading {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: opacity .3s;
}
.app-loading.fade-out { opacity: 0; pointer-events: none; }
.app-loading .spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--green); border-radius: 50%;
  animation: spin .7s linear infinite;
}
.app-loading .load-brand {
  font-family: 'DM Serif Display', Georgia, serif; font-size: 22px; color: var(--text);
}
.app-loading .load-brand em { color: var(--green); font-style: normal; }
