:root {
  --ink: #18211f;
  --muted: #63716d;
  --line: #dce7e3;
  --surface: #ffffff;
  --soft: #eef7f3;
  --page: #f5f8f6;
  --primary: #176b5d;
  --primary-strong: #0f4f44;
  --accent: #cf5135;
  --gold: #d99d28;
  --sky: #d9edf5;
  --blue: #245c82;
  --shadow: 0 14px 34px rgba(28, 50, 45, 0.1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf8f5;
  --muted: #a8bbb5;
  --line: #294b44;
  --surface: #10231f;
  --soft: #183b34;
  --page: #071512;
  --primary: #55d6ba;
  --primary-strong: #a9ffee;
  --accent: #ff8a65;
  --gold: #ffd166;
  --sky: #12333b;
  --blue: #82c7ff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 46px);
  border-bottom: 1px solid rgba(220, 231, 227, 0.86);
  background: rgba(245, 248, 246, 0.92);
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .topbar {
  background: rgba(7, 21, 18, 0.9);
}

.brand,
.top-actions,
.hero-actions,
.card-actions,
.category-chips {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

.brand span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.account-avatar-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.account-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.password-field input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 32px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-status {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.theme-status:hover {
  color: var(--primary);
  background: var(--soft);
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 46px) 98px;
}

.market-pulse {
  overflow: hidden;
  margin: 4px 0 14px;
  border: 1px solid #f0d488;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff5cf, #e7f8f1, #eef5ff, #fff0e8);
  box-shadow: 0 10px 24px rgba(97, 69, 12, 0.08);
}

[data-theme="dark"] .market-pulse {
  border-color: #4b3a17;
  background: linear-gradient(90deg, #1b2f29, #16263b, #2a1d16, #10231f);
}

.pulse-track {
  display: flex;
  width: max-content;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  animation: pulseMarquee 30s linear infinite;
}

.pulse-track span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 5px 14px rgba(31, 67, 60, 0.08);
}

[data-theme="dark"] .pulse-track span {
  background: rgba(16, 35, 31, 0.88);
}

.pulse-track strong {
  color: var(--accent);
  font-size: 18px;
}

@keyframes pulseMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  padding: 10px 0 18px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 250px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(217, 157, 40, 0.24), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(36, 92, 130, 0.18), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f4fbf7 54%, #fff1e8 100%);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .hero-copy {
  background:
    radial-gradient(circle at top left, rgba(255, 209, 102, 0.18), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(130, 199, 255, 0.15), transparent 30%),
    linear-gradient(135deg, #10231f 0%, #122a25 54%, #251912 100%);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(32px, 5.8vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

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

.hero-highlights span {
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 6px 14px rgba(28, 50, 45, 0.08);
}

[data-theme="dark"] .hero-highlights span,
[data-theme="dark"] .photo-callout,
[data-theme="dark"] .stats div,
[data-theme="dark"] .listing-card,
[data-theme="dark"] .controls {
  background: var(--surface);
}

.hero-visual {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13221f;
  box-shadow: var(--shadow);
}

.photo-collage {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: repeat(3, 92px);
  gap: 8px;
  height: 100%;
  padding: 10px;
}

.photo-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.photo-collage .wide {
  grid-row: span 3;
}

.photo-callout {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.photo-callout strong {
  color: var(--primary-strong);
}

.photo-callout span {
  color: var(--muted);
  font-size: 13px;
}

.controls {
  display: grid;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(28, 50, 45, 0.06);
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.search-box label {
  display: grid;
  gap: 6px;
}

.search-submit {
  min-height: 46px;
  min-width: 138px;
  white-space: nowrap;
}

.search-feedback {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #9bd5c9;
  border-radius: 8px;
  background: #e5f6f0;
  color: #145748;
  font-weight: 800;
}

.search-feedback.not-found {
  border-color: #e5bc82;
  background: #fff4dc;
  color: #744b11;
}

.search-active .security-panel,
.search-active .growth-logistics,
.search-active .transporter-strip {
  display: none;
}

.profile-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-summary h3,
.profile-summary p {
  margin: 0;
}

.profile-summary p {
  color: var(--muted);
  font-size: 13px;
}

.profile-listings {
  display: grid;
  gap: 8px;
}

.profile-listing-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-listing-row span,
.profile-listing-row small {
  display: block;
}

.profile-page {
  display: grid;
  gap: 20px;
  padding: 24px 0 80px;
}

.profile-page[hidden] {
  display: none;
}

body.profile-open main > :not(.profile-page) {
  display: none !important;
}

.profile-page-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-page .profile-avatar {
  width: 92px;
  height: 92px;
}

.profile-page-head h1,
.profile-page-head p {
  margin: 0;
}

.profile-page-head p {
  color: var(--muted);
}

.profile-section {
  display: grid;
  gap: 12px;
}

.profile-section h2 {
  margin: 0;
  font-size: 22px;
}

.inbox-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.inbox-row p,
.inbox-row small {
  margin: 0;
  color: var(--muted);
}

.profile-listing-row small {
  color: var(--muted);
}

.similar-results {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.similar-results h2 {
  margin: 0;
  font-size: 22px;
}

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

.suggestion-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.suggestion-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: cover;
}

.suggestion-card div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.suggestion-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-card span {
  color: var(--primary);
  font-size: 14px;
  font-weight: 850;
}

.celebration {
  position: fixed;
  z-index: 30;
  top: 84px;
  left: 50%;
  right: auto;
  max-width: min(320px, calc(100vw - 32px));
  text-align: center;
  padding: 12px 14px;
  border: 1px solid #93d8c6;
  border-radius: 8px;
  background: #e8fff6;
  box-shadow: 0 12px 30px rgba(12, 63, 51, 0.2);
  color: #0e4c3e;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20px) rotate(-1deg) scale(0.92);
}

.celebration.show {
  animation: celebration-pop 2.8s ease both;
}

@keyframes celebration-pop {
  0% { opacity: 0; transform: translate(-50%, -20px) rotate(-1deg) scale(0.92); }
  16% { opacity: 1; transform: translate(-50%, 0) rotate(1deg) scale(1.04); }
  28% { transform: translate(-50%, -5px) rotate(-1deg) scale(1); }
  84% { opacity: 1; transform: translate(-50%, 0) rotate(0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 10px) rotate(0) scale(0.96); }
}

.search-box span,
.dialog-card label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .chip {
  background: #0b1d19;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 93, 0.12);
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.filter-row,
.stats,
.grid {
  display: grid;
  gap: 12px;
}

.filter-row,
.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.distance-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 240px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.price-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.price-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.distance-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.category-chips {
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.chip[data-category-chip="Furniture"].active {
  border-color: var(--primary);
  background: var(--primary);
}

.chip[data-category-chip="Electronics"].active {
  border-color: var(--blue);
  background: var(--blue);
}

.chip[data-category-chip="Appliances"].active {
  border-color: var(--gold);
  background: var(--gold);
  color: #2b2108;
}

.stats {
  margin: 14px 0;
}

.stats div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 25px;
}

.stats span {
  color: var(--muted);
  font-size: 13px;
}

.security-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 16px;
  align-items: center;
  margin: 14px 0;
  padding: 16px;
  border: 1px solid #ead6a4;
  border-radius: 8px;
  background: #fffaf0;
}

[data-theme="dark"] .security-panel {
  border-color: #5c4a1e;
  background: #211a0e;
}

.security-panel p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.growth-logistics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.growth-panel,
.logistics-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(25, 48, 43, 0.07);
}

.growth-panel {
  background: linear-gradient(135deg, #fff3d4, #ffffff);
}

.logistics-panel {
  background: linear-gradient(135deg, #e3f4ff, #ffffff);
}

[data-theme="dark"] .growth-panel {
  background: linear-gradient(135deg, #30250e, var(--surface));
}

[data-theme="dark"] .logistics-panel {
  background: linear-gradient(135deg, #102a3c, var(--surface));
}

.growth-panel p,
.logistics-panel p {
  color: var(--muted);
  line-height: 1.5;
}

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

.transporter-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.transporter-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.transporter-card div,
.transporter-card strong,
.transporter-card span {
  display: block;
}

.transporter-card span,
.transporter-card p {
  color: var(--muted);
  font-size: 13px;
}

.transporter-card p {
  margin: 0;
}

.transporter-card b {
  color: var(--primary);
}

.marketplace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 14px;
}

.marketplace-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.listing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(25, 48, 43, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.listing-photo {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  background: var(--soft);
}

.listing-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(0,0,0,0.45), transparent);
  pointer-events: none;
}

.listing-photo img {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
  transition: transform 220ms ease;
}

.listing-card:hover .listing-photo img {
  transform: scale(1.035);
}

.photo-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.photo-count {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.listing-photo.furniture .photo-badge {
  background: var(--primary);
}

.listing-photo.electronics .photo-badge {
  background: var(--blue);
}

.listing-photo.appliances .photo-badge {
  background: var(--gold);
}

.listing-photo.other .photo-badge {
  background: var(--accent);
}

.save-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  min-width: 58px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.save-button.saved {
  color: white;
  background: var(--accent);
}

.listing-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.listing-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.listing-title h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.seller-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seller-badges span {
  padding: 5px 7px;
  border-radius: 8px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

[data-theme="dark"] .seller-badges span {
  background: #102b3d;
}

.price {
  color: var(--primary);
  font-weight: 900;
  white-space: nowrap;
}

.meta,
.description,
.seller-row {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.description {
  margin-bottom: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.tag:nth-child(2) {
  background: #fff1d1;
  color: #8b5b00;
}

.tag:nth-child(3) {
  background: #f9e6df;
  color: #9b321d;
}

[data-theme="dark"] .tag:nth-child(2) {
  background: #3d2d0a;
  color: #ffd166;
}

[data-theme="dark"] .tag:nth-child(3) {
  background: #3b1d16;
  color: #ffad95;
}

.seller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.transport-action {
  color: #0a6c7a;
  background: #e8f8fb;
  border-color: #a7e4ec;
}

[data-theme="dark"] .transport-action {
  color: #9ceaf2;
  background: #0d2d32;
  border-color: #22646e;
}

.primary-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.primary-button {
  min-height: 46px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
}

.primary-button:hover,
.icon-button:hover {
  background: var(--primary-strong);
}

.text-button {
  min-height: 40px;
  padding: 0 12px;
  background: var(--soft);
  color: var(--primary);
}

.text-button:hover {
  background: #dcefe7;
}

.danger-button {
  background: #f9e6df;
  color: #9b321d;
}

.danger-button:hover {
  background: #f3cfc2;
}

[data-theme="dark"] .danger-button {
  background: #3b1d16;
  color: #ffad95;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--primary);
  color: white;
  font-size: 22px;
}

.empty-state {
  margin: 40px 0;
  color: var(--muted);
  text-align: center;
}

.bottom-nav {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.nav-item {
  min-height: 58px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.nav-item.active {
  color: var(--primary);
  background: var(--soft);
}

dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 28, 25, 0.52);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-head,
.split {
  display: grid;
  gap: 10px;
}

.dialog-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.dialog-card label {
  display: grid;
  gap: 6px;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.google-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-weight: 850;
}

.google-button::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  color: #ffffff;
  background: #1a73e8;
  font-weight: 900;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-checks label,
.inline-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 8px !important;
  line-height: 1.4;
}

.auth-checks input,
.inline-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.location-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

[data-theme="dark"] .location-box,
[data-theme="dark"] .photo-preview {
  background: #0d211d;
}

.photo-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.photo-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

.photo-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.is-hidden {
  display: none !important;
}

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

@media (max-width: 920px) {
  .hero,
  .grid,
  .growth-logistics,
  .transporter-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .brand span {
    display: none;
  }

  .topbar {
    padding: calc(18px + env(safe-area-inset-top)) 14px 12px;
  }

  .top-actions .text-button {
    max-width: 126px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  main {
    padding: 14px 14px 104px;
  }

  .hero-copy {
    min-height: 0;
    padding: 18px;
  }

  .hero-visual {
    min-height: 220px;
  }

  .filter-row,
  .price-row,
  .stats,
  .security-panel,
  .split {
    grid-template-columns: 1fr;
  }

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

  .search-submit {
    width: 100%;
    min-height: 50px;
  }

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

  .profile-page-head {
    grid-template-columns: auto 1fr;
  }

  .profile-page-head > .text-button {
    grid-column: 1 / -1;
  }

  .marketplace-head {
    align-items: start;
  }

  .seller-row {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions {
    justify-content: stretch;
  }

.card-actions button {
    flex: 1 1 120px;
  }

  .bottom-nav {
    display: grid;
  }
}

.tool-form,
.message-list {
  display: grid;
  gap: 10px;
}

.message-list {
  max-height: 300px;
  overflow: auto;
}

.message-row,
.admin-row {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.blocked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.blocked-row div,
.blocked-row strong,
.blocked-row span {
  display: block;
}

.blocked-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.message-row span,
.admin-row span,
.message-row small {
  color: var(--muted);
  font-size: 13px;
}

.live-chat {
  gap: 8px;
}

.chat-bubble {
  display: grid;
  width: fit-content;
  max-width: 82%;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 8px;
}

.chat-bubble.mine {
  justify-self: end;
  background: var(--primary);
  color: white;
}

.chat-bubble.theirs {
  justify-self: start;
  background: var(--soft);
  color: var(--ink);
}

.chat-bubble small {
  font-size: 12px;
  opacity: 0.78;
}

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

.admin-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.admin-grid strong,
.admin-grid span {
  display: block;
}

.admin-grid strong {
  font-size: 24px;
  color: var(--primary);
}

.admin-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.photo-preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 88px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--primary);
  font-weight: 750;
}

.environment-label {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.legal-page {
  width: min(820px, calc(100% - 32px));
  margin: 32px auto;
  padding-bottom: 48px;
}

.legal-page h1 {
  margin-bottom: 8px;
}

.legal-page h2 {
  margin-top: 28px;
  font-size: 20px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-page a {
  color: var(--primary);
  font-weight: 750;
}

@media (max-width: 680px) {
  #adminButton {
    display: none;
  }

  .distance-row,
  .admin-grid,
  .photo-preview-grid {
    grid-template-columns: 1fr;
  }

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