/* ── Tokens ───────────────────────────────────────────────────────── */
:root {
  --green:       #ff037d;
  --green-h:     #e0006d;
  --green-light: #fff0f7;
  --green-text:  #cc0064;
  --bg:          #F0F2F5;
  --surface:     #FFFFFF;
  --surface-2:   #F7F8FA;
  --border:      #E2E5EA;
  --text:        #111827;
  --text-2:      #374151;
  --text-muted:  #6B7280;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 4px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --nav-h:       56px;
  --tab-h:       60px;           /* bottom tab bar height */
}

/* ── Dark mode ────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #000000;
  --surface:   #111111;
  --surface-2: #1a1a1a;
  --border:    #2a2a2a;
  --text:      #f1f5f9;
  --text-2:    #cbd5e1;
  --text-muted:#94a3b8;
  --shadow:    0 1px 4px rgba(0,0,0,.6);
  --shadow-md: 0 4px 16px rgba(0,0,0,.7);
}
[data-theme="dark"] .card          { background: var(--surface); }
[data-theme="dark"] .nav           { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .tab-bar       { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select   { background: var(--surface-2); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .swipe-item    { background: var(--surface) !important; }
[data-theme="dark"] .btn-outline   { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .btn-ghost     { color: var(--text-muted); }
[data-theme="dark"] .preset-chip   { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
[data-theme="dark"] input[type="checkbox"] { accent-color: var(--green); }

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

/* ── Base ─────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  /* reserve space for sticky top nav + bottom tab bar */
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  -webkit-text-size-adjust: 100%;
}

/* ── Top nav (mobile: brand + user only) ──────────────────────────── */
.site-nav {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
/* Fill status bar area with nav background color on iOS PWA */
.site-nav::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--surface);
  z-index: 201;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}

/* hide desktop links on mobile */
.nav-links { display: none; }

.nav-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-username {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hide sign-out in top nav on mobile (it's in the bottom tab bar) */
.nav-signout { display: none !important; }

/* Universal NWC wallet pill */
.nwc-wrap { position: relative; }
.nwc-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--surface-2, #f3f4f6);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 .6rem;
  height: 30px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .15s;
}
.nwc-pill:hover { border-color: var(--green); }
.nwc-check { color: var(--green); font-size: .8rem; font-weight: 900; }
.nwc-dropdown {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  width: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 200;
}
.nwc-dropdown.hidden { display: none; }

/* Upcoming calendar — person cards */
.upcoming-person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .6rem;
}
.upcoming-person-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  background: #111;
  border-bottom: 1px solid rgba(255,255,255,.1);
  text-decoration: none;
  color: #fff;
}
.upcoming-person-header:hover { opacity: .92; }
.upcoming-person-name { font-weight: 700; font-size: .88rem; color: #fff; letter-spacing: .01em; }

/* Person card headers */
.pcard-header-link { display: block; text-decoration: none; }
.pcard-header-link:hover .pcard-header { background: var(--surface); }
.pcard-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  background: var(--surface-2, #f9fafb);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.pcard-name { font-weight: 700; font-size: .88rem; }
.upcoming-events { display: flex; flex-direction: column; }
.upcoming-event-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.upcoming-event-row:last-child { border-bottom: none; }
.upcoming-event-row:hover { background: var(--surface-2, #f9fafb); }
.upcoming-event-name { font-size: .85rem; font-weight: 500; flex-shrink: 0; }
.upcoming-event-sub { font-size: .75rem; color: var(--text-muted); margin-left: .25rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover  { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--green-light); color: var(--green-text); }

/* ── Bottom tab bar (mobile) ──────────────────────────────────────── */
.bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  align-items: flex-start;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 600;
  padding: .5rem 0;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.tab-item i { font-size: 1.35rem; line-height: 1; }
.tab-item.active { color: var(--green); }
.tab-item:active { opacity: .7; }

/* ── Main content ─────────────────────────────────────────────────── */
.site-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
}

/* ── Flash ────────────────────────────────────────────────────────── */
.flash {
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
  font-size: .875rem;
  font-weight: 500;
}
.flash-success { background: var(--green-light); color: var(--green-text); }
.flash-danger  { background: #FEEEEC; color: #B02B1E; }
.flash-info    { background: #EFF6FF; color: #1D4ED8; }
.flash-warning { background: #FEF3C7; color: #92400E; }

/* ── Hero (logged-out landing) ────────────────────────────────────── */
.hero { padding: 2rem 0 1.5rem; }

.hero-content { text-align: center; }

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: .4rem;
  line-height: 1.1;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.hero-feature {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .875rem 1rem;
}
.hero-feature i {
  font-size: 1.25rem;
  color: var(--green);
  flex-shrink: 0;
  margin-top: .1rem;
}
.hero-feature strong { display: block; font-weight: 700; margin-bottom: .15rem; }
.hero-feature span   { font-size: .85rem; color: var(--text-muted); }

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.hero-cta .btn-primary,
.hero-cta .btn-outline {
  justify-content: center;
  padding: .8rem;
  font-size: 1rem;
}

/* ── Dashboard ────────────────────────────────────────────────────── */
.dashboard-greeting {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.dashboard-cards {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
  /* ensure full touch area */
  min-height: 72px;
}
.dashboard-card:active { opacity: .9; }

.card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--green-text);
  flex-shrink: 0;
}
.card-body  { flex: 1; min-width: 0; }
.card-title { font-weight: 700; font-size: .95rem; }
.card-stat  { font-size: 1rem; font-weight: 800; color: var(--green-text); margin: .1rem 0; }
.card-desc  { font-size: .78rem; color: var(--text-muted); }
.card-arrow { color: var(--text-muted); font-size: .9rem; flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.25rem;
  min-height: 44px;         /* iOS touch target */
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover  { background: var(--green-h); }
.btn-primary:active { opacity: .85; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.25rem;
  min-height: 44px;
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--green); color: var(--green-text); }

/* Bootstrap compat button aliases used by ported templates */
.btn { display: inline-flex; align-items: center; gap: .3rem; padding: .65rem 1.25rem; min-height: 44px; cursor: pointer; font-family: inherit; font-size: .9rem; border-radius: var(--radius-sm); font-weight: 600; transition: opacity .15s; justify-content: center; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; min-height: 32px; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; min-height: 48px; }
.btn-xl { padding: .85rem 1.75rem; font-size: 1.05rem; min-height: 52px; width: 100%; justify-content: center; }
.btn-green:hover  { background: var(--green-h); }
.btn-green-soft   { background: var(--green-light); color: var(--green-text); border: 1px solid #b6e8c8; }
.btn-green-soft:hover { background: #cef0d8; }
.btn-amber-soft   { background: #FEF3C7; color: #92400E; border: 1px solid #fde68a; }
.btn-danger-soft  { background: #FEEEEC; color: #B02B1E; border: 1px solid #fca5a5; }
.btn-outline-compat { background: transparent; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-outline-compat:hover { border-color: var(--green); color: var(--green-text); }
.w-100 { width: 100% !important; justify-content: center !important; }

/* ── Auth page ────────────────────────────────────────────────────── */
/* Auth is full-screen, no nav padding */
body.auth-body {
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--bg);
}

.auth-wrap {
  width: 100%;
  max-width: 400px;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--green);
  text-decoration: none;
  text-align: center;
  display: block;
  margin-bottom: .25rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}

.auth-tab {
  padding: .4rem .85rem;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 36px;
  transition: background .15s, color .15s;
}
.auth-tab.active { background: var(--green-light); color: var(--green-text); }

.auth-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: .35rem;
}

/* Inputs: 16px prevents iOS zoom */
.text-input, .form-control, input[type="text"], input[type="password"],
input[type="email"], input[type="number"], input[type="date"],
input[type="search"], input[type="tel"], input[type="url"],
textarea, select {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px !important;  /* prevents iOS auto-zoom on focus */
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.text-input:focus, .form-control:focus,
input[type="text"]:focus, input[type="password"]:focus,
input[type="email"]:focus, input[type="number"]:focus,
textarea:focus, select:focus {
  outline: none;
  border-color: var(--green);
}

.auth-submit { width: 100%; justify-content: center; margin-top: 1rem; }

.auth-switch {
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
}
.auth-switch a { color: var(--green); text-decoration: none; font-weight: 600; }

.auth-error {
  background: #FEEEEC;
  color: #B02B1E;
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  font-size: .875rem;
  margin-bottom: .75rem;
}

.btn-lightning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 1.25rem;
  min-height: 48px;
  background: #1a1a2e;
  color: #f5c518;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background .15s;
}
.btn-lightning:hover { background: #16213e; }

.hidden { display: none !important; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.modal-panel {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.2);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.card-header {
  font-weight: 700;
  font-size: .9rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: .2rem;
  line-height: 1.2;
}
.page-sub {
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 1.25rem;
}

/* ── Forms ────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: .35rem;
}
.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

/* ── Tables — scroll on mobile ────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  min-width: 480px;           /* prevents collapse before scroll kicks in */
}
.table th {
  text-align: left;
  padding: .5rem .75rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }

/* ── Badge ────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-green  { background: var(--green-light); color: var(--green-text); }
.badge-red    { background: #FEEEEC; color: #B02B1E; }
.badge-gray   { background: var(--surface-2); color: var(--text-muted); }
.badge-amber  { background: #FEF3C7; color: #92400E; }

/* ── Card body ────────────────────────────────────────────────────── */
.card-body { padding: 1rem; }
.card-body + .card-body { border-top: 1px solid var(--border); }

/* ── Form select ──────────────────────────────────────────────────── */
.form-select {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .75rem center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s;
}
.form-select:focus { outline: none; border-color: var(--green); }

/* ── Input group (inline input + button) ──────────────────────────── */
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control,
.input-group .text-input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  flex: 1;
  min-width: 0;
}
.input-group > .btn,
.input-group > .btn-outline,
.input-group > .btn-primary {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex-shrink: 0;
}

/* ── Segmented control ────────────────────────────────────────────── */
.seg-control {
  display: inline-flex;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  padding: .4rem .85rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 36px;
  transition: background .15s, color .15s;
}
.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ── Monospace ────────────────────────────────────────────────────── */
.font-mono { font-family: ui-monospace, 'SF Mono', 'Fira Code', monospace; }

/* ── Missing CSS variables ────────────────────────────────────────── */
:root {
  --blue:       #2563EB;
  --blue-light: #EFF6FF;
  --text-3:     #9CA3AF;
  --green-dark: #005A1F;
  --red:        #DC2626;
}

/* ── Bootstrap grid compat (used by ported templates) ────────────── */
.row { display: flex; flex-wrap: wrap; margin-left: -.5rem; margin-right: -.5rem; }
.row > * { padding-left: .5rem; padding-right: .5rem; }
.g-2 { gap: .5rem; margin-left: 0; margin-right: 0; }
.g-2 > * { padding: 0; }
.g-3 { gap: .75rem; margin-left: 0; margin-right: 0; }
.g-3 > * { padding: 0; }
.col   { flex: 1 1 0; min-width: 0; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12{ flex: 0 0 100%; max-width: 100%; }

/* ── Spacing / utility ────────────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .4rem; }
.mb-2 { margin-bottom: .75rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .4rem; }
.mt-2 { margin-top: .75rem; }
.mt-3 { margin-top: 1rem; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem; }
.px-3 { padding-left: .75rem !important; padding-right: .75rem !important; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.d-flex { display: flex; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-shrink-0 { flex-shrink: 0; }
.align-items-center { align-items: center; }
.align-items-start  { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.text-center { text-align: center; }
.text-end    { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green-text); }
.fw-400  { font-weight: 400; }
.fw-500  { font-weight: 500; }
.fw-600  { font-weight: 600; }
.fw-bold { font-weight: 700; }
.fw-800  { font-weight: 800; }
.small   { font-size: .82rem; }
.lh-1    { line-height: 1; }

/* ── Subscription list cards ─────────────────────────────────────── */
.sub-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .6rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 64px;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.sub-card:active { opacity: .85; }

.sub-card-main { flex: 1; min-width: 0; }
.sub-card-name { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.sub-card-meta { font-size: .78rem; color: var(--text-muted);
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sub-card-right { text-align: right; flex-shrink: 0; }
.sub-card-amount { font-weight: 700; font-size: .95rem; color: var(--green-text); }
.sub-card-freq { font-weight: 400; font-size: .78rem; color: var(--text-muted); }
.sub-card-next { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.sub-card-arrow { color: var(--border); font-size: .85rem; flex-shrink: 0; }

/* ── Gift manager styles ──────────────────────────────────────────── */
:root {
  --brand:        #6366f1;
  --brand-light:  #eef2ff;
  --purple:       #7c3aed;
  --purple-light: #f5f3ff;
  --amber:        #d97706;
  --amber-light:  #fffbeb;
  --teal:         #0891b2;
  --teal-light:   #ecfeff;
}

.section-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: .9rem;
  display: flex; align-items: center; gap: .4rem;
}
.section-title.indigo { color: var(--brand); }
.section-title.green  { color: #059669; }
.section-title.purple { color: var(--purple); }
.section-title.teal   { color: var(--teal); }
.section-title.muted  { color: #9ca3af; }

.occ-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 0; border-bottom: 1px solid #f3f4f6;
  text-decoration: none; color: inherit;
}
.occ-row:last-child { border-bottom: none; }
.occ-name { font-weight: 500; font-size: .95rem; }
.occ-meta { font-size: .8rem; color: #9ca3af; margin-top: .1rem; }

.idea-row { padding: 1rem; border-bottom: 1px solid var(--border); }
.idea-row:last-child { border-bottom: none; }

.ai-item {
  padding: .9rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem;
}
.ai-item:last-child { border-bottom: none; }

.pill { display: inline-block; border-radius: 999px; padding: .15rem .55rem; font-size: .7rem; font-weight: 600; }
.pill-idea      { background: #e0e7ff; color: #4338ca; }
.pill-purchased { background: #fef3c7; color: #b45309; }
.pill-wrapped   { background: #ddd6fe; color: #6d28d9; }
.pill-given     { background: #d1fae5; color: #065f46; }

.days { font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: .3rem;
        white-space: nowrap; min-width: 3rem; text-align: center; display: inline-block; }
.days-urgent { background: var(--amber-light); color: var(--amber); }
.days-soon   { background: var(--brand-light); color: var(--brand); }
.days-normal { background: var(--brand-light); color: var(--brand); }
.days-past   { background: #f9fafb; color: #d1d5db; }
.days-today  { background: #fee2e2; color: #dc2626; }

.person-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 0; border-bottom: 1px solid #f3f4f6;
}
.person-row:last-child { border-bottom: none; }

.empty { color: #9ca3af; font-size: .875rem; padding: 1.5rem 0; text-align: center; }

.section { padding: 1.25rem 0 1rem; border-bottom: 1px solid #f3f4f6; }
.section:last-child { border-bottom: none; }

.page-eyebrow { font-size: .75rem; color: #9ca3af; text-decoration: none; display: block; margin-bottom: .2rem; }

.tag { display: inline-flex; align-items: center; gap: .25rem; background: var(--teal-light);
       color: var(--teal); border-radius: 999px; padding: .2rem .65rem; font-size: .8rem; }
.tag button { background: transparent; border: none; color: var(--teal); padding: 0; line-height: 1; cursor: pointer; opacity: .5; }

.tag-chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--teal-light);
            color: var(--teal); border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 500; }
.tag-chip button { background: transparent; border: none; color: var(--teal); padding: 0; line-height: 1; cursor: pointer; opacity: .5; }

.tag-input-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .4rem .6rem;
  min-height: 44px; cursor: text; background: var(--surface); transition: border-color .15s;
}
.tag-input-box:focus-within { border-color: var(--teal); outline: none; }
.tag-input-box input { border: none; outline: none; font-size: 16px; background: transparent; min-width: 120px; flex: 1; padding: 0; }

.inline-form { display: flex; gap: .5rem; align-items: center; margin-top: .75rem; flex-wrap: wrap; }

.ideas-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

.budget-bar  { height: 4px; border-radius: 2px; background: #f3f4f6; margin-top: .4rem; }
.budget-fill { height: 100%; border-radius: 2px; }

.action-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--surface-2); color: var(--text-muted); border: none; border-radius: 999px;
  padding: .25rem .65rem; font-size: .72rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; min-height: 30px;
  transition: background .12s, color .12s;
}
.action-chip:hover       { background: var(--border); color: var(--text-2); }
.action-chip.chip-active { background: var(--teal-light); color: var(--teal); }

.preset-chip {
  flex-shrink: 0; display: inline-block; padding: .3rem .75rem;
  border-radius: 999px; font-size: .78rem; font-weight: 500;
  border: 1px solid #e5e7eb; background: #f9fafb; color: #374151;
  cursor: pointer; white-space: nowrap; min-height: 34px; line-height: 1.4;
}
#presetScroll { mask-image: linear-gradient(to right, black 85%, transparent 100%);
                -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%); }
#presetScroll::-webkit-scrollbar { display: none; }

.btn-brand, .btn-purple, .btn-teal, .btn-ghost, .btn-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .65rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s;
}
.btn-brand  { background: var(--brand);  color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-teal   { background: var(--teal);   color: #fff; }
.btn-green  { background: var(--green);  color: #fff; }
.btn-ghost  { background: transparent; border: 1px solid #e5e7eb; color: #6b7280; }

.interests-toggle { background: transparent; border: none; padding: 0; font-size: .85rem;
                    color: var(--teal); cursor: pointer; font-weight: 500; }

/* ── Subscription-specific variables ─────────────────────────────── */
:root {
  --sub-blue:       #2563EB;
  --sub-blue-light: #EFF6FF;
}

/* ── Desktop overrides (≥ 640px) ─────────────────────────────────── */
@media (min-width: 640px) {
  .site-main { padding: 2rem 1.5rem 1.5rem; }

  /* Show desktop nav links, hide bottom tabs */
  .nav-links {
    display: flex;
    gap: .25rem;
    flex: 1;
    margin-left: 1rem;
  }
  .bottom-tabs { display: none; }

  /* No bottom tab padding on desktop */
  body { padding-bottom: 0; }

  /* Hero */
  .hero { padding: 3.5rem 0 2.5rem; }
  .hero-title { font-size: 2.5rem; }
  .hero-sub   { font-size: 1.1rem; }
  .hero-cta { flex-direction: row; justify-content: center; }
  .hero-cta .btn-primary,
  .hero-cta .btn-outline { width: auto; padding: .65rem 1.5rem; font-size: .95rem; }

  /* Dashboard */
  .dashboard-greeting { font-size: 1.4rem; }
  .dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
  }
  .dashboard-card:hover { box-shadow: var(--shadow-md); border-color: var(--green); }

  /* Card padding */
  .card { padding: 1.25rem; }
  .card-header { font-size: 1rem; }
  .page-title { font-size: 1.5rem; }

  /* Auth: center vertically on larger screens */
  body.auth-body { align-items: center; }
  .auth-wrap { padding-top: 2.5rem; padding-bottom: 2.5rem; }

  /* Col responsive */
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .mb-md-0  { margin-bottom: 0 !important; }

  /* Show full username and sign-out in nav on desktop */
  .nav-username { max-width: none; }
  .nav-signout  { display: flex !important; }

  /* Table: no min-width needed on wider screens */
  .table { min-width: auto; }

  /* Gift ideas two-col on desktop */
  .ideas-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
