/* Spark — mobile-first swipe UI */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1d4ed8;
  --primary2: #3b82f6;
  --danger: #e05252;
  --green: #2e9e5b;
  --bg: #f3f6fa;
  --text: #1f2937;
  --radius: 16px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  z-index: 20;
}
.logo {
  font-size: 1.3rem;
  background: linear-gradient(45deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.icon-btn { font-size: 1.4rem; text-decoration: none; padding: 4px 8px; }

/* ---- Main nav ---- */
.nav-logo {
  font-size: 1.15rem; font-weight: 800; text-decoration: none;
  background: linear-gradient(45deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto;
  min-width: 0;
}
.nav a {
  text-decoration: none; color: #4b5768;
  font-size: .85rem; font-weight: 600;
  padding: 7px 9px; border-radius: 8px;
  white-space: nowrap;
}
.nav a:hover { background: #f0f4fa; }
.nav a.active { background: #eaf1fd; color: var(--primary); }

/* ---- Hamburger menu ---- */
.hamburger-menu {
  position: relative;
  flex: 0 0 auto;
  z-index: 35;
}
.hamburger-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d6dfec;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hamburger-button::-webkit-details-marker { display: none; }
.hamburger-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.hamburger-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #4b5768;
}
.hamburger-menu[open] .hamburger-button {
  border-color: var(--primary2);
  background: #eaf1fd;
}
.hamburger-menu[open] .hamburger-lines span { background: var(--primary); }
.hamburger-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
}
.hamburger-panel a,
.hamburger-policy-menu summary,
.hamburger-policy-menu button,
.hamburger-empty {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  color: #4b5768;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  text-align: left;
}
.hamburger-policy-menu summary {
  cursor: pointer;
  list-style: none;
}
.hamburger-policy-menu summary::-webkit-details-marker { display: none; }
.hamburger-policy-menu summary::after {
  content: '⌄';
  float: right;
  color: #8a94a5;
}
.hamburger-policy-menu[open] summary::after { content: '⌃'; }
.hamburger-policy-menu button {
  border: none;
  background: none;
  cursor: pointer;
}
.hamburger-policy-menu a,
.hamburger-policy-menu button {
  padding-left: 22px;
  font-weight: 600;
}
.hamburger-panel a:hover,
.hamburger-policy-menu summary:hover,
.hamburger-policy-menu button:hover { background: #f0f4fa; color: var(--primary); }
.hamburger-empty {
  color: #8a94a5;
  font-weight: 600;
}
.auth-hamburger {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
}
.auth-hamburger .hamburger-button {
  background: rgba(255,255,255,.94);
  border-color: rgba(255,255,255,.7);
}
@media (max-width: 600px) {
  .topbar { padding-left: 10px; padding-right: 10px; }
  .nav {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a span { display: none; }   /* icons only on small screens */
  .nav a { font-size: 1.15rem; padding: 6px 7px; }
  .hamburger-button { width: 36px; height: 36px; }
}

/* ---- Deck ---- */
.deck-wrap {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px;
  min-height: 0;
}
.deck {
  position: relative;
  width: 100%;
  max-width: 400px;
  flex: 1;
  min-height: 300px;
}
.card {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: transform .25s;
}
.card.dragging { transition: none; cursor: grabbing; }
.card-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
}
.card-grad {
  position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.card-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px; color: #fff;
}
.card-info h2 { font-size: 1.5rem; margin-bottom: 4px; }
.card-role {
  display: inline-block;
  background: rgba(255,255,255,.92); color: var(--primary);
  padding: 4px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 700;
  margin-bottom: 8px;
}
.card-info p { font-size: .95rem; opacity: .9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-info .card-pay {
  display: inline-block;
  margin: 4px 0;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: #1d4ed8;
  font-size: .84rem;
  font-weight: 800;
  opacity: 1;
}
.card-detail {
  display: inline-block; margin-top: 10px;
  background: rgba(255,255,255,.92); color: var(--primary);
  padding: 6px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; text-decoration: none;
}
.card-detail:active { background: #fff; }

.stamp {
  position: absolute; top: 30px;
  font-size: 2rem; font-weight: 800;
  padding: 4px 14px; border: 4px solid; border-radius: 8px;
  opacity: 0; transform: rotate(-15deg);
  pointer-events: none;
}
.stamp-like { left: 20px; color: var(--green); border-color: var(--green); }
.stamp-nope { right: 20px; color: var(--danger); border-color: var(--danger); transform: rotate(15deg); }

.deck-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; font-size: 1.1rem; color: #777;
}

/* ---- Action buttons ---- */
.actions {
  display: flex; gap: 40px; justify-content: center;
  padding: 18px 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.action-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: none; background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  font-size: 1.7rem; cursor: pointer;
  transition: transform .15s;
}
.action-btn:active { transform: scale(.88); }
.action-btn.nope { color: var(--danger); }
.action-btn.like { color: var(--green); }
.action-btn.is-disabled { opacity: .4; }

/* ---- Daily like counter (workers) ---- */
.like-counter {
  align-self: center;
  font-size: .95rem; font-weight: 700; color: var(--danger);
  background: #fff; border-radius: 999px;
  padding: 4px 14px; margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  line-height: 1.4;
}
.like-counter .lc-max { color: #a3adba; font-weight: 600; }
.like-counter.is-empty { color: #a3adba; }
.like-limit-note {
  align-self: center; text-align: center;
  background: #fff7e0; color: #8a6d1a;
  padding: 8px 14px; border-radius: 10px;
  font-size: .85rem; max-width: 420px; margin: 0 16px 8px;
}
.like-limit-note[hidden] { display: none; }

/* ---- Distance filter ---- */
.deck-filter {
  position: relative;
  align-self: center;
  margin-bottom: 10px;
  z-index: 20;
}
.distance-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--primary);
  border: none; border-radius: 999px;
  padding: 6px 14px; font-size: .9rem; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  cursor: pointer;
}
.distance-btn .distance-caret { font-size: .7rem; opacity: .7; }
.distance-panel {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 260px; max-width: 86vw;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  padding: 16px; text-align: center;
}
.distance-panel[hidden] { display: none; }
.distance-panel-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #9ca3af; margin-bottom: 10px;
}
.distance-options { display: flex; flex-direction: column; gap: 8px; }
.distance-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left;
  background: #f3f6fa; border: 2px solid transparent; border-radius: 12px;
  padding: 10px 14px; cursor: pointer;
}
.distance-opt:hover { background: #eaf1fd; }
.distance-opt.is-selected { border-color: var(--primary); background: #eaf1fd; }
.distance-opt-title { font-size: .98rem; font-weight: 700; color: var(--text); }
.distance-opt-sub { font-size: .8rem; color: #6b7280; }
.distance-opt.is-selected .distance-opt-title { color: var(--primary); }
.card-dist {
  font-size: .9rem !important; font-weight: 600;
  opacity: 1 !important; margin-top: 2px;
  -webkit-line-clamp: 1 !important;
}

/* ---- Profile detail page (view.php) ---- */
.vp-cover {
  width: 100%; height: 280px; border-radius: var(--radius);
  background-size: cover; background-position: center top; background-color: #eee;
}
.vp-head { padding: 14px 2px; }
.vp-name { margin: 6px 0 2px; }
.vp-city { color: #777; font-size: .9rem; }
.vp-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.vp-gallery img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: #eee; }
.vp-section {
  background: #fff; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.vp-section h3 { font-size: 1rem; margin-bottom: 6px; }
.vp-section p { line-height: 1.5; color: #374151; }
.vp-contact-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid #f0f0f0; color: #374151;
}
.vp-contact-row:last-of-type { border-bottom: none; }
.vp-hidden { color: #aaa; filter: blur(4px); user-select: none; -webkit-user-select: none; }
.vp-note { font-size: .8rem; color: #999; margin-top: 8px; }
.vp-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #f0c2c2;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--danger);
  font-size: .88rem;
  font-weight: 800;
  text-decoration: none;
}
.report-link:active { background: #ffe8ea; }

/* ---- Match overlay ---- */
.match-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.match-overlay[hidden] { display: none; }
.match-box {
  background: #fff; border-radius: var(--radius);
  padding: 28px 24px; text-align: center;
  width: 100%; max-width: 340px;
  animation: pop .3s ease-out;
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.match-box h2 { color: var(--primary); margin-bottom: 16px; }
.match-box img {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 4px solid var(--primary);
  margin-bottom: 12px;
}
.match-box p { margin-bottom: 20px; }
.match-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---- Auth pages ---- */
.auth-body {
  align-items: center; justify-content: flex-start;
  min-height: 100%;
  min-height: 100dvh;
  height: auto;
  overflow-y: auto;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  padding: calc(82px + env(safe-area-inset-top)) 20px 20px;
}
.auth-card {
  background: #fff; border-radius: var(--radius);
  padding: 28px 24px; width: 100%; max-width: 400px;
  margin: 0 0 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.auth-card .logo { display: block; text-align: center; margin-bottom: 8px; font-size: 1.8rem; }
.tagline {
  text-align: center; color: #4b5768;
  font-size: .95rem; line-height: 1.45;
  margin-bottom: 18px;
}
.tagline strong { color: var(--primary); }
.auth-card h2 { text-align: center; margin-bottom: 18px; font-weight: 600; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid #ddd; border-radius: 10px;
  font-size: 1rem; font-family: inherit;
  background: #fafafa;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
}
.worker-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
}
.worker-location-row strong,
.worker-location-row span { display: block; }
.worker-location-row strong { font-size: .9rem; }
.worker-location-row span { margin-top: 3px; color: #6b7280; font-size: .78rem; }
.btn-location {
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid #c7d8f2;
  border-radius: 8px;
  color: var(--primary);
  background: #f3f7fd;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}
.location-card { text-align: center; }
.location-mark {
  width: 64px;
  height: 64px;
  margin: 10px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf1fd;
  color: var(--primary);
  font-size: 2rem;
}
.location-copy {
  margin: -6px 0 16px;
  color: #5c6675;
  font-size: .94rem;
  line-height: 1.45;
}
.location-status {
  min-height: 44px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef7f1;
  color: #277448;
  font-size: .9rem;
  line-height: 1.4;
}
.location-status.is-error { background: #ffe8ea; color: #b7352b; }
.location-actions { display: flex; flex-direction: column; gap: 10px; }
.location-actions [hidden] { display: none; }
.btn-secondary {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #c7d8f2;
  border-radius: 8px;
  color: var(--primary);
  background: #f3f7fd;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.location-no-last {
  padding: 10px 12px;
  color: #7b8491;
  background: #f4f5f7;
  border-radius: 8px;
  font-size: .85rem;
}
.field-note {
  margin-top: -4px;
  color: #7b8491;
  font-size: .82rem;
  line-height: 1.35;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fbfcfe;
}
.form-section h3 {
  color: #4b5768;
  font-size: .86rem;
  font-weight: 800;
}
.pay-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pay-range-fields select,
.pay-range-fields input {
  width: 100%;
}
.pay-display {
  color: var(--primary);
  font-weight: 800;
}
@media (max-width: 420px) {
  .pay-range-fields { grid-template-columns: 1fr; }
}
.location-logout { display: block; margin: 8px auto 0; text-decoration: none; }
.role-toggle { display: flex; gap: 10px; }
.role-toggle label { flex: 1; min-width: 0; }
.role-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.role-toggle span {
  display: block; text-align: center;
  padding: 12px 8px; font-weight: 600; font-size: .95rem;
  border: 2px solid #d6dfec; border-radius: 10px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.role-toggle input:checked + span {
  border-color: var(--primary); color: var(--primary);
  background: #eaf1fd;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.file-label { font-size: .9rem; color: #555; display: flex; flex-direction: column; gap: 6px; }
.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #4b5768;
  font-size: .86rem;
  line-height: 1.35;
}
.legal-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--primary);
}
.legal-check a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  display: block; width: 100%; text-align: center;
  background: linear-gradient(45deg, var(--primary), var(--primary2));
  color: #fff; border: none; border-radius: 24px;
  padding: 13px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn-primary:active { opacity: .85; }
.btn-danger {
  display: block; width: 100%; text-align: center;
  background: var(--danger);
  color: #fff; border: none; border-radius: 24px;
  padding: 13px; font-size: 1rem; font-weight: 800;
  cursor: pointer; text-decoration: none;
}
.btn-danger:active { opacity: .85; }
.btn-ghost {
  background: none; border: none; color: #777;
  padding: 10px; font-size: 1rem; cursor: pointer;
}
.error {
  background: #ffe8ea; color: #c0392b;
  padding: 10px 14px; border-radius: 10px;
  margin-bottom: 14px; font-size: .95rem;
}
.success {
  background: #e8f9ef; color: #1e8449;
  padding: 10px 14px; border-radius: 10px;
  margin-bottom: 14px; font-size: .95rem;
}
.auth-switch { text-align: center; margin-top: 16px; font-size: .95rem; }
.auth-switch a { color: var(--primary); font-weight: 600; }

/* ---- Simple pages (profile, matches) ---- */
.page {
  flex: 1; width: 100%; max-width: 500px;
  margin: 0 auto; padding: 16px;
  overflow-y: auto;
}
.page h2 { margin-bottom: 16px; }
.page-title-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-link {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #c7d8f2;
  border-radius: 50%;
  color: var(--primary);
  background: #f3f7fd;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}
.info-link:active { background: #eaf1fd; }
.danger-zone {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #f0c2c2;
  border-radius: 8px;
  background: #fff5f5;
}
.danger-zone h3 {
  margin-bottom: 8px;
  color: #a83232;
  font-size: 1rem;
}
.danger-zone p {
  margin-bottom: 12px;
  color: #7a3b3b;
  font-size: .92rem;
  line-height: 1.45;
}
.profile-photo-preview {
  width: 110px; height: 110px; border-radius: 50%;
  object-fit: cover; display: block; margin: 0 auto 14px;
  border: 3px solid var(--primary);
  background: #eee;
}
.match-item {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.match-item img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  background: #eee;
}
.match-item .mi-text { flex: 1; min-width: 0; }
.match-item .mi-name { font-weight: 700; }
.match-item .mi-bio { font-size: .85rem; color: #777; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.match-item form { margin: 0; }
.unmatch-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid #f0c2c2; background: #fff5f5; color: var(--danger);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.unmatch-btn:active { background: #ffe8ea; }

/* Hidden identity on the "Likes you" list — the real values are never sent. */
.blurred {
  filter: blur(5px);
  user-select: none; -webkit-user-select: none; pointer-events: none;
}
.mi-locked { font-size: .8rem; color: #999; }
.mi-contact { font-size: .82rem; color: var(--primary); margin-top: 2px; }
.mi-contact a { color: var(--primary); }
.likeback-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  background: linear-gradient(45deg, var(--primary), var(--primary2)); color: #fff;
  border-radius: 999px; padding: 9px 14px;
  font-size: .85rem; font-weight: 700; white-space: nowrap;
}
.likeback-btn:active { opacity: .85; }
.likeback-btn:disabled { opacity: .45; cursor: not-allowed; }
.mi-detail { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.mi-detail:active { text-decoration: underline; }
.mi-report {
  display: inline-block;
  margin-top: 4px;
  margin-left: 8px;
  color: var(--danger);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.mi-report:active { text-decoration: underline; }
.empty-note { text-align: center; color: #888; padding: 40px 0; }

/* ---- Legal pages ---- */
.legal-kicker {
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  text-align: center;
}
.legal h2 {
  margin-bottom: 4px;
  text-align: center;
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 1.05;
}
.legal h3 { margin: 20px 0 7px; font-size: 1.05rem; }
.legal p,
.legal li,
.legal dd,
.legal td,
.legal th {
  line-height: 1.55;
  color: #374151;
}
.legal a { color: var(--primary); font-weight: 700; text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal ul {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-left: 20px;
  margin: 8px 0 0;
}
.legal-section {
  padding-top: 2px;
  margin-top: 10px;
  border-top: 1px solid #e6ebf2;
}
.legal-section:first-of-type { border-top: 0; }
.tutorial-page .legal-section {
  padding: 14px;
  margin-top: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fff;
}
.tutorial-page .legal-section:first-of-type { border-top: 1px solid #e6ebf2; }
.tutorial-step h3 {
  margin-top: 0;
  color: var(--primary);
}
.tutorial-shot {
  margin: 10px 0 14px;
}
.tutorial-shot img {
  display: block;
  width: 100%;
  border: 1px solid #d9e4f3;
  border-radius: 8px;
  background: #f3f6fa;
}
.tutorial-shot figcaption {
  margin-top: 6px;
  color: #6b7280;
  font-size: .84rem;
  font-weight: 700;
  text-align: center;
}
.legal-section.is-accordion-section {
  padding-top: 0;
  margin-top: 14px;
  border-top: 0;
}
.legal-section.is-accordion-section:first-of-type { margin-top: 24px; }
.legal-lead {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}
.legal-updated {
  color: #6b7280;
  font-size: .84rem;
  font-weight: 700;
  text-align: center;
}
.legal-note {
  background: #fff7e0; color: #8a6d1a;
  padding: 10px 14px; border-radius: 10px;
  font-size: .9rem; margin-bottom: 10px;
}
.legal-stance {
  padding: 12px 14px 14px;
  border: 1px solid #c7d8f2;
  border-radius: 8px;
  background: #f3f7fd;
}
.legal-accordion-page {
  max-width: 980px;
}
.legal-accordion {
  overflow: hidden;
  border: 1px solid #d9e4f3;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.legal-accordion.legal-stance {
  padding: 0;
  background: #fff;
}
.legal-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 20px 22px;
  color: #1f2937;
  font-size: clamp(1.05rem, 2.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1.18;
  cursor: pointer;
  list-style: none;
}
.legal-accordion-summary::-webkit-details-marker { display: none; }
.legal-accordion-summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 1.2rem;
  line-height: 1;
  transition: transform .18s ease;
}
.legal-accordion[open] .legal-accordion-summary::after {
  transform: rotate(180deg);
}
.legal-accordion-body {
  padding: 0 22px 22px;
}
.legal-accordion-body > *:first-child { margin-top: 0; }
.legal-accordion-body p + p { margin-top: 12px; }
.legal-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  font-size: .88rem;
}
.legal-table th,
.legal-table td {
  padding: 10px;
  border: 1px solid #e6ebf2;
  text-align: left;
  vertical-align: top;
}
.legal-table th {
  background: #f8fafc;
  color: #1f2937;
  font-weight: 800;
}
.legal-details {
  display: grid;
  grid-template-columns: minmax(120px, .55fr) 1fr;
  gap: 8px 14px;
  margin-top: 10px;
}
.legal-details dt {
  color: #6b7280;
  font-weight: 800;
}
.legal-details dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-context {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #c7d8f2;
  border-radius: 8px;
  background: #f3f7fd;
}
.report-context strong {
  color: var(--primary);
  font-size: .9rem;
}
.report-context span {
  color: #4b5768;
  font-size: .9rem;
}
.report-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 14px;
}
.report-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #4b5768;
  font-size: .88rem;
  font-weight: 800;
}
.report-form .legal-check {
  flex-direction: row;
  font-weight: 600;
}
.link-danger { color: var(--danger); text-decoration: none; font-size: .95rem; }

.card-sub {
  font-size: .9rem; font-weight: 600;
  opacity: .95; margin-bottom: 4px;
}

/* ---- Type-specific field groups on profile forms ---- */
.type-fields { display: flex; flex-direction: column; gap: 12px; }
.type-fields[hidden] { display: none; }

/* ---- Photo carousel dots on swipe cards ---- */
.card-dots {
  position: absolute; top: 10px; left: 12px; right: 12px;
  display: flex; gap: 5px; z-index: 3;
}
.card-dots span {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.45); box-shadow: 0 0 2px rgba(0,0,0,.3);
}
.card-dots span.on { background: #fff; }

/* Prev/next photo arrows — only rendered when a card has 2+ photos */
.pic-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(0,0,0,.35); color: #fff;
  font-size: 1.5rem; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 0 3px;
}
.pic-btn:active { background: rgba(0,0,0,.55); }
.pic-prev { left: 10px; }
.pic-next { right: 10px; }

/* ---- Photo management on the profile page ---- */
.photo-manage-label { font-size: .9rem; color: #555; font-weight: 600; }
.photo-manage { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { display: flex; flex-direction: column; gap: 4px; width: 92px; cursor: pointer; }
.photo-thumb img {
  width: 92px; height: 92px; object-fit: cover;
  border-radius: 10px; background: #eee; display: block;
}
.photo-remove-form { margin: 0; }
.photo-remove-btn {
  display: block; width: 100%; box-sizing: border-box;
  border: 1px solid #f0c2c2; background: #fff5f5; color: var(--danger);
  border-radius: 8px; padding: 5px 6px;
  font-size: .75rem; font-weight: 600; cursor: pointer;
}
.photo-remove-btn:active { background: #ffe8ea; }
.photo-remove-btn.is-blank {
  visibility: hidden; pointer-events: none;   /* keeps the last photo aligned */
}

/* ---- Active-profile chip in the nav ---- */
.nav a.nav-switch {
  background: #eaf1fd; color: var(--primary);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis;
}
.nav a.nav-switch:hover { background: #dbe8fc; }

/* ---- Profile chooser ---- */
.profile-pick {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  border: 2px solid transparent;
  text-decoration: none; color: inherit;
  transition: border-color .15s, transform .1s;
}
.profile-pick:hover { border-color: var(--primary2); }
.profile-pick:active { transform: scale(.99); }
.profile-pick.is-active { border-color: var(--primary); background: #f6f9ff; }
.profile-pick img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  background: #eee; flex-shrink: 0;
}
.profile-pick .pp-body { flex: 1; min-width: 0; }
.pp-type { font-size: .75rem; font-weight: 700; color: var(--primary); }
.pp-name { font-weight: 700; }
.pp-sub {
  font-size: .85rem; color: #777;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-active-badge {
  font-size: .7rem; font-weight: 700; color: var(--green);
  background: #e8f9ef; padding: 3px 8px; border-radius: 999px;
  flex-shrink: 0;
}
.pp-create { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* ---- Footer ---- */
.auth-body {
  padding-bottom: calc(52px + env(safe-area-inset-bottom));
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  color: #8a94a5;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
}
.footer-policy-menu { position: relative; }
.footer-policy-menu summary {
  color: inherit;
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-policy-menu summary::-webkit-details-marker { display: none; }
.footer-policy-menu summary::after {
  content: '⌄';
  margin-left: 5px;
}
.footer-policy-menu[open] summary::after { content: '⌃'; }
.footer-policy-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(260px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
  z-index: 40;
}
.footer-link,
.footer-cookie-link {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  color: #4b5768;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.footer-link:hover,
.footer-cookie-link:hover {
  background: #f0f4fa;
  color: var(--primary);
}
.auth-body .site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  color: rgba(255,255,255,.74);
  text-shadow: 0 1px 2px rgba(0,0,0,.16);
}

/* ---- Cookie consent ---- */
.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 12px;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: rgba(17,24,39,.42);
}
.cookie-consent[hidden] { display: none; }
.cookie-panel {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: 15px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
}
.cookie-kicker {
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.cookie-panel h2 {
  font-size: 1.08rem;
  margin-bottom: 6px;
}
.cookie-panel p {
  color: #4b5768;
  font-size: .9rem;
  line-height: 1.45;
}
.cookie-terms-link {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #c7d8f2;
  border-radius: 8px;
  background: #f3f7fd;
  color: var(--primary);
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cookie-terms-link:active { background: #eaf1fd; }
.cookie-doc-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.cookie-doc-links .cookie-terms-link { margin-top: 10px; }
.cookie-doc-links .cookie-terms-link + .cookie-terms-link { margin-top: 0; }
.cookie-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 9px 0;
  border-top: 1px solid #e6ebf2;
  color: inherit;
}
.cookie-choice strong {
  display: block;
  font-size: .95rem;
}
.cookie-choice span {
  display: block;
  color: #6b7280;
  font-size: .8rem;
  line-height: 1.35;
}
.cookie-choice input {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.cookie-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}
.cookie-actions .btn-ghost,
.cookie-actions .btn-secondary,
.cookie-actions .btn-primary {
  border-radius: 8px;
  padding: 11px 10px;
  font-size: .92rem;
  cursor: pointer;
}
.cookie-actions .btn-ghost {
  background: #fff;
  border: 1px solid #d6dfec;
  color: #4b5768;
}

@media (min-width: 560px) {
  .cookie-consent {
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top));
  }
  .cookie-panel { padding: 20px; }
  .cookie-actions { grid-template-columns: 1fr 1fr 1.2fr; }
  .cookie-doc-links { grid-template-columns: 1fr 1fr; }
  .legal-table { font-size: .92rem; }
}

/* ---- Larger screens ---- */
@media (min-width: 768px) {
  .deck { max-width: 420px; }
  .card-info h2 { font-size: 1.7rem; }
}
