/* Sprettum — shared styles. Mobile-first: base styles are for small screens,
   the @media rule near the bottom widens things up for tablets/desktop. */

:root {
  --green-900: #1e3a29;
  --green-700: #2f6b46;
  --green-600: #3d8a5c;
  --green-100: #e6f2ea;
  --green-50: #f4faf6;
  --earth-700: #6b4f3a;
  --earth-100: #f0e8de;
  --amber-600: #c47a2c;
  --ink: #1c2420;
  --ink-soft: #4b564f;
  --border: #dbe7de;
  --bg: #fbfdfc;
  --card-bg: #ffffff;
  --danger: #b3452f;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(30, 58, 41, 0.08), 0 1px 2px rgba(30, 58, 41, 0.06);
  --max-width: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; }

/* ---------- Layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 96px;
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--green-900);
  color: #fff;
  box-shadow: var(--shadow);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}

.brand:hover { text-decoration: none; opacity: 0.9; }

.brand-logo { height: 1.4rem; width: auto; display: block; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.header-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.header-scroll::-webkit-scrollbar { display: none; }

.nav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 0.66rem;
  line-height: 1.15;
  text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: none;
  text-decoration: none;
  white-space: nowrap;
}
.nav-tile:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-tile svg { width: 18px; height: 18px; }

.nav-tile-icon-wrap {
  position: relative;
  display: inline-flex;
}
.nav-tile-icon-wrap .nav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  margin-left: 0;
}

.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
  flex: none;
}
.burger-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

@media (max-width: 680px) {
  .burger-btn { display: flex; }
  .header-scroll {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow-x: visible;
    background: var(--green-900);
    padding: 6px 12px 14px;
    box-shadow: var(--shadow);
  }
  .header-scroll.open { display: flex; }
  .header-scroll .nav-tile {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 6px;
    font-size: 0.9rem;
    text-align: left;
  }
  .header-scroll .nav-fab {
    width: 100%;
    padding: 10px 6px;
  }
  .header-scroll .nav-fab-label {
    display: inline;
    font-weight: 600;
    font-size: 0.9rem;
  }
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

@media (max-width: 400px) {
  .brand { font-size: 1rem; }
  .brand-logo { height: 1.2rem; }
}

.lang-toggle {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.74rem;
  cursor: pointer;
  flex: none;
}

.lang-toggle:hover { background: rgba(255,255,255,0.2); }

.nav-fab {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
  color: #fff;
}
.nav-fab-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background 0.15s ease;
}
.nav-fab:hover .nav-fab-icon { background: var(--green-700); }
.nav-fab-label { display: none; }

.header-avatar {
  display: inline-flex;
  align-items: center;
}
.header-avatar:empty { display: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--green-600);
  color: #fff;
}
.btn-primary:hover { background: var(--green-700); text-decoration: none; }

.btn-secondary {
  background: var(--green-100);
  color: var(--green-900);
}
.btn-secondary:hover { background: #d9ecdf; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

/* Like .btn-ghost, but for use on light card backgrounds (not the dark
   header) -- e.g. a low-emphasis "Report" action next to a primary button. */
.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-quiet:hover { background: #f4f4f4; text-decoration: none; }

.btn-danger {
  background: #fbeae6;
  color: var(--danger);
}
.btn-danger:hover { background: #f6d9d1; }

.btn-block { width: 100%; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* Status control (active / frátekið / selt) for a listing -- two buttons
   for the two statuses it isn't currently in, styled like the other plain
   buttons on these pages rather than a dropdown. Each status keeps its own
   color (same greens/ambers/greys as the badges elsewhere) so "Selt" always
   looks the same wherever it's clicked from. */
.status-actions-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.btn-status-active { background: var(--green-100); color: var(--green-700); }
.btn-status-active:hover { background: #d9ecdf; }
.btn-status-claimed { background: #fdf0dd; color: var(--amber-600); }
.btn-status-claimed:hover { background: #fbe6c3; }
.btn-status-sold { background: #ddd; color: #555; }
.btn-status-sold:hover { background: #cfcfcf; }

/* Gentle nudge shown on a listing's own "my listings" row once it's been
   sitting "frátekið" for a week or more -- no email, nothing pushed to
   anyone, it only shows up when the owner is already looking at their own
   listings. */
.stale-claim-note {
  font-size: 0.8rem;
  color: var(--amber-600);
  margin-top: 4px;
}

/* ---------- Floating "add listing" button ---------- */

.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 25;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 12px rgba(30,58,41,0.3);
  border: none;
  cursor: pointer;
}
.fab:hover { background: var(--green-700); }

/* ---------- Search / filters ---------- */

.search-bar {
  margin: 16px 0 12px;
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 0.95rem;
}
.search-input:focus { outline: 2px solid var(--green-600); outline-offset: 1px; }

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.chip {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink-soft);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}

/* ---------- Listing cards / grid ---------- */

.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 8px;
}

@media (min-width: 560px) {
  .listing-grid { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  display: block;
  color: inherit;
}
.card:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(30,58,41,0.12); }

.card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--green-100);
}

.card-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

.card-body { padding: 12px 14px; }

.card-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 4px;
  color: var(--ink);
}

.card-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-sell { background: var(--earth-100); color: var(--earth-700); }
.badge-swap { background: #fdf0dd; color: var(--amber-600); }
.badge-free { background: var(--green-100); color: var(--green-700); }
.badge-claimed { background: #eee; color: #888; }
.badge-sold { background: #ddd; color: #555; }
.badge-deleted { background: #fde2e2; color: #b3261e; }
.badge-admin { background: var(--green-900); color: #fff; }

/* Report reasons (admin dashboard) */
.badge-spam { background: #fdf0dd; color: var(--amber-600); }
.badge-scam { background: #fde2e2; color: #b3261e; }
.badge-inappropriate { background: #fde2e2; color: #b3261e; }
.badge-other { background: #eee; color: #888; }

/* Report status (admin dashboard) */
.badge-open { background: #fdf0dd; color: var(--amber-600); }
.badge-resolved { background: var(--green-100); color: var(--green-700); }
.badge-dismissed { background: #eee; color: #888; }

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 48px 16px;
}
.empty-state .empty-emoji { font-size: 2.4rem; display: block; margin-bottom: 8px; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
}

/* Resets the browser's default fieldset chrome (border, padding, min-width)
   so a <fieldset class="field"> for a group of checkboxes looks identical
   to the plain <div class="field"> used everywhere else -- fieldset/legend
   is only here for the group of checkboxes to have a real accessible name,
   not for any visual reason. */
fieldset.field {
  border: none;
  padding: 0;
  min-width: 0;
}
.field legend {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
  padding: 0;
}

.field .hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--green-600);
  outline-offset: 1px;
}

.field textarea { min-height: 90px; resize: vertical; }

.field input.input-error,
.field textarea.input-error {
  border-color: var(--danger);
}
.field-error-msg {
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 4px;
}

.type-choice {
  display: flex;
  gap: 8px;
}
.type-choice label {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.type-choice input { display: none; }
.type-choice input:checked + span { color: var(--green-800, var(--green-700)); }
.type-choice label:has(input:checked) {
  border-color: var(--green-600);
  background: var(--green-50);
  color: var(--green-700);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--green-100);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-thumb .photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(20, 30, 24, 0.65);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.photo-thumb .photo-cover-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(20, 30, 24, 0.65);
  color: #fff;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 999px;
}

.photo-add-tile {
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--green-50);
  font-size: 0.68rem;
  text-align: center;
  padding: 4px;
}
.photo-add-tile .plus-icon { font-size: 1.3rem; line-height: 1; }

/* ---------- Listing detail ---------- */

/* The photo itself is inside a plain-looking button (rather than a bare
   <img> with an onclick) so opening the full-size lightbox works from the
   keyboard too, not just a mouse click. */
.detail-photo-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}
.detail-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--green-100);
  margin: 16px 0;
  display: block;
}

/* ---------- Photo lightbox ---------- */

.modal-backdrop.photo-lightbox-backdrop {
  align-items: center;
  padding: 16px;
  background: rgba(10, 16, 12, 0.85);
}

.photo-lightbox {
  position: relative;
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
}

.photo-lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  background: #101a13;
}

.photo-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

@media (max-width: 480px) {
  .photo-lightbox-close { top: -46px; right: 0; }
}

.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 30, 24, 0.55);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-lightbox-prev { left: 10px; }
.photo-lightbox-next { right: 10px; }

.photo-lightbox-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 30, 24, 0.6);
  color: #fff;
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Listing detail photo strip (multi-photo) ---------- */

.photo-thumb-strip {
  display: flex;
  gap: 8px;
  margin: -8px 0 16px;
  overflow-x: auto;
}
.photo-thumb-strip button {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--green-100);
}
.photo-thumb-strip button.active { border-color: var(--green-600); }
.photo-thumb-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

.detail-title { font-size: 1.4rem; margin: 0 0 6px; }

.detail-owner {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.detail-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.share-actions {
  margin: 14px 0 20px;
}

.share-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.share-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  flex: none;
  transition: filter 0.15s;
}
.share-icon-btn:hover { filter: brightness(0.96); text-decoration: none; }
/* Same pale badge palette used for listing types elsewhere on the site
   (badge-sell/free/swap/claimed), rather than each platform's own brand
   colors -- keeps the share row feeling like part of Sprettum. */
.share-icon-fb { background: var(--earth-100); color: var(--earth-700); }
.share-icon-x { background: #eee; color: #666; }
.share-icon-wa { background: var(--green-100); color: var(--green-700); }
.share-icon-email { background: #fdf0dd; color: var(--amber-600); font-size: 1.15rem; }

.my-listing-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
  background: var(--green-50);
}
.my-listing-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: 1px solid var(--border);
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--ink);
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 24, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

@media (min-width: 480px) {
  .modal-backdrop { align-items: center; }
}

.modal {
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 24px 20px 28px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
}

@media (min-width: 480px) {
  .modal { border-radius: var(--radius); }
}

.modal h2 { margin-top: 0; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.modal-inner { position: relative; }

.divider-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 16px 0;
}
.divider-or::before, .divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Messages / conversations ---------- */

.thread-list-item {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--card-bg);
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.msg-bubble.mine {
  background: var(--green-600);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.msg-bubble.theirs {
  background: var(--green-100);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--ink-soft);
  margin: 2px 4px 12px;
}

.contact-thread-messages {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--green-100);
}

.avatar-circle.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--green-600);
}

.avatar-circle-sm {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

.avatar-circle-lg {
  width: 84px;
  height: 84px;
  font-size: 2rem;
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

/* ---------- Utility ---------- */

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-soft { color: var(--ink-soft); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* Visually hidden but still readable by screen readers -- for a label that
   would be redundant on screen next to an already-clear input, like a
   textarea whose placeholder alone isn't enough of a label. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-tagline {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 60;
  box-shadow: var(--shadow);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--green-100);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Skeleton loaders (feed) ---------- */

.skeleton-shimmer {
  background: linear-gradient(90deg, var(--green-100) 25%, var(--green-50) 37%, var(--green-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.skeleton-card-body { padding: 12px 14px; }

.skeleton-line {
  height: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-40 { width: 40%; }

.show-claimed-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 10px 0 4px;
  cursor: pointer;
  width: fit-content;
}
.show-claimed-toggle input { width: auto; margin: 0; }

.tips-card {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.tips-card h3 { margin: 0 0 4px; font-size: 0.92rem; color: var(--green-800, var(--green-700)); }
.tips-card p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 24px 16px 100px;
}

.footer-support-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  cursor: pointer;
}
.footer-support-btn:hover {
  background: var(--green-50);
  color: var(--green-700);
  border-color: var(--green-100);
}

.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.footer-links a {
  color: inherit;
  text-decoration: underline;
}

.about-lead {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 8px 0 20px;
}

.about-signoff {
  margin: 20px 0 24px;
  line-height: 1.5;
}

/* ---------- Admin stats ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat-tile {
  text-align: center;
}
.stat-tile .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-tile .stat-label { font-size: 0.72rem; color: var(--ink-soft); }

@media (max-width: 360px) {
  .stat-tile .stat-value { font-size: 1.2rem; }
  .stat-tile .stat-label { font-size: 0.66rem; }
}

/* ---------- Admin tabs ---------- */

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--green-700);
  border-bottom-color: var(--green-700);
}
.count-badge {
  background: #b3261e;
  color: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

/* Message compose / reply textareas (listing detail's "Senda skilaboð" box,
   and the reply box on a message thread) -- previously bare <textarea>s with
   no class, so they rendered with the browser's default chrome instead of
   matching the rest of the form styling. */
.msg-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  color: var(--ink);
  resize: vertical;
  min-height: 80px;
}
.msg-textarea:focus {
  outline: 2px solid var(--green-600);
  outline-offset: 1px;
}

/* ---------- Safety tip ---------- */

.safety-tip {
  background: var(--green-50, #f2f7f2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
