/* ══════════════════════════════════════════════════════════════
   Exhibit A — Web App overrides
   Browser-only tweaks layered on top of styles.css. Loaded after it,
   so these rules win. The welcome screen is Mac-oriented; here we hide
   the Mac-only pieces (Full Disk Access, "Sync Call History") and make
   the iPhone-backup import the primary call to action.
   ══════════════════════════════════════════════════════════════ */

/* ── Hide Mac-only chrome & welcome elements ───────────────────── */
.titlebar-drag-region,
#btn-read-calls,          /* macOS-only "Sync Call History" */
#permission-status,       /* Full Disk Access status card */
#permission-guide {       /* Full Disk Access how-to */
  display: none !important;
}

/* ── Hide the telemetry opt-in row (license modal) ─────────────── */
/* trackEvent is a no-op in the web app — don't offer a toggle that
   changes nothing. */
.telemetry-setting {
  display: none !important;
}

/* ── Promote the backup import to the primary CTA ──────────────── */
/* The web fork's index.html carries the browser label directly
   ("Open my iPhone backup"); this gives it the brand's primary
   button treatment. */
#btn-backup-import {
  order: 5;                       /* sits right under the subtitle */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 0;
  padding: 13px 32px;
  background: var(--gray-900);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-md), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  transition: opacity var(--transition), transform var(--transition);
}
#btn-backup-import:hover {
  color: var(--white);
  opacity: 0.88;
  text-decoration: none;
}
#btn-backup-import:active {
  opacity: 0.76;
  transform: scale(0.97);
}

/* ── Reflow the remaining welcome items around the new CTA ──────── */
/* Icon / title / subtitle keep their natural order (0); everything
   after the CTA is ordered so nothing lands above it. */
#btn-sample-data { order: 6; margin-top: 18px; }
#sync-status     { order: 7; }
.welcome-note    { order: 8; }
#backup-guide    { order: 9; }
#welcome-error   { order: 10; }

/* ── Unsupported-browser gate ──────────────────────────────────── */
/* Revealed by shim.js when window.showDirectoryPicker is missing
   (Safari/Firefox). .hidden from styles.css keeps it out of view
   until then. */
#webapp-unsupported {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--white);
  text-align: center;
}
#webapp-unsupported .wu-card {
  max-width: 460px;
}
#webapp-unsupported .wu-icon {
  color: var(--gray-400);
  margin-bottom: 20px;
}
#webapp-unsupported h2 {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--gray-900);
  margin-bottom: 14px;
}
#webapp-unsupported p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray-500);
  margin: 0 auto 10px;
  max-width: 400px;
}
#webapp-unsupported strong {
  color: var(--gray-700);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   Web checkout — the export→pay moment
   ══════════════════════════════════════════════════════════════ */
.web-hidden { display: none !important; }

.web-upgrade-offer {
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.web-buy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 20px;
  line-height: 1.25;
  cursor: pointer;
}
.web-buy-main { font-size: 15px; font-weight: 600; }
.web-buy-sub { font-size: 11.5px; font-weight: 400; opacity: 0.8; }
.web-buy-btn:disabled { opacity: 0.75; cursor: default; }

.web-plans-link {
  background: none;
  border: none;
  color: var(--gray-500);
  font-family: var(--font-sans);
  font-size: 12.5px;
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 2px;
}
.web-plans-link:hover { color: var(--gray-800); }

.web-buy-guarantee {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--gray-400);
}
.web-buy-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--red, #ef4444);
}
.web-buy-error a { color: var(--gray-700); }

/* Return-from-checkout nudge banner */
.web-return-banner {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 3000;
  max-width: 520px;
  width: calc(100% - 40px);
  padding: 14px 18px;
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,0.25));
  font-size: 13px;
  line-height: 1.55;
}
.web-return-banner button {
  margin-left: 8px;
  background: rgba(255,255,255,0.14);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}
.web-return-banner button:hover { background: rgba(255,255,255,0.24); }

/* ══════════════════════════════════════════════════════════════
   How-to-back-up walkthrough
   ══════════════════════════════════════════════════════════════ */
.web-howto-link {
  order: 6;                      /* just under the primary CTA, above sample */
  background: none;
  border: none;
  color: var(--gray-500);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  margin: 12px auto 0;
  padding: 2px;
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 3px;
}
.web-howto-link:hover { color: var(--gray-800); }
#btn-sample-data { order: 7; }

.howto-card {
  max-width: 560px;
  text-align: left;
  max-height: 88vh;
  overflow-y: auto;
}
.howto-lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-600);
  margin: 6px 0 18px;
}
.howto-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}
.howto-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.howto-tab.active {
  background: var(--white);
  color: var(--gray-900);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.08));
}
.howto-steps {
  margin: 0 0 4px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.howto-steps li {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gray-700);
}
.howto-steps li.howto-critical {
  list-style: none;
  margin-left: -22px;
  padding: 10px 12px;
  background: #fef9c3;              /* amber-100 */
  border: 1px solid #fde68a;        /* amber-200 */
  border-radius: var(--radius-md, 8px);
  color: #713f12;                   /* amber-900 */
}
.howto-path {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--gray-600);
}
.howto-path code {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 9px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-800);
  user-select: all;
  word-break: break-all;
}
.howto-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-100);
  text-align: center;
}
.howto-actions .btn-primary { width: 100%; }
.howto-privacy {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--gray-400);
}

/* Return-from-checkout banner tones */
.web-return-banner.web-banner-success { background: #14532d; }  /* green-900 */
.web-return-banner.web-banner-success button { background: rgba(255,255,255,0.18); }

/* ══════════════════════════════════════════════════════════════
   Continue where you left off
   ══════════════════════════════════════════════════════════════ */
.web-resume-card {
  order: 4;                        /* above the fresh-start CTA */
  margin: 6px auto 14px;
  padding: 20px 26px;
  max-width: 380px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-lg, 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.web-resume-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--gray-900);
}
.web-resume-meta {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--gray-500);
}
.web-resume-card .btn-primary { width: 100%; }
.web-clear-link {
  margin-top: 8px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--gray-400);
  text-decoration: underline;
  text-decoration-color: var(--gray-300);
  text-underline-offset: 2px;
  cursor: pointer;
}
.web-clear-link:hover { color: var(--red, #ef4444); }

/* Fresh-start CTA de-emphasized when a resume card is present */
#btn-backup-import.web-cta-secondary {
  background: none;
  color: var(--gray-600);
  box-shadow: none;
  border: 1px solid var(--gray-300);
}
