/* ═══════════════════════════════════════════════════════════════════════════
   PIMS — iPhone Contacts–style UI
   Phase 4 redesign. Light + dark mode via prefers-color-scheme.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens (light) ─────────────────────────────────────────── */
:root {
  /* System colors — match iOS 17 system palette */
  --ios-blue:      #007AFF;
  --ios-blue-press:#0064D2;
  --ios-red:       #FF3B30;
  --ios-green:     #34C759;
  --ios-orange:    #FF9500;
  --ios-yellow:    #FFCC00;
  --ios-purple:    #AF52DE;
  --ios-pink:      #FF2D55;
  --ios-teal:      #5AC8FA;
  --ios-indigo:    #5856D6;

  /* Surfaces */
  --bg:             #F2F2F7;     /* page background, "system grouped" */
  --bg-elevated:    #FFFFFF;     /* nav bar, modal */
  --card:           #FFFFFF;     /* grouped list rows */
  --card-press:     #D1D1D6;     /* row press feedback */

  /* Separators */
  --separator:      rgba(60, 60, 67, 0.29);  /* full-width separator */
  --separator-opaque: #C6C6C8;

  /* Text */
  --text:           #000000;
  --text-secondary: rgba(60, 60, 67, 0.60);
  --text-tertiary:  rgba(60, 60, 67, 0.30);
  --text-quaternary:rgba(60, 60, 67, 0.18);

  /* Fills (used for buttons, badges, search bg) */
  --fill-1: rgba(120, 120, 128, 0.20);  /* tertiary system fill */
  --fill-2: rgba(120, 120, 128, 0.16);
  --fill-3: rgba(120, 120, 128, 0.12);
  --fill-4: rgba(116, 116, 128, 0.08);

  /* Layout */
  --nav-h: 44px;
  --large-title-h: 96px;
  --row-min-h: 44px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Radii — iOS uses 10px for cards, 14px for modals, 22px for inputs in cells */
  --r-card: 10px;
  --r-modal: 14px;
  --r-pill: 999px;

  /* Shadow — iOS rarely uses heavy shadows; just a soft elevation when needed */
  --shadow-modal: 0 10px 60px rgba(0, 0, 0, 0.30);
  --shadow-nav:   0 0.5px 0 var(--separator);

  --transition: 150ms ease;
}

/* ── Dark mode tokens ──────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --ios-blue:      #0A84FF;
    --ios-blue-press:#3395FF;
    --ios-red:       #FF453A;
    --ios-green:     #30D158;
    --ios-orange:    #FF9F0A;
    --ios-yellow:    #FFD60A;
    --ios-purple:    #BF5AF2;
    --ios-pink:      #FF375F;
    --ios-teal:      #64D2FF;
    --ios-indigo:    #5E5CE6;

    --bg:             #000000;
    --bg-elevated:    #1C1C1E;
    --card:           #1C1C1E;
    --card-press:     #2C2C2E;

    --separator:      rgba(84, 84, 88, 0.65);
    --separator-opaque: #38383A;

    --text:           #FFFFFF;
    --text-secondary: rgba(235, 235, 245, 0.60);
    --text-tertiary:  rgba(235, 235, 245, 0.30);
    --text-quaternary:rgba(235, 235, 245, 0.18);

    --fill-1: rgba(120, 120, 128, 0.36);
    --fill-2: rgba(120, 120, 128, 0.32);
    --fill-3: rgba(118, 118, 128, 0.24);
    --fill-4: rgba(118, 118, 128, 0.18);

    --shadow-nav: 0 0.5px 0 var(--separator);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
               'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.29;            /* iOS body */
  letter-spacing: -0.41px;      /* iOS body tracking */
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

a { color: var(--ios-blue); text-decoration: none; }
a:hover { color: var(--ios-blue); text-decoration: none; }

button { font: inherit; color: inherit; }

/* ── Top navigation bar ────────────────────────────────────────────── */
.ios-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-nav);
}
@media (prefers-color-scheme: light) {
  .ios-nav { background: rgba(248, 248, 248, 0.94); }
}
@media (prefers-color-scheme: dark) {
  .ios-nav { background: rgba(28, 28, 30, 0.88); }
}

.ios-nav-bar {
  height: var(--nav-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ios-nav-left, .ios-nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ios-nav-right { justify-content: flex-end; }
.ios-nav-title-center {
  flex: 0 1 auto;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.41px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* iOS nav buttons are blue text + small icon, no border */
.ios-nav-btn {
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 400;
  padding: 8px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.41px;
  text-decoration: none;
}
.ios-nav-btn:hover, .ios-nav-btn:active { color: var(--ios-blue-press); }
.ios-nav-btn-bold { font-weight: 600; }
.ios-nav-btn-back i { font-size: 18px; }
.ios-nav-btn-icon  { padding: 8px; font-size: 22px; }

.ios-nav-btn-destructive { color: var(--ios-red); }

/* Notification bell with red badge */
.ios-bell {
  position: relative;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ios-bell-badge {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ios-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* Large title (slides into nav bar on scroll – we keep static here) */
.ios-large-title-wrap {
  background: var(--bg);
  padding: 4px 16px 8px;
}
.ios-large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.37px;
  line-height: 1.21;
  color: var(--text);
  margin: 0;
}
.ios-large-title-meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* ── Main content shell ────────────────────────────────────────────── */
main.ios-main {
  padding: 0 0 32px;
  max-width: 760px;
  margin: 0 auto;
}

/* ── Search bar (system search look) ───────────────────────────────── */
.ios-search-wrap {
  padding: 8px 16px 12px;
  background: var(--bg);
}
.ios-search {
  position: relative;
  background: var(--fill-3);
  border-radius: var(--r-card);
  display: flex;
  align-items: center;
  padding: 7px 8px 7px 30px;
}
.ios-search::before {
  content: "\f002"; /* fa magnifying-glass */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--text-secondary);
  font-size: 14px;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.ios-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.41px;
}
.ios-search input::placeholder { color: var(--text-secondary); }

.ios-search-clear {
  margin-left: 6px;
  background: var(--text-tertiary);
  color: var(--bg-elevated);
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 11px;
  text-decoration: none;
}

/* ── Grouped list (the iOS bread and butter) ───────────────────────── */
.ios-section-header {
  padding: 16px 16px 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.08px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.ios-list {
  background: var(--card);
  margin: 0 16px 24px;
  border-radius: var(--r-card);
  overflow: hidden;
  list-style: none;
  padding: 0;
}

.ios-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--row-min-h);
  padding: 11px 16px;
  position: relative;
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}
.ios-row:active,
.ios-row.is-pressed { background: var(--card-press); }
.ios-row + .ios-row::before {
  /* Inset separator like iOS — starts after the avatar */
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 0.5px;
  background: var(--separator);
}
/* Force full-width separator (used in some sections) */
.ios-row.full-sep + .ios-row::before { left: 0; }

/* When the row has a leading icon/avatar, separator should start after it */
.ios-row.has-leading + .ios-row::before { left: 68px; }

.ios-row-leading { flex-shrink: 0; }
.ios-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ios-row-title {
  font-size: 17px;
  letter-spacing: -0.41px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}
.ios-row-title-bold { font-weight: 600; }

.ios-row-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: -0.24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ios-row-trailing {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 17px;
  letter-spacing: -0.41px;
}
.ios-chevron {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 600;
  margin-left: 4px;
}

/* Detail-style row: small label on top, blue value on bottom */
.ios-row-detail .ios-row-label {
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.08px;
}
.ios-row-detail .ios-row-value {
  font-size: 17px;
  color: var(--ios-blue);
  letter-spacing: -0.41px;
  word-break: break-word;
  white-space: normal;
}
.ios-row-detail .ios-row-value-plain { color: var(--text); }

/* Destructive (red) row, e.g. "Delete Contact" */
.ios-row-destructive .ios-row-title { color: var(--ios-red); }
.ios-row-destructive { justify-content: center; }
.ios-row-destructive form { width: 100%; }
.ios-row-destructive button {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--ios-red);
  font-size: 17px;
  letter-spacing: -0.41px;
  padding: 0;
  text-align: center;
  cursor: pointer;
}

/* List footer text (small gray hint below a section) */
.ios-section-footer {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 16px 0;
  letter-spacing: -0.08px;
}

/* ── Avatars ───────────────────────────────────────────────────────── */
.ios-avatar {
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  letter-spacing: -0.5px;
  overflow: hidden;
  flex-shrink: 0;
}
.ios-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ios-avatar-xs  { width: 20px;  height: 20px;  font-size: 10px; }
.ios-avatar-sm  { width: 40px;  height: 40px;  font-size: 16px; }
.ios-avatar-md  { width: 56px;  height: 56px;  font-size: 22px; }
.ios-avatar-lg  { width: 110px; height: 110px; font-size: 42px; }
.ios-avatar-xl  { width: 140px; height: 140px; font-size: 54px; }

/* ── A–Z section index (right-edge scrubber) ───────────────────────── */
.ios-az-scrubber {
  position: fixed;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ios-blue);
  z-index: 50;
  user-select: none;
  -webkit-user-select: none;
  padding: 4px 0;
}
.ios-az-scrubber a {
  color: var(--ios-blue);
  width: 18px;
  text-align: center;
  line-height: 14px;
  text-decoration: none;
}
.ios-az-scrubber a:active { color: var(--ios-blue-press); }
.ios-az-scrubber-disabled { color: var(--text-quaternary); pointer-events: none; }

@media (max-width: 380px) {
  .ios-az-scrubber { font-size: 10px; }
}

/* ── Section anchor (jump targets for the scrubber) ────────────────── */
.ios-list-anchor { scroll-margin-top: 60px; }

/* ── Profile header (detail page) ──────────────────────────────────── */
.ios-profile-header {
  text-align: center;
  padding: 16px 16px 24px;
  background: var(--bg);
}
.ios-profile-header .ios-avatar {
  margin: 0 auto 12px;
}
.ios-profile-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.35px;
  margin: 0;
  color: var(--text);
}
.ios-profile-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Action row: row of circular buttons (message / call / mail) */
.ios-action-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 16px 16px 24px;
  background: var(--bg);
}
.ios-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.ios-action-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--fill-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--ios-blue);
}
.ios-action-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.07px;
  color: var(--ios-blue);
}
.ios-action[aria-disabled="true"] {
  pointer-events: none;
  color: var(--text-tertiary);
}
.ios-action[aria-disabled="true"] .ios-action-icon,
.ios-action[aria-disabled="true"] .ios-action-label {
  color: var(--text-tertiary);
}

/* ── Form inputs (iOS grouped style) ───────────────────────────────── */
.ios-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--row-min-h);
  padding: 8px 16px;
  position: relative;
  background: var(--card);
}
.ios-form-row + .ios-form-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 0.5px;
  background: var(--separator);
}
.ios-form-row.has-leading + .ios-form-row::before { left: 16px; }

.ios-form-label {
  flex-shrink: 0;
  width: 96px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.24px;
  /* Vertical separator divides the label from the input */
  padding-right: 12px;
  margin-right: 12px;
  border-right: 0.5px solid var(--separator);
  align-self: stretch;
  display: flex;
  align-items: center;
}
/* Multi-line rows (textarea / photo / notes) — separator stretches the
   full row height and the label sits at the top instead of centered. */
.ios-form-row[style*="align-items: flex-start"] .ios-form-label,
.ios-form-row.is-multiline .ios-form-label {
  align-items: flex-start;
  padding-top: 8px;
}
.ios-form-label-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  /* background: var(--fill-3); */
  color: var(--ios-blue);
  font-size: 13px;
}

.ios-form-input,
.ios-form-textarea {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  letter-spacing: -0.41px;
  padding: 8px 0;
  min-width: 0;
}
.ios-form-input::placeholder,
.ios-form-textarea::placeholder { color: var(--text-tertiary); }
.ios-form-textarea { resize: vertical; min-height: 60px; }

.ios-form-select {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.41px;
  text-align: right;
  padding-right: 16px;
  appearance: none;
  -webkit-appearance: none;
}

/* ── Photo edit on form page ───────────────────────────────────────── */
.ios-photo-edit {
  text-align: center;
  padding: 16px 16px 8px;
  background: var(--bg);
}
.ios-photo-edit .ios-avatar {
  margin: 0 auto 4px;
  cursor: pointer;
  border: 0.5px solid var(--separator);
}
.ios-photo-edit-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--ios-blue);
  font-size: 15px;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.ios-photo-edit-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
}
.ios-photo-edit-actions button {
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}
.ios-photo-edit-actions button.danger { color: var(--ios-red); }

/* ── Toast / banner (replaces flash messages) ──────────────────────── */
.ios-toast-stack {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--safe-top) + var(--nav-h) + 8px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.ios-toast {
  background: var(--bg-elevated);
  color: var(--text);
  border: 0.5px solid var(--separator);
  border-radius: var(--r-modal);
  padding: 10px 14px;
  font-size: 15px;
  letter-spacing: -0.24px;
  box-shadow: var(--shadow-modal);
  pointer-events: auto;
  max-width: 90vw;
}
.ios-toast.is-success { color: var(--ios-green); }
.ios-toast.is-danger  { color: var(--ios-red); }
.ios-toast.is-warning { color: var(--ios-orange); }

/* ── Map pin card (reused in detail) ───────────────────────────────── */
.ios-map-pin .ios-row-leading {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--ios-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* Embedded map card */
.ios-map-card {
  margin: 0 16px 8px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--card);
  border: 0.5px solid var(--separator);
}
.ios-map-embed {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
  background: var(--fill-3);
}
.ios-map-address {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.24px;
  border-top: 0.5px solid var(--separator);
}
.ios-map-address i { color: var(--ios-red); font-size: 14px; }

/* ── Day Tracker / Activity ────────────────────────────────────────── */
.ios-activity-emoji {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--fill-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}
.ios-activity-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.ios-activity-actions button {
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  font-size: 14px;
  padding: 6px;
  cursor: pointer;
}
.ios-activity-actions button[disabled] {
  color: var(--text-tertiary);
  cursor: not-allowed;
}
.ios-activity-actions button.danger { color: var(--ios-red); }

/* Mini calendar — restyled to match iOS Calendar */
.ios-cal {
  background: var(--card);
  margin: 0 16px 12px;
  border-radius: var(--r-card);
  padding: 12px;
}
.ios-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}
.ios-cal-month {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.41px;
  color: var(--text);
}
.ios-cal-nav button {
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
.ios-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.ios-cal-hdr {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  padding: 4px 0;
}
.ios-cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  font-size: 15px;
  color: var(--text);
  position: relative;
}
.ios-cal-cell.empty { cursor: default; }
.ios-cal-cell .num {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.ios-cal-cell.today {
  /* Soft yellow tint — just enough to draw the eye without shouting.
     The red number pill on top does most of the identifying work. */
  background: rgba(255, 204, 0, 0.14);
  border-radius: 8px;
}
.ios-cal-cell.today .num {
  background: var(--ios-red);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.30);
}
@media (prefers-color-scheme: dark) {
  .ios-cal-cell.today { background: rgba(255, 214, 10, 0.10); }
}
/* Day cells with events show their emojis below the day number.
   The old colored dot is intentionally suppressed when emojis render. */
.ios-cal-cell-emojis {
  display: flex;
  gap: 1px;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji',
               -apple-system, BlinkMacSystemFont, sans-serif;
  align-items: center;
  justify-content: center;
}
.ios-cal-emoji {
  font-size: 11px;
  line-height: 1;
  display: inline-block;
}
.ios-cal-more {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--fill-3);
  border-radius: 4px;
  padding: 0 2px;
  line-height: 10px;
}
/* Cycle phase overlays (mini calendar) */
.ios-cal-cell.cyc-period .num {
  background: var(--ios-red);
  color: #fff;
}
.ios-cal-cell.cyc-period-predicted .num {
  background: transparent;
  color: var(--ios-red);
  box-shadow: inset 0 0 0 1.5px var(--ios-red);
}
.ios-cal-cell.cyc-fertile .num {
  background: rgba(90, 200, 250, 0.25);    /* light iOS teal */
  color: var(--ios-teal);
}
.ios-cal-cell.cyc-ovulation .num {
  background: var(--ios-green);
  color: #fff;
  font-weight: 700;
}
.ios-cal-cell.cyc-period.today .num,
.ios-cal-cell.cyc-ovulation.today .num { box-shadow: 0 0 0 2px var(--bg); }

.ios-cal-cell.selected:not(.today) .num {
  background: var(--fill-2);
  color: var(--ios-blue);
  font-weight: 600;
}

/* Brief highlight on the timeline row that the global calendar jumped to */
@keyframes ios-timeline-flash {
  0%   { background: rgba(10, 132, 255, 0.22); }
  100% { background: transparent; }
}
li.is-flash { animation: ios-timeline-flash 1.2s ease-out; }

/* ── Modals — iOS-styled ───────────────────────────────────────────── */
.modal-content {
  background: var(--bg-elevated);
  color: var(--text);
  border: 0;
  border-radius: var(--r-modal);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.modal-header {
  border-bottom: 0.5px solid var(--separator);
  padding: 14px 16px;
}
.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.41px;
  color: var(--text);
}
.modal-body { padding: 16px; }
.modal-footer {
  border-top: 0.5px solid var(--separator);
  padding: 12px 16px;
}
.btn-close { filter: grayscale(1); }
@media (prefers-color-scheme: dark) {
  .btn-close { filter: invert(1) grayscale(1); }
}

/* iOS-style modal action buttons (inside .modal-footer) */
.modal-footer .btn {
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 400;
  padding: 8px 14px;
  letter-spacing: -0.41px;
}
.modal-footer .btn-primary { font-weight: 600; }
.modal-footer .btn-danger  { color: var(--ios-red); }
.modal-footer .btn-secondary { color: var(--ios-blue); }

/* ── Icon picker grid (kept, restyled) ─────────────────────────────── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}
.icon-grid-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 10px;
  background: var(--fill-4);
  border: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 10px;
  text-align: center;
  line-height: 1.2;
}
.icon-grid-btn i { font-size: 18px; color: var(--ios-blue); }
.icon-grid-btn:hover { background: var(--fill-2); }
.icon-grid-btn span {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ── Emoji picker ──────────────────────────────────────────────────── */
.emoji-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 4px;
}
.emoji-cat-btn {
  background: var(--fill-4);
  border: 0;
  border-radius: var(--r-pill);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.emoji-cat-btn.active {
  background: var(--ios-blue);
  color: #fff;
}
.emoji-grid-lg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 2px;
  max-height: 50vh;
  overflow-y: auto;
}
.emoji-btn {
  background: transparent;
  border: 0;
  font-size: 24px;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}
.emoji-btn:hover { background: var(--fill-2); }
.emoji-preview-lg { font-size: 24px; line-height: 1; }
.emoji-picker-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--fill-4);
  cursor: pointer;
  color: var(--text);
}

/* ── Highlight (search results) ────────────────────────────────────── */
mark.hl {
  background: var(--ios-yellow);
  color: var(--text);
  padding: 0 1px;
  border-radius: 3px;
}

/* ── Form helpers / utility ────────────────────────────────────────── */
.ios-help { color: var(--text-secondary); font-size: 13px; padding: 6px 16px 0; }
.ios-error { color: var(--ios-red); font-size: 13px; padding: 6px 16px 0; }

.geo-status {
  margin: 6px 16px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Inline geolocation button — sits at the trailing edge of the address input */
.ios-geo-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--fill-3);
  color: var(--ios-blue);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-left: 8px;
  transition: background 100ms ease, transform 100ms ease;
}
.ios-geo-btn:hover  { background: var(--fill-2); }
.ios-geo-btn:active { transform: scale(0.92); }
.ios-geo-btn.is-loading {
  color: var(--text-tertiary);
  pointer-events: none;
}
.ios-geo-btn.is-loading i { animation: ios-spin 1s linear infinite; }
@keyframes ios-spin { to { transform: rotate(360deg); } }
.geo-loading { color: var(--ios-orange); }
.geo-success { color: var(--ios-green); }
.geo-error   { color: var(--ios-red); }

/* ── Lightbox ──────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; }

.lightbox-nav,
.lightbox-close {
  position: absolute;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, transform 120ms ease;
}
.lightbox-nav:hover,
.lightbox-close:hover { background: rgba(0, 0, 0, 0.78); }
.lightbox-nav:active,
.lightbox-close:active { transform: scale(0.92); }

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
}
.lightbox-nav:active { transform: translateY(-50%) scale(0.92); }
.lightbox-prev { left: max(16px, env(safe-area-inset-left, 0px)); }
.lightbox-next { right: max(16px, env(safe-area-inset-right, 0px)); }

.lightbox-close {
  top:   calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
}

.lightbox-counter {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

/* Hide nav + counter when there's only a single image */
.lightbox.single .lightbox-nav,
.lightbox.single .lightbox-counter { display: none; }

@media (max-width: 480px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 16px; }
}

/* ── Login page ────────────────────────────────────────────────────── */
.ios-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.ios-login {
  width: 100%;
  max-width: 360px;
}
.ios-login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.ios-login-icon {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
}
.ios-login h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.36px;
  margin: 0 0 4px;
}
.ios-login p { color: var(--text-secondary); font-size: 15px; margin: 0; }
.ios-login .ios-list { margin: 16px 0 12px; }
.ios-login-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  background: var(--ios-blue);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.41px;
  cursor: pointer;
}
.ios-login-btn:active { background: var(--ios-blue-press); }
.ios-login-error {
  background: var(--ios-red);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: center;
}

/* ── Empty state ───────────────────────────────────────────────────── */
.ios-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}
.ios-empty-icon {
  font-size: 56px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.ios-empty h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: 0.35px;
}
.ios-empty p { font-size: 15px; margin: 0 0 16px; }
.ios-empty-link {
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 400;
}

/* ── Upload progress (shown inside event modals while images upload) ── */
.ios-upload-progress {
  display: none;
  padding: 10px 16px 6px;
  background: var(--card);
  border-top: 0.5px solid var(--separator);
}
.ios-upload-progress.is-active { display: block; }
.ios-upload-progress .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.08px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-upload-progress .label i { color: var(--ios-blue); }
.ios-upload-progress .track {
  height: 4px;
  background: var(--fill-3);
  border-radius: 2px;
  overflow: hidden;
}
.ios-upload-progress .bar {
  height: 100%;
  background: var(--ios-blue);
  width: 0%;
  transition: width 150ms linear;
  border-radius: 2px;
}
.ios-upload-progress.is-error .bar   { background: var(--ios-red); }
.ios-upload-progress.is-error .label { color: var(--ios-red); }

/* Banner variant — used on the contact form (full page, not a modal).
   Pinned just below the nav bar so it stays visible no matter how far the
   user has scrolled when they tap Done. */
.ios-upload-progress.ios-upload-progress-banner {
  /* Default HIDDEN. display:none beats any transform-hiding trick that
     can leak pixels near the top of the viewport on iOS standalone. */
  display: none;
  position: fixed;
  top: calc(var(--safe-top) + var(--nav-h));
  left: 0;
  right: 0;
  z-index: 99;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-bottom: 0.5px solid var(--separator);
  border-radius: 0;
  background: var(--bg-elevated);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.ios-upload-progress.ios-upload-progress-banner.is-active {
  display: block;
  animation: banner-slide-in 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes banner-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.ios-upload-progress.ios-upload-progress-banner .label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}
.ios-upload-progress.ios-upload-progress-banner .label i {
  font-size: 16px;
}
.ios-upload-progress.ios-upload-progress-banner .track {
  height: 6px;
  border-radius: 3px;
}

/* Indeterminate stripes when total length isn't known */
.ios-upload-progress.is-indeterminate .bar {
  width: 35%;
  background: linear-gradient(90deg,
    transparent, var(--ios-blue), transparent);
  animation: ios-upload-shimmer 1.2s ease-in-out infinite;
}
@keyframes ios-upload-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(290%);  }
}

/* ── Custom file picker button (replaces native <input type=file>) ─── */
.ios-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--fill-3);
  border-radius: 10px;
  color: var(--ios-blue);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.24px;
  cursor: pointer;
  transition: background 120ms ease;
  max-width: fit-content;
}
.ios-file-btn:hover  { background: var(--fill-2); }
.ios-file-btn:active { transform: scale(0.98); }
.ios-file-btn input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.ios-file-btn i { font-size: 14px; }
.ios-file-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}
.ios-file-count:empty { display: none; }

/* ── "with" chips (avatar + name) on timeline rows and day popup ─── */
.ios-timeline-with {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.ios-with-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--fill-3);
  border-radius: var(--r-pill);
  padding: 2px 8px 2px 2px;
  font-size: 13px;
  color: var(--ios-blue);
  letter-spacing: -0.15px;
}

/* ── Attendee picker (inside event modals) ────────────────────────── */
.ios-attendee-picker {
  flex: 1;
  position: relative;
  min-width: 0;
}
.ios-attendee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.ios-attendee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--fill-3);
  border-radius: var(--r-pill);
  padding: 3px 8px 3px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.15px;
}
.ios-attendee-chip button {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.ios-attendee-search {
  width: 100%;
  font-size: 15px;
  padding: 4px 0;
}
.ios-attendee-results {
  /* Fixed positioning so the dropdown escapes the modal body's overflow
     clipping. Coordinates are set by JS on each open. */
  position: fixed;
  z-index: 10010;   /* above Bootstrap modal (1055) */
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.ios-attendee-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.ios-attendee-result:hover { background: var(--fill-3); }
.ios-attendee-result + .ios-attendee-result { border-top: 0.5px solid var(--separator); }
.ios-attendee-empty {
  padding: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Activity log photo thumbnails ─────────────────────────────────── */
.ios-event-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  margin-top: 8px;
  max-width: 280px;
}
.ios-event-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  background: var(--fill-3);
  border: 0.5px solid var(--separator);
}

.ios-event-thumbs-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  width: 100%;
  padding: 8px 0;
}
.ios-event-thumb-edit-cell {
  position: relative;
  aspect-ratio: 1;
}
.ios-event-thumb-edit-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 0.5px solid var(--separator);
  cursor: zoom-in;
}
.ios-event-thumb-edit-cell button {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: var(--ios-red);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  padding: 0;
}
.ios-event-thumb-edit-cell button:disabled { opacity: 0.5; cursor: wait; }

/* ── iOS-style radio row (list of options with right-side checkmark) ── */
.ios-radio-row { display: flex; align-items: center; }
.ios-radio-row input[type="radio"] {
  /* Visually hidden, still focusable for keyboard users */
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.ios-radio-check {
  color: var(--ios-blue);
  font-size: 17px;
  margin-left: auto;
  visibility: hidden;
}
/* Show the checkmark on the row whose radio is checked. Uses `:has()`
   which works in all modern browsers we target. */
.ios-radio-row:has(input[type="radio"]:checked) .ios-radio-check {
  visibility: visible;
}
.ios-radio-row:has(input[type="radio"]:focus-visible) {
  outline: 2px solid var(--ios-blue);
  outline-offset: -2px;
  border-radius: var(--r-card);
}

/* ── PIN unlock overlay (full-screen, blocks all interaction) ───────── */
.ios-pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(var(--safe-top) + 24px);
}
.ios-pin-card {
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.ios-pin-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.25);
}
.ios-pin-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 4px;
}
.ios-pin-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.ios-pin-input {
  width: 220px;
  padding: 16px;
  border: 1.5px solid var(--separator);
  border-radius: 12px;
  text-align: center;
  font-size: 28px;
  letter-spacing: 16px;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  outline: none;
}
.ios-pin-input:focus {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}
.ios-pin-input.is-error {
  border-color: var(--ios-red);
  animation: pin-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes pin-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX( 4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60%      { transform: translateX( 8px); }
}
.ios-pin-error {
  color: var(--ios-red);
  font-size: 14px;
  margin-top: 14px;
  font-weight: 500;
}

/* ── iOS-style toggle switch ───────────────────────────────────────── */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}
.ios-switch input { opacity: 0; width: 0; height: 0; }
.ios-switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--fill-3);
  border-radius: 999px;
  transition: background 200ms ease;
}
.ios-switch-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ios-switch input:checked + .ios-switch-slider { background: var(--ios-green); }
.ios-switch input:checked + .ios-switch-slider::before { transform: translateX(20px); }
.ios-switch input:focus-visible + .ios-switch-slider {
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.3);
}

/* Stepper — +/- buttons either side of a number (for numeric prefs) */
.ios-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--fill-3);
  border-radius: 8px;
  overflow: hidden;
}
.ios-stepper button {
  background: transparent;
  border: 0;
  color: var(--ios-blue);
  font-size: 17px;
  font-weight: 600;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.ios-stepper button:disabled { color: var(--text-tertiary); }
.ios-stepper-val {
  min-width: 32px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

/* ── Embed card (iframe field type: YouTube, Vimeo, etc.) ─────────── */
.ios-embed-card {
  margin: 0 16px 24px;
  background: var(--card);
  border-radius: var(--r-card);
  overflow: hidden;
  border: 0.5px solid var(--separator);
}
.ios-embed-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.08px;
  border-bottom: 0.5px solid var(--separator);
}
.ios-embed-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;   /* 16:9 aspect ratio */
  background: #000;
}
.ios-embed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── Tag chips (filter row on index, picker on form) ──────────────── */
.ios-chip-row {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ios-chip-row::-webkit-scrollbar { display: none; }
.ios-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.15px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 100ms ease, transform 100ms ease;
}
.ios-chip:active { transform: scale(0.96); }
.ios-chip.is-active {
  background: var(--ios-blue);
  color: #fff;
}
.ios-chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Tag pill for detail page + preview card */
.ios-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.08px;
  line-height: 1.3;
}
.ios-tag-pill .ios-chip-dot { width: 6px; height: 6px; }

.ios-tag-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

/* Timeline styling */
.ios-timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  position: relative;
}
.ios-timeline-row + .ios-timeline-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 68px;
  right: 0;
  height: 0.5px;
  background: var(--separator);
}
.ios-timeline-date {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--ios-blue);
  margin-bottom: 2px;
}
.ios-timeline-title { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.ios-timeline-person {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: -0.15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-timeline-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: pre-wrap;
  line-height: 1.4;
}

/* ── Bootstrap escape hatches ──────────────────────────────────────── */
.alert-custom { display: none; }   /* legacy — flash messages now go through .ios-toast */
