/* ADD to style.css - ensures Google Places Autocomplete suggestions
   dropdown (.pac-container, injected by Google's own script directly
   into <body>, outside our modal DOM) renders above our modal overlay
   (z-index: 200) rather than relying on Google's undocumented default. */
.pac-container {
  z-index: 9999 !important;
}
 
/* ── GLOBAL ── */


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

:root {
  --green:        #1D9E75;
  --green-dark:   #0F6E56;
  --green-light:  #E8F7F2;
  --green-mid:    #C8EBE0;
  --ink:          #0D1B14;
  --ink-mid:      #374940;
  --ink-soft:     #5E7268;
  --border:       #D8E6DF;
  --border-soft:  #EBF3EF;
  --surface:      #FFFFFF;
  --surface-2:    #F5FAF7;
  --surface-3:    #EDF5F0;
  --radius:       8px;
  --radius-sm:    6px;
  --amber:        #92600A;
  --amber-bg:     #FEF3CD;
  --amber-border: #F0C060;
  --red:          #A32D2D;
  --red-bg:       #FCEBEB;
  --red-border:   #F09595;
  --blue:         #185FA5;
  --blue-bg:      #E6F1FB;
  --blue-border:  #85B7EB;
  --purple:       #3C3489;
  --purple-bg:    #EEEDFE;
  --purple-border:#AFA9EC;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Sora', sans-serif; background: var(--surface-2); color: var(--ink); min-height: 100vh; line-height: 1.65; }

/* ── NAV ── */
nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 900px; margin: 0 auto; padding: 0 32px; min-height: 56px; height: auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.nav-logo { font-size: 1.125rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; text-decoration: none; }
.nav-tagline { font-size: 0.75rem; color: var(--ink-soft); font-weight: 300; }

/* ── LAYOUT ── */
.page-wrap { max-width: 640px; margin: 0 auto; padding: 40px 24px 80px; }

/* ── SCREENS ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── AUTH ── */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }
.auth-icon { width: 52px; height: 52px; background: var(--green-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.auth-title { font-size: 1.375rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 8px; }
.auth-sub { font-size: 0.875rem; color: var(--ink-soft); font-weight: 300; margin-bottom: 28px; line-height: 1.6; }
.auth-input { width: 100%; font-family: 'Sora', sans-serif; font-size: 1rem; padding: 11px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); outline: none; transition: border-color 0.15s; margin-bottom: 12px; text-align: center; }
.auth-input:focus { border-color: var(--green); }
.auth-input::placeholder { color: var(--ink-soft); opacity: 0.6; }
.btn-full { width: 100%; font-family: 'Sora', sans-serif; font-size: 0.9375rem; font-weight: 600; padding: 12px; border-radius: var(--radius-sm); border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary-full { background: var(--green); color: #fff; }
.btn-primary-full:hover { background: var(--green-dark); }
.auth-privacy { font-size: 0.6875rem; color: var(--ink-soft); margin-top: 16px; line-height: 1.5; }
.auth-privacy a { color: var(--green); text-decoration: none; }

/* ── OTP INPUT ── */
.otp-wrap { position: relative; margin: 20px auto 8px; width: fit-content; }
.otp-boxes { display: flex; gap: 8px; pointer-events: none; }
.otp-box { width: 44px; height: 52px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 0.15s, background 0.1s; display: flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif; font-size: 1.375rem; font-weight: 700; color: var(--ink); }
.otp-box.filled { border-color: var(--green); background: var(--green-light); }
.otp-box.active { border-color: var(--green); border-width: 2px; box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }
.otp-box.error { border-color: var(--red); background: var(--red-bg); }
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: text; font-size: 16px; border: none; background: transparent; }
.otp-hint { font-size: 0.75rem; color: var(--ink-soft); text-align: center; margin-top: 4px; font-weight: 300; }
.otp-error { font-size: 0.75rem; color: var(--red); text-align: center; margin-top: 4px; font-weight: 500; }
.otp-resend-btn { font-family: 'Sora', sans-serif; font-size: 0.8125rem; font-weight: 600; color: var(--green); background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; transition: opacity 0.15s; }
.otp-resend-btn:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: none; }

/* ── SENT ── */
.sent-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }
.sent-icon { width: 52px; height: 52px; background: var(--green-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.sent-title { font-size: 1.25rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 8px; }
.sent-sub { font-size: 0.875rem; color: var(--ink-soft); font-weight: 300; margin-bottom: 24px; line-height: 1.6; }
.sent-email-display { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 16px; font-family: 'Courier New', monospace; font-size: 0.875rem; color: var(--ink); margin-bottom: 24px; }
.resend-link { font-size: 0.8125rem; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ── PORTAL HEADER ── */
.portal-header { margin-bottom: 24px; }
.portal-greeting { font-size: 1.25rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 2px; }
.portal-sub { font-size: 0.875rem; color: var(--ink-soft); font-weight: 300; }

/* ── TABS ── */
.tab-strip { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.tab-btn { flex: 1; font-family: 'Sora', sans-serif; font-size: 0.875rem; font-weight: 500; padding: 9px 16px; border-radius: calc(var(--radius) - 2px); border: none; cursor: pointer; background: transparent; color: var(--ink-soft); transition: all 0.15s; text-align: center; }
.tab-btn.active { background: var(--green); color: #fff; font-weight: 600; }
.tab-btn:not(.active):hover { background: var(--surface-2); color: var(--ink); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── READER PROFILE ── */
.reader-profile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.reader-profile-header { padding: 14px 20px 12px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 10px; }
.reader-profile-title { font-size: 0.9375rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.reader-profile-body { padding: 4px 0; }
.profile-row { display: flex; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--border-soft); gap: 12px; }
.profile-row:last-child { border-bottom: none; }
.profile-row-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); width: 120px; flex-shrink: 0; }
.profile-row-value { font-size: 0.875rem; color: var(--ink); flex: 1; font-family: 'Courier New', monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row-value.city { font-family: 'Sora', sans-serif; }
.profile-row-value.masked { color: var(--ink-soft); font-size: 0.8125rem; }
.profile-row-value.unset { font-family: 'Sora', sans-serif; color: var(--ink-soft); font-style: italic; font-size: 0.8125rem; }
.profile-edit-btn { font-family: 'Sora', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--green); background: none; border: 1px solid var(--green-mid); border-radius: var(--radius-sm); padding: 3px 10px; cursor: pointer; flex-shrink: 0; transition: all 0.15s; }
.profile-edit-btn:hover { background: var(--green-light); }
.profile-add-btn { font-family: 'Sora', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 10px; cursor: pointer; flex-shrink: 0; transition: all 0.15s; }
.profile-add-btn:hover { border-color: var(--green); color: var(--green); }
.masked-note { font-size: 0.6875rem; color: var(--ink-soft); font-weight: 300; font-family: 'Sora', sans-serif; margin-top: 2px; }

/* ── DELIVERY INLINE EDIT ── */
.nl-addr-edit-btn { font-family: 'Sora', sans-serif; font-size: 0.7rem; font-weight: 600; color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 1px 6px; border-radius: 4px; transition: all 0.15s; margin-left: 4px; text-decoration: underline; text-underline-offset: 2px; }
.nl-addr-edit-btn:hover { color: var(--green); }
.nl-delivery-edit { margin-top: 8px; display: none; }
.nl-delivery-edit-row { display: flex; gap: 6px; align-items: center; }
.nl-delivery-input { font-family: 'Sora', sans-serif; font-size: 1rem; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); outline: none; transition: border-color 0.15s; flex: 1; }
.nl-delivery-input:focus { border-color: var(--green); }
.nl-delivery-input::placeholder { color: var(--ink-soft); opacity: 0.6; }
.nl-delivery-submit { font-family: 'Sora', sans-serif; font-size: 0.75rem; font-weight: 600; padding: 7px 12px; background: var(--green); color: #fff; border: none; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background 0.15s; }
.nl-delivery-submit:hover { background: var(--green-dark); }
.nl-delivery-cancel { font-family: 'Sora', sans-serif; font-size: 0.75rem; color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 2px; flex-shrink: 0; }
.nl-delivery-hint { font-size: 0.6875rem; color: var(--ink-soft); margin-top: 5px; font-weight: 300; }
/* Pending state */
.nl-pending-state { margin-top: 8px; display: none; background: var(--amber-bg); border: 1px solid var(--amber-border); border-radius: var(--radius-sm); padding: 10px 12px; }
.nl-pending-addr-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.nl-pending-old { font-family: 'Courier New', monospace; font-size: 0.8125rem; color: var(--ink-soft); text-decoration: line-through; }
.nl-pending-arrow { color: var(--amber); font-size: 0.75rem; }
.nl-pending-new { font-family: 'Courier New', monospace; font-size: 0.8125rem; color: var(--amber); font-weight: 600; }
.nl-pending-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber); }
.nl-pending-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.nl-pending-resend { font-family: 'Sora', sans-serif; font-size: 0.75rem; color: var(--amber); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 0; font-weight: 600; }
.nl-pending-cancel { font-family: 'Sora', sans-serif; font-size: 0.75rem; color: var(--ink-soft); background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.nl-pending-demo { font-family: 'Sora', sans-serif; font-size: 0.7rem; color: var(--ink-soft); background: none; border: 1px dashed var(--border); border-radius: 4px; cursor: pointer; padding: 2px 7px; margin-left: auto; opacity: 0.7; }
.nl-pending-demo:hover { opacity: 1; }

/* ── SECTION LABEL ── */
.section-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; margin-top: 8px; }
.section-label-text { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.manage-delivery-btn { font-family: 'Sora', sans-serif; font-size: 0.75rem; font-weight: 600; color: var(--green); background: none; border: 1px solid var(--green-mid); border-radius: var(--radius-sm); padding: 3px 10px; cursor: pointer; transition: all 0.15s; }
.manage-delivery-btn:hover { background: var(--green-light); }
.manage-delivery-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ── SELECTION BAR ── */
.selection-bar { display: none; background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px; align-items: center; justify-content: space-between; gap: 10px; }
.selection-bar.visible { display: flex; }
.selection-bar-count { font-size: 0.8125rem; font-weight: 600; color: var(--blue); }
.selection-bar-btn { font-family: 'Sora', sans-serif; font-size: 0.8125rem; font-weight: 600; padding: 6px 14px; border-radius: var(--radius-sm); border: none; cursor: pointer; background: var(--blue); color: #fff; transition: all 0.15s; }
.selection-bar-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.selection-bar-btn:not(:disabled):hover { opacity: 0.88; }

/* ── NL CARD CHECKBOX ── */
.nl-card-checkbox-wrap { display: none; padding-top: 2px; flex-shrink: 0; }
.nl-card-checkbox-wrap.visible { display: block; }
.nl-card.selected { border-color: var(--blue-border); box-shadow: 0 0 0 2px rgba(24,95,165,0.1); }

/* ── DEACTIVATED CARD ── */
.nl-card-inactive { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; opacity: 0.75; transition: opacity 0.15s; }
.nl-card-inactive:hover { opacity: 1; }
.nl-card-inactive-inner { padding: 16px 20px 12px; }
.nl-inactive-left { width: 100%; }
.nl-inactive-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.nl-inactive-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.01em; }
.nl-inactive-meta { font-size: 0.75rem; color: var(--ink-soft); font-weight: 300; margin-bottom: 6px; }
.nl-inactive-notified { font-size: 0.6875rem; color: var(--green-dark); background: var(--green-light); border: 1px solid var(--green-mid); border-radius: 99px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; margin-top: 2px; }
.nl-inactive-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.nl-inactive-resubscribe { font-family: 'Sora', sans-serif; font-size: 0.875rem; font-weight: 600; color: var(--green); background: var(--green-light); border: 1px solid var(--green-mid); border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer; transition: all 0.15s; width: 100%; text-align: center; min-height: 42px; }
.nl-inactive-resubscribe:hover { background: var(--green-mid); }
.nl-inactive-remove { font-family: 'Sora', sans-serif; font-size: 0.875rem; font-weight: 500; color: var(--ink-soft); background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; padding: 10px 16px; width: 100%; text-align: center; min-height: 42px; transition: all 0.15s; }
.nl-inactive-remove:hover { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }

/* ── INACTIVE SECTION TOGGLE ── */
.inactive-section { margin-top: 4px; }
.inactive-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; background: none; border: none; padding: 0; font-family: 'Sora', sans-serif; }
.inactive-toggle-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.inactive-toggle-count { font-size: 0.6875rem; background: var(--surface-3); color: var(--ink-soft); border: 1px solid var(--border); border-radius: 99px; padding: 1px 7px; font-weight: 600; }
.inactive-toggle-chevron { color: var(--ink-soft); transition: transform 0.2s; }
.inactive-toggle-chevron.open { transform: rotate(180deg); }
.inactive-cards { display: none; }
.inactive-cards.open { display: block; }

/* ── NEWSLETTER CARDS ── */
.nl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.nl-card-header { padding: 14px 20px 10px; }
.nl-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.nl-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.nl-name a, .nl-inactive-name a, .discovery-card-name a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.nl-name a:hover, .nl-inactive-name a:hover, .discovery-card-name a:hover { color: var(--green); }
.ext-icon { opacity: 0; transition: opacity 0.15s; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nl-name a:hover .ext-icon, .nl-inactive-name a:hover .ext-icon, .discovery-card-name a:hover .ext-icon { opacity: 1; }
.nl-delivery-row { font-size: 0.75rem; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.nl-delivery-addr { font-family: 'Courier New', monospace; color: var(--ink-mid); }
.nl-card-actions { padding: 10px 20px 14px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nl-action-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-right: 4px; }

/* Status pills — clickable */
.nl-pill { font-family: 'Sora', sans-serif; font-size: 0.75rem; font-weight: 600; padding: 5px 12px; border-radius: 99px; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all 0.15s; }
.nl-pill-free { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--border); }
.nl-pill-free:hover { border-color: var(--blue); color: var(--blue); }
.nl-pill-paid { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.nl-pill-paid:hover { background: #d0e5f8; }
.nl-pill-private { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--border); }
.nl-pill-private:hover { border-color: var(--purple); color: var(--purple); }
.nl-pill-unmasked { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-border); }
.nl-pill-unmasked:hover { background: #dddcfd; }
.nl-pill-unmasked-info { cursor: default; opacity: 0.85; }
.nl-pill-unmasked-info:hover { background: var(--purple-bg); opacity: 1; }
.nl-pill-remove { background: transparent; color: var(--ink-soft); border: 1px solid var(--border); margin-left: auto; }
.nl-pill-remove:hover { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }

/* Unsubscribe bottom strip — hidden on desktop, shown on mobile */
.nl-card-unsub-strip {
  display: none;
  padding: 0 20px 12px;
}
.nl-card-unsub-strip button {
  width: 100%;
  font-family: 'Sora', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}
.nl-card-unsub-strip button:hover { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }

/* On desktop: show unsubscribe in top-right, hide strip */
@media (min-width: 601px) {
  .nl-pill-remove-desktop { display: inline-flex; }
  .nl-card-unsub-strip { display: none !important; }
}

/* On mobile: hide top-right button, show bottom strip */
@media (max-width: 600px) {
  .nl-pill-remove-desktop { display: none !important; }
  .nl-card-unsub-strip {
    display: block;
    padding: 0 16px 14px;
  }
}
.nl-pill-ad-supported { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--border); cursor: default; }
.nl-pill-get-adfree { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green-mid); }
.nl-pill-get-adfree:hover { background: var(--green-mid); }

/* cohort badges */
.cohort-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; }
.cohort-native { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green-mid); }
.cohort-imported { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }

/* ── SECTION CARDS (complaint / delete) ── */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; transition: background 0.15s; user-select: none; }
.section-header:hover { background: var(--surface-2); }
.section-header-left { display: flex; align-items: center; gap: 12px; }
.section-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-header-text .label { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.section-header-text .desc { font-size: 0.75rem; color: var(--ink-soft); margin-top: 1px; font-weight: 300; }
.section-chevron { color: var(--ink-soft); transition: transform 0.2s; }
.section-chevron.open { transform: rotate(180deg); }
.section-body { display: none; padding: 0 20px 20px; border-top: 1px solid var(--border-soft); }
.section-body.open { display: block; }
.section-body-inner { padding-top: 16px; }

/* ── FORM ELEMENTS ── */
.field-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); display: block; margin-bottom: 6px; }
.field-input { width: 100%; font-family: 'Sora', sans-serif; font-size: 1rem; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); outline: none; transition: border-color 0.15s; }
.field-input:focus { border-color: var(--green); }
.field-group { margin-bottom: 16px; }
.complaint-textarea { width: 100%; font-family: 'Sora', sans-serif; font-size: 0.875rem; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--ink); outline: none; resize: vertical; min-height: 100px; transition: border-color 0.15s; }
.complaint-textarea:focus { border-color: var(--green); }

/* ── BUTTONS ── */
.btn { font-family: 'Sora', sans-serif; font-size: 0.8125rem; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s; border: 1px solid transparent; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: transparent; color: var(--ink-mid); border-color: var(--border); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red-border); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { font-size: 0.75rem; padding: 5px 12px; }

/* ── NOTICES ── */
.notice { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.8125rem; line-height: 1.6; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.notice-info { background: var(--green-light); border: 1px solid var(--green-mid); color: var(--green-dark); }
.notice-warn { background: var(--amber-bg); border: 1px solid var(--amber-border); color: var(--amber); }
.notice-danger { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); }

/* ── DELETE SECTION ── */
.delete-card { background: var(--red-bg); border: 1px solid var(--red-border); border-radius: var(--radius); padding: 20px; margin-top: 8px; }
.delete-title { font-size: 0.9375rem; font-weight: 600; color: var(--red); margin-bottom: 6px; }
.delete-desc { font-size: 0.8125rem; color: var(--red); opacity: 0.85; line-height: 1.6; margin-bottom: 16px; }
.delete-confirm { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.delete-confirm input { accent-color: var(--red); margin-top: 3px; flex-shrink: 0; }
.delete-confirm label { font-size: 0.75rem; color: var(--red); line-height: 1.5; cursor: pointer; }

/* ── DISCOVERY CARDS ── */
.discovery-intro { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 300; margin-bottom: 16px; line-height: 1.5; }
.discovery-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: flex-start; gap: 14px; transition: border-color 0.15s, box-shadow 0.15s; margin-bottom: 10px; }
.discovery-card:hover { border-color: var(--green-mid); box-shadow: 0 2px 12px rgba(29,158,117,0.08); }
.discovery-card-avatar { width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 700; color: #fff; }
.discovery-card-body { flex: 1; min-width: 0; }
.discovery-card-name { font-size: 0.9375rem; font-weight: 600; color: var(--ink); margin-bottom: 3px; letter-spacing: -0.01em; }
.discovery-card-desc { font-size: 0.8125rem; color: var(--ink-soft); font-weight: 300; line-height: 1.5; margin-bottom: 8px; }
.discovery-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.discovery-meta-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 500; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 99px; padding: 2px 8px; }
.discovery-meta-pill.distance { color: var(--green-dark); background: var(--green-light); border-color: var(--green-mid); }
.discovery-card-action { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.discovery-subscribers { font-size: 0.6875rem; color: var(--ink-soft); font-weight: 300; text-align: right; white-space: nowrap; }

/* ── RECOMMENDATION SECTIONS ── */
.rec-section { margin-bottom: 28px; }
.rec-section-header { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); }
.rec-section-title { display: flex; align-items: center; gap: 7px; font-size: 0.875rem; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 3px; }
.rec-section-desc { font-size: 0.75rem; color: var(--ink-soft); font-weight: 300; padding-left: 21px; }

/* ── MODAL ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(13,27,20,0.45); z-index: 200; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 28px 32px; width: min(440px, calc(100vw - 32px)); max-width: 100%; box-shadow: 0 8px 40px rgba(13,27,20,0.12); max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; }
.modal-title { font-size: 1.0625rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; letter-spacing: -0.01em; }
.modal-sub { font-size: 0.8125rem; color: var(--ink-soft); margin-bottom: 16px; font-weight: 300; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; position: sticky; bottom: -28px; background: var(--surface); margin-left: -32px; margin-right: -32px; padding-left: 32px; padding-right: 32px; padding-bottom: 28px; }

/* unmask before/after */
.unmask-before-after { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; }
.unmask-ba-row { display: flex; align-items: center; padding: 10px 14px; gap: 10px; }
.unmask-ba-row:first-child { border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.unmask-ba-row:last-child { background: var(--purple-bg); }
.unmask-ba-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; width: 70px; flex-shrink: 0; }
.unmask-ba-row:first-child .unmask-ba-label { color: var(--ink-soft); }
.unmask-ba-row:last-child .unmask-ba-label { color: var(--purple); }
.unmask-ba-value { font-family: 'Courier New', monospace; font-size: 0.8125rem; }
.unmask-ba-row:first-child .unmask-ba-value { color: var(--ink-soft); }
.unmask-ba-row:last-child .unmask-ba-value { color: var(--purple); font-weight: 600; }

.unmask-never { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 0.8125rem; color: var(--ink-soft); line-height: 1.5; }
.unmask-never strong { color: var(--ink-mid); }
.unmask-confirm-check { display: flex; align-items: flex-start; gap: 10px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 4px; }
.unmask-confirm-check input { accent-color: var(--purple); margin-top: 3px; flex-shrink: 0; }
.unmask-confirm-check label { font-size: 0.8125rem; color: var(--ink); line-height: 1.5; cursor: pointer; }

/* modal email display */
.modal-email-display { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-family: 'Courier New', monospace; font-size: 0.875rem; color: var(--ink); margin-bottom: 16px; text-align: center; }
/* adfree counter */
.adfree-counter-display { border: 1px solid var(--blue-border); background: var(--blue-bg); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }
.adfree-counter-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue); margin-bottom: 4px; }
.adfree-counter-value { font-size: 1.5rem; font-weight: 700; color: var(--blue); letter-spacing: -0.02em; }
.adfree-counter-sub { font-size: 0.75rem; color: var(--ink-soft); margin-top: 2px; }

/* ── FOOTER ── */
.portal-footer { text-align: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.portal-footer p { font-size: 0.75rem; color: var(--ink-soft); line-height: 1.6; }
.portal-footer a { color: var(--green); text-decoration: none; }

/* ── SVG HELPER ── */
.ico { display: inline-block; vertical-align: -2px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ── DIVIDER ── */
.section-divider { height: 1px; background: var(--border-soft); margin: 20px 0; }
/* ══ MOBILE RESPONSIVENESS ══ */

/* ── Global: prevent iOS auto-zoom on ALL inputs ── */
input, textarea, select {
  font-size: 16px !important;
}

/* ── Nav: flexible height, hide tagline on tiny screens ── */
.nav-inner {
  height: auto;
  min-height: 56px;
  padding: 8px 20px;
  flex-wrap: wrap;
  gap: 4px;
}
@media (max-width: 360px) {
  .nav-tagline { display: none; }
}

/* ── Page wrap: tighter padding on mobile ── */
@media (max-width: 600px) {
  .page-wrap { padding: 24px 16px 64px; }
  .page-wrap[style*="max-width:480px"] { padding: 24px 16px 64px; }
}

/* ── Auth card ── */
@media (max-width: 600px) {
  .auth-card, .sent-card { padding: 28px 20px; }
}

/* ── OTP boxes: scale down on small screens ── */
@media (max-width: 400px) {
  .otp-box { width: 38px; height: 46px; font-size: 1.125rem; }
  .otp-boxes { gap: 6px; }
}

/* ── Tabs ── */
@media (max-width: 600px) {
  .tab-btn { font-size: 0.8125rem; padding: 8px 10px; }
}

/* ── Reader profile rows: stack label above value on mobile ── */
@media (max-width: 600px) {
  .profile-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 16px;
  }
  .profile-row-label {
    width: auto;
    font-size: 0.625rem;
    letter-spacing: 0.07em;
  }
  .profile-row-value {
    flex: none;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-all;
    max-width: 100%;
  }
  /* Edit button sits on its own line, left-aligned */
  .profile-edit-btn, .profile-add-btn {
    align-self: flex-start;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    margin-top: 2px;
  }
  /* Privacy promise in profile */
  .reader-profile-body > div:last-child { padding: 12px 16px; }
}

/* ── Data transparency rows: stack on mobile ── */
@media (max-width: 600px) {
  .data-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px;
    padding: 10px 0;
  }
  .data-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .data-value {
    font-size: 0.875rem;
    word-break: break-all;
    overflow-wrap: break-word;
  }
}

/* ── Newsletter cards: breathing room on mobile ── */
@media (max-width: 600px) {
  .nl-card { border-radius: 10px; }
  .nl-card-header { padding: 16px 16px 12px; }

  /* Name — slightly larger */
  .nl-name { font-size: 1rem; }

  /* Delivery row — break address and date onto separate lines */
  .nl-delivery-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 6px;
    font-size: 0.8125rem;
    line-height: 1.5;
  }
  .nl-delivery-addr {
    font-size: 0.8125rem;
    color: var(--ink);
  }
  /* Hide the mid-dot separator on mobile */
  .nl-delivery-sep { display: none; }
  /* Date on its own line, slightly muted */
  .nl-delivery-date {
    font-size: 0.75rem;
    color: var(--ink-soft);
    font-weight: 300;
  }

  /* Status section — more room, label bigger */
  .nl-card-actions {
    padding: 12px 16px 14px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
  }
  .nl-action-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-soft);
    flex-shrink: 0;
  }

  /* Pills — full width stacked, generous tap target */
  .nl-pill {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    font-size: 0.875rem;
    white-space: nowrap;
  }
}

/* ── Cohort badge — slightly larger on mobile ── */
@media (max-width: 600px) {
  .cohort-badge {
    font-size: 0.6875rem;
    padding: 3px 8px;
  }
  .nl-name-row {
    gap: 8px;
    margin-bottom: 6px;
  }
}

/* ── Inactive cards — already stacked by default ── */
@media (max-width: 600px) {
  .nl-card-inactive-inner { padding: 14px 16px 10px; }
}

/* ── Section cards ── */
@media (max-width: 600px) {
  .section-header { padding: 14px 16px; }
  .section-body { padding: 0 14px 16px; }
  .section-icon { width: 28px; height: 28px; flex-shrink: 0; }
}

/* ── Modal: breathing room + no double-scroll trap ── */
@media (max-width: 600px) {
  .modal-overlay { padding: 16px; align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 20px;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .modal-actions {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    bottom: -24px;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  /* OTP modal boxes */
  .otp-wrap { width: 100%; }
}

/* ── Discovery cards: stack on mobile ── */
@media (max-width: 600px) {
  .discovery-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }
  .discovery-card-avatar { width: 36px; height: 36px; font-size: 0.8125rem; }
  .discovery-card-body { min-width: 0; width: calc(100% - 50px); }
  .discovery-card-action {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid var(--border-soft);
  }
  .discovery-card-action .btn { min-height: 36px; }
  .discovery-subscribers { text-align: left; }
}

/* ── Rec section headers ── */
@media (max-width: 600px) {
  .rec-section-header { padding-bottom: 8px; margin-bottom: 10px; }
}

/* ── Selection bar ── */
@media (max-width: 600px) {
  .selection-bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .selection-bar-btn {
    width: 100%;
    min-height: 40px;
    font-size: 0.8125rem;
  }
}

/* ── Delete section ── */
@media (max-width: 600px) {
  .delete-card { padding: 16px; }
  .delete-confirm { align-items: flex-start; }
  .delete-confirm input { margin-top: 3px; }
}

/* ── Buttons: minimum tap target globally on mobile ── */
@media (max-width: 600px) {
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .manage-delivery-btn { min-height: 32px; padding: 5px 12px; font-size: 0.8125rem; }
}

/* ── Footer ── */
@media (max-width: 600px) {
  .portal-footer { padding-top: 20px; margin-top: 28px; }
  .portal-footer p { font-size: 0.6875rem; }
}

/* ── Section label row ── */
@media (max-width: 600px) {
  .section-label-row { flex-wrap: wrap; gap: 6px; }
}

/* ══ V26 MOBILE FIXES ══ */

/* 1. OTP boxes inside modals — scale down on narrow screens */
@media (max-width: 600px) {
  .modal .otp-wrap {
    width: 100%;
    max-width: 100%;
  }
  .modal .otp-boxes {
    justify-content: center;
    gap: 6px;
  }
  .modal .otp-box {
    width: 38px;
    height: 46px;
    font-size: 1.125rem;
  }
}

/* 2. Modal OTP resend/back row — stack vertically */
@media (max-width: 600px) {
  .modal-otp-nav-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
}

/* 3. Unmask before/after — address overflow fix */
.unmask-ba-value {
  word-break: break-all;
  overflow-wrap: break-word;
  min-width: 0;
  flex: 1;
}

/* 4. Subscription types modal — badge+label row wraps */
@media (max-width: 600px) {
  .modal .sub-type-header {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* 5. Delete button — full width on mobile */
@media (max-width: 600px) {
  .delete-card .btn-danger {
    width: 100%;
    justify-content: center;
  }
}

/* 6. Privacy promise panel — padding consistency */
@media (max-width: 600px) {
  .reader-profile-body > div[style*="green-light"] {
    padding: 12px 16px !important;
  }
}

/* 7. Section desc — prevent awkward mid-word break */
.section-header-text .desc {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 8. Portal footer — tap targets for links */
@media (max-width: 600px) {
  .portal-footer a {
    display: inline-block;
    padding: 4px 2px;
    min-height: 44px;
    line-height: 44px;
  }
}