/* ==========================================================================
   Mereketoi.kz — app.css
   Layout, components, mobile-first responsive styles.
   Design tokens: tokens.css (colors_and_type.css)
   ========================================================================== */

/* ── Global reset + base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* overflow-x:hidden must stay OFF on <html> — it breaks position:sticky for
   the navbar. Only <body> clips horizontal overflow. */
html, body { max-width: 100%; }
body { overflow-x: hidden; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  margin: 0 0 var(--space-4);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }
img, video { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; }
p { margin: 0 0 var(--space-4); }

/* ── Container ───────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-8); } }

/* ═══════════════════════════════════════════════════════════════════════
   FRONT LAYOUT — public pages
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Top navbar (desktop only, hidden on mobile) ─────────────────────── */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
  transition: transform 0.28s ease;
}
/* Hide on scroll-down, show on scroll-up (toggled by JS) */
.site-header.nav-hidden { transform: translateY(-100%); }
.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 72px;
}
.site-logo {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 20px; font-weight: var(--weight-bold);
  color: var(--color-text); text-decoration: none;
}
.site-logo img { width: 30px; height: 30px; }
/* Full brand logo image (with wordmark): cap height, keep aspect ratio */
.site-logo .site-logo-img { width: auto; height: 40px; display: block; border-radius: 6px; }
@media (max-width: 768px) { .site-logo .site-logo-img { height: 34px; } }
/* Navbar wordmark: whole "mereketoi" stays navy (no gold "toi"). */
.site-logo .logo-dot { color: inherit; }

.site-nav { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.site-nav a {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover, .site-nav a.active {
  color: var(--color-primary); background: var(--color-primary-soft2);
}

/* Lang switch */
.lang-switch {
  display: flex; align-items: center;
  border: 1px solid var(--color-accent); /* gold border (white-bg control) */
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-switch a {
  padding: 5px 10px;
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--color-accent); /* ҚАЗ / РУС — gold */
  background: transparent;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.lang-switch a.active { background: var(--color-primary); color: #fff; } /* active stays white on navy */
.lang-switch a:hover:not(.active) { background: var(--color-surface-muted); }

/* Icon-only nav link (e.g. cabinet) */
.nav-icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  color: var(--color-text-muted); background: transparent;
  transition: color var(--transition), background var(--transition);
}
.nav-icon-link:hover,
.nav-icon-link.is-active { color: var(--color-primary); background: var(--color-primary-soft2); }

/* Notification bell (header) — works as a plain icon button on mobile and as a
   .nav-icon-link on desktop; carries an unread-count badge. */
.nav-bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; color: var(--color-text-muted); background: transparent;
  transition: color var(--transition), background var(--transition); }
.nav-bell:hover { color: var(--color-primary); }
.nav-bell-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 800; border-radius: 999px; line-height: 1; }

/* CTA button in header */
.btn-post {
  display: inline-flex; align-items: center;
  height: 44px; padding: 0 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 14px;
  /* small gold accent line under the primary CTA (navy + gold brand) */
  border-bottom: 2px solid var(--color-secondary);
  font-size: var(--text-sm); font-weight: var(--weight-bold);
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-post:hover { background: var(--color-primary-hover); color: #fff; box-shadow: var(--shadow-primary); }

/* Mobile header */
.mobile-header {
  display: none;
  align-items: center; gap: var(--space-3);
  height: 52px; padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
  transition: transform 0.28s ease;
}
.mobile-header.nav-hidden { transform: translateY(-100%); }
.mobile-header .site-logo { font-size: 17px; }

@media (max-width: 767px) {
  .site-header { display: none; }
  .mobile-header { display: flex; }
}

/* ── Main content area ───────────────────────────────────────────────── */
.site-main {
  min-height: calc(100vh - 60px - 80px); /* header + bottom nav */
  padding-bottom: calc(var(--space-16) + env(safe-area-inset-bottom, 0px)); /* clear mobile nav + home indicator */
}
@media (min-width: 768px) { .site-main { padding-bottom: var(--space-10); } }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-primary, #000099);
  color: rgba(255,255,255,0.72);
  padding: var(--space-10) 0 var(--space-6);
  font-size: var(--text-sm);
  /* visible on all public pages, incl. mobile (extra bottom space for the bottom nav) */
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-8);
}
.footer-col { display: flex; flex-direction: column; }
.footer-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  color: #fff; text-decoration: none; margin-bottom: 12px;
}
.footer-logo .footer-logo-dot { color: inherit; } /* «toi» «mereke»-мен бірдей түсте (ақ), алтын акцентсіз */
.footer-desc { font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,0.55); margin: 0; max-width: 280px; }
.footer-col-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: #fff; margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.04em;
}
.footer-col a {
  color: rgba(255,255,255,0.62); text-decoration: none;
  font-size: 14px; padding: 5px 0; transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: var(--space-8); padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.45); font-size: 13px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
/* Guest-accessible theme switch (owner 2026-07-17) — sits on the navy footer */
.footer-theme { display: inline-flex; gap: 6px; }
.footer-theme button {
  border: 1px solid rgba(255,255,255,0.25); background: transparent;
  color: rgba(255,255,255,0.75); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.footer-theme button:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.footer-theme button.is-active { background: #fff; color: var(--color-navy); border-color: #fff; }

@media (max-width: 768px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .footer-brand-col { grid-column: 1 / -1; }
  .site-footer { padding-bottom: calc(var(--space-6) + 72px + env(safe-area-inset-bottom, 0px)); } /* clear the mobile bottom nav */
  /* Smaller footer wordmark on phones */
  .footer-logo { font-size: 16px; gap: 6px; }
}
@media (max-width: 420px) {
  .footer-cols { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION (спек: fixed bottom, 5 items)
   ═══════════════════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex; align-items: stretch;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 12px rgba(15,23,42,0.08);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }

.bottom-nav-item {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.bottom-nav-item span {
  font-size: 10px; font-weight: 600; line-height: 1;
  letter-spacing: 0.01em;
  color: inherit;
}
.bottom-nav-item svg { width: 22px; height: 22px; stroke-width: 1.8; color: inherit; }
/* Pending count badge (e.g. той booking requests) on a bottom-nav item. */
.bottom-nav-item .nav-badge {
  position: absolute; top: 2px; left: 50%; margin-left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-error-solid); color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 999px; line-height: 1;
}
@media (hover: hover) {
  .bottom-nav-item:hover { color: var(--color-primary); }
}
.bottom-nav-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -4px;
  border-radius: var(--radius-md);
}
/* Active page: BLUE label + icon only — no background fill (owner request). */
.bottom-nav-item.active:not(.add-btn),
.bottom-nav-item.is-active:not(.add-btn) {
  background: transparent;
  color: var(--color-primary);
}
.bottom-nav-item.active:not(.add-btn) > span:not(.nav-badge),
.bottom-nav-item.is-active:not(.add-btn) > span:not(.nav-badge),
.bottom-nav-item.active:not(.add-btn) svg,
.bottom-nav-item.is-active:not(.add-btn) svg { color: var(--color-primary); }

/* Add (+) uses the same primary fill on every page and in both themes. */
.bottom-nav-item.add-btn svg {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-md);
  padding: 4px;
  width: 32px; height: 32px;
}
.bottom-nav-item.add-btn.active svg,
.bottom-nav-item.add-btn.is-active svg { background: var(--color-primary); }
.bottom-nav-item.add-btn.active span,
.bottom-nav-item.add-btn.is-active span { color: var(--color-primary); }

/* ═══════════════════════════════════════════════════════════════════════
   AUTH PAGES (mobile-first — full screen)
   ═══════════════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-background);
  padding: var(--space-4);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-md);
}
/* Mobile: a smaller card floating over the background (not full-screen).
   Bottom padding leaves room for the fixed bottom nav so the card never hides
   under it; the auth-page bg + bottom nav handling live in auth_box.php. */
@media (max-width: 480px) {
  .auth-card {
    max-width: 100%; min-height: 0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 153, 0.12);
  }
}

.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-2); margin-bottom: 14px;
}
.auth-logo img { width: 36px; height: 36px; }
.auth-logo .auth-logo-img { width: auto; height: 38px; border-radius: 6px; }
.auth-logo span {
  font-family: var(--font-display);
  font-size: 19px; font-weight: var(--weight-bold);
  color: var(--color-text);
}
/* Auth pages (login / register / forgot): whole "mereketoi" stays blue (no gold "toi"). */
.auth-logo .logo-dot { color: inherit; }

.auth-title {
  font-size: var(--text-h2); font-weight: var(--weight-bold);
  text-align: center; margin-bottom: var(--space-2);
}
.auth-subtitle {
  font-size: var(--text-sm); color: var(--color-text-muted);
  text-align: center; margin-bottom: var(--space-6);
}

/* Compact auth so the card fits on one screen without scrolling. */
.auth-card .form-group { margin-bottom: 10px; }
.auth-card .form-input { height: 42px; }
.auth-card .form-label { margin-bottom: 3px; font-size: 13px; }
.auth-card .btn-primary { height: 46px; width: 100%; }
.auth-card .auth-title { font-size: 20px; margin-bottom: 4px; }
.auth-card .auth-subtitle { margin-bottom: 14px; line-height: 1.5; }
.auth-identity { display: block; margin-top: 4px; color: var(--color-text); word-break: break-all; }

/* The one-time code — six digits, spaced out, centred (autocomplete=one-time-code
   lets iOS/Android paste it straight from the SMS). */
.auth-code-input {
  height: 52px !important;
  font-size: 24px; font-weight: 700; letter-spacing: 10px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.auth-code-input::placeholder { letter-spacing: 10px; color: var(--color-text-faint); font-weight: 500; }

/* Step 2 secondary actions: resend (a POST form, CSRF-safe) + change address. */
.auth-code-actions {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 14px; font-size: 13px; color: var(--color-text-muted);
}
.auth-code-actions form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.auth-link-btn {
  appearance: none; background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--color-primary);
  text-decoration: none;
}
.auth-link-btn:hover { text-decoration: underline; }

/* Legal note under the button (terms + privacy consent — a first sign-in is the
   registration, so this is the consent) */
.auth-legal-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--color-text-faint); text-align: center; }
.auth-legal-note a { color: var(--color-text-muted); text-decoration: underline; }

/* ── Form inputs ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-4); }
.form-label {
  display: block;
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--color-text); margin-bottom: var(--space-2);
}
.form-input {
  width: 100%; height: 48px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 16px;
  color: var(--color-text); background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--ring-focus);
}
.form-input.error { border-color: var(--color-error); }

/* Two-column form row that collapses to one column on small screens */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row-2 { grid-template-columns: 1fr; } }

/* ── Polished select — shared dropdown (city, category, …) ───────────────
   Native <select> styled clean: rounded border, custom chevron, blue focus
   ring. Wrap in .mk-select-wrap to add a leading icon. The dropdown list
   itself is browser-rendered (scrolls natively on long lists). */
.mk-select-wrap { position: relative; display: block; }
.mk-select-wrap .mk-select-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--color-text-muted); pointer-events: none;
}
.mk-select-wrap .mk-select { padding-left: 42px; }
.mk-select {
  width: 100%; height: 48px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--color-border-strong); border-radius: 14px;
  font-family: var(--font-body); font-size: 16px; color: var(--color-text);
  background-color: var(--color-surface);
  cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.mk-select:hover { border-color: var(--color-primary); }
.mk-select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.mk-select::-ms-expand { display: none; }
.mk-select optgroup { font-weight: var(--weight-bold); color: var(--color-text); }
.mk-select option { padding: 8px; color: var(--color-text); }

/* ── Generic styled <select> (.form-select) — admin filters, calendar, report,
   user role/status, etc. Consistent rounded border + chevron + blue focus ring. */
.form-select {
  height: 40px; padding: 0 36px 0 12px; max-width: 100%;
  border: 1px solid var(--color-border-strong); border-radius: 10px;
  font-family: var(--font-body); font-size: 16px; color: var(--color-text);
  background-color: var(--color-surface); cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-select:hover  { border-color: var(--color-primary); }
.form-select:focus  { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.form-select::-ms-expand { display: none; }
.form-select option   { padding: 8px; color: var(--color-text); }
.form-select optgroup { font-weight: var(--weight-bold); color: var(--color-text); }

/* Generic text input (settings/profile forms) */
.form-control {
  width: 100%; height: 44px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--color-border-strong); border-radius: 10px;
  font-family: var(--font-body); font-size: 16px; color: var(--color-text);
  background-color: var(--color-surface); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:hover  { border-color: var(--color-primary); }
.form-control:focus  { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.form-control[readonly] { background: var(--color-surface-muted); color: var(--color-text-muted); cursor: default; }
.form-control[readonly]:hover { border-color: var(--color-border-strong); }
.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); margin: 6px 0 0; }

.form-error {
  font-size: var(--text-xs); color: var(--color-error);
  margin-top: var(--space-1);
}

/* ── Alert boxes ─────────────────────────────────────────────────────── */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.alert-error { background: var(--color-error-soft); color: var(--color-error); border: 1px solid var(--color-error); }
.alert-success { background: var(--color-success-soft); color: var(--color-success); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 48px; padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--text-body); font-weight: var(--weight-semibold);
  border: none; cursor: pointer; text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), transform 80ms;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--color-primary); color: #fff; width: 100%;
}
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-outline {
  background: transparent; color: var(--color-text);
  border: 1.5px solid var(--color-border); width: 100%;
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* OAuth buttons */
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  height: 44px; border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text);
  cursor: pointer; width: 100%; margin-bottom: var(--space-3);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.btn-oauth:hover { border-color: var(--color-primary-hover); box-shadow: var(--shadow-xs); }
.btn-oauth svg, .btn-oauth img { width: 20px; height: 20px; }

.divider {
  display: flex; align-items: center; gap: var(--space-3);
  margin: var(--space-5) 0;
  font-size: var(--text-xs); color: var(--color-text-faint);
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--color-border);
}

/* Auth footer links */
.auth-footer-links {
  text-align: center; margin-top: var(--space-5);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.auth-footer-links a { color: var(--color-primary); font-weight: var(--weight-medium); }
.forgot-link {
  display: block; text-align: right; margin-top: var(--space-1);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.forgot-link:hover { color: var(--color-primary); }

/* ═══════════════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════════════ */
.flash { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  margin-bottom: var(--space-4); font-size: var(--text-sm); }
.flash-success { background: var(--color-success-soft); color: var(--color-success); }
.flash-error   { background: var(--color-error-soft);   color: var(--color-error); }
.flash-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.flash-info    { background: var(--color-info-soft);    color: var(--color-info); }

/* ═══════════════════════════════════════════════════════════════════════
   MEREKETOI RIBBON LOADER (design system)
   ═══════════════════════════════════════════════════════════════════════ */
.page-loader {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--color-surface); z-index: 9999;
}
.page-loader .mereketoi-loader { width: 200px; }
.page-loader .loader-text {
  margin-top: var(--space-3);
  font-size: var(--text-sm); color: var(--color-text-muted);
}

/* Inline button loader */
.btn .btn-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Utility ──────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }

/* ═══════════════════════════════════════════════════════════════════════
   MK DISCOVERY SYSTEM — shared between public home (/) and cabinet (/app)
   so both pages feel like one platform: same palette, cards, spacing.
   ═══════════════════════════════════════════════════════════════════════ */

/* Centered content container for discovery pages */
.mk-container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 768px) { .mk-container { padding-inline: var(--space-6); } }

/* Subtle entrance animation (disabled under prefers-reduced-motion below) */
@keyframes mkFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.mk-animate { animation: mkFadeUp 420ms ease both; }

/* Hero (public home only) — compact gradient band holding title + search card */
.mk-hero {
  background: linear-gradient(135deg, var(--color-primary-soft2) 0%, var(--color-surface) 45%, var(--color-violet-soft) 100%);
  padding: var(--space-10) 0 var(--space-12);
}
.mk-hero-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 28px; padding: 36px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}
.mk-hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 42px); font-weight: var(--weight-black);
  line-height: 1.1; letter-spacing: -0.03em; color: var(--color-text);
  margin: 0 0 var(--space-3);
}
.mk-hero-sub { font-size: var(--text-body); color: var(--color-text-muted); margin: 0 0 var(--space-6); max-width: 640px; line-height: var(--leading-normal); }
@media (max-width: 768px) {
  /* Compact hero on phones so the search doesn't fill the whole screen */
  .mk-hero { padding: var(--space-4) 0 var(--space-5); }
  .mk-hero-card { padding: 16px; border-radius: 18px; }
  .mk-hero-title { font-size: 22px; margin-bottom: var(--space-2); }
  .mk-hero-sub { font-size: var(--text-sm); margin-bottom: var(--space-4); }

  /* Smaller category chips on phones */
  .mk-category-strip { gap: 6px; }
  .mk-parent-category-card { gap: 6px; padding: 5px 9px; border-radius: 11px; box-shadow: 0 4px 12px rgba(15, 23, 42, .05); }
  .mk-parent-bubble { width: 26px; height: 26px; border-radius: 8px; }
  .mk-parent-bubble svg { width: 15px; height: 15px; }
  .mk-parent-name { font-size: var(--text-xs); }
  /* Photo cards: a touch narrower on phones, still a real photo */
  .mk-parent-category-card.mk-cat-photo-card { width: 108px; padding: 0; border-radius: 14px; }
  .mk-cat-photo { height: 88px; }
  .mk-cat-photo-card .mk-parent-name { padding: 6px 6px 8px; min-height: 34px; }
}

/* Auto-width buttons inside discovery contexts (override auth full-width) */
.mk-scope .btn,
.mk-actions .btn { width: auto; }

/* Parent category strip (4 main categories under navbar) — horizontal scroll */
.mk-category-strip {
  display: flex; gap: var(--space-3); max-width: 100%;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  padding: var(--space-4) 0; scrollbar-width: none; -ms-overflow-style: none;
}
.mk-category-strip::-webkit-scrollbar { display: none; }
.mk-category-strip > * { flex-shrink: 0; }
.mk-parent-category-card {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
  padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 14px;
  background: var(--color-surface); text-decoration: none; color: var(--color-text);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}
.mk-parent-category-card:hover { transform: translateY(-2px); border-color: var(--color-primary); box-shadow: 0 14px 32px rgba(37, 99, 235, .12); }
.mk-parent-category-card.is-active { background: var(--color-primary-soft2); border-color: var(--color-primary); }
.mk-parent-bubble {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-violet-soft); color: var(--color-primary);
}
.mk-parent-bubble svg { width: 18px; height: 18px; }
.mk-parent-name { font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: 1.2; white-space: nowrap; }

/* Photo category cards (owner 2026-08-28: real photos instead of icons) — a photo
   box on top, the name on a strip below, one rounded shell. Mirrors the mobile
   home rail. `cover` fills the box (the hall); `cutout` is a person with the
   background removed, bottom-anchored so they stand on the label strip. */
.mk-parent-category-card.mk-cat-photo-card {
  flex-direction: column; align-items: stretch; gap: 0;
  width: 132px; padding: 0; border-radius: 16px; overflow: hidden;
  background: var(--color-primary-soft2);
}
.mk-cat-photo {
  display: block; height: 108px; position: relative; overflow: hidden;
  background: var(--color-primary-soft2);
}
.mk-cat-photo img { display: block; width: 100%; height: 100%; }
.mk-cat-photo.is-cover img { object-fit: cover; }
.mk-cat-photo.is-cutout img { object-fit: contain; object-position: bottom center; }
.mk-cat-photo-card .mk-parent-name {
  display: block; text-align: center; white-space: normal;
  padding: 8px 8px 10px; min-height: 40px;
}
.mk-cat-photo-card.is-active { background: var(--color-primary-soft); }
.mk-cat-photo-card .mk-parent-bubble { margin: 38px auto; }
/* «Барлығы» on the catalog: same shell, a grid glyph where the photo would be */
.mk-cat-photo.is-all { display: flex; align-items: center; justify-content: center; color: var(--color-primary); }

/* Offer / ad placeholder card */
.mk-offer-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 22px;
  border: 1px dashed var(--color-border-strong); border-radius: 24px;
  background: linear-gradient(135deg, var(--color-surface), var(--color-background));
}
.mk-offer-text-wrap { display: flex; flex-direction: column; gap: 4px; }
.mk-offer-title { font-size: var(--text-body-lg); font-weight: var(--weight-bold); color: var(--color-text); }
.mk-offer-text { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
.mk-offer-badge {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-violet-soft); color: var(--color-primary);
}
.mk-offer-badge svg { width: 24px; height: 24px; }
/* Inline "see all" link arrow (replaces the → glyph) */
.mk-link-arrow { vertical-align: middle; margin-left: 2px; }
@media (max-width: 560px) { .mk-offer-card { flex-direction: column; align-items: flex-start; text-align: left; } }

/* Ghost / tertiary button */
.btn-ghost {
  background: var(--color-surface); color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }


/* Section */
.mk-section { margin-top: var(--space-8); margin-bottom: var(--space-8); }
.mk-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.mk-section-title {
  font-family: var(--font-display); font-size: 24px; font-weight: var(--weight-black);
  margin: 0; letter-spacing: -0.01em;
  /* small gold accent under section titles (sparingly — brand touch) */
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-secondary);
  display: inline-block;
}
/* Reusable gold decorative divider (use sparingly for premium feel) */
.mk-gold-divider { height: 2px; border: 0; background: var(--color-secondary); opacity: .5; margin: var(--space-4) 0; }
.mk-section-link { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-primary); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.mk-section-link:hover { text-decoration: underline; }
@media (max-width: 768px) { .mk-section-title { font-size: 20px; } }

/* Category grid + cards */
.mk-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-3); }
.mk-category-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2); min-height: 104px; padding: var(--space-4) var(--space-3); text-align: center;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); text-decoration: none; color: var(--color-text);
  font-weight: var(--weight-semibold); font-size: var(--text-sm); line-height: var(--leading-snug);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.mk-category-card:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mk-category-icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: var(--radius-md);
  background: var(--color-primary-soft); color: var(--color-primary);
}
.mk-category-icon svg { width: 24px; height: 24px; }
.mk-category-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-category-desc { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); line-height: var(--leading-snug); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-category-count { font-size: var(--text-xs); color: var(--color-primary); font-weight: var(--weight-semibold); }
/* subcategory count badge on parent pill */
.mk-category-pill .mk-subcount {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--color-primary-soft); color: var(--color-primary);
  font-size: 11px; font-weight: var(--weight-bold);
}
.mk-category-pill.is-active .mk-subcount { background: rgba(255,255,255,.25); color: #fff; }

/* Favorite (heart) button — SVG, outline by default, filled when active */
.fav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--color-text-muted); line-height: 1;
  transition: color var(--transition), transform var(--transition);
}
.fav-btn:hover { color: var(--color-primary); transform: scale(1.08); }
.fav-btn svg { width: 22px; height: 22px; fill: none; }
.fav-btn.is-fav { color: #e11d48; }
.fav-btn.is-fav svg { fill: currentColor; }

/* ── Listing detail page (public) ─────────────────────────────────────── */
.listing-detail-grid {
  display: grid; grid-template-columns: 1fr 320px; gap: 32px;
}
/* Main image: fixed-ratio container keeps the page stable for any image size.
   object-fit:contain shows the whole image without cropping; background fills
   the letterbox areas so odd-sized photos don't look broken. */
.listing-img-wrap {
  position: relative; width: 100%; padding-bottom: 60%; /* 5:3 ratio */
  border-radius: 12px; overflow: hidden;
  background: var(--color-surface-muted);
  margin-bottom: 10px; cursor: zoom-in;
}
.listing-main-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.listing-img-wrap:hover .listing-img-expand {
  opacity: 1;
}
.listing-img-expand {
  position: absolute; bottom: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(0,0,0,.48); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .15s; pointer-events: none;
}
/* Thumbnails */
.listing-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.listing-thumb {
  width: 72px; height: 60px; object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 2.5px solid transparent;
  transition: border-color .15s, opacity .15s;
}
.listing-thumb:hover { border-color: var(--color-primary); opacity: .88; }
.listing-thumb.is-active { border-color: var(--color-primary); }
/* Lightbox */
.lbx-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.lbx-overlay[hidden] { display: none; }
.lbx-img {
  max-width: 100%; max-height: 90vh;
  object-fit: contain; border-radius: 8px;
  user-select: none; -webkit-user-select: none;
}
.lbx-close {
  position: fixed; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 2001;
}
.lbx-close:hover { background: rgba(255,255,255,.3); }
.lbx-arr {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; height: 64px; border-radius: 10px;
  background: rgba(255,255,255,.13); border: none;
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2001; transition: background .15s;
}
.lbx-arr:hover { background: rgba(255,255,255,.28); }
.lbx-arr:disabled { opacity: .25; pointer-events: none; }
.lbx-prev { left: 8px; }
.lbx-next { right: 8px; }
.lbx-counter {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600;
  background: rgba(0,0,0,.35); padding: 4px 12px; border-radius: 20px;
  z-index: 2001; white-space: nowrap;
}
.listing-contact-card {
  border: 1px solid var(--color-border); border-radius: 12px; padding: 20px;
  position: sticky; top: 20px;
}
/* Phones: single column, full-width non-sticky card, shorter image */
@media (max-width: 768px) {
  .listing-detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .listing-contact-card { position: static; top: auto; padding: 16px; }
  .listing-img-wrap { padding-bottom: 66%; border-radius: 10px; }
  .lbx-arr { width: 38px; height: 54px; font-size: 20px; }
}

/* Subcategory drill-down row (under search, when a parent is selected) */
.mk-subcat-row { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.mk-subcat-pill {
  display: inline-flex; align-items: center; padding: 6px var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--color-text-muted);
  font-size: var(--text-xs); font-weight: var(--weight-medium); text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.mk-subcat-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.mk-subcat-pill.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Listing grid + cards — desktop 3 / tablet 2 / mobile 1 */
.mk-listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); align-items: stretch; }
@media (max-width: 980px) { .mk-listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .mk-listing-grid { grid-template-columns: 1fr; } }
.mk-listing-card {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%; /* grid row — all siblings share the same height */
  border: 1px solid var(--color-border); border-radius: 22px;
  overflow: hidden; background: var(--color-surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.mk-listing-card:hover { border-color: var(--color-primary); box-shadow: 0 18px 42px rgba(15, 23, 42, .10); transform: translateY(-3px); }
/* Whole card is clickable: the title link stretches over the card. */
.mk-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
/* Real actions (image link, share, view button) sit above the stretched link. */
.mk-listing-img, .mk-listing-foot-actions { position: relative; z-index: 2; }
.mk-listing-img { display: block; background: var(--color-violet-soft); flex-shrink: 0; height: 180px; overflow: hidden; }
.mk-listing-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-listing-body { padding: var(--space-4); display: flex; flex-direction: column; flex: 1; min-height: 140px; }
/* Title: max 2 lines, then ellipsis — keeps card height consistent */
.mk-listing-title { font-size: var(--text-h3); font-weight: var(--weight-bold); margin: 0 0 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; overflow-wrap: anywhere; }
.mk-listing-title a { color: inherit; text-decoration: none; }
.mk-listing-title a:hover { color: var(--color-primary); }
/* Meta: 1 line */
.mk-listing-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; overflow-wrap: anywhere; }
/* Desc: 2 lines */
.mk-listing-desc { font-size: var(--text-xs); color: var(--color-text-muted); margin: 0 0 var(--space-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex-shrink: 0; word-break: break-word; overflow-wrap: anywhere; }
/* Owner line on card → public profile */
.mk-listing-owner { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--space-2); text-decoration: none; max-width: 100%; }
.mk-listing-owner:hover .mk-listing-owner-name { color: var(--color-primary); text-decoration: underline; }
.mk-listing-owner-avatar { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); }
.mk-listing-owner-name { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Price row: price left, share icon right */
.mk-listing-price-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
/* Calendar link on card (shown when availability data exists) */
.mk-card-cal-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  font-size: var(--text-xs); color: var(--color-primary); text-decoration: none;
  font-weight: var(--weight-medium); position: relative; z-index: 2;
}
.mk-card-cal-link:hover { text-decoration: underline; }

/* Contact row: phone + whatsapp buttons */
.mk-card-contact-row { display: flex; gap: 6px; margin-top: 8px; }
.mk-card-phone-btn, .mk-card-wa-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  height: 36px; border-radius: 8px; border: none; cursor: pointer;
  transition: opacity .15s; position: relative; z-index: 2;
}
.mk-card-phone-btn { background: var(--color-primary-soft); color: var(--color-primary); }
.mk-card-phone-btn:hover { opacity: .8; }
.mk-card-wa-btn { background: var(--color-success-soft); color: var(--color-success); }
.mk-card-wa-btn:hover { opacity: .8; }
.mk-card-phone-btn.is-loading, .mk-card-wa-btn.is-loading { opacity: .5; pointer-events: none; }
/* "Add to той" — booking CTA on the card (primary blue). */
.mk-card-book-btn {
  flex: 2; display: flex; align-items: center; justify-content: center;
  height: 36px; border-radius: 8px; border: 1px solid var(--color-primary);
  background: transparent; color: var(--color-primary); font-size: 12.5px; font-weight: 700;
  text-decoration: none; position: relative; z-index: 2; transition: background .15s, color .15s;
}
.mk-card-book-btn:hover { background: var(--color-primary); color: #fff; }
/* Legacy foot selector kept for any stray references */
.mk-listing-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.mk-listing-price { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--color-primary); }
/* Amount + «Келісімді» as a column: the note used to ride inline after the ₸ and
   clipped on narrow 2-up cards (2026-08-29, same fix as the app card). */
.mk-listing-price-col { display: flex; flex-direction: column; min-width: 0; }
.mk-listing-price-note { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); line-height: 1.2; }
.mk-listing-btn {
  flex-shrink: 0; padding: 6px var(--space-3); border-radius: var(--radius-sm);
  background: var(--color-primary-soft); color: var(--color-primary);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.mk-listing-btn:hover { background: var(--color-primary); color: #fff; }
.mk-listing-foot-actions { display: inline-flex; align-items: center; gap: 8px; }
.mk-card-share {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text-muted);
  cursor: pointer; transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.mk-card-share:hover { border-color: var(--color-primary); color: var(--color-primary); }
.mk-card-share.is-copied { border-color: #16a34a; color: #16a34a; }

/* Phones: compact 2-up listing cards (smaller image, tighter text) */
@media (max-width: 560px) {
  .mk-listing-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .mk-listing-card { border-radius: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
  .mk-listing-img { height: 110px; }
  .mk-listing-img img { height: 100%; }
  .mk-listing-body { padding: 8px 10px 10px; min-height: 90px; }
  .mk-listing-title { font-size: 12px; line-height: 1.3; -webkit-line-clamp: 2; }
  .mk-listing-meta { font-size: 10px; margin-bottom: 2px; }
  .mk-listing-desc { display: none; } /* too cramped at 2-up */
  .mk-listing-price { font-size: 11px; }
  .mk-listing-price-row { padding-top: 4px; }
  .mk-card-contact-row { gap: 4px; margin-top: 5px; }
  .mk-card-phone-btn, .mk-card-wa-btn { height: 30px; border-radius: 6px; }
  .mk-card-phone-btn svg, .mk-card-wa-btn svg { width: 15px; height: 15px; }
  .mk-card-book-btn { height: 30px; border-radius: 6px; font-size: 11px; }
  .mk-listing-btn { padding: 4px 8px; font-size: 10px; }
}

/* Empty state */
.mk-empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 44px 24px;
  border: 1px solid var(--color-border); border-radius: 28px; background: var(--color-surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .05);
}
.mk-empty-icon {
  width: 72px; height: 72px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-violet-soft); color: var(--color-primary); margin-bottom: 18px;
}
.mk-empty-title { font-size: 22px; font-weight: var(--weight-black); margin: 0 0 4px; color: var(--color-text); }
.mk-empty-sub { font-size: var(--text-sm); color: var(--color-text-muted); margin: 8px auto 0; max-width: 460px; line-height: var(--leading-normal); }
.mk-empty-actions, .mk-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.mk-empty-actions { justify-content: center; margin-top: 20px; }
/* Empty-state buttons: normal size on desktop, full-width on mobile */
.mk-empty-actions .mk-primary-btn, .mk-empty-actions .mk-secondary-btn { width: auto; padding: 0 var(--space-6); }
@media (max-width: 560px) {
  .mk-empty-actions { flex-direction: column; align-self: stretch; width: 100%; }
  .mk-empty-actions .mk-primary-btn, .mk-empty-actions .mk-secondary-btn { width: 100%; }
}

/* Ad slots (visual placeholders only) */
.mk-ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-12); }
.mk-ad-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 120px; text-align: center;
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md);
  background: repeating-linear-gradient(45deg, var(--color-surface), var(--color-surface) 10px, var(--color-surface-muted) 10px, var(--color-surface-muted) 20px);
  color: var(--color-text-muted);
}
.mk-ad-label { font-size: var(--text-sm); font-weight: var(--weight-bold); letter-spacing: .04em; text-transform: uppercase; }
.mk-ad-sub { font-size: var(--text-xs); }

/* Category strip — horizontal, scrollable on mobile (sits under navbar) */
.mk-cat-strip-wrap { background: transparent; border-bottom: 0; }
.mk-cat-strip, .mk-category-strip {
  display: flex; gap: var(--space-2); overflow-x: auto;
  padding: var(--space-3) 0; scrollbar-width: none; -ms-overflow-style: none;
}
.mk-cat-strip::-webkit-scrollbar, .mk-category-strip::-webkit-scrollbar { display: none; }
.mk-category-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  flex-shrink: 0; padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--color-text);
  font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.mk-category-pill:hover, .mk-category-pill.is-active { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); }
.mk-category-emoji { display: inline-flex; align-items: center; justify-content: center; color: var(--color-primary); }
.mk-category-emoji svg { width: 16px; height: 16px; }
.mk-category-pill.is-active .mk-category-emoji { color: inherit; }

/* Compact intro (no giant hero) */
.mk-intro { padding: var(--space-8) 0 var(--space-4); }
.mk-intro-title { font-family: var(--font-display); font-size: clamp(22px, 3.5vw, var(--text-h1)); font-weight: var(--weight-black); line-height: var(--leading-tight); margin: 0 0 var(--space-2); letter-spacing: var(--tracking-tight); }
.mk-intro-sub { font-size: var(--text-body); color: var(--color-text-muted); margin: 0; max-width: 640px; line-height: var(--leading-normal); }

/* Marketplace search tool (multi-field) — card with a 3-col grid */
.mk-search-card.mk-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 24px; padding: 20px; box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
  margin-bottom: var(--space-8); max-width: none; display: block;
}
/* Inside the hero card the search has no shadow/margin (hero card already framed) */
.mk-hero-card .mk-search-card.mk-card { margin-bottom: 0; box-shadow: none; border: none; padding: 0; }
.mk-search-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; align-items: end; }
.mk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mk-field-wide { grid-column: span 1; }
.mk-field-submit { justify-content: flex-end; }
.mk-field-label { font-size: 13px; font-weight: var(--weight-bold); color: var(--color-text-muted); }
/* Field control wraps the leading icon + the input/select */
.mk-field-control { position: relative; display: block; }
.mk-field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted); pointer-events: none;
}
.mk-field-input {
  width: 100%; height: 52px; padding: 0 16px 0 42px;
  border: 1px solid var(--color-border-strong); border-radius: 14px;
  font-family: var(--font-body); font-size: 16px; color: var(--color-text);
  background: var(--color-surface); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* selects keep room for the native chevron on the right */
select.mk-field-input { padding-right: 36px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.mk-field-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.mk-field-submit .mk-primary-btn { height: 52px; }

/* Shared discovery buttons */
.mk-primary-btn, .mk-secondary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 48px; padding: 0 22px; border-radius: 14px;
  font-family: var(--font-body); font-size: 15px; font-weight: var(--weight-bold);
  text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.mk-primary-btn { background: var(--color-primary); color: #fff; width: 100%; }
.mk-primary-btn:hover { background: var(--color-primary-hover); color: #fff; box-shadow: var(--shadow-primary); }
.mk-secondary-btn { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.mk-secondary-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Quick chips */
.mk-chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mk-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--color-surface-muted); color: var(--color-text-body);
  font-size: 14px; font-weight: var(--weight-semibold); text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.mk-chip:hover { color: var(--color-primary); background: var(--color-primary-soft2); }

@media (max-width: 768px) {
  body { overflow-x: hidden; }
  /* Compact booking.com-style stacked search on phones */
  .mk-search-grid { grid-template-columns: 1fr; gap: 10px; }
  .mk-field-wide { grid-column: span 1; }
  /* labels are redundant on mobile — the icon + placeholder convey the field */
  .mk-search-grid .mk-field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mk-search-grid .mk-field-input { height: 46px; font-size: 16px; border-radius: 10px; }
  .mk-search-grid .mk-field-icon { left: 12px; }
  .mk-field-submit .mk-primary-btn { width: 100%; height: 46px; border-radius: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE — strict no-horizontal-overflow safety net (≤768px)
   ═══════════════════════════════════════════════════════════════════════ */
.table-responsive, .mk-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  /* Containers fill the viewport with consistent 16px gutters */
  .mk-container, .container, .app-page-inner, .site-header-inner {
    max-width: 100%; padding-left: 16px; padding-right: 16px;
  }

  /* Collapse all multi-column grids to a single column (except the
     intentionally-scrollable category strip, which is a flex row) */
  .mk-search-grid, .mk-listing-grid, .mk-category-grid,
  .mk-ad-grid, .mk-promo-grid, .form-row-2 {
    grid-template-columns: 1fr !important;
  }

  /* Search fields + buttons go full width, never overflow */
  .mk-search-card, .mk-search-grid, .mk-field, .mk-field-input,
  .mk-primary-btn, .mk-secondary-btn {
    width: 100%; max-width: 100%;
  }

  /* Long labels/buttons wrap instead of forcing width */
  .mk-primary-btn, .mk-secondary-btn, .btn, .btn-post, .mk-chip, .mk-section-link {
    white-space: normal;
  }

  /* Long category / listing names break instead of pushing layout */
  .mk-parent-name, .mk-category-name, .mk-listing-title, .mk-chip {
    overflow-wrap: anywhere; word-break: break-word;
  }
}

/* Mobile bottom nav must never exceed viewport */
.bottom-nav { left: 0; right: 0; width: 100%; max-width: 100%; overflow-x: hidden; }
.bottom-nav-item { min-width: 0; flex: 1 1 0; }


/* Promo blocks */
.mk-promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.mk-promo {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); text-decoration: none; color: var(--color-text);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.mk-promo:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mk-promo-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--color-primary-soft); color: var(--color-primary); }
.mk-promo-title { font-size: var(--text-body); font-weight: var(--weight-bold); display: block; }
.mk-promo-sub { font-size: var(--text-sm); color: var(--color-text-muted); display: block; }
.mk-promo-primary { background: var(--color-primary); border-color: var(--color-primary); }
.mk-promo-primary .mk-promo-title, .mk-promo-primary .mk-promo-sub { color: #fff; }
.mk-promo-primary .mk-promo-sub { opacity: .85; }
.mk-promo-primary .mk-promo-icon { background: rgba(255,255,255,.18); color: #fff; }
.mk-promo-primary:hover { opacity: .96; }

/* =========================================================
   Mereketoi custom marketplace search box
   ========================================================= */

.mk-search-box {
  width: 100%;
  max-width: 980px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 22px;
  padding: 8px;
}

.mk-search-main {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    minmax(170px, 0.75fr)
    minmax(190px, 0.85fr)
    minmax(145px, 0.6fr)
    112px;
  gap: 0;
  align-items: center;
}

.mk-search-item {
  position: relative;
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
}

.mk-search-icon {
  position: absolute;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  pointer-events: none;
}

.mk-search-input {
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-strong);
  font-size: 15px;
  font-weight: 600;
  padding: 0 14px 0 42px;
  border-radius: 16px;
}

.mk-search-input::placeholder {
  color: var(--color-text-faint);
  font-weight: 500;
}

.mk-search-item:focus-within,
.mk-custom-dropdown.is-open {
  background: var(--color-surface-muted);
  border-radius: 16px;
}

.mk-search-button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--color-primary);
  color: var(--color-surface);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 10px 24px rgba(11, 31, 77, 0.22);
}

.mk-search-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(11, 31, 77, 0.28);
}

.mk-search-button:active {
  transform: translateY(0);
}

/* Dropdown */

.mk-custom-dropdown {
  position: relative;
}

.mk-dropdown-trigger {
  position: relative;
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text-strong);
  font-size: 15px;
  font-weight: 700;
  padding: 0 42px 0 42px;
  display: flex;
  align-items: center;
  text-align: left;
  border-radius: 16px;
  cursor: pointer;
}

.mk-dropdown-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mk-dropdown-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.mk-custom-dropdown.is-open .mk-dropdown-chevron {
  transform: translateY(-35%) rotate(225deg);
}

.mk-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 100;
  width: 100%;
  min-width: 230px;
  max-height: 285px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  padding: 8px;
  display: none;
}

.mk-dropdown-menu--wide {
  min-width: 290px;
}

.mk-custom-dropdown.is-open .mk-dropdown-menu {
  display: block;
  animation: mkDropdownIn 140ms ease both;
}

.mk-dropdown-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-strong);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.mk-dropdown-option:hover {
  background: var(--color-primary-soft2);
  color: var(--color-primary);
}

.mk-dropdown-option.is-active {
  background: var(--color-primary);
  color: var(--color-surface);
}

.mk-dropdown-option--child {
  padding-left: 22px;
  color: var(--color-text-body);
}

.mk-dropdown-group {
  padding: 4px 0;
}

.mk-dropdown-group + .mk-dropdown-group {
  border-top: 1px solid var(--color-surface-muted);
  margin-top: 6px;
  padding-top: 8px;
}

.mk-dropdown-group-title {
  padding: 7px 12px 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@keyframes mkDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mk-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.mk-dropdown-menu::-webkit-scrollbar-track {
  background: var(--color-surface-muted);
  border-radius: 999px;
}

.mk-dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: 999px;
}

.mk-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* Mobile */

@media (max-width: 980px) {
  .mk-search-main {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mk-search-item--query,
  .mk-search-button {
    grid-column: 1 / -1;
  }

  .mk-search-box {
    padding: 10px;
  }
}

@media (max-width: 768px) {
  .mk-search-box {
    max-width: 100%;
    border-radius: 20px;
    padding: 10px;
  }

  .mk-search-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mk-search-item,
  .mk-dropdown-trigger,
  .mk-search-input,
  .mk-search-button {
    height: 50px;
  }

  .mk-dropdown-menu {
    left: 0;
    right: 0;
    width: 100%;
    max-height: 250px;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   Admin panel — shared design system (.adm-*)
   Moved out of layouts/admin.php inline <style> + extended with reusable
   table / card / button / badge / filter classes so every admin view styles
   consistently through tokens (no per-view inline CSS). Brand navy #000099.
   ════════════════════════════════════════════════════════════════════════ */

.adm-wrap    { display: flex; min-height: 100vh; }
.adm-sidebar {
  width: 220px; background: var(--color-primary); color: #fff;
  padding: 0; flex-shrink: 0; display: flex; flex-direction: column;
}
.adm-brand     { padding: 20px 16px 12px; font-family: var(--font-display); font-weight: 700; font-size: 18px; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 10px; }
.adm-brand-img { height: 34px; width: auto; border-radius: 6px; flex-shrink: 0; }
.adm-brand span{ opacity: .5; font-size: 12px; }
.adm-nav    { flex: 1; padding: 12px 8px; overflow-y: auto; }
.adm-nav a  {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: rgba(255,255,255,.72);
  border-radius: 6px; font-size: 13px; margin-bottom: 2px; text-decoration: none; transition: background .15s, color .15s;
}
.adm-nav a:hover  { background: rgba(255,255,255,.10); color: #fff; }
.adm-nav a.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.adm-nav a.active .adm-nav-ico { color: var(--color-accent); }
.adm-nav-ico { flex-shrink: 0; width: 17px; height: 17px; display: inline-flex; opacity: .9; }
.adm-nav .nav-section { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: rgba(255,255,255,.4); padding: 14px 12px 4px; text-transform: uppercase; }
.adm-user      { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; }
.adm-user-name { color: #fff; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-user-role { color: rgba(255,255,255,.55); margin-bottom: 8px; text-transform: capitalize; }
.adm-site-link {
  display: block; font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
  padding: 8px 12px; margin-bottom: 8px; border: 1px solid rgba(255,255,255,.28); border-radius: 8px;
  text-align: center; transition: background .15s, border-color .15s;
}
.adm-site-link:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.5); }
.adm-logout { display: block; font-size: 12px; color: rgba(255,255,255,.6); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; }
.adm-logout:hover { color: #fff; }
.adm-main   { flex: 1; padding: 32px; min-width: 0; }
.adm-page-header { margin-bottom: var(--space-6, 24px); }
.adm-page-header h1 { font-size: var(--text-h2, 22px); margin: 0 0 4px; }
.adm-page-desc { color: var(--color-text-muted); font-size: var(--text-sm, 13px); margin: 0; }

/* Mobile topbar (hidden on desktop) — hamburger + collapsible sidebar */
.adm-topbar { display: none; }
.adm-sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .adm-topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 60;
    background: var(--color-primary); color: #fff; padding: 10px 14px;
  }
  .adm-topbar-btn { background: none; border: none; color: #fff; cursor: pointer; display: inline-flex; padding: 4px; }
  .adm-topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
  .adm-wrap { flex-direction: column; }
  .adm-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 80;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  .adm-sidebar.is-open { transform: translateX(0); }
  .adm-sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .adm-sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .adm-main { padding: 18px 14px; }
}

/* ── Reusable admin building blocks ──────────────────────────────────── */

/* Card / panel */
.adm-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: 20px; }
.adm-card-title { font-size: 14px; font-weight: 700; margin: 0 0 14px; }

/* Stat card grid (dashboard) */
.adm-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 32px; }
.adm-stat { display: block; padding: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-primary); border-radius: 10px; text-decoration: none; color: var(--color-text); transition: box-shadow .15s, transform .15s; }
.adm-stat:hover { box-shadow: 0 4px 14px rgba(0,0,153,.08); transform: translateY(-1px); }
.adm-stat-label { font-size: 11px; color: var(--color-text-muted); margin-bottom: 4px; font-weight: 500; }
.adm-stat-value { font-size: 28px; font-weight: 700; color: var(--color-primary); line-height: 1.1; }

/* Two-column responsive grid for dashboard panels */
.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .adm-grid-2 { grid-template-columns: 1fr; } }

/* Table */
.adm-table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.adm-table thead tr { background: var(--color-surface-muted); text-align: left; }
.adm-table th { padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.adm-table td { padding: 10px 14px; vertical-align: middle; }
.adm-table tbody tr { border-top: 1px solid var(--color-border); }
.adm-table tbody tr:hover { background: var(--color-surface-muted); }
.adm-table .adm-link { font-size: 12px; color: var(--color-primary); text-decoration: none; font-weight: 500; white-space: nowrap; }
.adm-table .adm-link:hover { text-decoration: underline; }
.adm-code { font-size: 11px; color: var(--color-text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Badge (status / role pills) */
.adm-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }

/* Buttons */
.adm-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid transparent; text-decoration: none; line-height: 1; transition: background .15s, border-color .15s; }
.adm-btn-primary { background: var(--color-primary); color: #fff; }
.adm-btn-primary:hover { background: var(--color-primary-hover); }
.adm-btn-ghost { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.adm-btn-ghost:hover { background: var(--color-surface-muted); }
.adm-btn-link { background: none; color: var(--color-text-muted); padding: 7px 10px; }
.adm-btn-link:hover { color: var(--color-text); }

/* Filter bar */
.adm-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-end; }
.adm-filter-field { display: flex; flex-direction: column; }
.adm-filter-label { font-size: 11px; color: var(--color-text-muted); margin-bottom: 3px; }
.adm-filter .form-select, .adm-filter .form-input { height: 36px; font-size: 13px; }

/* Empty state */
.adm-empty { text-align: center; padding: 48px 16px; color: var(--color-text-muted); }
.adm-empty-ico { color: var(--color-border); margin-bottom: 10px; display: inline-flex; }
.adm-empty p { margin: 0 0 4px; }
.adm-empty .adm-empty-title { font-weight: 600; color: var(--color-text); }

/* Pill tabs (status filters: listings, reports, …) */
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.adm-tab {
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; text-decoration: none;
  background: var(--color-surface-muted); color: var(--color-text); border: 1px solid var(--color-border);
  transition: background .15s, color .15s, border-color .15s;
}
.adm-tab:hover { border-color: var(--color-primary); }
.adm-tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Card list (reports, listings moderation rows) */
.adm-rowcard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: 14px; }

/* Section toolbar: title left, action(s) right */
.adm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.adm-toolbar h1 { font-size: 20px; font-weight: 700; margin: 0; }

/* Small green / muted action buttons (resolve / dismiss) */
.adm-btn-success { background: #16a34a; color: #fff; }
.adm-btn-success:hover { background: #15803d; }

/* ── Contextual hints — the (?) marker + popover (partials/hint.php + app.js) ── */
.mk-hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; padding: 0; margin-left: 5px;
  border: none; border-radius: 50%; cursor: pointer; vertical-align: middle;
  background: var(--color-primary-soft, #E5E5F5); color: var(--color-primary, #000099);
  font-size: 11px; font-weight: 700; line-height: 1; font-family: inherit;
  flex: 0 0 auto; transition: background .15s, color .15s;
}
.mk-hint:hover, .mk-hint.is-open { background: var(--color-primary, #000099); color: #fff; }
.mk-hint:focus-visible { outline: 2px solid var(--color-primary, #000099); outline-offset: 2px; }

/* The popover bubble (positioned by app.js; starts hidden) */
.mk-hint-popover {
  position: fixed; z-index: 400; max-width: 280px;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border, #e2e3e2); border-radius: 10px;
  padding: 11px 13px; font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.mk-hint-popover.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mk-hint-popover[hidden] { display: none !important; }
