/* Shared popup (dialog) styles. Colours come from theme variables so light mode
   needs no per-element overrides. Loaded after styles.css / home.css. */

/* Every .slip-overlay shares the same z-index (home.css), so two stacked at once
   paint in DOM order - whichever is later in the page wins, regardless of which
   was opened more recently. The generic confirm (e.g. "Delete conversation?" on
   top of the claim conversation modal) always needs to win that stacking, so it
   gets a z-index above every other overlay instead of relying on source order. */
#genericConfirmModal {
  z-index: 1200;
}
#confirmItemReturnedModal {
  z-index: 1200;
}

#confirmItemReturnedModal .confirm-item-returned-card {
  border: 2px solid var(--tone-success-strong) !important;
}
#confirmItemReturnedModal .confirm-item-returned-card .modal-icon--success {
  color: var(--tone-success) !important;
  -webkit-text-fill-color: var(--tone-success) !important;
}
#confirmItemReturnedModal .confirm-item-returned-card .modal-confirm-title--success {
  color: var(--tone-success) !important;
  -webkit-text-fill-color: var(--tone-success) !important;
}
#confirmItemReturnedModal .confirm-item-returned-card .modal-confirm-text {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
}
#confirmItemReturnedModal .confirm-item-returned-card .modal-actions > .confirm-item-returned-button {
  border: 1px solid #15803d !important;
  background: #15803d !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
#confirmItemReturnedModal .confirm-item-returned-card .modal-actions > .confirm-item-returned-button:hover {
  border-color: #166534 !important;
  background: #166534 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

:root {
  --modal-bg: #18181b;
  --modal-shadow: 0 10px 45px rgba(0, 0, 0, 0.85);
  --modal-divider: rgba(59, 130, 246, 0.25);
  --surface-subtle: rgba(255, 255, 255, 0.03);
  --surface-subtle-border: rgba(255, 255, 255, 0.08);
  --surface-raised: #27272a;
  --tone-danger: #fca5a5;
  --tone-danger-strong: #ef4444;
  --tone-error: #f87171;
  --tone-success: #4ade80;
  --tone-success-soft: #86efac;
  --tone-success-strong: #22c55e;
  --tone-info-text: #bfdbfe;
  --field-bg: rgba(255, 255, 255, 0.05);
}

[data-theme='light'] {
  --modal-bg: #ffffff;
  --modal-shadow: 0 10px 45px rgba(0, 0, 0, 0.18);
  --modal-divider: rgba(37, 99, 235, 0.2);
  --surface-subtle: #f8fafc;
  --surface-subtle-border: #e2e8f0;
  --surface-raised: #f1f5f9;
  --tone-danger: #dc2626;
  --tone-error: #dc2626;
  --tone-success: #15803d;
  --tone-success-soft: #166534;
  --tone-info-text: #1e3a8a;
  --field-bg: #ffffff;
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.modal-card {
  position: relative;
  box-sizing: border-box;
  width: 92%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  border: 1.5px solid var(--blue-main);
  border-radius: 18px;
  background: var(--modal-bg);
  color: var(--text-main);
  box-shadow: var(--modal-shadow);
}
.modal-card:focus {
  outline: none;
}
.modal-card--sm {
  max-width: 420px;
}
.modal-card--md {
  max-width: 460px;
}
.modal-card--lg {
  max-width: 520px;
  overflow-x: hidden;
}
.modal-card--xl {
  max-width: 650px;
}
.modal-card--center {
  text-align: center;
}
.modal-card--danger {
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.modal-card--neutral {
  border: 1px solid var(--border);
}
.modal-card--success {
  border-color: var(--tone-success-strong);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--modal-divider);
}
.modal-header--center {
  align-items: center;
}
.modal-header--success {
  border-bottom-color: rgba(34, 197, 94, 0.3);
}
.modal-header-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.modal-header-icon {
  font-size: 1.3rem;
}
.notifications-modal-header {
  align-items: flex-start;
}
.notifications-modal-header-group {
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.75rem;
}
.notifications-modal-header .modal-header-icon {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  line-height: 1.25;
  text-align: center;
}
.notifications-modal-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.modal-header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.modal-heading {
  margin: 0.4rem 0 0.2rem;
  font-size: 1.25rem;
  font-weight: 800;
}
.modal-heading--plain {
  color: var(--text-main);
}
.modal-heading--flush {
  margin-top: 0;
}
.modal-heading--sm {
  margin: 0;
  font-size: 1.1rem;
}
.modal-heading--xs {
  margin: 0;
  font-size: 1.05rem;
}
.modal-heading--accent {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-main);
  text-align: left;
}

.modal-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.modal-close {
  display: grid;
  flex: 0 0 2.5rem;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.modal-close:hover,
.modal-close:focus-visible {
  border-color: var(--blue-main);
  background: rgba(59, 130, 246, 0.12);
  color: var(--text-main);
}
.modal-close:focus-visible {
  outline: 2px solid var(--blue-main);
  outline-offset: 2px;
}
.modal-close--boxed {
  font-weight: 700;
}

.modal-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: var(--blue-main);
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ── Confirmation layout (icon, title, text) ─────────────────────────── */
.modal-icon {
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
}
.modal-icon--accent {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--blue-main);
}
.modal-confirm-title {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue-main);
}
.modal-confirm-title--danger {
  color: var(--tone-danger);
}
.modal-confirm-title--neutral {
  color: var(--text-main);
}
.modal-confirm-text {
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.modal-confirm-text--tight {
  margin-bottom: 1rem;
}
.modal-body-text {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--text-main);
}

/* ── Actions ──────────────────────────────────────────────────────────── */
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}
.modal-actions--center {
  justify-content: center;
}
.modal-actions--stretch {
  align-items: stretch;
  flex-wrap: nowrap;
}
.modal-actions--stretch > .btn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  text-align: center;
  text-decoration: none;
}
.modal-actions--tight {
  gap: 0.5rem;
}
.btn-compact {
  padding: 0.5rem 1.25rem;
}
.btn-danger {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: var(--tone-danger-strong);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}
.btn-success {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: var(--tone-success-strong);
  color: #000000;
  font-weight: 800;
  cursor: pointer;
}
.btn-outline-accent {
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--blue-light);
}

/* ── Fields and messages ──────────────────────────────────────────────── */
.modal-field {
  margin-bottom: 0.9rem;
}
.modal-field--last {
  margin-bottom: 1.25rem;
}
.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
}
.modal-field textarea {
  font-size: 0.875rem;
  resize: none;
}
.modal-field--boxed input {
  border: 1.5px solid rgba(59, 130, 246, 0.25);
  background: var(--field-bg);
  color: var(--text-main);
}
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.modal-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.modal-error {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--tone-error);
}
.field-error {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--tone-error);
}

/* ── Password fields: show/hide toggle, live requirement checklist, match hint ──── */

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-wrap input {
  padding-right: 2.9rem !important;
}
.btn-toggle-pw {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transform: translateY(-50%);
  transition: color 0.2s ease;
}
.btn-toggle-pw:hover {
  color: var(--text-main);
}
.btn-toggle-pw:focus-visible {
  outline: 2px solid var(--blue-main);
  outline-offset: 2px;
}
.password-toggle-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-requirements {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  column-gap: 0.75rem;
  row-gap: 0.35rem;
  margin: 0.6rem 0 0;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.password-requirements li {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.password-requirements li::before {
  content: '○';
  flex-shrink: 0;
  width: 1rem;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1.4;
}
.password-requirements li.satisfied {
  color: var(--tone-success);
}
.password-requirements li.satisfied::before {
  content: '✓';
  color: var(--tone-success);
}

.password-match-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.password-match-hint.match {
  color: var(--tone-success);
}
.password-match-hint.mismatch {
  color: var(--tone-error);
}
.modal-alert {
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--tone-danger);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ── Panels inside popups ─────────────────────────────────────────────── */
.info-panel {
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
}
.info-panel--hint {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-color: rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.06);
}
.info-panel-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.info-panel-label--accent {
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  color: var(--blue-light);
  text-transform: none;
}
.info-panel-code {
  margin-top: 0.2rem;
  font-family: monospace;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--blue-main);
}
.info-panel-quote {
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-main);
}
.success-panel {
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--tone-success-soft);
  font-size: 0.875rem;
  text-align: left;
}

.feature-notes {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}
.feature-note {
  padding: 0.75rem;
  border: 1px solid var(--surface-subtle-border);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.feature-note-title {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--blue-main);
}
.feature-note-text {
  line-height: 1.45;
  color: var(--text-muted);
}
.feature-note--success {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.08);
}
.feature-note--success .feature-note-title {
  color: var(--tone-success);
}
.feature-note--success .feature-note-text {
  color: var(--tone-success-soft);
}

.demo-box {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 10px;
  background: var(--surface-raised);
  text-align: left;
}
.demo-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.demo-box-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--blue-main);
}
.demo-box-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--tone-success);
  font-size: 0.8125rem;
}
.demo-box-text {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.demo-box-input {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  background: var(--modal-bg);
  color: var(--text-main);
  font-size: 0.875rem;
  resize: none;
}

.modal-green-notice {
  margin-bottom: 1.1rem;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* ── Connect & Notify screen: finder messages the owner and can opt to share
   contact details, styled as a two-person exchange rather than a plain form ──── */
.connect-card {
  position: relative;
  padding-top: 2.5rem;
  text-align: center;
}
.connect-card-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  flex: 0 0 2.5rem;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.connect-card-close:hover,
.connect-card-close:focus-visible {
  border-color: var(--blue-main);
  background: rgba(59, 130, 246, 0.12);
  color: var(--text-main);
}
.connect-card-close:focus-visible {
  outline: 2px solid var(--blue-main);
  outline-offset: 2px;
}

.connect-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-main);
}
.connect-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}
.connect-ref {
  margin: 0.1rem 0 0;
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.connect-instructions {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.connect-instructions:empty {
  display: none;
}
.connect-test-notice {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-main);
  line-height: 1.5;
}
.connect-test-notice[hidden] {
  display: none !important;
}

.connect-form {
  margin-top: 1.25rem;
  text-align: left;
}
.connect-form [hidden] {
  display: none !important;
}

.connect-field {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--surface-subtle-border);
  border-radius: 12px;
  background: var(--surface-subtle);
}
/* Outgoing-message shape (matches .thread-msg--mine in the claim conversation
   modal) so this one-shot form reads as the finder's half of an exchange. */
.connect-field--bubble {
  margin-left: 1.25rem;
  border-radius: 16px 16px 4px 16px;
}
.connect-field-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.6;
}
.connect-field-body {
  flex: 1;
  min-width: 0;
}
.connect-field-body label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
}
.connect-field-body input,
.connect-field-body textarea {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 0.9rem;
  box-sizing: border-box;
  text-overflow: ellipsis;
}
.connect-field-body textarea {
  resize: none;
}
.connect-field--contact {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.connect-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--surface-subtle-border);
  border-radius: 12px;
  background: var(--surface-subtle);
  cursor: pointer;
}
.connect-toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.connect-toggle-switch {
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  width: 3.1rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid #cbd5e1;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}
.connect-toggle-knob {
  display: block;
  position: absolute;
  top: 1px;
  left: 1px;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease;
}
.connect-toggle input:checked + .connect-toggle-switch {
  background: #22c55e;
  border-color: #22c55e;
}
.connect-toggle input:checked + .connect-toggle-switch .connect-toggle-knob {
  transform: translateX(1.4rem);
}
.connect-toggle input:focus-visible + .connect-toggle-switch {
  outline: 2px solid var(--blue-main);
  outline-offset: 2px;
}
.connect-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8125rem;
  color: var(--text-main);
}
.connect-toggle-text small {
  color: var(--text-muted);
  font-weight: 400;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Printable stickers: always black on white, whatever the theme ────── */
.print-sticker {
  margin-bottom: 1.25rem;
  padding: 1.4rem;
  border: 2px dashed #3b82f6;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.print-sticker--match {
  padding: 1.25rem;
  margin-bottom: 1.2rem;
  border-color: #0f172a;
  box-shadow: none;
}
.print-sticker-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.print-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.print-brand-text {
  font-size: 0.875rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #0f172a;
  text-transform: uppercase;
}
.print-title {
  margin-bottom: 0.15rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}
.print-ref {
  margin-bottom: 0.75rem;
  font-family: monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: #475569;
}
.print-qr-frame {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.6rem;
  border: 1.5px solid #0f172a;
  border-radius: 10px;
  background: #f8fafc;
}
.print-qr-frame--block {
  display: block;
  width: max-content;
  margin: 0 auto 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: #ffffff;
}
.print-qr-img {
  display: block;
  width: 140px;
  height: 140px;
  image-rendering: pixelated;
}
.print-qr-img--sm {
  width: 130px;
  height: 130px;
}
.print-cta {
  font-size: 0.875rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #1d4ed8;
  text-transform: uppercase;
}
.print-hint {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: #64748b;
}
.print-hint--spaced {
  margin-top: 0.45rem;
}
.print-note {
  margin-top: 0.55rem;
  font-size: 0.8125rem;
  color: #475569;
}
.print-disclaimer {
  font-size: 0.8125rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
}
.match-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.6rem 0;
  padding: 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.8125rem;
  text-align: left;
}
.match-column-label {
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
}
.match-column-label--lost {
  color: #dc2626;
}
.match-column-label--found {
  color: #15803d;
}
.match-column-title {
  font-weight: 800;
  color: #0f172a;
}
.match-column-meta {
  font-size: 0.8125rem;
  color: #64748b;
}
.match-column-meta--mono {
  font-family: monospace;
}

/* Buttons rendered inside item cards. */
.btn-finder-test {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--tone-success-soft);
}

/* ── Account settings: delete account (students) ── */
/* A quiet, contained "danger zone" rather than a loud block of colour: neutral card
   background, a single coloured accent on the leading edge, and the action aligned to
   the end of its own row - the same language Stripe/Linear/GitHub settings panels use
   for a rare, deliberate action, instead of an alert banner. */
.account-danger {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--well-bg);
}
.account-danger[hidden] {
  display: none;
}
.account-section {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--well-bg);
}
.account-section[hidden] {
  display: none;
}
.account-section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}
.account-section-text {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.account-section .btn {
  align-self: flex-end;
}
.account-danger-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}
/* Beats the theme-wide popup paragraph colour, which is !important. */
:root[data-theme] #changePasswordModal p.account-danger-title {
  color: var(--tone-danger) !important;
}
.account-danger-text {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
/* More specific than the glass theme's outline-button colours. */
:root .account-danger .btn.account-danger-btn {
  align-self: flex-end;
  border-color: var(--tone-danger);
  color: var(--tone-danger);
  cursor: pointer;
}
:root .account-danger .btn.account-danger-btn:hover {
  background: color-mix(in srgb, var(--tone-danger) 12%, transparent);
  border-color: var(--tone-danger);
}

:root[data-theme] .slip-overlay #deleteAccountModal h2.modal-confirm-title--danger,
:root[data-theme] #deleteAccountModal h2.modal-confirm-title--danger {
  color: var(--tone-danger) !important;
}
.account-delete-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.account-delete-list strong {
  color: var(--text-main);
}
/* ── QR scanner (shared-screen preview inside #qrScannerModal) ─────────────
   A scan is often of a QR code on this same screen/tab (e.g. the sticker
   behind this very dialog), so this overlay skips the shared dark/blurred
   .slip-overlay backdrop and floats as a small corner widget instead of a
   centered dialog - otherwise it would hide the very code being scanned. */
#qrScannerModal {
  background: transparent;
  backdrop-filter: none;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}
#qrScannerModal .modal-card {
  max-width: 250px;
  margin: 1rem;
  padding: 1rem;
  pointer-events: auto;
  box-shadow: var(--modal-shadow), 0 0 0 2000px rgba(0, 0, 0, 0.12);
}
.qr-scanner-viewport {
  position: relative;
  width: 100%;
  max-width: 210px;
  aspect-ratio: 4 / 3;
  margin: 0.65rem auto 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}
.qr-scanner-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Camera fallback (phones without screen-capture support): fill the frame
   instead of letterboxing, since there's no risk of cropping out a shared
   window the way there is with a screen capture. */
.qr-scanner-video--camera {
  object-fit: cover;
}
/* Shown over the (otherwise black) viewport while the camera/screen stream
   is still connecting, so it doesn't read as stuck or broken. */
.qr-scanner-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.qr-scanner-loading[hidden] {
  display: none;
}
.qr-scanner-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.qr-scanner-spinner,
.qr-scanner-status-spinner {
  width: 1.1em;
  height: 1.1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qr-scanner-spin 0.8s linear infinite;
  flex-shrink: 0;
}
/* The inline status spinner sits on the card's own background, not the dark
   video, so it needs theme-aware colours instead of the video overlay's. */
.qr-scanner-status-spinner {
  width: 0.95em;
  height: 0.95em;
  border-color: var(--surface-subtle-border);
  border-top-color: var(--blue-main);
}
.qr-scanner-status-spinner[hidden] {
  display: none;
}
/* Desktop already has screen-share for a QR shown elsewhere on the same
   machine; mobile has no equivalent (see js/home-page.js), so this picks a
   saved screenshot/photo instead. Shown only on mobile widths - see
   css/responsive.css. */
.qr-scanner-upload-btn {
  display: none;
}
@keyframes qr-scanner-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── App-experience review modal ──────────────────────────────────────── */
.review-star-row {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.25rem 0 1rem;
}
.review-star {
  padding: 0;
  border: 0;
  background: none;
  color: var(--surface-subtle-border);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}
.review-star:hover {
  transform: scale(1.1);
}
.review-star.is-active {
  color: #f5b700;
}
.review-tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.review-tag {
  padding: 0.35rem 0.8rem;
  border: 1.5px solid var(--surface-subtle-border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.review-tag:hover {
  border-color: var(--blue-main);
  color: var(--text-main);
}
.review-tag.is-active {
  border-color: var(--blue-main);
  background: rgba(59, 130, 246, 0.16);
  color: var(--blue-light);
}
.review-comment {
  width: 100%;
  min-height: 4.5rem;
  margin-bottom: 1rem;
  padding: 0.6rem;
  border: 1.5px solid var(--surface-subtle-border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  resize: none;
}

/* ── "This is your report" (own QR code scanned) ── */
#ownReportScanModal .modal-card {
  text-align: left;
}
.own-report-summary {
  display: grid;
  gap: 0.5rem;
  margin: 0.25rem 0 1.1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--well-border, var(--surface-subtle-border));
  border-radius: 14px;
  background: var(--well-bg, var(--surface-subtle));
}
.own-report-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.own-report-title {
  margin: 0;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.own-report-facts {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.875rem;
}
.own-report-facts > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.5rem;
}
.own-report-facts dt {
  color: var(--text-muted);
  font-weight: 600;
}
.own-report-facts dd {
  margin: 0;
  color: var(--text-main);
  overflow-wrap: anywhere;
}
.own-report-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.own-report-actions > .btn {
  min-height: 2.5rem;
  margin: 0;
}
.own-report-actions > [hidden] {
  display: none;
}
@media (max-width: 380px) {
  .own-report-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  /* Label above value: the values get the full width instead of a narrow column. */
  .own-report-facts {
    gap: 0.55rem;
  }
  .own-report-facts > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.05rem;
  }
  .own-report-facts dt {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
}

/* ── Edit report (My Reports → Edit) ── */
.edit-report-photo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--well-border, var(--surface-subtle-border));
  border-radius: 14px;
  background: var(--well-bg, var(--surface-subtle));
}
.edit-report-photo-frame {
  position: relative;
  display: grid;
  flex: 0 0 5.5rem;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  overflow: hidden;
  border: 1px solid var(--well-border, var(--surface-subtle-border));
  border-radius: 12px;
  background: var(--surface-raised, transparent);
}
.edit-report-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.edit-report-photo-frame img[hidden],
.edit-report-photo-empty[hidden],
.edit-report-photo-remove[hidden] {
  display: none;
}
.edit-report-photo-empty {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.edit-report-photo-actions {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}
.edit-report-photo-label {
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 700;
}
.edit-report-photo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
/* The "Change photo" control is a label (opens the file picker): undo the popup label style. */
:root[data-theme] #editReportModal label.edit-report-photo-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--blue-main) !important;
  font-size: 0.8125rem;
  letter-spacing: 0;
  cursor: pointer;
}
#editReportModal .edit-report-photo-buttons .btn {
  min-height: 2.5rem;
  margin: 0;
}
#editReportPhotoInput:focus-visible + .edit-report-photo-remove,
#editReportModal label.edit-report-photo-pick:focus-within {
  outline: 2px solid var(--blue-main);
  outline-offset: 2px;
}
.edit-report-photo-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.edit-report-location {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 0 0.75rem;
}
.edit-report-keeps {
  margin: 0.25rem 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--blue-main);
  border-radius: 6px;
  background: var(--surface-subtle, transparent);
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}
@media (max-width: 480px) {
  .edit-report-location {
    grid-template-columns: minmax(0, 1fr);
  }
  .edit-report-photo {
    gap: 0.75rem;
    padding: 0.65rem;
  }
  .edit-report-photo-frame {
    flex-basis: 4.5rem;
    width: 4.5rem;
    height: 4.5rem;
  }
  #editReportModal .edit-report-photo-buttons .btn {
    flex: 1 1 auto;
    padding-inline: 0.6rem;
  }
}
/* Both photo controls read at the same size (one is a label, one a button). */
#editReportModal .edit-report-photo-buttons .btn {
  font-size: 0.8125rem;
  font-weight: 700;
}
