/* The app, onboarding, sign-in and customer-facing pages. Same design DNA as
   the marketing site — navy/green, thick outlines, hard shadows — but calmer:
   this is a tool someone uses weekly, not a pitch. */

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: var(--green); font-weight: 600; }
.dim { color: var(--text-muted-light); font-weight: 400; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- buttons (shared with site) -------------------------------------------- */

.btn {
  display: inline-block;
  font: 700 1rem var(--font-body);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: var(--outline);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: var(--white);
  color: var(--ink);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.btn-sm { padding: 0.45rem 1rem; font-size: 0.9rem; }
.btn-primary { background: var(--lime); box-shadow: 3px 3px 0 var(--ink); }
.btn-primary:hover { background: var(--lime-hover); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--white); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--green); outline-offset: 2px;
}
.linklike {
  background: none; border: none; color: var(--green); font: inherit; font-weight: 700;
  cursor: pointer; padding: 0; text-decoration: underline;
}

/* --- app chrome ------------------------------------------------------------- */

.impersonation-bar {
  background: var(--star); color: var(--ink); border-bottom: var(--outline);
  padding: 0.5rem 1rem; text-align: center; font-size: 0.9rem; font-weight: 600;
}
.impersonation-bar .linklike { color: var(--ink); margin-left: 0.5rem; }

.app-header { background: var(--navy); color: var(--text-on-dark); }
.app-header-inner {
  max-width: 1060px; margin: 0 auto; padding: 0.9rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.app-header .logo {
  font-family: var(--font-display); font-size: 1.3rem; text-transform: uppercase;
  color: var(--text-on-dark); text-decoration: none; letter-spacing: 0.02em;
}
.app-header .logo .dot { color: var(--lime); }
.app-header .logo { display: inline-flex; align-items: center; }
.logo-bull { width: 0.95em; height: 0.95em; flex: none; margin-right: 0.3em; }
.app-client-name {
  font-weight: 700; font-size: 0.95rem; color: var(--text-muted-dark);
  border-left: 2px solid #24365f; padding-left: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header-right { margin-left: auto; }

.user-menu { position: relative; }
.user-menu summary {
  list-style: none; cursor: pointer; display: grid; place-items: center;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu img, .avatar-fallback {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--lime);
  display: grid; place-items: center; font-weight: 800; background: var(--navy-raised);
  color: var(--lime);
}
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--white); color: var(--ink);
  border: var(--outline); border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 0.9rem 1.1rem; min-width: 220px; display: grid; gap: 0.5rem;
}
.user-menu-email { font-size: 0.85rem; color: var(--text-muted-light); word-break: break-all; }

.app-nav {
  max-width: 1060px; margin: 0 auto; padding: 0 1.25rem;
  display: flex; gap: 0.25rem; overflow-x: auto;
}
.app-nav a {
  color: var(--text-muted-dark); text-decoration: none; font-weight: 700; font-size: 0.95rem;
  padding: 0.6rem 0.9rem; border-radius: 10px 10px 0 0; white-space: nowrap;
}
.app-nav a.active { background: var(--cream); color: var(--ink); }
.app-nav a:not(.active):hover { color: var(--white); }
.badge {
  background: var(--lime); color: var(--ink); border-radius: 999px;
  font-size: 0.75rem; padding: 0.05rem 0.5rem; margin-left: 0.2rem; font-weight: 800;
}

.app-main { max-width: 1060px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }

.flash {
  border: var(--outline); border-radius: var(--radius); padding: 0.8rem 1.1rem;
  font-weight: 600; margin-bottom: 1.25rem; background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
}
.flash-success { background: #eafbe0; }
.flash-error { background: #fdecec; }

.page-title { font-size: 1.7rem; font-weight: 800; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.page-sub { color: var(--text-muted-light); max-width: 40rem; margin-bottom: 1.5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.breadcrumb { margin-bottom: 0.75rem; font-size: 0.9rem; }

/* --- stat tiles -------------------------------------------------------------- */

.stat-tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.25rem 0 1.5rem;
}
.stat-tile {
  background: var(--white); border: var(--outline); border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink); padding: 1.1rem 1.2rem;
  display: grid; gap: 0.15rem; align-content: start;
}
.stat-hero { background: var(--navy); color: var(--text-on-dark); }
.stat-hero .stat-value { color: var(--lime); }
.stat-alert { background: #fdecec; }
.stat-label { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; line-height: 1.1; }
.stat-delta { color: var(--lime); font-weight: 700; font-size: 0.85rem; }
.stat-tile:not(.stat-hero) .stat-delta { color: var(--green); }
.stat-delta-muted { font-size: 0.85rem; opacity: 0.7; }

.banner {
  background: var(--navy); color: var(--text-on-dark);
  border: var(--outline); border-radius: var(--radius); box-shadow: 3px 3px 0 var(--ink);
  padding: 1rem 1.25rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 0.25rem;
}

/* --- panels ------------------------------------------------------------------ */

.panel {
  background: var(--white); border: var(--outline); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 1.4rem 1.5rem; margin-bottom: 1.5rem;
}
.panel-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel-head .panel-title { margin-bottom: 0; }
.dash-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.5rem; align-items: start; }

.growth-chart { width: 100%; height: auto; }
.chart-label { font-size: 11px; fill: var(--text-muted-light); font-family: var(--font-body); }
.chart-value { font-size: 13px; font-weight: 800; fill: var(--ink); font-family: var(--font-body); }
.empty-chart { text-align: center; padding: 1rem 0; }
.empty-chart svg { width: 220px; height: auto; margin-bottom: 0.5rem; }
.empty-chart p { color: var(--text-muted-light); font-size: 0.92rem; max-width: 24rem; margin: 0 auto; }

.activity { list-style: none; display: grid; gap: 0.65rem; }
.activity li { display: flex; gap: 0.9rem; align-items: baseline; font-size: 0.95rem; }
.act-when { color: var(--text-muted-light); font-size: 0.8rem; white-space: nowrap; min-width: 3.6rem; }

/* --- lists, tables, chips ---------------------------------------------------- */

.job-list { list-style: none; display: grid; gap: 0.75rem; }
.job-row, .import-row, .conn-row {
  background: var(--white); border: var(--outline); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.job-row { box-shadow: 3px 3px 0 var(--ink); }
.conn-row { border-width: 2px; margin-bottom: 0.75rem; box-shadow: none; border-color: var(--cream-dark); }
.conn-error { border-color: var(--red); }
.conn-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.copy-link {
  font-size: 0.8rem; background: var(--cream); border: 1.5px solid var(--cream-dark);
  border-radius: 8px; padding: 0.3rem 0.6rem; user-select: all; word-break: break-all;
}
.job-info { display: grid; gap: 0.15rem; }
.job-meta { font-size: 0.85rem; color: var(--text-muted-light); display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.job-actions { display: flex; gap: 0.5rem; }

.src-badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 6px; padding: 0.1rem 0.45rem; border: 1.5px solid var(--ink);
}
.src-xero { background: #13b5ea; color: #fff; }
.src-quickbooks { background: #2ca01c; color: #fff; }
.src-freeagent { background: #005b7f; color: #fff; }
.src-sage { background: #00d639; color: #001e00; }
.src-hubspot { background: #ff7a59; color: #fff; }
.src-pipedrive { background: #1a1a1a; color: #fff; }
.src-csv, .src-manual { background: var(--cream-dark); }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
  text-align: left; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted-light); padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 2px solid var(--cream-dark);
}
.data-table td { padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1.5px solid var(--cream); vertical-align: top; }

.chip {
  display: inline-block; font-size: 0.78rem; font-weight: 800; border-radius: 999px;
  padding: 0.15rem 0.7rem; border: 1.5px solid var(--ink); white-space: nowrap;
}
.chip-green { background: var(--lime); }
.chip-blue { background: #d8e6ff; }
.chip-amber { background: #ffe9b3; }
.chip-red { background: #ffd4d6; }
.chip-muted { background: var(--cream-dark); border-color: var(--cream-dark); color: var(--text-muted-light); }
.chip-navy { background: var(--navy); color: var(--lime); }
.pill-muted {
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted-light);
  background: var(--cream); border-radius: 999px; padding: 0.35rem 0.9rem;
}
.stars-inline { color: var(--star); letter-spacing: 1px; }
.star-glyph { color: var(--star); }

/* --- empty states ------------------------------------------------------------ */

.empty-state {
  text-align: center; background: var(--white); border: var(--outline);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 3rem 2rem; max-width: 34rem; margin: 2rem auto;
}
.empty-state svg { width: 110px; height: auto; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted-light); margin-bottom: 1.25rem; }
.empty-mini { color: var(--text-muted-light); font-size: 0.95rem; padding: 0.5rem 0; }

/* --- forms ------------------------------------------------------------------- */

input, select, textarea {
  font: inherit; padding: 0.65rem 0.9rem; border: var(--outline); border-radius: 12px;
  background: var(--white); width: 100%;
}
textarea { resize: vertical; }
label { font-weight: 700; font-size: 0.92rem; display: grid; gap: 0.35rem; }
.optional { font-weight: 400; color: var(--text-muted-light); }
.stacked-form { display: grid; gap: 1rem; max-width: 440px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-grid .full, label.full { grid-column: 1 / -1; }
.check-row {
  display: flex; gap: 0.75rem; align-items: flex-start; font-weight: 400;
  margin-top: 1rem; font-size: 0.95rem;
}
.check-row input { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; accent-color: var(--green); }
.settings-save { position: sticky; bottom: 1rem; }
.settled { margin-bottom: 0.9rem; }
.form-note { font-size: 0.85rem; color: var(--text-muted-light); font-weight: 400; }
.form-error {
  background: #fdecec; border: 2px solid var(--red); border-radius: var(--radius);
  padding: 0.8rem 1rem; font-weight: 600; margin-bottom: 1rem;
}

.import-form { display: grid; gap: 1rem; }
.file-drop {
  border: 2.5px dashed var(--ink); border-radius: var(--radius); padding: 1.1rem;
  text-align: center; cursor: pointer; background: var(--cream); font-weight: 600;
}
.file-drop input { display: none; }
.import-controls { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.import-controls label { min-width: 220px; }
.import-list { list-style: none; display: grid; gap: 0.75rem; }

/* --- onboarding + auth ------------------------------------------------------- */

.bare-body { background: var(--cream); min-height: 100vh; }
.bare-main { max-width: 460px; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.bare-main.bare-wide { max-width: 640px; }

.auth-wrap { display: grid; gap: 1.5rem; justify-items: center; }
.auth-logo {
  font-family: var(--font-display); font-size: 1.6rem; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.auth-logo .dot { color: var(--green); }
.auth-card {
  background: var(--white); border: var(--outline); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-lg); padding: 2.2rem; width: 100%;
}
.auth-card h1 { font-size: 1.45rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.auth-sub { color: var(--text-muted-light); margin-bottom: 1.4rem; }
.auth-form { display: grid; gap: 0.8rem; }
.auth-alt { margin-top: 1.2rem; font-size: 0.92rem; color: var(--text-muted-light); }
.auth-sent-icon svg { width: 64px; height: auto; margin-bottom: 0.75rem; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-weight: 700; text-decoration: none; color: var(--ink);
  border: var(--outline); border-radius: var(--radius-pill); padding: 0.7rem 1.2rem;
  background: var(--white); box-shadow: 3px 3px 0 var(--ink);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn-google:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.auth-or {
  display: flex; align-items: center; gap: 0.8rem; margin: 1.1rem 0;
  color: var(--text-muted-light); font-size: 0.85rem; font-weight: 700;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 2px; background: var(--cream-dark); }

.onb { display: grid; gap: 1rem; }
.onb h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; }
.onb-sub { color: var(--text-muted-light); max-width: 34rem; }
.onb-alt { font-size: 0.92rem; margin-top: 0.5rem; }
.onb-progress {
  display: flex; gap: 1.25rem; list-style: none; margin-bottom: 1rem; flex-wrap: wrap;
}
.onb-progress li {
  display: flex; gap: 0.5rem; align-items: center; font-size: 0.85rem; font-weight: 700;
  color: var(--text-muted-light);
}
.onb-progress li span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--cream-dark); font-size: 0.8rem; background: var(--white);
}
.onb-progress li.now { color: var(--ink); }
.onb-progress li.now span { background: var(--lime); border-color: var(--ink); }
.onb-progress li.done span { background: var(--green); border-color: var(--ink); color: var(--white); }

.gbp-search { display: flex; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.gbp-search input { flex: 1; }
.gbp-search .btn { white-space: nowrap; }
.gbp-results { display: grid; gap: 0.75rem; min-height: 8px; }
.gbp-results.gbp-loading::before {
  content: 'Searching Google…';
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted-light);
  animation: gbp-pulse 1s ease-in-out infinite; padding: 0.3rem 0;
}
@keyframes gbp-pulse { 50% { opacity: 0.35; } }
.onb-prefill { font-weight: 700; font-size: 0.9rem; color: var(--green); }
.gbp-result {
  background: var(--white); border: var(--outline); border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink); padding: 1rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.gbp-result-info { display: grid; gap: 0.1rem; }
.gbp-addr { font-size: 0.85rem; color: var(--text-muted-light); }
.gbp-meta { font-size: 0.9rem; font-weight: 600; }

.connect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 0.5rem; }
.connect-card {
  background: var(--white); border: var(--outline); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 1.4rem; display: grid; gap: 0.6rem; align-content: start;
}
.connect-card h3 { font-size: 1.05rem; font-weight: 800; }
.connect-logo { width: auto; justify-self: start; }
.connect-card p { font-size: 0.9rem; color: var(--text-muted-light); }
.connect-card-off { opacity: 0.75; }
.notice {
  background: #fff8e1; border: 2px solid var(--star); border-radius: var(--radius);
  padding: 0.8rem 1rem; font-size: 0.95rem;
}

.big-tick svg { width: 72px; height: auto; }
.tick-circle { fill: var(--lime); stroke: var(--ink); stroke-width: 3; }
.tick-path {
  fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60; animation: tick-draw 600ms var(--ease) 250ms forwards;
}
@keyframes tick-draw { to { stroke-dashoffset: 0; } }

/* --- customer review page ----------------------------------------------------- */

.rv-wrap { display: grid; gap: 1rem; justify-items: center; padding-top: 1.5rem; }
.rv-card {
  background: var(--white); border: var(--outline); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-lg); padding: 2.2rem; width: 100%; text-align: center;
}
.rv-brand {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.75rem;
}
.rv-card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.rv-sub { color: var(--text-muted-light); margin-bottom: 1.5rem; }

.btn-google-review {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  font-weight: 800; font-size: 1.05rem; text-decoration: none; color: var(--ink);
  border: var(--outline); border-radius: var(--radius-pill); padding: 1rem 1.4rem;
  background: var(--lime); box-shadow: var(--shadow-card);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn-google-review:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lift); background: var(--lime-hover); }

.rv-private { margin-top: 1.5rem; text-align: left; }
.rv-private summary {
  cursor: pointer; font-weight: 700; font-size: 0.95rem; color: var(--text-muted-light);
  text-align: center; list-style: none;
}
.rv-private summary::-webkit-details-marker { display: none; }
.rv-private summary:hover { color: var(--ink); }
.rv-form { display: grid; gap: 0.9rem; margin-top: 1rem; }

.rv-stars { border: none; display: flex; flex-direction: row-reverse; justify-content: center; gap: 0.25rem; }
.rv-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rv-stars label { font-size: 2.1rem; color: var(--cream-dark); cursor: pointer; transition: color 120ms, transform 120ms; }
.rv-stars label:hover, .rv-stars label:hover ~ label,
.rv-stars input:checked ~ label { color: var(--star); }
.rv-stars label:hover { transform: scale(1.15); }
.rv-stars input:focus-visible + label { outline: 3px solid var(--green); border-radius: 6px; }

.rv-thanks {
  margin-top: 1.5rem; background: #eafbe0; border: 2px solid var(--green);
  border-radius: var(--radius); padding: 1rem 1.2rem; font-size: 0.95rem; text-align: left;
}
.rv-legal { font-size: 0.8rem; color: var(--text-muted-light); text-align: center; }
.rv-legal a { color: var(--text-muted-light); }

/* --- responsive --------------------------------------------------------------- */

@media (max-width: 820px) {
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .field-grid, .connect-grid { grid-template-columns: 1fr; }
  .app-client-name { display: none; }
  .gbp-search { flex-direction: column; }
  .job-row { flex-direction: column; align-items: stretch; }
  .job-actions { justify-content: stretch; }
  .job-actions form { flex: 1; }
  .job-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .tick-path { stroke-dashoffset: 0; }
}

/* --- professional shell polish ---------------------------------------------- */
.app-nav a { display: inline-flex; align-items: center; gap: 0.45rem; }
.nav-ic { display: inline-flex; width: 1.05em; height: 1.05em; }
.nav-ic svg { width: 100%; height: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; }
.page-sub { color: var(--text-muted-light); margin: 0.35rem 0 1.25rem; max-width: 60ch; }
.page-head .page-title { margin: 0; }
.page-head .page-sub { margin-bottom: 0; }

/* --- integrations ------------------------------------------------------------ */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; }
.int-card {
  background: #fff; border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink); padding: 1.1rem 1.15rem;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  gap: 0.6rem 0.9rem; align-items: start;
}
.int-logo {
  width: 52px; height: 52px; border: 1.5px solid var(--cream-dark); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; background: #fff;
}
.int-logo img { max-width: 38px; max-height: 30px; }
.int-logo-csv { font-weight: 900; font-size: 0.8rem; letter-spacing: 0.05em; background: var(--cream); }
.int-body strong { display: block; margin-bottom: 0.15rem; }
.int-body p { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--text-muted-light); line-height: 1.45; }
.int-status {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.03em;
  padding: 0.15rem 0.55rem; border-radius: 999px; border: 1.5px solid var(--ink);
}
.int-on  { background: var(--lime); color: var(--ink); }
.int-off { background: var(--cream-dark); color: var(--text-muted-light); border-color: var(--cream-dark); }
.int-err { background: #ffdada; color: #8a1f1f; border-color: #8a1f1f; }
.int-action { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* --- setup checklist --------------------------------------------------------- */
.setup-panel { border-width: 3px; }
.setup-count {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em;
  background: var(--cream); border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 0.15rem 0.7rem;
}
.setup-steps { list-style: none; display: grid; gap: 0.85rem; }
.setup-steps li { display: flex; align-items: center; gap: 0.85rem; }
.setup-tick { width: 26px; height: 26px; flex: none; }
.setup-tick svg { width: 100%; height: 100%; display: block; }
.setup-steps li.done .setup-body { opacity: 0.55; }
.setup-steps li.done .setup-body strong { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.setup-body { flex: 1; line-height: 1.4; }
.setup-steps .btn { flex: none; }
.empty-state .btn { margin-top: 1rem; }

.auth-trust {
  list-style: none; display: flex; gap: 1.4rem; justify-content: center;
  margin-top: 1.2rem; padding: 0; flex-wrap: wrap;
}
.auth-trust li {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted-light);
  padding-left: 1.25rem; position: relative;
}
.auth-trust li::before {
  content: ""; position: absolute; left: 0; top: 0.28em; width: 0.75em; height: 0.4em;
  border-left: 2.5px solid var(--green); border-bottom: 2.5px solid var(--green); transform: rotate(-48deg);
}

.setup-help { font-size: 0.85rem; white-space: nowrap; }
.data-table tbody tr { transition: background var(--fast) var(--ease); }
.data-table tbody tr:hover { background: var(--cream); }

/* --- import attestation and preview ------------------------------------------ */
.attest {
  display: flex; gap: 0.7rem; align-items: flex-start; margin-top: 1rem;
  background: var(--cream); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 0.85rem 1rem; cursor: pointer; line-height: 1.45;
}
.attest input { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--green); flex: none; }
.preview-chips { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.preview-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* --- rank map ---------------------------------------------------------------- */
.rm-controls { display: flex; gap: 0.9rem; align-items: end; flex-wrap: wrap; margin-bottom: 0.4rem; }
.rm-controls label { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.85rem; }
.rm-controls input, .rm-controls select {
  font: 400 1rem var(--font-body); padding: 0.55rem 0.8rem; border: 2px solid var(--ink);
  border-radius: 10px; background: var(--white); min-width: 0;
}
.rm-controls input { width: 260px; max-width: 100%; }
.rm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.1rem 0 1.25rem; }
.rm-of { font-size: 1.1rem; opacity: 0.6; }
.rank-map { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; border-radius: 14px; border: 2px solid var(--ink); }
.rm-bg { fill: #f4efe6; }
.rm-road { stroke: #e3dccd; stroke-width: 5; stroke-linecap: round; }
.rm-road-a { stroke: #dcd4c2; stroke-width: 9; }
.rm-park { fill: #e3eeda; }
.rm-ring { fill: none; stroke: #9aa3b5; stroke-width: 1.4; stroke-dasharray: 5 6; opacity: 0.85; }
.rm-ring-label { font: 700 12px var(--font-body); fill: #5a6478; }
.rm-you { fill: var(--navy); stroke: #fff; stroke-width: 2.5; }
.rm-you-label { font: 800 12px var(--font-body); fill: var(--navy); letter-spacing: 0.02em; }
.rm-pin-num { font: 800 13px var(--font-body); }
.rm-pin-sm { font-size: 10px; }
.rm-pin-pending { fill: #fff; stroke: #c9cfdb; stroke-width: 2; stroke-dasharray: 4 4; }
.rm-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; font-size: 0.85rem; font-weight: 600; }
.rm-legend i { display: inline-block; width: 0.85em; height: 0.85em; border-radius: 50%; border: 1.5px solid var(--ink); margin-right: 0.35em; vertical-align: -0.08em; }
.rm-empty { padding: 3rem 2rem; }
.rm-upsell { margin-bottom: 1.25rem; }
.rm-locked .rank-map { opacity: 0.96; }

/* --- live map (Leaflet + OpenStreetMap) -------------------------------------- */
.rm-live {
  position: relative; isolation: isolate; z-index: 0;
  width: 100%; height: min(460px, 68vh);
  border-radius: 14px; border: 2px solid var(--ink); overflow: hidden;
  background: #e8ecef;
}
.rm-live .leaflet-control-attribution { font-size: 10px; }
/* Custom pins: same colour language as the legend. */
.rm-mk-wrap { background: none; border: 0; }
.rm-mk {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--ink); font: 800 13px/1 var(--font-body);
  box-shadow: 0 1px 3px rgba(7, 18, 40, 0.35);
}
.rm-mk-sm { font-size: 10px; }
.rm-mk-pending {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px dashed #c9cfdb;
}
.rm-mk-you {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--navy); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--navy), 0 2px 6px rgba(7, 18, 40, 0.5);
}
/* Locked teaser: real area map, dimmed, with a lock pill over the top. */
.rm-lockwrap { position: relative; }
.rm-lockveil {
  position: absolute; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 18, 40, 0.30); backdrop-filter: blur(2px);
  border-radius: 14px; pointer-events: none;
}
.rm-lock-pill {
  background: var(--navy); color: #fff; font-weight: 700; font-size: 0.9rem;
  padding: 0.6rem 1rem; border-radius: 999px; border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.rm-empty-illus { padding: 2.5rem 2rem; text-align: center; }

/* --- mobile app shell: bottom tab bar ---------------------------------------- */
@media (max-width: 820px) {
  .app-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--navy); border-top: 2px solid var(--ink);
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    max-width: none; overflow: visible;
  }
  .app-nav a {
    display: grid; justify-items: center; gap: 0.15rem;
    padding: 0.3rem 0.2rem; border-radius: 10px; font-size: 0.62rem; letter-spacing: 0.01em;
  }
  .app-nav a .nav-ic { width: 22px; height: 22px; }
  .app-nav a.active { background: transparent; color: var(--lime); }
  .app-nav a.nav-desktop { display: none; }
  .app-main { padding-bottom: 6rem; }
  .rm-stats { grid-template-columns: 1fr; }
}
.nav-ic { display: inline-block; width: 18px; height: 18px; vertical-align: -0.22em; margin-right: 0.4rem; }
.nav-ic svg { width: 100%; height: 100%; display: block; }
@media (min-width: 821px) {
  .app-nav a { display: inline-flex; align-items: center; }
  .app-nav a .nav-ic { margin-right: 0.4rem; }
}

.aff-link-row { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.aff-link {
  background: var(--cream); border: 2px solid var(--ink); border-radius: 10px;
  padding: 0.6rem 0.9rem; font-size: 0.95rem; word-break: break-all;
}

.danger-zone { border-color: #e5484d; }
.danger-zone .panel-title { color: #b3261e; }
.btn-danger { background: #e5484d; color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.btn-danger:hover { background: #d63c41; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

.inline-adjust { display: inline-flex; gap: 0.35rem; align-items: center; margin-top: 0.35rem; }
.inline-adjust input {
  width: 4.2rem; padding: 0.25rem 0.4rem; border: 2px solid var(--ink); border-radius: 8px;
  font: 600 0.9rem var(--font-body);
}
.agency-actions { display: grid; gap: 0.4rem; }

/* --- connect trust interstitial --------------------------------------------- */
.connect-intro { max-width: 44rem; }
.trust-list { list-style: none; display: grid; gap: 1rem; margin: 0 0 1.5rem; }
.trust-list li { padding-left: 2rem; position: relative; line-height: 1.5; }
.trust-list li::before {
  content: ""; position: absolute; left: 0; top: 0.15em; width: 1.15em; height: 1.15em;
  background: var(--lime); border: 2px solid var(--ink); border-radius: 50%;
}
.trust-list li::after {
  content: ""; position: absolute; left: 0.33em; top: 0.42em; width: 0.55em; height: 0.3em;
  border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(-48deg);
}
.connect-intro-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.bridge-banner { background: #eef4ff; color: var(--ink); border-color: var(--ink); }

.track-banner { background: var(--white); color: var(--ink); }
.track-banner strong { color: var(--navy); }
.track-warn { background: #fff7e6; border-color: var(--ink); }
