:root {
  --bg: #0b0f14;
  --surface: #141a22;
  --elevated: #1b2330;
  --divider: #2a3441;
  --primary: #00e676;
  --primary-dim: rgba(0, 230, 118, 0.14);
  --text: #eaf0f5;
  --muted: #a0a5b5;
  --danger: #ff5252;
  --font: "Vazirmatn", "IBM Plex Sans", system-ui, sans-serif;
  --display: "Syne", "Vazirmatn", sans-serif;
  --radius: 14px;
  --max: 720px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
}
body.feed-mode {
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(0, 230, 118, 0.08), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(0, 176, 255, 0.06), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: auto !important;
}
body.feed-mode html {
  overflow: auto !important;
}
a { color: var(--primary); text-decoration: none; }
button, input, textarea { font: inherit; }
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(11, 15, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
}
.brand {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand span { color: var(--primary); }
.topbar__spacer { flex: 1; }
.topbar__lang {
  flex-shrink: 0;
}
.topbar .lang-select {
  border-color: var(--divider);
  background-color: var(--elevated);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a0a5b5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}
.topbar__user {
  font-size: 13px;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: var(--primary);
  color: #04140a;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--divider);
}
.btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 82, 82, 0.35);
}
.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--elevated);
  border: 1px solid var(--divider);
  color: var(--text);
}

.auth {
  flex: 1;
  position: relative;
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
  padding: 28px 16px 48px;
  overflow: hidden;
}
.auth__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  filter: blur(2px) saturate(0.85);
  transform: scale(1.04);
}
.auth__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.auth__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(120deg, rgba(11, 15, 20, 0.82) 0%, rgba(11, 15, 20, 0.55) 45%, rgba(11, 15, 20, 0.78) 100%),
    radial-gradient(600px 400px at 80% 20%, rgba(0, 230, 118, 0.12), transparent 60%);
}
.auth__layout {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: stretch;
}
.auth__aside {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(20, 26, 34, 0.55);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.auth__aside-media {
  flex: 1;
  min-height: 220px;
  background:
    linear-gradient(180deg, transparent 30%, rgba(11, 15, 20, 0.85) 100%),
    url("../img/bg/02.jpg") center/cover no-repeat;
}
.auth__aside-copy {
  padding: 18px 18px 20px;
}
.auth__aside-copy h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.auth__aside-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.92rem;
}
.auth__card {
  width: 100%;
  background: rgba(20, 26, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 26px 22px 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}
.auth__title {
  font-family: var(--display);
  font-size: 1.85rem;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.auth__sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}
.oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.btn--oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 600;
  border: 1px solid var(--divider);
  background: #fff;
  color: #111;
  cursor: pointer;
}
.btn--oauth[hidden],
#google-btn-host[hidden] {
  display: none !important;
}
.btn--oauth.apple {
  background: #000;
  color: #fff;
  border-color: #222;
}
.btn--oauth svg { width: 18px; height: 18px; flex-shrink: 0; }
.oauth__switch {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.oauth__switch:hover { color: var(--text); }
.auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 14px;
}
.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.field input {
  width: 100%;
  border: 1px solid var(--divider);
  background: rgba(11, 15, 20, 0.75);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus { border-color: var(--primary); }
.auth__error {
  color: var(--danger);
  font-size: 13px;
  min-height: 1.2em;
  margin: 0 0 12px;
}
.auth__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth__note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}
#google-btn-host {
  min-height: 44px;
  display: flex;
  justify-content: center;
}

@media (max-width: 820px) {
  .auth__layout {
    grid-template-columns: 1fr;
  }
  .auth__aside {
    order: 2;
    min-height: 0;
  }
  .auth__aside-media { min-height: 160px; }
  .auth__bg { grid-template-columns: repeat(2, 1fr); }
}

.auth {
  /* legacy override handled above */
}

.feed {
  flex: 1;
  padding: 12px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--elevated);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar--empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}
.card__meta { min-width: 0; }
.card__name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__loc {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--elevated);
  border: 1px solid var(--divider);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  line-height: 1.35;
}
a.card__loc:hover {
  border-color: rgba(0, 230, 118, 0.35);
  color: var(--text);
}
.card__loc--ok { color: var(--primary); }
.card__loc--manual { color: #ffd54f; }
.card__loc--off { color: var(--muted); }
.card__loc-icon { flex: 0 0 auto; }
.card__loc-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.card__loc-coords {
  margin-inline-start: auto;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  direction: ltr;
}
.card__loc-open {
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
a.card__loc:hover .card__loc-open {
  border-color: rgba(0, 230, 118, 0.4);
  color: var(--primary);
}
.card__time { font-size: 12px; color: var(--muted); }
.card__media {
  width: 100%;
  background: #000;
  aspect-ratio: 9 / 14;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}
.card__media--video {
  aspect-ratio: 9 / 16;
  min-height: 220px;
  background: #000;
}
.card__media--photo {
  aspect-ratio: auto;
  max-height: 70vh;
  width: 100%;
  object-fit: cover;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--trust, #a0a5b5);
  background: color-mix(in srgb, var(--trust, #a0a5b5) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--trust, #a0a5b5) 35%, transparent);
}
.trust-badge__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.btn--report { color: var(--muted); }
.card__actions { flex-wrap: wrap; }
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}
.report-modal__panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.report-modal__panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.report-modal__hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.report-modal__cats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 240px;
  overflow: auto;
}
.report-cat {
  text-align: right;
  border: 1px solid var(--divider);
  background: var(--elevated);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.report-cat.is-active {
  border-color: rgba(255, 82, 82, 0.55);
  background: rgba(255, 82, 82, 0.12);
  color: #ff8a80;
}
.report-modal textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  background: var(--elevated);
  color: var(--text);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.report-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.card__body { padding: 12px 14px 14px; }
.card__caption {
  margin: 0 0 12px;
  line-height: 1.55;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card__actions .count {
  font-size: 13px;
  color: var(--muted);
  min-width: 1.5em;
}
.liked { color: var(--primary) !important; border-color: rgba(0, 230, 118, 0.45) !important; background: var(--primary-dim) !important; }

.comments {
  margin-top: 12px;
  border-top: 1px solid var(--divider);
  padding-top: 12px;
}
.comments__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 10px;
}
.comment {
  background: var(--elevated);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.comment strong { color: var(--primary); font-weight: 600; }
.comment__row {
  display: flex;
  gap: 8px;
}
.comment__row input {
  flex: 1;
  border: 1px solid var(--divider);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}

.empty, .error-box, .loading {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}
.error-box { color: var(--danger); }
.load-more { align-self: center; margin-top: 8px; }

.filters {
  position: sticky;
  top: 58px;
  z-index: 15;
  padding: 10px 12px 8px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filters__row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.filters__row::-webkit-scrollbar { height: 4px; }
.filters__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.filters__label,
.filters__hint {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--divider);
  background: var(--elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip--sm { padding: 5px 10px; font-size: 11px; }
.chip.is-on {
  background: var(--primary-dim);
  border-color: rgba(0, 230, 118, 0.55);
  color: var(--primary);
}
.chip:hover { border-color: rgba(0, 230, 118, 0.35); }
.filters__hint--block {
  padding: 4px 2px 2px;
  white-space: normal;
  line-height: 1.45;
}
.area-map-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}
.area-map-modal__panel {
  width: min(720px, 100%);
  max-height: min(92dvh, 860px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.area-map-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.area-map-modal__head h2 {
  margin: 0;
  font-size: 17px;
}
.area-map-modal__hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.area-map-modal__radii {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.area-map-modal__canvas {
  width: 100%;
  height: min(52vh, 420px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--divider);
  background: #111;
}
.area-map-modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.profile {
  padding: 16px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.profile__card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 18px 16px 20px;
}
.profile__title {
  margin: 0 0 6px;
  font-size: 20px;
}
.profile__hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}
.profile__hint--warn { color: #ffd54f; }
.profile__avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.profile__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--elevated);
  border: 2px solid var(--divider);
}
.profile__avatar--empty {
  display: grid;
  place-items: center;
  font-size: 36px;
  color: var(--muted);
}
.profile__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.profile__field input,
.profile__field textarea,
.profile__field select {
  border: 1px solid var(--divider);
  background: var(--elevated);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
.profile__field input:disabled,
.profile__field textarea:disabled,
.profile__field select:disabled {
  opacity: 0.65;
}
.profile__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.profile__error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}
.profile__save {
  width: 100%;
  margin-top: 4px;
}
.profile__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 900px) {
  .card__media, .card__media--photo { max-height: 640px; }
}
