@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100..900&display=swap");

* {
  box-sizing: border-box;
}

/* Design tokens and base styles */
:root {
  --bg: #f7f7f5;
  --paper: #fff;
  --ink: #111;
  --muted: #707070;
  --line: #deded9;
  --soft: #ecece7;
  --accent: #BF1F1B;
  --radius: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

html[lang="ar"] body {
  font-family: "Noto Sans Arabic",Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

body,
button,
input,
select,
textarea {
  font-size: 16px;
}

a {
  text-decoration: none;
  color: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Header and primary navigation */
.site-header {
  height: 74px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px,5vw);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 25px;
  line-height: 1;
  letter-spacing: -1.5px;
  white-space: nowrap;
}

.logo-bold {
  font-weight: 800;
}

.logo-medium {
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.main-nav>a {
  font-weight: 600;
}

.nav-button,
.lang-button,
.secondary-button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 11px;
  padding: 10px 15px;
}

.nav-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 800;
}

.nav-button:hover {
  filter: brightness(.94);
}

.lang-button {
  min-width: 54px;
  font-weight: 800;
}

/* Public pages and shared content */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.hero {
  padding-top: 84px;
  padding-bottom: 70px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.hero h1,
.explore-page h1,
.place-page h1,
.admin-page h1 {
  font-size: clamp(48px,7vw,86px);
  line-height: .96;
  letter-spacing: -4px;
  max-width: 900px;
  margin: 0 0 24px;
}

.lead {
  font-size: 20px;
  line-height: 1.55;
  color: #5f5f5a;
  max-width: 760px;
  margin: 0 0 34px;
}

.search-wrap {
  position: relative;
  max-width: 900px;
  margin-inline: auto;
}

.search-input {
  width: 100%;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 0 52px 0 18px;
  outline: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.04);
}

.search-input:focus {
  border-color: #999;
}

.search-field {
  position: relative;
  display: block;
}

.search-field-icon {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

html[dir="rtl"] .search-field-icon {
  right: auto;
  left: 18px;
}

html[dir="rtl"] .search-input {
  padding: 0 18px 0 52px;
}

.search-input::placeholder,
.explore-search input::placeholder {
  color: #a3a39d;
  opacity: .5;
}

.search-results-head {
  font-size: 13px;
  color: var(--muted);
  margin: 22px 0 12px;
}

.section {
  padding-top: 20px;
  padding-bottom: 90px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 32px;
  margin: 0 0 6px;
  letter-spacing: -1px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.text-link {
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .16s ease,box-shadow .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar,
.place-avatar {
  width: 69px;
  height: 69px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: none;
}

.card h3 {
  font-size: 23px;
  line-height: 1.1;
  margin: 20px 0 9px;
  letter-spacing: -.7px;
}

.tag {
  display: inline-flex;
  background: var(--soft);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  color: #5d5d58;
}

.subbrand-tag {
  font-size: 10px;
  padding: 5px 8px;
}

.card-meta {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
  margin-bottom: 20px;
}

.card-split-summary {
  margin-top: 20px;
}

.card-split-summary .split-bar {
  height: 8px;
}

.card-split-summary .split-labels {
  margin-top: 8px;
  font-size: 11px;
}

.vote-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 800;
}

.vote-number {
  font-size: 28px;
  font-weight: 900;
  margin: 5px 0 10px;
}

.vote-number span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.bar {
  height: 7px;
  background: #e4e4df;
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.pct-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.explore-page {
  padding-top: 70px;
  padding-bottom: 100px;
}

.explore-controls {
  display: grid;
  grid-template-columns: minmax(0,3fr) minmax(180px,1fr);
  gap: 18px;
  align-items: end;
  margin: 26px 0 30px;
}

.explore-search,
.country-filter {
  display: block;
  min-width: 0;
}

.explore-search input,
.country-filter select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
  outline: none;
  font: inherit;
}

.explore-search input:focus,
.country-filter select:focus {
  border-color: #999;
}

.explore-search input {
  padding-right: 46px;
  border-radius: 999px;
}

html[dir="rtl"] .explore-search input {
  padding-right: 12px;
  padding-left: 46px;
}

.explore-search .search-field-icon {
  right: 14px;
}

html[dir="rtl"] .explore-search .search-field-icon {
  right: auto;
  left: 14px;
}

.country-select-field {
  position: relative;
  display: block;
}

.country-filter select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 42px;
}

.country-select-icon {
  position: absolute;
  top: 50%;
  inset-inline-end: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-hint {
  display: none;
}

.filter {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 9px 14px;
}

.filter.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.place-page {
  padding-top: 55px;
  padding-bottom: 100px;
  max-width: 980px;
}

.back-link {
  display: inline-block;
  font-weight: 800;
  margin-bottom: 36px;
}

.place-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.place-head h1 {
  font-size: clamp(42px,6vw,72px);
  margin: 10px 0 8px;
}

.place-head p {
  margin: 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  border-block: 1px solid var(--line);
  margin: 40px 0;
  padding: 28px 0;
  gap: 20px;
}

.stats strong {
  display: block;
  font-size: 36px;
  letter-spacing: -1px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.vote-box {
  background: #111;
  color: #fff;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 48px;
}

.vote-box h2 {
  font-size: 30px;
  margin: 0 0 8px;
  letter-spacing: -1px;
}

.vote-box p {
  color: #bdbdb8;
  margin: 0 0 22px;
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.yes-button,
.no-button {
  border: 1px solid #333;
  border-radius: 12px;
  padding: 15px;
  font-weight: 900;
}

.yes-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.yes-button:not(:disabled):hover {
  filter: brightness(.94);
}

.no-button {
  background: #222;
  color: #fff;
}

.subheading {
  font-size: 30px;
  margin: 0 0 20px;
}

.reason {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.reason-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.reason-row span {
  color: var(--muted);
  font-size: 12px;
}

.notice,
.error-box,
.empty,
.loading {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
  color: #555;
}

.error-box h2 {
  margin-top: 0;
  color: #111;
}

.primary-button {
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 11px;
  padding: 11px 15px;
  font-weight: 800;
}

.inline-add {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 8px 11px;
  margin-inline-start: 8px;
}

.full {
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-panel {
  position: relative;
  background: var(--paper);
  border-radius: 20px;
  padding: 30px;
  width: min(650px,100%);
  max-height: 90vh;
  overflow: auto;
}

.modal-panel h2 {
  font-size: 32px;
  margin: 0 0 22px;
}

.modal-close {
  position: absolute;
  top: 15px;
  inset-inline-end: 15px;
  border: 0;
  background: var(--soft);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.field {
  margin: 15px 0;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
  outline: none;
}

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

.field-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 7px;
}

.country-results {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  max-height: 220px;
  margin-top: 6px;
  background: #fff;
}

.country-option {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
  text-align: start;
  padding: 10px 12px;
}

.country-option:hover {
  background: var(--soft);
}

.country-option span {
  color: var(--muted);
  font-size: 11px;
}

.hidden {
  display: none !important;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-logo {
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -1px;
  opacity: .6;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.footer-contact-button {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-contact-button:hover {
  color: var(--ink);
}

/* Admin dashboard */
.admin-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 65px 24px 100px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 30px;
}

.admin-top h1 {
  font-size: 48px;
  letter-spacing: -2px;
  margin-bottom: 8px;
}

.admin-top p {
  color: var(--muted);
}

.admin-list {
  display: grid;
  gap: 14px;
}

.submission-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

#approvedPlacesList {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
  align-items: stretch;
}

#approvedPlacesList .approved-place-card {
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

#approvedPlacesList .submission-main {
  min-width: 0;
}

#approvedPlacesList .submission-title h2 {
  font-size: 21px;
  overflow-wrap: anywhere;
}

#approvedPlacesList .submission-reason {
  max-width: none;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#approvedPlacesList .submission-actions {
  width: 100%;
  align-items: stretch;
}

#approvedPlacesList .submission-actions .secondary-button {
  flex: 1;
}

@media (max-width:1050px) {
  #approvedPlacesList {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

.submission-title h2 {
  font-size: 25px;
  margin: 10px 0;
}

.submission-meta {
  font-size: 13px;
  color: var(--muted);
}

.submission-reason {
  max-width: 700px;
  line-height: 1.55;
}

.submission-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.login-card {
  max-width: 440px;
  margin: 70px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
}

.login-card h1 {
  font-size: 45px;
  letter-spacing: -2px;
  margin: 0 0 10px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width:850px) {
  .grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .hero h1,
  .explore-page h1,
  .admin-page h1 {
    letter-spacing: -2.5px;
  }

  .main-nav {
    gap: 10px;
  }

  .main-nav>a {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .submission-card {
    flex-direction: column;
  }

  .submission-actions {
    align-items: stretch;
  }

  #approvedPlacesList {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width:560px) {
  .site-header {
    padding: 0 16px;
  }

  .main-nav {
    gap: 7px;
  }

  .nav-button {
    padding: 9px 10px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 55px;
  }

  .hero h1,
  .explore-page h1,
  .place-page h1,
  .admin-page h1 {
    font-size: 45px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .vote-actions {
    grid-template-columns: 1fr;
  }

  .place-head {
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
  }

  .modal-panel {
    padding: 24px 18px;
  }

  #approvedPlacesList {
    grid-template-columns: 1fr;
  }
}

.vote-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 68px;
}

.vote-choice small {
  font-size: 11px;
  font-weight: 800;
  opacity: .9;
}

.vote-choice.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.your-vote-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid #333;
  margin-top: 20px;
  padding-top: 18px;
}

.your-vote-box span {
  font-size: 14px;
  color: #fff;
}

.your-vote-box small {
  font-size: 12px;
  color: #aaa;
}

.split-vote-summary {
  margin: -24px 0 40px;
}

.split-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e4e4df;
  display: flex;
}

.split-bar i {
  display: block;
  height: 100%;
}

.split-boycott {
  background: var(--accent);
}

.split-no {
  background: #b7b7b2;
}

.split-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
}

.split-labels strong {
  color: #111;
}

.comment-form {
  margin-top: 22px;
  border-top: 1px solid #333;
  padding-top: 20px;
}

.comment-form label {
  display: block;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.comment-form label span {
  font-weight: 600;
  color: #aaa;
  font-size: 11px;
}

.comment-form textarea {
  min-height: 95px;
  background: #fff;
  border: 1px solid #444;
  color: #111;
  border-radius: 11px;
  width: 100%;
  padding: 12px;
  resize: vertical;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.comment-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}

.comment-card p {
  margin: 9px 0;
  line-height: 1.55;
}

.comment-card small {
  color: var(--muted);
  font-size: 11px;
}

.comment-vote {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 900;
  color: var(--accent);
}

.community-comments {
  margin-bottom: 42px;
}

.admin-section {
  margin-top: 44px;
}

.admin-section-head h2 {
  margin: 0 0 5px;
  font-size: 28px;
  letter-spacing: -.8px;
}

.admin-section-head p {
  margin: 0;
  color: var(--muted);
}

.avatar.has-logo,
.place-avatar.has-logo {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.admin-place-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: none;
  overflow: hidden;
}

.admin-logo.large {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  font-size: 20px;
}

.admin-logo.has-logo {
  background: #fff;
  border: 1px solid var(--line);
}

.admin-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-upload-box {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fafaf8;
}

.logo-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-start;
}

.logo-upload-actions input[type=file] {
  max-width: 100%;
}

@media (max-width:560px) {
  .logo-upload-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-place-line {
    align-items: flex-start;
  }
}

.brand-products-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.product-search-results {
  margin: 14px 0 18px;
}

.product-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}

.product-result-main span {
  font-size: 12px;
  color: var(--muted);
}

.admin-products {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-product-row.pending {
  background: #fafaf8;
}

.admin-product-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.admin-product-add input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
  outline: none;
}

@media (max-width:560px) {
  .admin-product-add {
    grid-template-columns: 1fr;
  }

  .product-result {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .explore-controls {
    grid-template-columns: 1fr;
  }

  .country-filter {
    max-width: 100%;
  }
}

.card-top .scope-tag {
  opacity: .72;
}

.brand-products-public {
  margin: 34px 0 42px;
  margin-top: 1.25rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1 1 320px;
  min-width: 220px;
}

.admin-search input,
.admin-filter {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--border, #ddd);
  border-radius: 10px;
  background: var(--surface, #fff);
  padding: 0 .85rem;
  font: inherit;
}

.admin-filter {
  flex: 0 0 150px;
}

.admin-result-count {
  font-size: .85rem;
  opacity: .62;
  white-space: nowrap;
}

.approved-place-card[hidden] {
  display: none !important;
}

.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;
}

.danger-button {
  border-color: rgba(190, 40, 40, .35);
  color: #b3261e;
}

.danger-button:hover {
  border-color: rgba(190, 40, 40, .6);
}

html[dir="rtl"] .explore-controls {
  grid-template-columns: minmax(0,3fr) minmax(180px,1fr);
}

@media (max-width: 760px) {
  .explore-controls,
  html[dir="rtl"] .explore-controls {
    grid-template-columns: 1fr;
  }
}

.admin-view-hidden {
  display: none !important;
}

.logo-library-section.admin-view-hidden {
  display: none !important;
}

.logo-library-toolbar {
  align-items: center;
}

.logo-library-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
}

.logo-library-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.logo-library-preview {
  height: 108px;
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 16px;
}

.logo-library-preview .admin-logo {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  font-size: 17px;
}

.logo-library-card-body {
  padding: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  flex: 1;
}

.logo-library-card-body h3 {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -.3px;
  margin: 0;
  min-height: 39px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.logo-library-card-body .tag {
  font-size: 10px;
  padding: 5px 8px;
}

.logo-library-status {
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
  margin-bottom: 4px;
}

.logo-library-status.is-active {
  color: #4d6650;
}

.logo-library-status.is-missing {
  color: var(--accent);
  font-weight: 700;
}

.logo-library-card .full {
  padding: 9px 10px;
  font-size: 12px;
}

.admin-top-compact {
  margin-bottom: 8px;
}

@media (max-width:1000px) {
  .logo-library-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (max-width:760px) {
  .logo-library-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width:480px) {
  .logo-library-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:850px) {
  .main-nav>a[data-admin-view="logos"] {
    display: block;
  }
}

.product-result-main {
  flex-direction: column;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-result-main>div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.product-result-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.product-result-logo.has-logo {
  background: #fff;
  border: 1px solid var(--line);
}

.product-result-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.admin-product-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  align-items: center;
}

.admin-product-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-product-main>span {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-product-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.admin-product-logo.has-logo {
  background: #fff;
  border: 1px solid var(--line);
}

.admin-product-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.admin-product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 9px;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.mini-upload input {
  display: none;
}

@media (max-width:700px) {
  .admin-product-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-product-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Associated brands/products editor */
.admin-product-name-input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.admin-product-name-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

@media (max-width:700px) {
  .admin-product-name-input {
    width: 100%;
  }

  .admin-product-main {
    width: 100%;
  }
}

.admin-bilingual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-lang-button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}

.logo-library-search {
  flex: 1 1 320px;
  min-width: 220px;
}

.logo-library-search input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--border,#ddd);
  border-radius: 10px;
  background: var(--surface,#fff);
  padding: 0 .85rem;
  font: inherit;
}

.logo-library-card[hidden] {
  display: none !important;
}

.admin-product-actions .icon-delete-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #111;
}

.admin-product-actions .icon-delete-button:hover {
  border-color: #bdbdb8;
  background: var(--soft);
}

.admin-product-actions .icon-delete-button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.listing-reason {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 42px;
  white-space: pre-wrap;
  min-height: 0 !important;
  height: auto !important;
  display: block;
  padding: 18px 22px !important;
  line-height: 1.7;
}

.listing-reason > .empty {
  margin: 0;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  align-items: center;
}

.admin-add-place-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width:560px) {
  .admin-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-add-place-button {
    width: 100%;
  }
}

.reason-editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.reason-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-bottom: 1px solid var(--line);
  background: #fafaf8;
}

.reason-tool:hover {
  background: var(--soft);
}

.reason-tool:focus-visible {
  outline: 2px solid #999;
  outline-offset: 1px;
}

.reason-editor-content {
  min-height: 150px;
  max-height: 360px;
  overflow: auto;
  padding: 13px 14px;
  outline: none;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.reason-editor-content:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

.reason-editor-content b,
.reason-editor-content strong {
  font-weight: 900;
}

.reason-editor-content i,
.reason-editor-content em {
  font-style: italic;
}

.reason-tool {
  width: 38px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-weight: 400;
}

.reason-tool strong {
  font-weight: 900;
}

.reason-tool em {
  font-weight: 400;
}

.reason-tool[data-reason-direction] {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}

.reason-editor-content [dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.reason-editor-content [dir="ltr"] {
  direction: ltr;
  text-align: left;
}

/* The public submission note is explanatory text, not a bordered notice box. */
.submit-note {
  margin-top: 12px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  border: 0;
  background: transparent;
}

/* Logo preview in Admin > Add place */
#addLogoPreview.has-logo {
  background: #fff;
  border: 1px solid var(--line);
}

/* Keep the associated product logo frame; remove only the outer card/circle. */

/* Logo Library is no longer a dashboard view. */
.logo-library-section {
  margin-top: 30px;
  display: none !important;
}

.admin-logout-button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
}

.admin-logout-button:hover {
  background: var(--soft);
}

.admin-logout-button[hidden] {
  display: none;
}

.avatar img,
.place-avatar img {
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  margin: 6px;
  object-fit: contain;
  display: block;
}

.admin-logo.has-logo img {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  margin: 5px;
  object-fit: contain;
}

.reason-copy,
.listing-reason {
  white-space: normal;
}

.reason-copy {
  text-indent: 0;
  line-height: 1.75;
  white-space: normal;
  word-break: break-word;
  margin: 0 !important;
  padding: 0 !important;
}

.reason-copy p,
.reason-copy div {
  margin: 0 !important;
  padding: 0 !important;
}

.reason-copy p+p,
.reason-copy div+div {
  margin-top: .65em !important;
}

.reason-copy br {
  margin-top: .2em;
  display: block;
  content: "";
  margin: 0;
}

@media (max-width:700px) {
  .admin-logout-button {
    padding: 8px 10px;
  }

  .site-header .main-nav {
    flex-wrap: wrap;
  }
}

.edit-place-tools {
  display: flex;
  justify-content: flex-start;
  margin: -8px 0 20px;
}

.comments-back-button {
  margin-bottom: 18px;
}

.brand-comment-card {
  align-items: center;
}

.brand-comment-card .submission-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-status-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}

.comment-status-tag.status-pending {
  background: #fafaf8;
}

.comment-status-tag.status-rejected {
  background: #f6eeee;
}

.comment-management-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.comment-management-text {
  white-space: pre-wrap;
}

@media (max-width:700px) {
  .brand-comment-card .submission-actions {
    align-self: stretch;
  }

  .comment-management-actions .secondary-button {
    flex: 1;
  }
}

.notice.success {
  border-color: #aaa;
  background: #aaaaaa !important;
  border: none !important;
  box-shadow: none !important;
}

.status-positive {
  background: #e2fee3 !important;
  border-color: #c9efcc !important;
  color: #315f37 !important;
}

.comment-status-tag.status-approved {
  background: #e2fee3 !important;
  border-color: #c9efcc !important;
  color: #315f37 !important;
}

.notice.success.contact-success {
  background: #e2fee3 !important;
  border: 1px solid #c9efcc !important;
  color: #315f37 !important;
  box-shadow: none !important;
}

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

.brand-products-title-row .subheading {
  margin: 0;
}

.brand-products-title-row .brand-products-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.brand-products-title-row p {
  flex-basis: 100%;
  margin: 0px 0px 20px 0px;
}

.product-chip {
  width: 82px;
  padding-inline: 1px;
}

/* Products & Brands — single source of truth */
.product-chips {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 24px;
  align-items: flex-start;
}

.product-chip {
  flex: 0 0 calc((100% - 108px) / 10);
  width: calc((100% - 108px) / 10);
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  vertical-align: top;
  min-height: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 2px 3px;
  gap: 7px;
  box-sizing: border-box;
}

.product-chip-logo {
  width: 77px;
  height: 56px;
  flex: 0 0 56px;
  margin: 0 auto;
  padding: 5px;
  box-sizing: border-box;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.product-chip-logo img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  flex: none !important;
}

.product-chip-name {
  display: block;
  width: 100%;
  min-height: 36px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400 !important;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: center;
}

/* Product grid follows the site's wider responsive rhythm:
   10 desktop → 8 large tablet → 6 tablet → 4 mobile → 3 small mobile. */
@media (max-width: 1100px) {
  .product-chip {
    flex-basis: calc((100% - 84px) / 8);
    width: calc((100% - 84px) / 8);
  }
}

@media (max-width: 850px) {
  .product-chips {
    column-gap: 10px;
    row-gap: 22px;
  }

  .product-chip {
    flex-basis: calc((100% - 50px) / 6);
    width: calc((100% - 50px) / 6);
  }
}

@media (max-width: 560px) {
  .product-chips {
    column-gap: 8px;
    row-gap: 18px;
  }

  .product-chip {
    flex-basis: calc((100% - 24px) / 4);
    width: calc((100% - 24px) / 4);
    padding-inline: 1px;
    gap: 10px;
  }

  .product-chip-logo {
    width: 77px;
    height: 56px;
  }

  .product-chip-name {
    min-height: 34px;
  }
}

@media (max-width: 380px) {
  .product-chips {
    column-gap: 7px;
    row-gap: 16px;
  }

  .product-chip {
    flex-basis: calc((100% - 14px) / 3);
    width: calc((100% - 14px) / 3);
  }

  .product-chip-logo {
    width: 72px;
    height: 54px;
  }
}

/* Brand identity */
.logo-bold,
.logo-medium {
  color: var(--ink);
}

/* Admin dashboard: pending work is intentionally split into two equal panels. */
.admin-dashboard-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.admin-dashboard-panel {
  min-width: 0;
  margin-top: 0;
}

.admin-dashboard-panel .admin-section-head {
  min-height: 68px;
}

.admin-dashboard-panel .admin-list {
  gap: 10px;
}

.admin-dashboard-panel .submission-card {
  padding: 16px;
  gap: 14px;
  flex-direction: column;
}

.admin-dashboard-panel .submission-title h2 {
  font-size: 20px;
  margin: 8px 0;
}

.admin-dashboard-panel .submission-reason {
  font-size: 13px;
  line-height: 1.5;
}

.admin-dashboard-panel .submission-actions {
  width: 100%;
}

.admin-dashboard-panel .submission-actions .primary-button,
.admin-dashboard-panel .submission-actions .secondary-button {
  flex: 1;
}

@media (max-width: 850px) {
  .admin-dashboard-pair {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-panel .admin-section-head {
    min-height: 0;
  }
}

/* Associated brands & products editor — compact single-row layout */
.admin-product-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.admin-product-row.pending {
  background: #fafaf8;
}

.admin-product-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.admin-product-logo.has-logo {
  background: #fff;
  border: 1px solid var(--line);
}

.admin-product-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.admin-product-name-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.admin-product-name-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

.admin-product-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.icon-action-btn {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.icon-action-btn:hover {
  border-color: #bdbdb8;
  background: var(--soft);
  transform: translateY(-1px);
}

.icon-action-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.icon-action-btn input[type="file"] {
  display: none;
}

.icon-action-btn.danger {
  color: #b42318;
}

.admin-pending-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-product-actions .field-help {
  white-space: nowrap;
}

/* Native browser tooltip via title remains available on every action icon. */
@media (max-width: 820px) {
  .admin-product-row {
    grid-template-columns: 50px minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 8px;
  }

  .admin-product-logo {
    width: 42px;
    height: 42px;
  }

  .icon-action-btn {
    width: 36px;
    height: 36px;
  }

  .admin-product-actions {
    gap: 5px;
  }
}

@media (max-width: 620px) {
  .admin-product-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .admin-product-row .admin-product-name-input:nth-child(3) {
    grid-column: 2 / 3;
  }

  .admin-product-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

/* Associated brands & products — final visual polish */
.admin-product-row {
  background: #fafaf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  box-sizing: border-box;
}

.admin-product-row.pending {
  background: #fafaf8;
}

.admin-product-actions {
  align-items: center;
  gap: 7px;
}

.icon-action-btn {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-sizing: border-box;
  line-height: 0;
  cursor: pointer;
}

.icon-action-btn svg {
  width: 19px;
  height: 19px;
  margin: 0;
  flex: 0 0 auto;
  display: block;
}

.icon-action-btn:hover {
  border-color: #bdbdb8;
  background: var(--soft);
  transform: translateY(-1px);
}

.icon-action-btn.danger {
  color: #b42318;
}

/* The Replace-logo control is a label because it opens the file picker.
   Keep it the same compact size as the other action buttons. */
.field .admin-product-actions label.icon-action-btn {
  display: inline-flex !important;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0 !important;
  margin: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  position: relative;
  box-sizing: border-box;
  line-height: 0 !important;
  vertical-align: middle;
}

.field .admin-product-actions label.icon-action-btn svg {
  display: block !important;
  position: static !important;
  width: 19px;
  height: 19px;
  margin: 0 !important;
}

.field .admin-product-actions label.icon-action-btn input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Replace-logo icon optical alignment */
.icon-action-btn .replace-logo-icon {
  display: block;
  width: 19px;
  height: 19px;
  margin: 0;
  transform: translate(-1px, 1px);
  transform-origin: center;
}

/* Instant custom tooltip */
.icon-action-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: none;
  z-index: 10000;
}

.icon-action-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #111;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: none;
  z-index: 10000;
}

.icon-action-btn:hover::after,
.icon-action-btn:hover::before,
.icon-action-btn:focus-visible::after,
.icon-action-btn:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.icon-action-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Associated Brands & Products — add form */
.admin-product-add.bilingual-add {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, .75fr) 38px 38px;
  align-items: center;
  gap: 10px;
}

.admin-product-add.bilingual-add > input {
  min-width: 0;
  margin: 0;
}

.admin-product-add.bilingual-add .associated-add-logo-btn,
.admin-product-add.bilingual-add .associated-add-product-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  box-sizing: border-box;
  line-height: 0 !important;
  position: relative;
}

.admin-product-add.bilingual-add .associated-add-logo-btn svg,
.admin-product-add.bilingual-add .associated-add-product-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  margin: 0;
  flex: 0 0 auto;
}

.admin-product-add.bilingual-add .associated-add-logo-btn input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.admin-product-add.bilingual-add .associated-add-logo-btn::after,
.admin-product-add.bilingual-add .associated-add-product-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: none;
  z-index: 10000;
}

.admin-product-add.bilingual-add .associated-add-logo-btn:hover::after,
.admin-product-add.bilingual-add .associated-add-product-btn:hover::after,
.admin-product-add.bilingual-add .associated-add-logo-btn:focus-visible::after,
.admin-product-add.bilingual-add .associated-add-product-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 760px) {
  .admin-product-add.bilingual-add {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .admin-product-add.bilingual-add .associated-add-logo-btn,
  .admin-product-add.bilingual-add .associated-add-product-btn {
    justify-self: start;
  }
}

/* Brand logo: keep Latin lettering identical in Arabic and English */
.brand-logo-latin,
.brand-logo-latin * {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-style: normal !important;
}

html[lang="ar"] .brand-logo-latin {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Public Boycott Index label */
.public-boycott-index,
.boycott-index-label,
.public-index-label {
  color: #d21f1f !important;
}

/* Brand logo is always Latin: never switch it to the Arabic font */
.logo,
.logo .logo-bold,
.logo .logo-medium {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Public card tags — single authoritative styling */
.card-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 3px;
  min-width: 0;
}

.card .scope-tag {
  font-size: 11px !important;
  line-height: 1.15 !important;
  font-weight: 400 !important;
  white-space: nowrap;
}

.card .subbrand-count-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
  font-size: 11px !important;
  line-height: 1.15 !important;
  font-weight: 400 !important;
  color: #5d5d58;
}

.card .subbrand-count-tag strong {
  font-weight: 800 !important;
}

html[lang="ar"] .card .scope-tag,
html[lang="ar"] .card .subbrand-count-tag {
  font-size: 11px !important;
  line-height: 1.15 !important;
}

html[lang="ar"] .card .scope-tag {
  font-weight: 400 !important;
}

html[lang="ar"] .card .subbrand-count-tag {
  font-weight: 400 !important;
}

html[lang="ar"] .card .subbrand-count-tag strong {
  font-weight: 800 !important;
}

/* Remove the previous inner spacing so the logo sits directly against its border. */
.avatar.has-logo img,
.avatar img,
.place-avatar.has-logo img,
.place-avatar img {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
  display: block;
}

.public-boycott-index {
  color: #BF1F1B !important;
}

/* Public Add a Place — parent brand picker */
.parent-brand-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.parent-brand-option,
.parent-brand-add {
  width: 100%;
  text-align: start;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}

.parent-brand-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.parent-brand-option span {
  opacity: .65;
  font-size: .9em;
}

.parent-brand-option:hover,
.parent-brand-add:hover {
  background: var(--soft);
}

.parent-brand-not-found {
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}

.parent-brand-add {
  font-weight: 700;
}

.new-parent-fields {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fafaf8;
}

.new-parent-fields .field {
  margin-bottom: 10px;
}

/* Hero heading refinement */
.hero h1 {
  line-height: 1.1 !important;
  font-size: clamp(44px,6.2vw,78px) !important;
}

@media (max-width:560px) {
  .hero h1 {
    font-size: 42px !important;
    line-height: 1.1 !important;
  }
}

/* Public associated-brand logos: remove inner spacing */
.product-chip-logo {
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}

.product-chip-logo img {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  display: block !important;
  object-fit: contain !important;
}

/* Public feedback states */
.notice.error {
  background: #fbe7e7 !important;
  border: 1px solid #efc5c5 !important;
  color: #7d2020 !important;
  box-shadow: none !important;
}

.notice.warning {
  background: #fdf2dd !important;
  border: 1px solid #ecd8ad !important;
  color: #76551b !important;
  box-shadow: none !important;
}

/* Add Place modal: reserve compact space for post-submit feedback */
.add-place-modal .modal-body,
.add-place-modal .modal-content,
.modal.add-place-modal .modal-body {
  padding-bottom: 18px;
}

.admin-section-title-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.admin-section-title-line h1,
.admin-section-title-line h2 {
  margin: 0;
}

.admin-count-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f1ee;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.admin-see-all {
  margin-inline-start: auto;
  white-space: nowrap;
}

.admin-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.admin-select-all input,
.submission-check input {
  width: 17px;
  height: 17px;
  accent-color: currentColor;
}

.submission-check {
  display: flex;
  align-items: flex-start;
  padding-top: 3px;
}

.admin-full-list .submission-card {
  align-items: flex-start;
}

.admin-full-list .submission-main {
  flex: 1;
}

.admin-full-list .submission-actions {
  align-self: center;
}

.admin-back-button {
  margin-bottom: 14px;
}

@media (max-width:850px) {
  .admin-full-list .submission-card {
    flex-direction: column;
  }

  .submission-check {
    padding-top: 0;
  }

  .admin-full-list .submission-actions {
    width: 100%;
  }
}

/* Admin moderation overview */
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-section-head > div {
  min-width: 0;
}

.count-tag {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  margin-inline-start: 6px;
  border-radius: 999px;
  background: #fbe7e7;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.see-all-button {
  flex: none;
  white-space: nowrap;
}

.moderation-page .admin-top {
  margin-bottom: 26px;
}

.moderation-back-button {
  margin-bottom: 18px;
}

.moderation-page .admin-top h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

.moderation-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 4px 14px;
}

.select-all-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  cursor: pointer;
}

.select-all-control input,
.moderation-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #111;
  cursor: pointer;
}

.selected-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.moderation-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.moderation-check {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 22px;
}

.moderation-item .submission-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 650px) {
  .admin-section-head {
    align-items: flex-start;
  }

  .admin-section-head h2 {
    font-size: 23px;
  }

  .moderation-item {
    grid-template-columns: 24px minmax(0,1fr);
    gap: 8px;
  }

  .moderation-item .submission-card {
    padding: 16px;
  }
}

/* Bulk moderation actions */
.moderation-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.moderation-bulk-actions button:disabled {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width:640px) {
  .moderation-toolbar {
    flex-wrap: wrap;
  }

  .selected-count {
    width: 100%;
  }
}

/* Theme toggle and dark mode */
.theme-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 11px;
  padding: 0;
  transition: background .16s ease,border-color .16s ease,color .16s ease;
}

.theme-toggle:hover {
  background: var(--soft);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
  display: block;
}

/* Bulk actions sit at the logical end: right in English, left in Arabic. */
.moderation-bulk-actions {
  margin-inline-start: auto;
}

html[data-theme="dark"] {
  --bg: #111210;
  --paper: #191a18;
  --ink: #f4f4f0;
  --muted: #a9aaa4;
  --line: #343531;
  --soft: #262724;
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .site-header {
  background: rgba(17,18,16,.94);
}

html[data-theme="dark"] .lead {
  color: #b8b9b3;
}

html[data-theme="dark"] .search-input,
html[data-theme="dark"] .explore-search input,
html[data-theme="dark"] .country-filter select,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .country-results,
html[data-theme="dark"] .country-option,
html[data-theme="dark"] .comment-form textarea,
html[data-theme="dark"] .admin-search input,
html[data-theme="dark"] .admin-filter,
html[data-theme="dark"] .reason-editor,
html[data-theme="dark"] [contenteditable="true"] {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #85867f;
}

html[data-theme="dark"] .search-input::placeholder,
html[data-theme="dark"] .explore-search input::placeholder {
  color: #9b9c96;
  opacity: .5;
}

html[data-theme="dark"] .explore-search input {
  background: var(--paper);
  color: var(--ink);
  caret-color: var(--ink);
}

html[data-theme="dark"] .country-filter select {
  background: var(--paper);
  color: var(--ink);
}

html[data-theme="dark"] .country-select-icon {
  color: #d7d8d1;
}

/* Match the public boycott-reason card to community-reason cards in dark mode. */
html[data-theme="dark"] .listing-reason {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

/* The vote callout intentionally inverts against the dark page. */
html[data-theme="dark"] .vote-box {
  background: #fff;
  color: #111;
}

html[data-theme="dark"] .vote-box p {
  color: #666660;
}

html[data-theme="dark"] .vote-box .your-vote-box,
html[data-theme="dark"] .vote-box .comment-form {
  border-color: #d8d8d2;
}

html[data-theme="dark"] .vote-box .your-vote-box span {
  color: #111;
}

html[data-theme="dark"] .vote-box .your-vote-box small,
html[data-theme="dark"] .vote-box .comment-form label span {
  color: #74746e;
}

html[data-theme="dark"] .vote-box .comment-form textarea {
  background: #fff;
  color: #111;
  border-color: #cfcfc9;
  caret-color: #111;
}

html[data-theme="dark"] .vote-box .comment-form textarea::placeholder {
  color: #8b8b85;
}

html[data-theme="dark"] .country-option {
  border-bottom-color: var(--line);
}

html[data-theme="dark"] .country-option:hover {
  background: var(--soft);
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .submission-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .comment-card,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .admin-section,
html[data-theme="dark"] .card {
  background: var(--paper);
  border-color: var(--line);
}

html[data-theme="dark"] .modal {
  background: rgba(0,0,0,.72);
}

html[data-theme="dark"] .modal-close {
  background: var(--soft);
  color: var(--ink);
}

html[data-theme="dark"] .split-labels strong {
  color: var(--ink);
}

html[data-theme="dark"] .bar,
html[data-theme="dark"] .split-bar {
  background: #383934;
}

html[data-theme="dark"] .tag {
  background: var(--soft);
  color: #c6c7c0;
}

html[data-theme="dark"] .avatar,
html[data-theme="dark"] .place-avatar {
  background: #f1f1ed;
  color: #111;
}

html[data-theme="dark"] .count-tag,
html[data-theme="dark"] .admin-count-tag {
  color: #2a1515;
}

html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .lang-button,
html[data-theme="dark"] .admin-lang-button,
html[data-theme="dark"] .admin-logout-button {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .notice,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .error-box {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .admin-logo,
html[data-theme="dark"] .admin-product-logo {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .admin-product-row {
  border-color: var(--line);
}

html[data-theme="dark"] .select-all-control input,
html[data-theme="dark"] .moderation-check input {
  accent-color: #f4f4f0;
}

@media (max-width:560px) {
  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* Approve / Reject action colors */
[data-approve],
[data-comment-approve],
#bulkApproveSubmissions,
#bulkApproveComments {
  background: #cff5cb !important;
  border: 1px solid #8fc989 !important;
  color: #173b1a !important;
}

[data-approve]:not(:disabled):hover,
[data-comment-approve]:not(:disabled):hover,
#bulkApproveSubmissions:not(:disabled):hover,
#bulkApproveComments:not(:disabled):hover {
  background: #bceab7 !important;
  border-color: #75b86e !important;
}

[data-reject],
[data-comment-reject],
#bulkRejectSubmissions,
#bulkRejectComments {
  background: #ecbbb9 !important;
  border: 1px solid #bd7774 !important;
  color: #501b19 !important;
}

[data-reject]:not(:disabled):hover,
[data-comment-reject]:not(:disabled):hover,
#bulkRejectSubmissions:not(:disabled):hover,
#bulkRejectComments:not(:disabled):hover {
  background: #dfa5a2 !important;
  border-color: #a95f5c !important;
}

[data-approve]:disabled,
[data-comment-approve]:disabled,
#bulkApproveSubmissions:disabled,
#bulkApproveComments:disabled,
[data-reject]:disabled,
[data-comment-reject]:disabled,
#bulkRejectSubmissions:disabled,
#bulkRejectComments:disabled {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
}

.count-tag,
.admin-count-tag {
  background: #fbe7e7;
  border: 1px solid #e7bcbc;
}

html[data-theme="dark"] .count-tag,
html[data-theme="dark"] .admin-count-tag {
  background: #fbe7e7;
  border-color: #dca9a9;
  color: #2a1515;
}

/* Button sizing parity and RTL directional arrows */
.primary-button,
.secondary-button,
.nav-button,
.lang-button,
.admin-lang-button,
.admin-logout-button,
.see-all-button,
.moderation-back-button,
.comments-back-button,
.footer-contact-button {
  box-sizing: border-box;
  line-height: 1.2;
}

.primary-button,
.secondary-button,
.nav-button,
.see-all-button,
.moderation-back-button,
.comments-back-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[lang="ar"] .primary-button,
html[lang="ar"] .secondary-button,
html[lang="ar"] .nav-button,
html[lang="ar"] .lang-button,
html[lang="ar"] .admin-lang-button,
html[lang="ar"] .admin-logout-button,
html[dir="rtl"] .primary-button,
html[dir="rtl"] .secondary-button,
html[dir="rtl"] .nav-button,
html[dir="rtl"] .lang-button,
html[dir="rtl"] .admin-lang-button,
html[dir="rtl"] .admin-logout-button {
  font-size: 16px;
  line-height: 1.2;
}

.direction-link,
.moderation-back-button,
.comments-back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.direction-arrow {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke-width: 2;
}

html[dir="rtl"] .direction-link,
html[dir="rtl"] .moderation-back-button,
html[dir="rtl"] .comments-back-button {
  flex-direction: row;
}

/* v83 — stable search border + softer placeholder */
.search-input,
.explore-search .search-field input {
  border-width: 1.5px;
  box-sizing: border-box;
  transition: border-color .22s ease;
}

.search-wrap:hover .search-input,
.explore-search .search-field:hover input {
  border-color: rgba(191, 31, 27, .5);
}

/* v85 — Products & brands count badge color parity with Admin pending count */
.brand-products-title-row .brand-products-count {
  background: #fbe7e7;
  border-color: #e7bcbc;
}

html[data-theme="dark"] .brand-products-title-row .brand-products-count {
  background: #fbe7e7;
  border-color: #dca9a9;
  color: #2a1515;
}
