:root {
  --bg: #ffffff;
  --bg-gradient: radial-gradient(120% 80% at 50% 0%, #f3effe 0%, #ffffff 60%);
  --surface: #ffffff;
  --surface-2: #faf9ff;
  --ink: #1e1b3a;
  --ink-2: #3b3760;
  --muted: #6b7280;
  --border: #ece9f5;
  --border-strong: #d4cfe5;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f5f3ff;
  --accent-ink: #5b21b6;
  --secondary: #6366f1;
  --missing: #7c3aed;
  --missing-bg: #f5f3ff;
  --found: #6366f1;
  --found-bg: #eef2ff;
  --success-bg: #e8f6ec;
  --success-ink: #166534;
  --danger-bg: #fdecec;
  --danger-ink: #b91c1c;
  --warn-bg: #fff4e0;
  --warn-ink: #8a5a00;
  --shadow-sm: 0 1px 2px rgba(17, 12, 46, 0.04), 0 1px 3px rgba(17, 12, 46, 0.06);
  --shadow-md: 0 4px 12px rgba(17, 12, 46, 0.08), 0 2px 4px rgba(17, 12, 46, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(17, 12, 46, 0.18), 0 6px 12px rgba(17, 12, 46, 0.06);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --focus-ring: 0 0 0 3px rgba(124, 58, 237, 0.22);
  --font-display: ui-rounded, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Hebrew", "Noto Sans Arabic", sans-serif;
}

html { color-scheme: light; }
* { box-sizing: border-box; }

/* Enforce the HTML5 hidden attribute against author display rules.
 * Otherwise selectors like .account-btn { display: inline-flex } override
 * the user-agent [hidden] { display: none } and elements stay visible. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; min-height: 100dvh; }

/* Guard against any descendant (dynamic list content, GIS-injected iframes,
 * long unbreakable text in RTL) forcing a horizontal scroll. `clip` is
 * preferred over `hidden` so it doesn't establish a scroll container that
 * would break the sticky tab bar. */
html, body { overflow-x: clip; }
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

.top-bar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 20px 0;
  max-width: 720px;
  margin: 0 auto;
  /* Logo on the physical right; controls on the physical left — all languages. */
  direction: ltr;
}

.top-bar-start {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}

.top-bar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}

.top-bar-controls > * {
  flex: 0 0 auto;
}

.brand {
  flex: 0 0 auto;
  margin-inline-start: 12px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand-btn {
  background: transparent;
  border: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 10px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.brand-btn:hover,
.brand-btn:focus,
.brand-btn:visited {
  text-decoration: none;
}
.brand-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-btn:hover .brand-mark { transform: scale(1.04); }
.brand-btn .brand-mark { transition: transform 0.15s ease; }

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px -1px rgba(124, 58, 237, 0.4), 0 1px 2px rgba(17, 12, 46, 0.06);
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 55%);
  pointer-events: none;
}
.brand-mark svg { width: 20px; height: 20px; position: relative; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15)); }

/* Container for Google's rendered Sign-In button. The button itself is an
   iframe with its own styling; we just align it to match the other
   top-bar action heights. */
.gis-signin {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.gis-signin iframe { color-scheme: light; }

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s, background 0.15s ease;
}
.account-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.account-btn:active { transform: scale(0.95); }
.account-btn .g-logo { width: 13px; height: 13px; }

/* Translated labels inside the locked LTR header still read RTL in he/ar. */
[dir="rtl"] .top-bar .account-btn {
  direction: rtl;
}

.close-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--success-bg);
  border: 1px solid color-mix(in srgb, var(--success-ink) 18%, transparent);
  color: var(--success-ink);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s;
  max-width: 100%;
}
.close-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.close-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.close-btn:hover { background: color-mix(in srgb, var(--success-ink) 14%, white); }
.close-btn:active { transform: scale(0.97); }

.report-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 14px; height: 14px; }
/* Pill variant: icon + short label. Used for the most common actions
   (share, flag) so the purpose is obvious without hovering for a tooltip. */
.icon-btn--labeled {
  width: auto;
  padding: 0 12px 0 10px;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}
.icon-btn--labeled span { white-space: nowrap; }

.delete-btn { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger-ink) 22%, transparent); }
.delete-btn:hover { background: var(--danger-bg); border-color: var(--danger-ink); color: var(--danger-ink); }
.flag-btn.done { color: var(--success-ink); border-color: color-mix(in srgb, var(--success-ink) 30%, transparent); background: var(--success-bg); }
.flag-btn.done:hover { background: var(--success-bg); color: var(--success-ink); }
.flag-btn:disabled { opacity: 0.5; cursor: default; }

/* === Pager (10 reports per page) ======================================= */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.pager-btn {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-status { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* === Admin /stats.html dashboard ====================================== */
.stats-page {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
}
.stats-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.stats-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}
.stats-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.stats-updated {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stats-refresh {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.stats-refresh:hover { border-color: var(--accent); color: var(--accent-ink); }

.stats-empty {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.stats-empty h2 { margin: 0 0 8px; font-size: 16px; }
.stats-empty p { margin: 0; color: var(--muted); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.kpi-value {
  font-size: 27px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-sub {
  font-size: 11px;
  color: var(--muted);
  min-height: 1em;
}

.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.stats-card h2 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.stats-hint {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--muted);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

/* Quotas — usage gauges against Supabase free-tier ceilings. */
.quotas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.quota {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quota-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.quota-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.quota-sub {
  font-size: 11px;
  color: var(--muted);
}
.quota-bar {
  position: relative;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}
.quota-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.quota-bar-fill[data-level="warn"] { background: var(--warn-ink); }
.quota-bar-fill[data-level="danger"] { background: var(--danger-ink); }
.stats-table th,
.stats-table td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.stats-table th {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2);
}
.stats-table td {
  font-size: 13px;
  color: var(--ink);
}
.stats-table td:first-child { font-weight: 600; }
.stats-table tr:last-child td { border-bottom: 0; }
.stats-table tbody tr:hover { background: var(--surface-2); }

.stats-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stats-feed-item {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.stats-feed-item:last-child { border-bottom: 0; }
.stats-feed-time {
  grid-row: 1;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stats-feed-primary {
  grid-row: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.stats-feed-secondary {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-word;
}
.stats-feed-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.signin-nudge {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--accent-ink);
  font-weight: 500;
}
.signin-nudge-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 600;
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s;
  white-space: nowrap;
}
.signin-nudge-btn:hover { background: var(--accent-hover); }
.signin-nudge-btn:active { transform: scale(0.96); }

.site-footer {
  max-width: 720px;
  margin: 32px auto max(20px, env(safe-area-inset-bottom));
  padding: 16px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.site-footer p { margin: 0; }
.site-footer a {
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover { text-decoration: underline; }

.card.legal {
  max-width: 720px;
  margin: 20px auto;
  padding: 28px 28px 24px;
  line-height: 1.6;
}
.card.legal h1 { margin-top: 0; font-size: 21px; }
.card.legal h2 { margin-top: 1.4em; font-size: 14px; color: var(--ink); }
.card.legal ul { padding-inline-start: 20px; }
.card.legal li { margin-bottom: 6px; }
.card.legal .legal-updated { color: var(--muted); font-size: 12px; margin-top: -8px; }
.card.legal .legal-back { margin-top: 28px; }
.card.legal a { color: var(--accent-ink); }

.faq-page .faq-lead {
  color: var(--muted);
  font-size: 13px;
  margin-top: -4px;
  margin-bottom: 16px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0 0 12px;
  margin-bottom: 12px;
}

.faq-item:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  list-style: none;
  padding: 4px 0;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--accent);
  font-weight: 700;
}

.faq-item[open] summary::before { content: "−"; }

.faq-item p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

/* Feedback form on /feedback.html */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.feedback-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.feedback-form input,
.feedback-form textarea {
  font-family: inherit;
  font-size: 13px;
}
.feedback-form button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 20px;
  cursor: pointer;
  align-self: flex-start;
}
.feedback-form button[type="submit"]:hover { background: var(--accent-hover); }
.feedback-form button[type="submit"]:disabled { opacity: 0.6; cursor: default; }
.feedback-status { min-height: 1.2em; font-size: 12px; color: var(--muted); margin: 0; }
.feedback-user { color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.feedback-signedout { margin-top: 8px; }
.feedback-signin {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
}
.feedback-signin:hover { border-color: var(--accent); color: var(--accent-ink); }
.feedback-signin:disabled { opacity: 0.6; cursor: default; }

article[data-lang] { display: none; }
html[data-active-lang="en"] article[data-lang="en"],
html[data-active-lang="he"] article[data-lang="he"],
html[data-active-lang="ar"] article[data-lang="ar"],
html[data-active-lang="ru"] article[data-lang="ru"] { display: block; }

.plang-bar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.plang {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  min-width: 30px;
}
.plang:hover { color: var(--ink); background: var(--surface-2); }
.plang[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}


.lang-menu { position: relative; }

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s, background 0.15s ease;
}
.lang-trigger:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.lang-trigger:active { transform: scale(0.95); }
.lang-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.lang-trigger .globe { width: 13px; height: 13px; opacity: 0.85; }
.lang-trigger .caret { width: 8px; height: 8px; opacity: 0.65; transition: transform 0.18s ease; }
.lang-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }

.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  list-style: none;
  margin: 0;
  z-index: 30;
  transform-origin: top left;
  animation: lang-pop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.lang-list[hidden] { display: none; }

@keyframes lang-pop {
  from { opacity: 0; transform: scale(0.94) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
}
.lang-option:hover, .lang-option:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.lang-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}
.lang-option .check {
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0;
  flex-shrink: 0;
  margin-inline-start: auto;
}
.lang-option[aria-selected="true"] .check { opacity: 1; }
.lang-option .lang-native {
  flex-shrink: 0;
}
.lang-option .lang-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}
.lang-option[aria-selected="true"] .lang-code {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-ink);
}

.hero {
  text-align: center;
  padding: 2px 20px 0;
  max-width: 640px;
  margin: 0 auto;
  direction: ltr;
}

.hero-title {
  margin: 0 auto 2px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  max-width: 34ch;
}

.tagline {
  margin: 0 auto;
  color: var(--ink-2);
  font-size: 13px;
  max-width: 34ch;
}

[dir="rtl"] .hero .tagline,
[dir="rtl"] .hero .seo-intro {
  direction: rtl;
}

.seo-intro {
  margin: 4px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 42ch;
}

.tabs {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  width: min(400px, calc(100% - 40px));
  margin: 8px auto 0;
}

.tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tab:hover { color: var(--ink-2); }
.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.tab[data-tab="missing"].active { color: var(--missing); }
.tab[data-tab="found"].active { color: var(--found); }
.tab[data-tab="report"].active { color: var(--accent-ink); }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-panel { display: none; animation: fade-up 0.25s ease both; min-width: 0; }
.tab-panel.active { display: block; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid color-mix(in srgb, var(--warn-ink) 18%, transparent);
}
.banner[hidden] { display: none; }
.banner svg { flex-shrink: 0; width: 18px; height: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card > h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.row h2 { margin: 0; }

.row--list-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
}
.row--list-head > h2 {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: calc(1.5em * 0.85);
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  margin: 0;
}
.row--list-head > .filters-collapse--header {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin: 0;
}
.row--list-head > .filters {
  grid-column: 1 / -1;
  grid-row: 2;
  display: none;
  width: 100%;
  min-width: 0;
  margin: 0;
}
/* Sibling combinator instead of :has() so older Android WebViews (Chrome
 * <105 on the Capacitor build) still reveal the filters when the details
 * toggle opens. Relies on .filters being a DOM sibling *after* the
 * <details> in .row--list-head. */
.filters-collapse--header[open] ~ .filters {
  display: flex;
}

form { display: flex; flex-direction: column; gap: 14px; margin: 0; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 380px) { .grid-2 { grid-template-columns: 1fr; } }

input, select, textarea {
  font: inherit;
  font-size: 13px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }

input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--focus-ring);
}

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 32px;
}
button {
  font: inherit;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}

button[type="submit"] {
  background: var(--accent);
  color: #fff;
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: 0.005em;
  box-shadow: 0 6px 16px -4px rgba(124, 58, 237, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
button[type="submit"]:hover { background: var(--accent-hover); }
button[type="submit"]:active { transform: translateY(1px); box-shadow: 0 3px 8px -2px rgba(124, 58, 237, 0.4); }
button[disabled] { opacity: 0.6; cursor: progress; }

.link-btn {
  background: transparent;
  color: var(--accent);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.15s;
}
.link-btn:hover { background: var(--accent-soft); }

.single-back { margin-bottom: 10px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; }
.back-btn svg { width: 14px; height: 14px; }
html[dir="rtl"] .back-btn svg { transform: scaleX(-1); }

.list-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--ink);
  font-size: 13px;
  list-style: none;
}
.list-load-error .link-btn { white-space: nowrap; }

.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
}
.cta-secondary:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); border-style: solid; }
.cta-secondary svg { width: 16px; height: 16px; }

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.segment {
  flex: 1;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 9px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.segment[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.phone-field { display: flex; flex-direction: column; gap: 6px; }
.phone-field[hidden] { display: none; }
.phone-field .hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

.tel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
}
.tel-chip:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.tel-chip:active { transform: translateY(1px); }
.tel-chip svg { width: 12px; height: 12px; }
.tel-chip .tel-num { unicode-bidi: isolate; direction: ltr; font-variant-numeric: tabular-nums; }

/* WhatsApp variant — distinct green so finders recognize it instantly. */
.wa-chip {
  background: #e8f7ec;
  border-color: color-mix(in srgb, #25d366 35%, transparent);
  color: #128c4f;
}
.wa-chip:hover {
  background: color-mix(in srgb, #25d366 18%, transparent);
  border-color: #25d366;
}

.photo-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.photo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.photo-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.photo-button:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.photo-button svg { width: 18px; height: 18px; }

.photo-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  max-width: 220px;
}
.photo-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: slide-in 0.2s ease;
}
.status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.status.error { color: var(--danger-ink); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger-ink) 25%, transparent); }
.status.error::before { background: var(--danger-ink); }
.status.success { color: var(--success-ink); background: var(--success-bg); border-color: color-mix(in srgb, var(--success-ink) 25%, transparent); }
.status.success::before { background: var(--success-ink); }
.status.loading::before {
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

.reports { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.report {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  animation: slide-in 0.25s ease both;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.report:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.report-thumb {
  width: 88px;
  height: 88px;
  border-radius: 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border-strong);
  flex-shrink: 0;
}
.report-thumb img { width: 100%; height: 100%; object-fit: cover; }
.report-thumb svg { width: 44px; height: 44px; }
.report-thumb--clickable { cursor: zoom-in; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.report-thumb--clickable:hover { transform: scale(1.04); box-shadow: var(--shadow-sm); }
.report-thumb--clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.report-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
}
.report .title,
.report .report-breed,
.report .badges,
.report .notes {
  flex: 0 0 100%;
  min-width: 0;
}

.report .title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.report .title .badge--time {
  flex: 0 0 auto;
}

.report-breed {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}

.dog-name {
  font-weight: 700;
  color: var(--accent-ink);
  white-space: nowrap;
  flex: 0 0 auto;
}
.dog-name::after {
  content: "·";
  margin-inline-start: 6px;
  color: var(--ink-muted, #888);
  font-weight: 400;
}
.type-tag svg { width: 11px; height: 11px; }
.type-tag--missing { background: var(--missing-bg); color: var(--missing); }
.type-tag--found { background: var(--found-bg); color: var(--found); }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  line-height: 1.3;
}
.badge svg { width: 12px; height: 12px; }
.badge--time { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 4px; }
.badge--collar-yes { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent-ink); }
.badge--reporter { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 4px; font-weight: 500; }

.report .notes {
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-word;
  padding: 3px 8px;
  background: var(--surface);
  border-radius: 8px;
  border-inline-start: 3px solid var(--border-strong);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.report .notes--truncated {
  cursor: pointer;
  transition: background 0.15s ease;
}

.report .notes--truncated:hover {
  background: var(--surface-2);
}

.report .notes--truncated:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.report .notes--expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  white-space: pre-wrap;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
}
.map-chip:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent-ink); }
.map-chip:active { transform: translateY(1px); }
.map-chip svg { width: 14px; height: 14px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 8px 8px;
  margin: 0;
}
.empty[hidden] { display: none; }
.empty-mark {
  width: 56px;
  height: 56px;
  color: var(--border-strong);
}

@media (max-width: 480px) {
  .hero { padding-top: 4px; }
  .card { padding: 18px; }
  main { padding-inline: 12px; }
  .report-thumb { width: 75px; height: 75px; }
  .report-thumb svg { width: 34px; height: 34px; }
  .report .icon-btn--labeled span,
  .report .comments-toggle span:not(.comments-count),
  .report .close-btn span { display: none; }
  .report .icon-btn--labeled { width: 28px; padding: 0; }
  .report .close-btn { width: 28px; height: 28px; padding: 0; justify-content: center; }
  .report .close-btn svg { width: 14px; height: 14px; }
  .report .comments-toggle { padding: 4px; }
}

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

@media (max-width: 600px) {
  .top-bar {
    padding: max(12px, env(safe-area-inset-top)) 12px 0;
    gap: 8px;
  }
  .top-bar-start { gap: 6px; }
  .top-bar-controls { gap: 10px; }
  .account-btn,
  .lang-trigger { padding: 4px 8px; font-size: 10px; }
  .account-btn .g-logo { width: 12px; height: 12px; }
  .lang-trigger .globe { width: 12px; height: 12px; }
}

/* === Proximity filter chips ============================================= */
.prox-bar {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.prox-chip {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.prox-chip:hover { color: var(--ink); background: var(--surface-2); }
.prox-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === Pull to refresh ==================================================== */
.ptr-indicator {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 200;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-120%);
  transition: opacity 0.15s ease;
}
.ptr-indicator.ptr-visible { opacity: 1; }
.ptr-indicator.ptr-refreshing .ptr-icon {
  animation: ptr-spin 0.8s linear infinite;
}
.ptr-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.12s ease;
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}
main.ptr-pulling {
  transition: transform 0.08s ease-out;
  will-change: transform;
}

/* === Filter dropdowns =================================================== */
.filters-collapse {
  margin: 0 0 4px;
}
.filters-collapse--header {
  margin: 0;
}
.filters-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.filters-summary::-webkit-details-marker { display: none; }
.filters-summary:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-ink); }
.filters-summary > svg { width: 14px; height: 14px; opacity: 0.8; }
.filters-summary .filters-caret { transition: transform 0.18s ease; opacity: 0.65; }
.filters-collapse[open] .filters-summary { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); }
.filters-collapse[open] .filters-summary .filters-caret { transform: rotate(180deg); }

.filters {
  display: flex;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}
.filter-field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 140px;
}
.filter-search {
  flex: 1 1 100%;
  display: block;
}
.filter-search input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 12px;
  color: var(--ink);
}
.filter-search input:focus { border-color: var(--accent); }
.filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.filters select {
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
}
.filters select:focus { border-color: var(--accent); }

/* === Install banner ===================================================== */
.install-banner {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.install-banner > span { flex: 1; }
.install-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 600;
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.install-btn:hover { background: var(--accent-hover); }
.install-dismiss {
  background: transparent;
  border: 0;
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}
.install-dismiss:hover { color: var(--ink); }

/* === Location banner ==================================================== */
.location-banner {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 12px;
  background: var(--accent-soft, #f3eaff);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink);
  box-shadow: var(--shadow-md);
}
.location-banner > svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.location-banner > span { flex: 1; }
.location-banner-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 600;
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.location-banner-btn:hover { background: var(--accent-hover); }
.location-banner-btn:disabled { opacity: 0.6; cursor: default; }

/* === Location source indicator (under the submit button) =============== */
.location-source {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.location-source > svg { width: 14px; height: 14px; flex: none; }
.location-source[data-state="photo"] { color: var(--accent-ink, #5b21b6); }
.location-source[data-state="precise"] { color: var(--accent-ink, #5b21b6); }
.location-source[data-state="approx"] { color: var(--muted); }
.location-source[data-state="detecting"] { color: var(--muted); }
.location-source[data-state="unavailable"] { color: #b91c1c; }

/* === Edit button (uses generic icon-btn) ================================ */
.edit-btn { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.edit-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* === Form buttons (Submit + optional Cancel during edit) ================ */
.form-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-buttons > #submit-btn { flex: 1 1 200px; }
.cancel-btn {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cancel-btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-ink); }

/* === Comments ============================================================ */
.comments-block {
  display: contents;
}
.comments-panel { flex: 0 0 100%; }
.comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 999px;
  cursor: pointer;
}
.comments-toggle:hover { color: var(--accent-ink); background: var(--surface); }
.comments-toggle svg { width: 14px; height: 14px; }
.comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.comments-panel {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comments-empty,
.comments-loading,
.comments-error {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.comments-error { color: var(--danger-ink); }
.comment {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  position: relative;
}
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
}
.comment-author { font-weight: 700; color: var(--ink); }
.comment-time { color: var(--muted); }
.comment-body {
  margin: 4px 0 0;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--ink-2);
  word-break: break-word;
}
.comment-delete {
  background: none;
  border: none;
  color: var(--danger-ink);
  font: inherit;
  font-size: 11px;
  padding: 4px 0 0;
  cursor: pointer;
}
.comments-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comments-form textarea {
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 60px;
  background: var(--surface);
  color: var(--ink);
}
.comments-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.comments-submit {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.comments-submit:hover { background: var(--accent-hover); }
.comments-submit:disabled { opacity: 0.6; cursor: default; }
.comments-form-status {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.comments-form-status.error { color: var(--danger-ink); }
.comments-signin {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.comments-signin-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* === Footer links ======================================================= */
.footer-links {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.footer-links span { color: var(--muted); }

/* === RTL fine-tuning ===================================================
 * Most layout flips automatically because the codebase uses logical
 * properties (inset-inline-*, margin-inline-*, justify-content with flex).
 * A few visual details still need explicit RTL overrides. */

[dir="rtl"] .lang-list { animation-name: lang-pop-rtl; }
@keyframes lang-pop-rtl {
  from { opacity: 0; transform: scale(0.94) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Photo lightbox ===================================================== */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 12, 46, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 0) 16px env(safe-area-inset-bottom, 0);
  animation: lightbox-in 0.18s ease;
  cursor: zoom-out;
}
@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.photo-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
  cursor: default;
}
.photo-lightbox-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  inset-inline-end: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.photo-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
