/* ── Theme tokens ──────────────────────────────────────────────────────
   Dark mode here is its own mode, not an inversion. The light column is
   exactly the literal each token replaced, so a light page renders as it
   always did. The dark column is a small designed palette - a few
   surfaces, three levels of ink, three borders, and one tint/fill/ink set
   per hue - and every light colour is placed into it by what it DOES.

   The role is the whole trick. #fff was a card background in 150 places
   and the text on a blue button in 114, and only the first of those may
   turn dark. --bg-* is a surface, --fg-* is ink, --line-* is a border,
   --amb-* is a custom property used as both.

   The switch has three settings and only one of them writes a class:
     Automatic - no class, so these :root values stand. The board is light,
                 so Automatic IS light. It deliberately does not read
                 prefers-color-scheme: a phone left on dark would otherwise
                 change a site nobody asked to change, and 'auto' means the
                 same thing here as it does for the listing layout - let the
                 board's own CSS decide.
     Light     - .theme-light, same values, said out loud
     Dark      - .theme-dark, the palette below

   Regenerate with tools/theme-tokens.py; do not hand-edit the two lists.
   ──────────────────────────────────────────────────────────────────── */
:root {
  --amb-amber-500: #f59e0b;
  --amb-blue-600: #2563eb;
  --amb-gray-700: #374151;
  --amb-slate-500: #64748b;
  --amb-slate-900: #0f172a;
  --amb-x12101a: #12101a;
  --amb-x229ed9: #229ed9;
  --amb-x2f855a: #2f855a;
  --amb-xc0392b: #c0392b;
  --amb-xdd9d18: #dd9d18;
  --bg-amber-100: #fef3c7;
  --bg-amber-50: #fffbeb;
  --bg-amber-500: #f59e0b;
  --bg-amber-600: #d97706;
  --bg-amber-700: #b45309;
  --bg-amber-800: #92400e;
  --bg-amber-900: #78350f;
  --bg-blue-100: #dbeafe;
  --bg-blue-300: #93c5fd;
  --bg-blue-50: #eff6ff;
  --bg-blue-500: #3b82f6;
  --bg-blue-600: #2563eb;
  --bg-blue-700: #1d4ed8;
  --bg-cyan-600: #0891b2;
  --bg-emerald-50: #ecfdf5;
  --bg-gray-100: #f3f4f6;
  --bg-gray-200: #e5e7eb;
  --bg-gray-300: #d1d5db;
  --bg-gray-400: #9ca3af;
  --bg-gray-50: #f9fafb;
  --bg-gray-500: #6b7280;
  --bg-gray-600: #4b5563;
  --bg-gray-800: #1f2937;
  --bg-gray-900: #111827;
  --bg-green-100: #dcfce7;
  --bg-green-50: #f0fdf4;
  --bg-green-500: #22c55e;
  --bg-green-600: #16a34a;
  --bg-green-700: #15803d;
  --bg-indigo-100: #e0e7ff;
  --bg-indigo-50: #eef2ff;
  --bg-indigo-500: #6366f1;
  --bg-indigo-700: #4338ca;
  --bg-orange-50: #fff7ed;
  --bg-orange-500: #f97316;
  --bg-orange-700: #c2410c;
  --bg-pink-50: #fdf2f8;
  --bg-pink-500: #ec4899;
  --bg-purple-50: #faf5ff;
  --bg-purple-700: #7e22ce;
  --bg-red-100: #fee2e2;
  --bg-red-300: #fca5a5;
  --bg-red-50: #fef2f2;
  --bg-red-500: #ef4444;
  --bg-red-600: #dc2626;
  --bg-red-700: #b91c1c;
  --bg-red-800: #991b1b;
  --bg-sky-100: #e0f2fe;
  --bg-sky-50: #f0f9ff;
  --bg-slate-100: #f1f5f9;
  --bg-slate-200: #e2e8f0;
  --bg-slate-300: #cbd5e1;
  --bg-slate-400: #94a3b8;
  --bg-slate-50: #f8fafc;
  --bg-slate-500: #64748b;
  --bg-slate-800: #1e293b;
  --bg-slate-900: #0f172a;
  --bg-teal-700: #0f766e;
  --bg-violet-100: #ede9fe;
  --bg-violet-50: #f5f3ff;
  --bg-violet-700: #6d28d9;
  --bg-violet-900: #4c1d95;
  --bg-w: #ffffff;
  --bg-x000000: #000000;
  --bg-x0b1220: #0b1220;
  --bg-x0f2a4a: #0f2a4a;
  --bg-x110000: #110000;
  --bg-x111111: #111111;
  --bg-x12101a: #12101a;
  --bg-x128c7e: #128c7e;
  --bg-x161e2e: #161e2e;
  --bg-x1877f2: #1877f2;
  --bg-x1b7fb0: #1b7fb0;
  --bg-x1c1930: #1c1930;
  --bg-x1da851: #1da851;
  --bg-x1eb355: #1eb355;
  --bg-x1ebe5b: #1ebe5b;
  --bg-x229ed9: #229ed9;
  --bg-x243049: #243049;
  --bg-x25d366: #25d366;
  --bg-x285aeb: #285aeb;
  --bg-x2a2a2a: #2a2a2a;
  --bg-x2b2640: #2b2640;
  --bg-x2bb3ee: #2bb3ee;
  --bg-x34b7eb: #34b7eb;
  --bg-x36404a: #36404a;
  --bg-x3a3a3a: #3a3a3a;
  --bg-x6d4aff: #6d4aff;
  --bg-x888866: #888866;
  --bg-xd6249f: #d6249f;
  --bg-xdde3ec: #dde3ec;
  --bg-xdfe3ea: #dfe3ea;
  --bg-xe0940f: #e0940f;
  --bg-xe4572e: #e4572e;
  --bg-xe5edff: #e5edff;
  --bg-xe6f4ea: #e6f4ea;
  --bg-xe8e6ff: #e8e6ff;
  --bg-xeef1f6: #eef1f6;
  --bg-xeef2f7: #eef2f7;
  --bg-xeef4ff: #eef4ff;
  --bg-xf4f5f9: #f4f5f9;
  --bg-xf5a623: #f5a623;
  --bg-xf5f7fb: #f5f7fb;
  --bg-xf7f8fa: #f7f8fa;
  --bg-xf8fbff: #f8fbff;
  --bg-xfafbfc: #fafbfc;
  --bg-xfbfcfe: #fbfcfe;
  --bg-xfce7f0: #fce7f0;
  --bg-xfd5949: #fd5949;
  --bg-xfde8e8: #fde8e8;
  --bg-xfdf497: #fdf497;
  --bg-xffc845: #ffc845;
  --bg-zinc-50: #fafafa;
  --fg-amber-600: #d97706;
  --fg-amber-700: #b45309;
  --fg-amber-800: #92400e;
  --fg-amber-900: #78350f;
  --fg-blue-300: #93c5fd;
  --fg-blue-400: #60a5fa;
  --fg-blue-600: #2563eb;
  --fg-blue-700: #1d4ed8;
  --fg-blue-800: #1e40af;
  --fg-blue-900: #1e3a8a;
  --fg-gray-200: #e5e7eb;
  --fg-gray-300: #d1d5db;
  --fg-gray-400: #9ca3af;
  --fg-gray-500: #6b7280;
  --fg-gray-600: #4b5563;
  --fg-gray-700: #374151;
  --fg-gray-800: #1f2937;
  --fg-gray-900: #111827;
  --fg-green-500: #22c55e;
  --fg-green-600: #16a34a;
  --fg-green-700: #15803d;
  --fg-green-800: #166534;
  --fg-green-900: #14532d;
  --fg-indigo-700: #4338ca;
  --fg-orange-700: #c2410c;
  --fg-orange-800: #9a3412;
  --fg-orange-900: #7c2d12;
  --fg-pink-700: #be185d;
  --fg-purple-700: #7e22ce;
  --fg-purple-800: #6b21a8;
  --fg-purple-900: #581c87;
  --fg-red-500: #ef4444;
  --fg-red-600: #dc2626;
  --fg-red-700: #b91c1c;
  --fg-red-800: #991b1b;
  --fg-red-900: #7f1d1d;
  --fg-sky-700: #0369a1;
  --fg-sky-800: #075985;
  --fg-sky-900: #0c4a6e;
  --fg-slate-300: #cbd5e1;
  --fg-slate-400: #94a3b8;
  --fg-slate-50: #f8fafc;
  --fg-slate-500: #64748b;
  --fg-slate-600: #475569;
  --fg-slate-700: #334155;
  --fg-slate-800: #1e293b;
  --fg-slate-900: #0f172a;
  --fg-teal-700: #0f766e;
  --fg-violet-700: #6d28d9;
  --fg-violet-900: #4c1d95;
  --fg-w: #ffffff;
  --fg-x0f2a4a: #0f2a4a;
  --fg-x12101a: #12101a;
  --fg-x15719c: #15719c;
  --fg-x1c1930: #1c1930;
  --fg-x229ed9: #229ed9;
  --fg-x25d366: #25d366;
  --fg-x2f855a: #2f855a;
  --fg-x36404a: #36404a;
  --fg-x3b4a63: #3b4a63;
  --fg-x57534e: #57534e;
  --fg-x6d4aff: #6d4aff;
  --fg-xc0392b: #c0392b;
  --fg-xc7d7f0: #c7d7f0;
  --fg-xd6d2f5: #d6d2f5;
  --fg-xe4572e: #e4572e;
  --fg-xe8ecf4: #e8ecf4;
  --fg-xffc845: #ffc845;
  --fg-yellow-700: #a16207;
  --line-amber-200: #fde68a;
  --line-amber-400: #fbbf24;
  --line-amber-500: #f59e0b;
  --line-blue-100: #dbeafe;
  --line-blue-200: #bfdbfe;
  --line-blue-400: #60a5fa;
  --line-blue-600: #2563eb;
  --line-blue-700: #1d4ed8;
  --line-gray-100: #f3f4f6;
  --line-gray-200: #e5e7eb;
  --line-gray-300: #d1d5db;
  --line-gray-400: #9ca3af;
  --line-gray-800: #1f2937;
  --line-gray-900: #111827;
  --line-green-200: #bbf7d0;
  --line-green-500: #22c55e;
  --line-indigo-200: #c7d2fe;
  --line-orange-200: #fed7aa;
  --line-orange-300: #fdba74;
  --line-pink-200: #fbcfe8;
  --line-pink-300: #f9a8d4;
  --line-purple-200: #e9d5ff;
  --line-red-200: #fecaca;
  --line-red-300: #fca5a5;
  --line-red-500: #ef4444;
  --line-red-600: #dc2626;
  --line-red-700: #b91c1c;
  --line-sky-200: #bae6fd;
  --line-slate-100: #f1f5f9;
  --line-slate-200: #e2e8f0;
  --line-slate-300: #cbd5e1;
  --line-slate-50: #f8fafc;
  --line-slate-600: #475569;
  --line-slate-800: #1e293b;
  --line-slate-900: #0f172a;
  --line-w: #ffffff;
  --line-x12101a: #12101a;
  --line-x1d9bf0: #1d9bf0;
  --line-x1e2738: #1e2738;
  --line-x229ed9: #229ed9;
  --line-x243049: #243049;
  --line-x25d366: #25d366;
  --line-x36404a: #36404a;
  --line-xc7d2e0: #c7d2e0;
  --line-xc7d8fb: #c7d8fb;
  --line-xd7dfea: #d7dfea;
  --line-xdbe2ea: #dbe2ea;
  --line-xdbe3ee: #dbe3ee;
  --line-xdfe4ec: #dfe4ec;
  --line-xe6eaf0: #e6eaf0;
  --line-xe8ecf2: #e8ecf2;
  --line-xe8edf4: #e8edf4;
  --line-xeef0f3: #eef0f3;
  --line-xeef1f6: #eef1f6;
  --line-xeef2f7: #eef2f7;
  --line-xf1f3f6: #f1f3f6;
  --line-xf1f4f8: #f1f4f8;
  --line-xf5a623: #f5a623;
  --rgb-surface: 255,255,255;
  color-scheme: light;
}

html.theme-dark {
  --amb-amber-500: #b4791a;
  --amb-blue-600: #2f6fe4;
  --amb-gray-700: #aab3c0;
  --amb-slate-500: #aab3c0;
  --amb-slate-900: #aab3c0;
  --amb-x12101a: #aab3c0;
  --amb-x229ed9: #229ed9;
  --amb-x2f855a: #1f8b4c;
  --amb-xc0392b: #c23b3b;
  --amb-xdd9d18: #b4791a;
  --bg-amber-100: #45330f;
  --bg-amber-50: #2e2310;
  --bg-amber-500: #b4791a;
  --bg-amber-600: #b4791a;
  --bg-amber-700: #b4791a;
  --bg-amber-800: #b4791a;
  --bg-amber-900: #78350f;
  --bg-blue-100: #15293f;
  --bg-blue-300: #1b3b63;
  --bg-blue-50: #15293f;
  --bg-blue-500: #2f6fe4;
  --bg-blue-600: #2f6fe4;
  --bg-blue-700: #2f6fe4;
  --bg-cyan-600: #1a8f85;
  --bg-emerald-50: #102e1f;
  --bg-gray-100: #12161c;
  --bg-gray-200: #1f242c;
  --bg-gray-300: #1f242c;
  --bg-gray-400: #444e5c;
  --bg-gray-50: #171b22;
  --bg-gray-500: #444e5c;
  --bg-gray-600: #1f242c;
  --bg-gray-800: #1f242c;
  --bg-gray-900: #0f1217;
  --bg-green-100: #102e1f;
  --bg-green-50: #102e1f;
  --bg-green-500: #1f8b4c;
  --bg-green-600: #1f8b4c;
  --bg-green-700: #15803d;
  --bg-indigo-100: #221834;
  --bg-indigo-50: #221834;
  --bg-indigo-500: #7b55d6;
  --bg-indigo-700: #7b55d6;
  --bg-orange-50: #2e2310;
  --bg-orange-500: #b4791a;
  --bg-orange-700: #b4791a;
  --bg-pink-50: #2f1523;
  --bg-pink-500: #c7508b;
  --bg-purple-50: #221834;
  --bg-purple-700: #7b55d6;
  --bg-red-100: #33171a;
  --bg-red-300: #4a1f22;
  --bg-red-50: #33171a;
  --bg-red-500: #c23b3b;
  --bg-red-600: #c23b3b;
  --bg-red-700: #c23b3b;
  --bg-red-800: #c23b3b;
  --bg-sky-100: #15293f;
  --bg-sky-50: #15293f;
  --bg-slate-100: #12161c;
  --bg-slate-200: #1f242c;
  --bg-slate-300: #1f242c;
  --bg-slate-400: #444e5c;
  --bg-slate-50: #171b22;
  --bg-slate-500: #444e5c;
  --bg-slate-800: #1f242c;
  --bg-slate-900: #0f1217;
  --bg-teal-700: #0f766e;
  --bg-violet-100: #221834;
  --bg-violet-50: #221834;
  --bg-violet-700: #7b55d6;
  --bg-violet-900: #7b55d6;
  --bg-w: #171b22;
  --bg-x000000: #000000;
  --bg-x0b1220: #0b1220;
  --bg-x0f2a4a: #0f2a4a;
  --bg-x110000: #110000;
  --bg-x111111: #0f1217;
  --bg-x12101a: #0f1217;
  --bg-x128c7e: #128c7e;
  --bg-x161e2e: #161e2e;
  --bg-x1877f2: #1877f2;
  --bg-x1b7fb0: #1a8f85;
  --bg-x1c1930: #1c1930;
  --bg-x1da851: #1da851;
  --bg-x1eb355: #1eb355;
  --bg-x1ebe5b: #1f8b4c;
  --bg-x229ed9: #229ed9;
  --bg-x243049: #243049;
  --bg-x25d366: #25d366;
  --bg-x285aeb: #2f6fe4;
  --bg-x2a2a2a: #1f242c;
  --bg-x2b2640: #2b2640;
  --bg-x2bb3ee: #2bb3ee;
  --bg-x34b7eb: #34b7eb;
  --bg-x36404a: #36404a;
  --bg-x3a3a3a: #1f242c;
  --bg-x6d4aff: #6d4aff;
  --bg-x888866: #b4791a;
  --bg-xd6249f: #d6249f;
  --bg-xdde3ec: #1b3b63;
  --bg-xdfe3ea: #1f242c;
  --bg-xe0940f: #b4791a;
  --bg-xe4572e: #c23b3b;
  --bg-xe5edff: #15293f;
  --bg-xe6f4ea: #102e1f;
  --bg-xe8e6ff: #15293f;
  --bg-xeef1f6: #12161c;
  --bg-xeef2f7: #12161c;
  --bg-xeef4ff: #15293f;
  --bg-xf4f5f9: #12161c;
  --bg-xf5a623: #b4791a;
  --bg-xf5f7fb: #12161c;
  --bg-xf7f8fa: #12161c;
  --bg-xf8fbff: #171b22;
  --bg-xfafbfc: #171b22;
  --bg-xfbfcfe: #171b22;
  --bg-xfce7f0: #2f1523;
  --bg-xfd5949: #fd5949;
  --bg-xfde8e8: #33171a;
  --bg-xfdf497: #fdf497;
  --bg-xffc845: #b4791a;
  --bg-zinc-50: #171b22;
  --fg-amber-600: #edbb5e;
  --fg-amber-700: #edbb5e;
  --fg-amber-800: #edbb5e;
  --fg-amber-900: #edbb5e;
  --fg-blue-300: #d0dff1;
  --fg-blue-400: #7cb0ff;
  --fg-blue-600: #7cb0ff;
  --fg-blue-700: #7cb0ff;
  --fg-blue-800: #7cb0ff;
  --fg-blue-900: #7cb0ff;
  --fg-gray-200: #ffffff;
  --fg-gray-300: #ffffff;
  --fg-gray-400: #7b8593;
  --fg-gray-500: #aab3c0;
  --fg-gray-600: #aab3c0;
  --fg-gray-700: #e7eaef;
  --fg-gray-800: #e7eaef;
  --fg-gray-900: #e7eaef;
  --fg-green-500: #63d894;
  --fg-green-600: #63d894;
  --fg-green-700: #63d894;
  --fg-green-800: #63d894;
  --fg-green-900: #63d894;
  --fg-indigo-700: #bfa5ff;
  --fg-orange-700: #edbb5e;
  --fg-orange-800: #edbb5e;
  --fg-orange-900: #edbb5e;
  --fg-pink-700: #f79ac6;
  --fg-purple-700: #bfa5ff;
  --fg-purple-800: #bfa5ff;
  --fg-purple-900: #bfa5ff;
  --fg-red-500: #ff9a9a;
  --fg-red-600: #ff9a9a;
  --fg-red-700: #ff9a9a;
  --fg-red-800: #ff9a9a;
  --fg-red-900: #ff9a9a;
  --fg-sky-700: #7cb0ff;
  --fg-sky-800: #7cb0ff;
  --fg-sky-900: #7cb0ff;
  --fg-slate-300: #ffffff;
  --fg-slate-400: #7b8593;
  --fg-slate-50: #ffffff;
  --fg-slate-500: #aab3c0;
  --fg-slate-600: #aab3c0;
  --fg-slate-700: #e7eaef;
  --fg-slate-800: #e7eaef;
  --fg-slate-900: #e7eaef;
  --fg-teal-700: #5fd5c8;
  --fg-violet-700: #bfa5ff;
  --fg-violet-900: #bfa5ff;
  --fg-w: #ffffff;
  --fg-x0f2a4a: #7cb0ff;
  --fg-x12101a: #e7eaef;
  --fg-x15719c: #5fd5c8;
  --fg-x1c1930: #7cb0ff;
  --fg-x229ed9: #229ed9;
  --fg-x25d366: #25d366;
  --fg-x2f855a: #63d894;
  --fg-x36404a: #7cb0ff;
  --fg-x3b4a63: #7cb0ff;
  --fg-x57534e: #aab3c0;
  --fg-x6d4aff: #6d4aff;
  --fg-xc0392b: #ff9a9a;
  --fg-xc7d7f0: #d0ddf1;
  --fg-xd6d2f5: #d3d0f1;
  --fg-xe4572e: #ff9a9a;
  --fg-xe8ecf4: #ffffff;
  --fg-xffc845: #edbb5e;
  --fg-yellow-700: #edbb5e;
  --line-amber-200: #6a4e18;
  --line-amber-400: #6a4e18;
  --line-amber-500: #6a4e18;
  --line-blue-100: #2d527f;
  --line-blue-200: #2d527f;
  --line-blue-400: #2d527f;
  --line-blue-600: #2d527f;
  --line-blue-700: #2d527f;
  --line-gray-100: #262c35;
  --line-gray-200: #323a45;
  --line-gray-300: #323a45;
  --line-gray-400: #444e5c;
  --line-gray-800: #444e5c;
  --line-gray-900: #444e5c;
  --line-green-200: #1f6340;
  --line-green-500: #1f6340;
  --line-indigo-200: #453065;
  --line-orange-200: #6a4e18;
  --line-orange-300: #6a4e18;
  --line-pink-200: #632a47;
  --line-pink-300: #632a47;
  --line-purple-200: #453065;
  --line-red-200: #6e2f33;
  --line-red-300: #6e2f33;
  --line-red-500: #6e2f33;
  --line-red-600: #6e2f33;
  --line-red-700: #6e2f33;
  --line-sky-200: #2d527f;
  --line-slate-100: #262c35;
  --line-slate-200: #323a45;
  --line-slate-300: #323a45;
  --line-slate-50: #262c35;
  --line-slate-600: #444e5c;
  --line-slate-800: #444e5c;
  --line-slate-900: #444e5c;
  --line-w: #262c35;
  --line-x12101a: #444e5c;
  --line-x1d9bf0: #1d9bf0;
  --line-x1e2738: #2d527f;
  --line-x229ed9: #229ed9;
  --line-x243049: #2d527f;
  --line-x25d366: #25d366;
  --line-x36404a: #2d527f;
  --line-xc7d2e0: #2d527f;
  --line-xc7d8fb: #2d527f;
  --line-xd7dfea: #2d527f;
  --line-xdbe2ea: #2d527f;
  --line-xdbe3ee: #2d527f;
  --line-xdfe4ec: #2d527f;
  --line-xe6eaf0: #323a45;
  --line-xe8ecf2: #323a45;
  --line-xe8edf4: #262c35;
  --line-xeef0f3: #262c35;
  --line-xeef1f6: #262c35;
  --line-xeef2f7: #262c35;
  --line-xf1f3f6: #262c35;
  --line-xf1f4f8: #262c35;
  --line-xf5a623: #6a4e18;
  --rgb-surface: 23,27,34;
  color-scheme: dark;
}
html.theme-dark :where(.admin-sidebar, .cta-card, .bs-topbar, .bs-hero, .bs-footer, .bs-mobile-menu, .bs-wa-avatar-fb) {
  --amb-amber-500: #f59e0b;
  --amb-blue-600: #2563eb;
  --amb-gray-700: #374151;
  --amb-slate-500: #64748b;
  --amb-slate-900: #0f172a;
  --amb-x12101a: #12101a;
  --amb-x229ed9: #229ed9;
  --amb-x2f855a: #2f855a;
  --amb-xc0392b: #c0392b;
  --amb-xdd9d18: #dd9d18;
  --bg-amber-100: #fef3c7;
  --bg-amber-50: #fffbeb;
  --bg-amber-500: #f59e0b;
  --bg-amber-600: #d97706;
  --bg-amber-700: #b45309;
  --bg-amber-800: #92400e;
  --bg-amber-900: #78350f;
  --bg-blue-100: #dbeafe;
  --bg-blue-300: #93c5fd;
  --bg-blue-50: #eff6ff;
  --bg-blue-500: #3b82f6;
  --bg-blue-600: #2563eb;
  --bg-blue-700: #1d4ed8;
  --bg-cyan-600: #0891b2;
  --bg-emerald-50: #ecfdf5;
  --bg-gray-100: #f3f4f6;
  --bg-gray-200: #e5e7eb;
  --bg-gray-300: #d1d5db;
  --bg-gray-400: #9ca3af;
  --bg-gray-50: #f9fafb;
  --bg-gray-500: #6b7280;
  --bg-gray-600: #4b5563;
  --bg-gray-800: #1f2937;
  --bg-gray-900: #111827;
  --bg-green-100: #dcfce7;
  --bg-green-50: #f0fdf4;
  --bg-green-500: #22c55e;
  --bg-green-600: #16a34a;
  --bg-green-700: #15803d;
  --bg-indigo-100: #e0e7ff;
  --bg-indigo-50: #eef2ff;
  --bg-indigo-500: #6366f1;
  --bg-indigo-700: #4338ca;
  --bg-orange-50: #fff7ed;
  --bg-orange-500: #f97316;
  --bg-orange-700: #c2410c;
  --bg-pink-50: #fdf2f8;
  --bg-pink-500: #ec4899;
  --bg-purple-50: #faf5ff;
  --bg-purple-700: #7e22ce;
  --bg-red-100: #fee2e2;
  --bg-red-300: #fca5a5;
  --bg-red-50: #fef2f2;
  --bg-red-500: #ef4444;
  --bg-red-600: #dc2626;
  --bg-red-700: #b91c1c;
  --bg-red-800: #991b1b;
  --bg-sky-100: #e0f2fe;
  --bg-sky-50: #f0f9ff;
  --bg-slate-100: #f1f5f9;
  --bg-slate-200: #e2e8f0;
  --bg-slate-300: #cbd5e1;
  --bg-slate-400: #94a3b8;
  --bg-slate-50: #f8fafc;
  --bg-slate-500: #64748b;
  --bg-slate-800: #1e293b;
  --bg-slate-900: #0f172a;
  --bg-teal-700: #0f766e;
  --bg-violet-100: #ede9fe;
  --bg-violet-50: #f5f3ff;
  --bg-violet-700: #6d28d9;
  --bg-violet-900: #4c1d95;
  --bg-w: #ffffff;
  --bg-x000000: #000000;
  --bg-x0b1220: #0b1220;
  --bg-x0f2a4a: #0f2a4a;
  --bg-x110000: #110000;
  --bg-x111111: #111111;
  --bg-x12101a: #12101a;
  --bg-x128c7e: #128c7e;
  --bg-x161e2e: #161e2e;
  --bg-x1877f2: #1877f2;
  --bg-x1b7fb0: #1b7fb0;
  --bg-x1c1930: #1c1930;
  --bg-x1da851: #1da851;
  --bg-x1eb355: #1eb355;
  --bg-x1ebe5b: #1ebe5b;
  --bg-x229ed9: #229ed9;
  --bg-x243049: #243049;
  --bg-x25d366: #25d366;
  --bg-x285aeb: #285aeb;
  --bg-x2a2a2a: #2a2a2a;
  --bg-x2b2640: #2b2640;
  --bg-x2bb3ee: #2bb3ee;
  --bg-x34b7eb: #34b7eb;
  --bg-x36404a: #36404a;
  --bg-x3a3a3a: #3a3a3a;
  --bg-x6d4aff: #6d4aff;
  --bg-x888866: #888866;
  --bg-xd6249f: #d6249f;
  --bg-xdde3ec: #dde3ec;
  --bg-xdfe3ea: #dfe3ea;
  --bg-xe0940f: #e0940f;
  --bg-xe4572e: #e4572e;
  --bg-xe5edff: #e5edff;
  --bg-xe6f4ea: #e6f4ea;
  --bg-xe8e6ff: #e8e6ff;
  --bg-xeef1f6: #eef1f6;
  --bg-xeef2f7: #eef2f7;
  --bg-xeef4ff: #eef4ff;
  --bg-xf4f5f9: #f4f5f9;
  --bg-xf5a623: #f5a623;
  --bg-xf5f7fb: #f5f7fb;
  --bg-xf7f8fa: #f7f8fa;
  --bg-xf8fbff: #f8fbff;
  --bg-xfafbfc: #fafbfc;
  --bg-xfbfcfe: #fbfcfe;
  --bg-xfce7f0: #fce7f0;
  --bg-xfd5949: #fd5949;
  --bg-xfde8e8: #fde8e8;
  --bg-xfdf497: #fdf497;
  --bg-xffc845: #ffc845;
  --bg-zinc-50: #fafafa;
  --fg-amber-600: #d97706;
  --fg-amber-700: #b45309;
  --fg-amber-800: #92400e;
  --fg-amber-900: #78350f;
  --fg-blue-300: #93c5fd;
  --fg-blue-400: #60a5fa;
  --fg-blue-600: #2563eb;
  --fg-blue-700: #1d4ed8;
  --fg-blue-800: #1e40af;
  --fg-blue-900: #1e3a8a;
  --fg-gray-200: #e5e7eb;
  --fg-gray-300: #d1d5db;
  --fg-gray-400: #9ca3af;
  --fg-gray-500: #6b7280;
  --fg-gray-600: #4b5563;
  --fg-gray-700: #374151;
  --fg-gray-800: #1f2937;
  --fg-gray-900: #111827;
  --fg-green-500: #22c55e;
  --fg-green-600: #16a34a;
  --fg-green-700: #15803d;
  --fg-green-800: #166534;
  --fg-green-900: #14532d;
  --fg-indigo-700: #4338ca;
  --fg-orange-700: #c2410c;
  --fg-orange-800: #9a3412;
  --fg-orange-900: #7c2d12;
  --fg-pink-700: #be185d;
  --fg-purple-700: #7e22ce;
  --fg-purple-800: #6b21a8;
  --fg-purple-900: #581c87;
  --fg-red-500: #ef4444;
  --fg-red-600: #dc2626;
  --fg-red-700: #b91c1c;
  --fg-red-800: #991b1b;
  --fg-red-900: #7f1d1d;
  --fg-sky-700: #0369a1;
  --fg-sky-800: #075985;
  --fg-sky-900: #0c4a6e;
  --fg-slate-300: #cbd5e1;
  --fg-slate-400: #94a3b8;
  --fg-slate-50: #f8fafc;
  --fg-slate-500: #64748b;
  --fg-slate-600: #475569;
  --fg-slate-700: #334155;
  --fg-slate-800: #1e293b;
  --fg-slate-900: #0f172a;
  --fg-teal-700: #0f766e;
  --fg-violet-700: #6d28d9;
  --fg-violet-900: #4c1d95;
  --fg-w: #ffffff;
  --fg-x0f2a4a: #0f2a4a;
  --fg-x12101a: #12101a;
  --fg-x15719c: #15719c;
  --fg-x1c1930: #1c1930;
  --fg-x229ed9: #229ed9;
  --fg-x25d366: #25d366;
  --fg-x2f855a: #2f855a;
  --fg-x36404a: #36404a;
  --fg-x3b4a63: #3b4a63;
  --fg-x57534e: #57534e;
  --fg-x6d4aff: #6d4aff;
  --fg-xc0392b: #c0392b;
  --fg-xc7d7f0: #c7d7f0;
  --fg-xd6d2f5: #d6d2f5;
  --fg-xe4572e: #e4572e;
  --fg-xe8ecf4: #e8ecf4;
  --fg-xffc845: #ffc845;
  --fg-yellow-700: #a16207;
  --line-amber-200: #fde68a;
  --line-amber-400: #fbbf24;
  --line-amber-500: #f59e0b;
  --line-blue-100: #dbeafe;
  --line-blue-200: #bfdbfe;
  --line-blue-400: #60a5fa;
  --line-blue-600: #2563eb;
  --line-blue-700: #1d4ed8;
  --line-gray-100: #f3f4f6;
  --line-gray-200: #e5e7eb;
  --line-gray-300: #d1d5db;
  --line-gray-400: #9ca3af;
  --line-gray-800: #1f2937;
  --line-gray-900: #111827;
  --line-green-200: #bbf7d0;
  --line-green-500: #22c55e;
  --line-indigo-200: #c7d2fe;
  --line-orange-200: #fed7aa;
  --line-orange-300: #fdba74;
  --line-pink-200: #fbcfe8;
  --line-pink-300: #f9a8d4;
  --line-purple-200: #e9d5ff;
  --line-red-200: #fecaca;
  --line-red-300: #fca5a5;
  --line-red-500: #ef4444;
  --line-red-600: #dc2626;
  --line-red-700: #b91c1c;
  --line-sky-200: #bae6fd;
  --line-slate-100: #f1f5f9;
  --line-slate-200: #e2e8f0;
  --line-slate-300: #cbd5e1;
  --line-slate-50: #f8fafc;
  --line-slate-600: #475569;
  --line-slate-800: #1e293b;
  --line-slate-900: #0f172a;
  --line-w: #ffffff;
  --line-x12101a: #12101a;
  --line-x1d9bf0: #1d9bf0;
  --line-x1e2738: #1e2738;
  --line-x229ed9: #229ed9;
  --line-x243049: #243049;
  --line-x25d366: #25d366;
  --line-x36404a: #36404a;
  --line-xc7d2e0: #c7d2e0;
  --line-xc7d8fb: #c7d8fb;
  --line-xd7dfea: #d7dfea;
  --line-xdbe2ea: #dbe2ea;
  --line-xdbe3ee: #dbe3ee;
  --line-xdfe4ec: #dfe4ec;
  --line-xe6eaf0: #e6eaf0;
  --line-xe8ecf2: #e8ecf2;
  --line-xe8edf4: #e8edf4;
  --line-xeef0f3: #eef0f3;
  --line-xeef1f6: #eef1f6;
  --line-xeef2f7: #eef2f7;
  --line-xf1f3f6: #f1f3f6;
  --line-xf1f4f8: #f1f4f8;
  --line-xf5a623: #f5a623;
  --rgb-surface: 255,255,255;
}
/* ── end theme tokens ─────────────────────────────────────────────── */

:root {
  --bg: var(--bg-xf4f5f9);
  --card-bg: var(--bg-w);
  --text-dark: var(--fg-gray-800);
  --text-muted: var(--fg-gray-500);
  --accent: var(--amb-blue-600);
  --available: var(--amb-x2f855a);
  --kiv: var(--amb-xdd9d18);
  --booked: var(--amb-xc0392b);
  --sold: var(--amb-gray-700);
  --border: var(--line-gray-200);
  --telegram: var(--amb-x229ed9);
}

* { box-sizing: border-box; }

/* Global form control baseline — without this, any <input>/<select>/
   <textarea> outside a scoped container (like .form-box) falls back to
   the browser's raw default appearance (no radius, inconsistent padding,
   default system font) which is where most of the "dated" look across
   admin pages came from. Scoped containers with their own more specific
   rules (.form-box, .filter-bar, etc.) still win via normal CSS specificity,
   this only fills in the gaps everywhere else. */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="search"],
select, textarea {
  padding: 9px 12px;
  border: 1px solid var(--border, var(--line-gray-200));
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-dark, var(--fg-gray-800));
  background: var(--bg-w);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="tel"]:focus, input[type="url"]:focus,
input[type="date"]:focus, input[type="datetime-local"]:focus, input[type="search"]:focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent, var(--line-blue-600));
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
label { font-family: inherit; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  /* clip, not hidden. Both stop a sideways scrollbar, but hidden also makes
     the body a scroll container — and then every position:sticky inside it
     measures itself against a body that never scrolls, because the page
     scrolls on <html>. Nothing stuck anywhere on this site. clip does the
     same clipping without the scroll container. The hidden line below is
     the fallback for a browser without clip, which gets the old behaviour
     rather than a sideways scrollbar. */
  overflow-x: hidden;
  overflow-x: clip;
}

@media (max-width: 640px) {
  /* Site-wide (admin forms, main site, brand-site all share this
     stylesheet) — iOS Safari auto-zooms the whole page when an input/
     select/textarea is focused with font-size under 16px. Add Listing and
     other admin forms had no explicit font-size at all (falling back to
     the browser default, ~13px), triggering this on every field. */
  input[type="text"], input[type="number"], input[type="email"],
  input[type="tel"], input[type="password"], input[type="date"],
  input[type="search"], input[type="url"], select, textarea {
    font-size: 16px;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

h1.site-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 20px 0 24px;
}

.filter-bar {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.filter-bar label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.filter-bar select, .filter-bar input[type="text"] {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-w);
  font-size: 0.9rem;
  color: var(--text-dark);
}

.filter-bar button {
  background: var(--accent);
  border: none;
  color: var(--fg-w);
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
}

.filter-bar button:hover { filter: brightness(0.95); }

/* ---------- Grouped filter fields (label stays attached to its own control) ---------- */
.filter-bar-grouped {
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}
.filter-field label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
}
.filter-field select, .filter-field input {
  width: 100%;
}
.filter-field-btn { min-width: auto; }
.filter-field-btn button { width: 100%; white-space: nowrap; }
@media (max-width: 640px) {
  .filter-bar-grouped { gap: 12px; }
  .filter-field { flex: 1 1 calc(50% - 6px); min-width: calc(50% - 6px); }
  .filter-field:first-child { flex: 1 1 100%; min-width: 100%; }
  .filter-field-btn { flex: 1 1 100%; min-width: 100%; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  max-width: 100%;
}
/* Brand-site homepage listing grid — force a consistent 4-per-row instead
   of auto-fill, which produced inconsistent card widths/column counts
   depending on exact container width. */
@media (min-width: 900px) {
  #bsHomeListingsGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-xdfe3ea);
  /* A photo that fails to load paints its alt text — the listing title — on
     top of the card. The alt stays for screen readers; it just is not drawn. */
  color: transparent;
}

.agent-photo-card img {
  aspect-ratio: 1 / 1;
  height: auto;
  object-position: top center;
}
.agent-photo-card { position: relative; }
.agent-save-btn { position: absolute; top: 8px; right: 8px; z-index: 5; width: 32px; height: 32px; border-radius: 50%; background: rgba(var(--rgb-surface),0.9); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--fg-gray-700); }
.agent-save-btn svg { width: 16px; height: 16px; }
.agent-save-btn.saved { color: var(--fg-blue-600); }

.agents-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1000px) {
  .agents-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .agents-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .agents-grid { grid-template-columns: 1fr; }
}

/* ---------- Listing form step-tracker sidebar (add_listing.php + edit_listing.php) ---------- */
.listing-form-layout { display: flex; gap: 24px; align-items: flex-start; }
.listing-form-layout .form-box { flex: 1; min-width: 0; }
.listing-toc { display: none; }
@media (min-width: 1024px) {
  /* Right-side step tracker, desktop only — on mobile the form is
     already a single manageable scroll, and a sticky sidebar would
     just eat screen space without room to show the form comfortably. */
  .listing-toc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    background: var(--bg-w);
    border: 1px solid var(--border, var(--line-gray-200));
    border-radius: 12px;
    padding: 14px;
  }
  .listing-toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text-muted, var(--fg-gray-500));
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background-color 0.12s ease, color 0.12s ease;
  }
  .listing-toc a:hover { background: var(--bg-gray-50); }
  .listing-toc a.active { background: var(--bg-blue-50); color: var(--accent, var(--fg-blue-600)); }
  .listing-toc-num {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--bg-gray-200);
    color: var(--fg-gray-500);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 800;
  }
  .listing-toc a.active .listing-toc-num { background: var(--accent, var(--bg-blue-600)); color: var(--fg-w); }
}

/* ---------- Extra photos drag-to-reorder uploader (add_listing.php + edit_listing.php) ---------- */
.extra-photos-reorder-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.extra-photo-item { position: relative; width: 90px; height: 90px; border-radius: 8px; overflow: hidden; cursor: grab; border: 2px solid var(--border, var(--line-gray-200)); background: var(--bg-gray-100); }
.extra-photo-item.dragging { opacity: 0.4; }
.extra-photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.extra-photo-order { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,0.6); color: var(--fg-w); font-size: 0.68rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.extra-photo-remove { position: absolute; top: 4px; right: 4px; background: rgba(220,38,38,0.9); color: var(--fg-w); border: none; border-radius: 50%; width: 20px; height: 20px; line-height: 1; cursor: pointer; font-size: 0.9rem; }

/* ---------- Agent directory hero ---------- */
.agents-hero {
  background: linear-gradient(135deg, var(--bg-blue-600) 0%, var(--bg-blue-700) 100%);
  border-radius: 18px;
  padding: 40px 32px;
  color: var(--fg-w);
  margin: 24px 0 28px;
  position: relative;
  overflow: hidden;
}
.agents-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.agents-hero h2 { margin: 0 0 10px; font-size: 1.9rem; display: flex; align-items: center; gap: 12px; }
.agents-hero p { margin: 0; opacity: 0.92; font-size: 1rem; max-width: 640px; line-height: 1.6; }
.agents-hero-stat { display: inline-flex; align-items: baseline; gap: 6px; margin-top: 16px; background: rgba(255,255,255,0.16); padding: 7px 16px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; }
.agents-hero-stat strong { font-size: 1.25rem; }
.agents-hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.agents-hero-saved {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  background: var(--bg-w); color: var(--fg-blue-700); padding: 9px 16px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.agents-hero-saved:hover { background: var(--bg-xeef4ff); }

/* ---------- Agent directory controls (search/sort/filter) ---------- */
.agent-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
/* Shared search-with-icon style used identically across Telegram Channel
   Directory, WTB List, and Agent Directory — same look everywhere instead
   of each page inventing its own slightly-different variant. */
.tgcp-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.tgcp-search { flex: 1; min-width: 220px; position: relative; }
.tgcp-search input { width: 100%; box-sizing: border-box; padding: 12px 16px 12px 40px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.95rem; }
.tgcp-search::before { content: '\1F50D'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; opacity: 0.5; }
.agent-sort-select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: var(--bg-w);
}
.agent-state-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
}
.state-pill {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-w);
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.state-pill.active {
  background: var(--bg-slate-800);
  color: var(--fg-w);
  border-color: var(--line-slate-800);
}

/* ---------- Agent directory card ----------
   Built like FindHartanah's: a small round portrait over centred lines.
   The page used to lead with a big rectangular photo, and agents upload
   all sorts of things - logos, group shots, posters - so every awkward
   one filled the card. A circle at 72px carries them all evenly. */
.agents-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.agent-photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 16px 0;
  text-align: center;
  overflow: hidden;
}
.agent-card-link { display: block; text-decoration: none; color: inherit; flex: 1; }
.agent-photo-wrap { position: relative; display: inline-block; line-height: 0; }
.agent-photo-card img {
  width: 72px !important;
  height: 72px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-xf7f8fa);
}
.agent-tick {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-w);
  color: var(--fg-blue-600);
  box-shadow: 0 0 0 1.5px var(--bg-w);
}
.agent-tick svg { width: 15px; height: 15px; }
.agent-tick-off { color: var(--fg-slate-300); }
.agent-ag-name {
  display: block;
  margin: 10px 0 4px;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--fg-x12101a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-ag-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Top right, over the card's own white margin - not over the portrait,
   which is where it used to sit. */
.agent-save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-gray-400);
  padding: 0;
}
.agent-save-btn svg { width: 17px; height: 17px; }
.agent-save-btn.saved { color: var(--fg-blue-600); }
/* The count and the channel sit side by side across the foot: one says
   what is there, the other is where to go next. */
.agent-row-actions {
  display: flex;
  margin: 14px -16px 0;
}
.agent-row-badge,
.agent-row-tg {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.3;
}
.agent-row-badge { color: var(--fg-green-700); background: var(--bg-green-50); }
.agent-row-tg {
  color: var(--fg-w);
  text-decoration: none;
  background: linear-gradient(135deg, var(--bg-x34b7eb) 0%, var(--telegram) 100%);
}
/* No channel yet: present, plainly grey, and it says why when tapped. */
.agent-row-tg-off {
  background: var(--bg-gray-100);
  color: var(--fg-gray-400);
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.ap-btn-off { color: var(--fg-gray-400); cursor: pointer; }

@media (max-width: 640px) {
  .agents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .agent-photo-card { padding: 14px 8px 0; }
  .agent-photo-card img { width: 62px !important; height: 62px !important; }
  .agent-ag-name { font-size: 0.88rem; margin: 8px 0 3px; }
  .agent-ag-meta { font-size: 0.74rem; }
  .agent-row-actions { margin: 12px -8px 0; }
  .agent-row-badge,
  .agent-row-tg { font-size: 0.72rem; padding: 9px 4px; }
}

@media (min-width: 641px) {
  /* Two rows: the listing count with the save button beside it, then
     Telegram across the foot. The strip runs to both edges of the card -
     a gap on the right would read as a mistake next to a full-width
     button under it. */
  .agent-row-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    margin-top: auto;
  }
  .agent-row-badge { text-align: center; padding: 11px 6px; font-weight: 700; font-size: 0.85rem; color: var(--available); background: var(--bg-green-50); }
  .agent-row-actions .agent-save-btn {
    position: static;
    width: auto;
    height: auto;
    border-radius: 0;
    padding: 0 14px;
    background: var(--bg-green-50);
    color: var(--fg-green-700);
  }
  .agent-row-actions .agent-save-btn.saved { color: var(--fg-blue-600); }
  .agent-row-actions .agent-row-tg { grid-column: 1 / -1; }
  .agent-row-tg { flex: 1; text-align: center; text-decoration: none; padding: 11px 6px; font-weight: 700; font-size: 0.85rem; color: var(--fg-w); background: linear-gradient(135deg, var(--bg-x34b7eb) 0%, var(--telegram) 100%); display: flex; align-items: center; justify-content: center; }
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  /* One gap for every row in the card. Keep it tight — these lines are short
     labels, not paragraphs, and 6px+ made the card read as a list of islands. */
  gap: 4px;
}

.card-title { font-weight: 700; font-size: 1.05rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* .card-body is a flex column with its own gap — these elements carry no
   margins of their own, otherwise each row sits a different distance apart. */
.card-state { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* No wrapping: a long price used to push the status badge onto its own line,
     which looked broken. The price shrinks instead; the badge never moves. */
  flex-wrap: nowrap;
  gap: 8px;
}
.card-row .price { min-width: 0; }
.card-row > .badge { flex: none; }

/* The price/status row leads the card body, so it gets a touch more air. */
.card-body > .card-row { margin-bottom: 1px; }

/* Bold like the FindHartanah card, but a notch smaller: here the price shares
   its line with the status badge, and a seven-figure price crowded it. */
.price { color: var(--text-dark); font-weight: 800; font-size: 1.05rem; }
.old-price { display: block; color: var(--fg-gray-400); font-weight: 400; font-size: 0.72rem; text-decoration: line-through; margin: 0 0 1px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg-w);
  white-space: nowrap;
  /* Fallback: a status with no colour of its own still has to be readable —
     without this, an unknown value renders white text on a white card. */
  background: var(--bg-gray-500);
}

.badge.AVAILABLE { background: var(--available); }
.badge.BIN, .badge.KIV { background: var(--kiv); }
.badge.DRAFT { background: var(--bg-gray-500); }
.badge.BOOKED { background: var(--booked); }
.badge.SOLD { background: var(--sold); }
.badge.EXPIRED { background: var(--bg-gray-400); }
.badge.ACTIVE { background: var(--available); }

/* Status badge on a card: the full word on a desktop, a two-letter circle on a
   phone — tapping either opens the same explanation popup. */
.card-status-badge .cs-short { display: none; }
/* The portals keep their photo to two marks - Sale/Rent above, the photo
   count below, both on the left - and nothing on the right. The status
   reads beside the price instead, where the board puts it: a buyer looks
   at the number first, and "SOLD" means something there. */
.bs-card .photo-count-badge,
.bsa-card .photo-count-badge { right: auto; left: 8px; }

/* The portals' cards read the way FindHartanah's do, which were measured
   side by side: there the price is 18px against a 12px title at weight
   600, so the eye lands on the number and then the name. The portals had
   it the other way round - a 15px price under a 13px title at weight 700
   - and the two fought each other. Same positions, different weights. */
/* .card.bs-card, not .bs-card: the two-column phone grid sets
   .grid-2col-mobile .price, which ties a single-class rule and wins on
   order - which is how the price stayed at 15px here. */
.card.bs-card .price,
.card.bsa-card .price { font-size: 1.15rem; }
.card.bs-card .card-title,
.card.bsa-card .card-title { font-weight: 600; }
.card.bs-card .card-body,
.card.bsa-card .card-body { padding: 12px; }

/* Bed and Bath stay as icons and numbers. Spelling them out was tried
   and measured: the portals' cards run 185-252px wide and
   "4 Bed · 3 Bath · 2,787 sq.ft" needs about 230, so the words would
   wrap to a second line on most cards and show on almost none.
   FindHartanah has the room for them; these do not. The line is pinned
   to one line either way, so a long size can never fold it. */
.card.bs-card .card-specs,
.card.bsa-card .card-specs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A seven-figure price and the badge do not both fit on a phone card.
   Measured on a 167px card, where the price row is 141px: "RM2,500,000"
   wants 130 at 18.4px and gets 109, so every million-ringgit listing
   read "RM1,200,0...". At 16px with a 22px badge it needs 113 and gets
   113. The bigger price stays wherever there is room for it - this is
   the two-column phone grid only. Ellipsis as a backstop, so a price
   longer still ends in dots instead of a cut-off digit. */
@media (max-width: 640px) {
  .grid-2col-mobile .card.bs-card .price,
  .grid-2col-mobile .card.bsa-card .price { font-size: 1rem; }
  .grid-2col-mobile .card.bs-card .card-status-badge,
  .grid-2col-mobile .card.bsa-card .card-status-badge { width: 20px; height: 20px; font-size: 0.56rem; }
  .grid-2col-mobile .card.bs-card .card-row,
  .grid-2col-mobile .card.bsa-card .card-row { gap: 4px; }
}
.card.bs-card .price,
.card.bsa-card .price { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .card-status-badge { width: 30px; height: 30px; padding: 0; border-radius: 50%;
    justify-content: center; font-size: 0.68rem; letter-spacing: .02em; flex: none; }
  .card-status-badge .cs-full { display: none; }
  .card-status-badge .cs-short { display: inline; }
}

.tg-btn {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-x34b7eb) 0%, var(--telegram) 100%);
  color: var(--fg-w);
  text-decoration: none;
  padding: 11px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 3px 10px rgba(34, 158, 217, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tg-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(34, 158, 217, 0.4);
  filter: brightness(1.03);
}
.tg-btn:active { transform: translateY(0); }

.coa-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
}

/* ---------- Admin ---------- */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 9px;
  border: none;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg-w);
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); filter: brightness(0.98); }
.btn-primary { background: var(--accent); color: var(--fg-w); box-shadow: 0 2px 6px rgba(37,99,235,0.35); }
.btn-primary:hover { box-shadow: 0 4px 10px rgba(37,99,235,0.4); }
.btn-danger { background: var(--booked); box-shadow: 0 2px 6px rgba(192,57,43,0.3); }
.btn-danger:hover { box-shadow: 0 4px 10px rgba(192,57,43,0.35); }
.btn-muted { background: var(--bg-gray-400); }
.btn-outline { background: var(--bg-w); color: var(--text-dark); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.btn-outline:hover { border-color: var(--line-gray-300); background: var(--bg-zinc-50); }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-indigo-50);
  border: 1px solid var(--line-indigo-200);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.bulk-bar select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.bulk-bar .btn { padding: 6px 14px; font-size: 0.85rem; }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-w);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
table.admin-table th, table.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.88rem;
  vertical-align: top;
}
/* Every "Actions" cell across admin tables (listings, WTB, ads, agents,
   etc.) tends to hold a mix of <a class="btn">, <form style="display:inline">
   and the occasional plain <span> status note — left to wrap as plain
   inline content, these bunch up unevenly (different heights, no
   consistent gap) the moment a row has more than 2-3 actions. A flex
   wrap with a fixed gap keeps every row's buttons in a tidy, even grid
   regardless of how many actions that particular row has. */
table.admin-table td[data-label="Actions"] {
  white-space: nowrap;
}
table.admin-table td[data-label="Actions"] form { margin: 0; }
table.admin-table th {
  background: var(--bg-xfafbfc);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.admin-table tbody tr { transition: background-color 0.1s ease; }
table.admin-table tbody tr:hover { background: var(--bg-xfafbfc); }
table.admin-table tbody tr:last-child td { border-bottom: none; }

.status-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.8rem;
}

.login-box {
  max-width: 360px;
  margin: 80px auto;
  background: var(--bg-w);
  padding: 32px;
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
/* The three marks, above everything else on the page. Agents arrive here
   from findhartanah.com, from a linkren bio and from the board itself, and
   the heading alone says only "COAListing Board" — which, to someone who
   clicked from linkren, reads as the wrong place. The row answers that
   before they look for the username field. */
.login-brands { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.login-brands img { width: 38px; height: 38px; object-fit: contain; display: block; }
.login-brands-x { color: var(--text-muted, var(--fg-gray-400)); font-size: 0.8rem; font-weight: 600; }
/* linkren is set as its wordmark, not a mark — that is how the site signs
   itself. "ren" is var(--bg-blue-300) on linkren's own dark pages; on this white box
   that is about 1.9:1 against the background, so the brand blue carries it
   here instead and the pale shade stays where it was drawn for. */
.login-brands-linkren { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--fg-x12101a); line-height: 38px; }
.login-brands-linkren b { color: var(--fg-blue-600); }
.login-brands-note { text-align: center; margin: 0 0 20px; font-size: 0.78rem; color: var(--text-muted, var(--fg-gray-500)); }
.login-box h2 { text-align: center; margin-top: 0; }
.login-box input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.login-box button { width: 100%; }

.form-box {
  background: var(--bg-w);
  padding: 24px;
  border-radius: 14px;
  max-width: 560px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-two-col .form-box { max-width: 100%; }
.form-box label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--text-muted);
}
.form-box input, .form-box select, .form-box textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error { background: var(--bg-xfde8e8); color: var(--fg-xc0392b); }
.alert-success { background: var(--bg-xe6f4ea); color: var(--fg-x2f855a); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
}
.pagination a, .pagination span, .pagination button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.9rem;
  background: var(--bg-w);
  font-family: inherit;
  cursor: pointer;
}
.pagination .active { background: var(--accent); border-color: var(--accent); color: var(--fg-w); font-weight: 700; }

@media (max-width: 640px) {
  .pagination a, .pagination span, .pagination button { padding: 7px 11px; font-size: 0.82rem; }
}

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

/* ---------- Top nav (single row) ---------- */
.topbar {
  background: var(--bg-w);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (max-width: 1024px) {
  /* While a full-screen filter panel (Location/Property Type/Filter) is
     open, hide the site header entirely instead of trying to out-stack it
     with z-index — a hidden element can never visually overlap anything,
     sidestepping the whole class of stacking-context bugs that approach
     kept running into. */
  body.lf-panel-active .topbar,
  body.lf-panel-active .announcement-marquee {
    display: none;
  }
}

/* ---------- Announcement marquee (sits right under the header) ---------- */
.announcement-marquee {
  background: var(--bg-blue-50);
  border-bottom: 1px solid var(--line-blue-100);
  overflow: hidden;
  white-space: nowrap;
  padding: 7px 0;
}
.announcement-marquee-track {
  display: inline-block;
  animation: announcement-marquee-scroll 32s linear infinite;
}
.announcement-marquee-item {
  display: inline-block;
  padding: 0 48px;
  color: var(--fg-blue-700);
  font-size: 0.85rem;
  font-weight: 600;
}
@keyframes announcement-marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
/* Reduce Motion: drop the banner rather than freeze it.
   It is a reminder, not content anyone navigates to — the same text lives in
   the Help Centre. Shown static it is a 100px wall of text at the top of every
   page, and because the markup repeats the message to make the scroll loop
   seamlessly, it read as the same announcement printed twice. */
@media (prefers-reduced-motion: reduce) {
  .announcement-marquee { display: none; }
}
.topbar-row {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}
.topbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-dark);
  text-decoration: none;
  flex-shrink: 0;
  display: inline-block;
  line-height: 1.3;
}
.topbar-brand-credit { display: block; font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.main-nav {
  display: flex;
  gap: 18px;
  flex-wrap: nowrap;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding-bottom: 4px;
}
.nav-link.active, .nav-link:hover {
  color: var(--fg-blue-600);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.topbar-login-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg-gray-700);
  padding: 10px 8px;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-login-link:hover { color: var(--fg-blue-600); }
.topbar-login-link-mobile { display: none; }

.hamburger-btn { display: none; align-items: center; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--fg-gray-700); padding: 4px 8px; }

/* ---------- Centralized listing filter (Filter Lanjut) ---------- */
.listing-filter-form { background: var(--bg-w); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.listing-filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.listing-filter-input {
  flex: 2; min-width: 180px; padding: 12px; border: 1px solid var(--line-gray-300); border-radius: 8px;
  box-sizing: border-box; font-size: 16px; font-family: inherit;
}
.listing-filter-toggle-btn {
  background: var(--bg-gray-100); border: 1px solid var(--line-gray-300); padding: 12px 18px; border-radius: 8px;
  font-weight: 700; font-size: 16px; color: var(--fg-gray-700); cursor: pointer; white-space: nowrap; font-family: inherit;
}
.listing-filter-submit-btn {
  background: var(--bg-x1c1930); color: var(--fg-w); border: none; padding: 12px 28px; border-radius: 8px;
  font-weight: 700; font-size: 16px; cursor: pointer; font-family: inherit;
}
.listing-filter-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-gray-100); }
.listing-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.listing-filter-grid label { font-size: 0.78rem; font-weight: 700; color: var(--fg-gray-700); display: block; margin-bottom: 4px; }
.listing-filter-grid select {
  width: 100%; padding: 9px; border: 1px solid var(--line-gray-300); border-radius: 8px;
  font-size: 16px; font-family: inherit; box-sizing: border-box;
}
.listing-filter-clear { margin-top: 12px; }
.listing-filter-clear a { color: var(--fg-blue-600); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
@media (max-width: 640px) {
  .listing-filter-input { flex: none !important; width: 100%; }
  .listing-filter-toggle-btn, .listing-filter-submit-btn { flex: 1; }
}
.mobile-nav { display: none; flex-direction: column; background: var(--bg-w); border-top: 1px solid var(--border); padding: 8px 20px 14px; }
/* The menu lives inside the sticky top bar, so anything of it past the
   bottom of the screen could not be reached: scrolling moves the content
   underneath, not the bar. It scrolls itself instead, bounded by what is
   left of the screen below the bar. 100dvh rather than 100vh, since vh is
   the height the screen would have with the phone browser's own chrome
   hidden, which is not where the menu ends up; the vh line is the
   fallback. The bar's height is measured into --cl-topbar-h rather than
   written in, because it grows with the reader's text-size setting. */
.mobile-nav.open {
  display: flex;
  max-height: calc(100vh - var(--cl-topbar-h, 64px));
  max-height: calc(100dvh - var(--cl-topbar-h, 64px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mobile-nav a { padding: 10px 4px; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--line-gray-100); text-decoration: none; }
.mobile-nav a.active { color: var(--text-dark); }
.mobile-nav-bell,
/* The signed-in rows carry a line icon, so they need the same row layout as
   the bell rather than a bare block that leaves the glyph on its own line. */
.mobile-nav-ico { display: flex; align-items: center; gap: 8px; }
.mobile-nav-badge {
  background: var(--booked);
  color: var(--fg-w);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.3;
}
.mobile-nav-group { border-bottom: 1px solid var(--line-gray-100); }
.mobile-nav-group summary { padding: 10px 4px; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); cursor: pointer; list-style: none; }
.mobile-nav-group summary::-webkit-details-marker { display: none; }
.mobile-nav-group summary::after { content: '\25BE'; float: right; }
.mobile-nav-group[open] summary::after { content: '\25B4'; }
.mobile-nav-group a { display: block; padding: 10px 4px 10px 16px; border-bottom: none; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.mobile-nav-group a.active { color: var(--text-dark); }

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .hamburger-btn { display: flex; }
  .topbar-user-info { display: none; }
  .topbar-actions-desktop { display: none; }
  .topbar-login-link-mobile {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg-gray-700);
    text-decoration: none;
    white-space: nowrap;
  }
}
.btn-outline.btn-sm { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; }

.bell {
  position: relative;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 4px;
}
.admin-topbar-lang { position: relative; }
.admin-topbar-lang-summary {
  /* A circle of the same 38px as the search and guide buttons beside it, so
     the three read as one row of controls and the bar keeps its width for
     the agent's own name. */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--fg-gray-700);
  background: var(--bg-slate-50);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.admin-topbar-lang-summary:hover { background: var(--bg-blue-50); border-color: var(--line-blue-200); color: var(--fg-blue-600); }
.admin-topbar-lang-summary::-webkit-details-marker { display: none; }
.admin-topbar-lang[open] .admin-topbar-lang-summary { border-color: var(--accent); color: var(--accent); }
.admin-topbar-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
}
.admin-topbar-lang-option {
  display: block;
  padding: 9px 16px;
  color: var(--fg-gray-700);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-w);
}
.admin-topbar-lang-option:hover { background: var(--bg-gray-100); }
.admin-topbar-lang-option.active { color: var(--accent); }
.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--booked);
  color: var(--fg-w);
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.3;
}
.topbar-user-wrap { position: relative; display: inline-flex; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.topbar-user img, .topbar-user-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}
.topbar-user-fallback {
  background: var(--accent);
  color: var(--fg-w);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
/* The photo and its tick. The wrapper is what the tick is positioned
   against, so the photo keeps its own 38px and nothing shifts. */
.topbar-user-pic { position: relative; flex: none; display: block; line-height: 0; }
.topbar-user-tick {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg-w);
  color: var(--fg-blue-600);
  box-shadow: 0 0 0 1.5px var(--bg-w);
}
.topbar-user-tick svg { width: 13px; height: 13px; }
.topbar-user-tick-off { color: var(--fg-slate-300); }
/* The line under a headline figure that says what it is made of. Quieter
   than the delta beside it: the delta is news, this is composition. */
.stat-split { color: var(--fg-slate-500); font-size: 0.78rem; line-height: 1.4; margin-top: 2px; }
.topbar-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-user-name { font-weight: 700; font-size: 0.85rem; color: var(--text-dark);
  max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-user-role { font-size: 0.72rem; color: var(--text-muted); }

.topbar-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-w);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 160px;
  overflow: hidden;
  z-index: 50;
}
.topbar-user-menu.open { display: block; }
.topbar-user-menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
}
/* One mark, one label per row — no second line. */
.topbar-user-menu .tum-mark { flex: none; width: 18px; height: 18px; object-fit: contain; }
/* The COA mark is an SVG whose own artwork is rounded (rx 112 of 512, so
   22%); the linkren mark is a PNG with no transparency at all, which on a
   dark menu reads as a hard square beside it. Same proportion, so the two
   sit together whatever size they are drawn at. A mark that is already
   round-cornered loses nothing. */
.topbar-user-menu img.tum-mark { border-radius: 22%; }
.topbar-user-menu .tum-mark-ico { display: inline-flex; align-items: center; justify-content: center; color: var(--fg-slate-500); }
.topbar-user-menu a:hover { background: var(--bg-gray-50); }
.topbar-user-menu a + a { border-top: 1px solid var(--line-gray-100); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg-xeef1f6) 0%, var(--bg-xdde3ec) 100%);
  padding: 40px 20px 90px;
}
.hero-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 55%;
  background-size: cover;
  background-position: 65% 20%;
  mask-image: linear-gradient(to right, transparent, black 25%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 25%);
  opacity: 0.35;
}
@media (max-width: 640px) {
  .hero-bg {
    width: 100%;
    background-position: 63% 15%;
    mask-image: linear-gradient(to bottom, black 55%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent);
    opacity: 0.3;
  }
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--fg-slate-800);
  margin: 10px 0 2px;
}
.hero h1 strong {
  display: block;
  font-weight: 800;
  font-size: 2.1rem;
}
.hero p {
  color: var(--fg-slate-600);
  margin: 6px 0 26px;
}
.hero-search {
  background: var(--bg-w);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-width: 1150px;
}
.hero-search input[type="text"], .hero-search input[type="number"], .hero-search select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}
.hero-search input[type="text"] { flex: 3 1 240px; }
.hero-search select, .hero-search input[type="number"] { flex: 1 1 90px; }
.hero-search button {
  background: var(--bg-slate-800);
  color: var(--fg-w);
  border: none;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* ---------- Stats row ---------- */
.stats-row {
  max-width: 1200px;
  margin: -75px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .stats-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stats-row { grid-template-columns: 1fr; } }
.stats-row > * { min-width: 0; }
.stat-card {
  background: var(--bg-w);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  gap: 12px;
  align-items: center;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  color: var(--fg-w);
}
.stat-icon.blue { background: var(--bg-indigo-500); }
.stat-icon.green { background: var(--bg-green-600); }
.stat-icon.orange { background: var(--bg-orange-500); }
.stat-number { font-size: 1.3rem; font-weight: 800; color: var(--text-dark); line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); }
.stat-delta { font-size: 0.72rem; color: var(--fg-green-600); font-weight: 700; margin-top: 2px; }
.cta-card {
  background: var(--bg-slate-800);
  color: var(--fg-w);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.cta-card strong { font-size: 0.95rem; }
.cta-card p { font-size: 0.78rem; color: var(--fg-slate-300); margin: 0 0 4px; }
.cta-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* The card is a quarter of the row, so below ~1100px the two buttons no
   longer fit side by side — they wrapped past the card's right edge and
   looked cut off. Wrapping + centred text keeps them inside. */
.cta-card .btn { padding: 6px 12px; font-size: 0.78rem; text-align: center; }

/* ---------- Home content grid ---------- */
.home-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

.home-grid-3col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .home-grid-3col { grid-template-columns: 1fr; } }
/* clip rather than hidden, for the same reason body uses it: hidden makes
   this a scroll container, and a sticky child then has nothing to stick to.
   The hidden line is the fallback where clip is unknown. */
.home-grid > div { min-width: 0; overflow-x: hidden; overflow-x: clip; }

/* ---------- WTB simple list (no cards/images, just rows) ---------- */
.wtb-simple-list { display: flex; flex-direction: column; }
.wtb-simple-row {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-xeef0f3);
  font-size: 0.85rem;
}
.wtb-simple-row:last-child { border-bottom: none; }
.wtb-simple-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.wtb-simple-budget { font-weight: 700; color: var(--fg-x12101a); font-size: 0.95rem; }
.wtb-simple-time { color: var(--fg-gray-400); font-size: 0.75rem; }
.wtb-simple-area { color: var(--fg-gray-700); margin-bottom: 2px; }
.wtb-simple-type { color: var(--fg-gray-500); font-size: 0.8rem; margin-bottom: 8px; }
.wtb-simple-row-bottom { display: flex; justify-content: space-between; align-items: center; }
.wtb-simple-status { color: var(--fg-gray-500); font-size: 0.8rem; }
.wtb-simple-actions { display: flex; gap: 10px; font-size: 1.1rem; }
.wtb-simple-actions a { text-decoration: none; }

.hscroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  max-width: 100%;
}
.hscroll .card { flex: 0 0 250px; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .listings-grid { grid-template-columns: repeat(2, 1fr); } }

.card-badges-topleft {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
  align-items: center;
}

.new-badge {
  background: var(--bg-indigo-500);
  color: var(--fg-w);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.coa-mark-btn {
  border: 1.5px solid var(--line-red-600);
  background: var(--bg-w);
  color: var(--fg-red-600);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: transform 0.1s ease, background 0.15s ease, color 0.15s ease;
}
.coa-mark-btn:hover { transform: scale(1.05); }
.coa-mark-btn.active {
  background: var(--bg-red-600);
  color: var(--fg-w);
}
/* Both are buttons: tapping either explains why the listing has no COA. */
.not-my-listing-badge, .no-coa-badge { font-family: inherit; cursor: pointer; }
.not-my-listing-badge {
  background: var(--bg-blue-50);
  color: var(--fg-blue-700);
  border: 1.5px solid var(--line-blue-200);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.no-coa-badge {
  background: var(--bg-gray-100);
  color: var(--fg-gray-500);
  border: 1.5px solid var(--line-gray-200);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Icon-only circular variant, used on cards without a NEW badge (All Listing / Agent profile) */
.coa-mark-corner {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(var(--rgb-surface),0.9);
  border: 1.5px solid var(--line-red-600);
  color: var(--fg-red-600);
  font-size: 0.95rem;
  padding: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.coa-mark-corner.active {
  background: var(--bg-red-600);
  color: var(--fg-w);
}
/* overflow: a photo that fails to load renders its alt text — the listing
   title — which otherwise spills across the card beneath it. */
.card-thumb-wrap { position: relative; overflow: hidden; }
.photo-count-badge {
  position: absolute;
  display: inline-flex; align-items: center; gap: 4px;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: var(--fg-w);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}
.card-view-hint {
  /* Two icons, no words: the whole photo opens the listing, so the label was
     naming something the card already makes obvious — and on a narrow card it
     ran into the photo count beside it. The wording lives on as the title. */
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.6);
  color: var(--fg-w);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  pointer-events: none;
  transition: background 0.15s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
/* Desktop bonus — darken the photo + make the hint pop a little on hover.
   Has no effect on touch devices (no real hover state there), which is why
   the badge itself stays always-visible rather than only appearing on hover. */
.card-thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.15s;
  pointer-events: none;
  z-index: 2;
}
.card-thumb-wrap:hover::after { background: rgba(0,0,0,0.12); }
.card-thumb-wrap:hover .card-view-hint { background: rgba(0,0,0,0.8); transform: scale(1.05); }
.card-thumb-wrap img.card-agent-avatar {
  position: absolute;
  top: 8px; right: 8px;
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-w);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
/* The ring says whether we checked this agent's licence. White told a buyer
   nothing, and the tick itself does not fit at 36px over a photo. The two
   colours are cl_verified_tick()'s own, so the ring and the tick are never
   two different blues; the grey is absence of a check, not a warning. */
.card-thumb-wrap img.card-agent-avatar.cav-verified { border-color: var(--line-x1d9bf0); }
.card-thumb-wrap img.card-agent-avatar.cav-plain { border-color: var(--line-slate-300); }
.card-thumb-wrap img.card-agent-avatar:hover { transform: scale(1.12); }

/* WhatsApp contact button (wa-contact-btn — see whatsapp_button_html() in
   site_config.php): a round green icon button. It used to be the word
   "WhatsApp" with a looping zoom, which crowded the 2-column phone grid. */
.wa-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-x25d366);
  box-shadow: 0 1px 4px rgba(37,211,102,0.4);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wa-contact-btn svg { fill: var(--fg-w); width: 16px; height: 16px; }
.wa-contact-btn:hover, .wa-contact-btn:focus { transform: scale(1.08); box-shadow: 0 3px 10px rgba(37,211,102,0.5); }

/* Same button, greyed out: the listing is closed to COA, so it opens an
   explanation rather than WhatsApp. Kept in place so every card footer lines
   up instead of some having a button and some not. */
.wa-contact-btn-blocked { background: var(--bg-slate-300); box-shadow: none; border: none; padding: 0; font: inherit; }
.wa-contact-btn-blocked svg { fill: var(--fg-slate-50); }
.wa-contact-btn-blocked:hover, .wa-contact-btn-blocked:focus { transform: none; background: var(--bg-slate-400); box-shadow: none; }

/* An agent's own listing: the slot is filled so the footer lines up, but there
   is genuinely nobody to message, so the button is disabled rather than
   clickable-but-useless. */
.wa-contact-btn-own { cursor: default; opacity: 0.55; }
.wa-contact-btn-own:hover, .wa-contact-btn-own:focus { transform: none; background: var(--bg-slate-300); }

/* Telegram / Download in the details view, same idea. */
.tg-btn-blocked { background: var(--bg-slate-100); color: var(--fg-slate-400); border-color: var(--line-slate-200); cursor: pointer; font-family: inherit; }
.tg-btn-blocked svg { opacity: 0.6; }
.tg-btn-blocked:hover { background: var(--bg-slate-200); color: var(--fg-slate-500); }


/* Icon-only variant for cards in a flex row (not absolute), e.g. Featured Listings sidebar */
.coa-mark-inline {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
}
.card-specs { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

.buyer-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  max-width: 100%;
}
.buyer-card {
  flex: 0 0 250px;
  background: var(--bg-w);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.buyer-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.buyer-tag {
  background: var(--bg-xfde8e8); color: var(--fg-xc0392b);
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 6px;
}
.buyer-time { font-size: 0.72rem; color: var(--fg-gray-400); }
.buyer-row { display: flex; justify-content: space-between; font-size: 0.85rem; margin: 5px 0; }
.buyer-row .label { color: var(--fg-gray-400); }
.buyer-actions { display: flex; gap: 8px; margin-top: 12px; }
.buyer-actions .btn { flex: 1; text-align: center; padding: 8px; font-size: 0.82rem; }

.sidebar-block { margin-bottom: 32px; min-width: 0; }
.sidebar-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.featured-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-w);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
}
.featured-card img {
  width: 76px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.featured-card .info { font-size: 0.82rem; min-width: 0; }
.featured-card .price { font-size: 0.85rem; }
.featured-badge {
  background: var(--bg-amber-100); color: var(--fg-amber-700);
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 6px; border-radius: 5px;
  margin-left: 6px;
}

.agent-rank-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-w);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
  max-width: 100%;
}
.agent-rank-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.agent-rank-info { flex: 1; min-width: 0; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; }
.agent-rank-agency { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-rank-stats { text-align: right; font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.agent-rank-stats strong { color: var(--text-dark); font-size: 0.85rem; }
.medal { font-size: 1rem; margin-right: 2px; }
@media (max-width: 400px) {
  .agent-rank-stats { font-size: 0.66rem; }
  .agent-rank-stats strong { font-size: 0.76rem; }
}

.activity-section { max-width: 1200px; margin: 0 auto 50px; padding: 0 20px; }
.activity-row-list { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
@media (min-width: 901px) {
  /* Web sahaja — 3 kolum (Active Buyer, Top Agent, Latest Activity) dalam
     .home-grid-3col sepatutnya nampak sama tinggi, tapi masing-masing boleh
     jadi panjang berbeza ikut jumlah data. Fixed height + scroll dalam
     senarai ni sendiri, bukan pada seluruh kolum, supaya heading/button
     "View All" di atas tetap kekal di tempat asal. Mobile tak disentuh. */
  .activity-row-list, .wtb-simple-list, .sidebar-list { max-height: 520px; overflow-y: auto; padding-right: 4px; }
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-w);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.activity-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-xdfe3ea); }
.activity-info { font-size: 0.8rem; min-width: 0; }
.activity-info strong { display: block; font-size: 0.82rem; }
.activity-time { font-size: 0.68rem; color: var(--text-muted); }
/* A price row's figures: what it was, then what it is. A cut is the news a
   co-agent wants, so the new figure is green; a rise is stated plainly. */
.activity-price { display: inline-block; margin-left: 4px; font-size: 0.78rem; color: var(--fg-gray-500); white-space: nowrap; }
.activity-price strong { display: inline; font-size: inherit; color: var(--fg-gray-900); }
.activity-price.down strong { color: var(--fg-green-700); }

/* ---------- Footer ----------
   One CSS grid holds every block so the mobile layout can reorder them:
   brand on its own row, Platform + Resources side by side, then Legal
   sharing a row with the FindHartanah credit. Every block is placed by
   explicit grid-area — auto-flow puts the full-width rows in the wrong
   place once the columns differ between breakpoints. */
/* Full-bleed band: the footer runs the width of the page with no outline, and
   only its contents are held to the same 1100px column as the rest of the site. */
.site-footer {
  margin: 40px 0 0;
  padding: 36px 20px 28px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.sf-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  column-gap: 28px;
  row-gap: 18px;
}
.sf-brand    { grid-area: 1 / 1 / 2 / 2; }
.sf-platform { grid-area: 1 / 2 / 2 / 3; }
.sf-resources{ grid-area: 1 / 3 / 2 / 4; }
.sf-legal    { grid-area: 1 / 4 / 2 / 5; }
.sf-mid      { grid-area: 2 / 1 / 3 / 5; }
.sf-copy     { grid-area: 3 / 1 / 4 / 3; }
.sf-credit   { grid-area: 3 / 3 / 4 / 5; text-align: right; }

.sf-wordmark {
  display: inline-block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-x12101a);
  text-decoration: none;
}
.sf-wordmark span { color: var(--accent); }
.sf-wordmark small { font-size: inherit; font-weight: 800; }
.sf-tagline {
  margin: 12px 0 0;
  max-width: 34ch;
  line-height: 1.6;
  color: var(--text-muted);
}
.sf-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sf-social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-w);
  flex: none;
}
.sf-social-btn svg { width: 18px; height: 18px; }
.sf-facebook  { background: var(--bg-x1877f2); }
.sf-instagram { background: radial-gradient(circle at 30% 107%, var(--bg-xfdf497) 0%, var(--bg-xfd5949) 45%, var(--bg-xd6249f) 60%, var(--bg-x285aeb) 90%); }
.sf-tiktok    { background: var(--bg-x12101a); }
.sf-threads   { background: var(--bg-x12101a); }
.sf-telegram  { background: var(--telegram); }
.sf-whatsapp  { background: var(--bg-x25d366); }

.sf-col h2 {
  margin: 4px 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}
.sf-col a {
  display: block;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}
.sf-col a:hover { color: var(--accent); }
/* Live count beside Latest Activity — the board's pulse, not a personal alert,
   so it uses the accent rather than the red of an unread notification. */
.sf-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--fg-w);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}

.sf-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 28px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border);
}
.sf-stats { display: flex; align-items: center; gap: 22px; flex: none; }
/* The group invite sits beside the counts: this row is the one place in the
   footer a visitor's eye already stops, and the link was invisible as one more
   round icon up in the brand column. margin-right:auto pushes the skyline to
   the far edge, so the middle no longer reads as a hole. */
.sf-wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--bg-x25d366);
  color: var(--fg-w);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
}
.sf-wa-cta:hover { background: var(--bg-x1da851); }
.sf-wa-cta svg { flex: none; }
.sf-stats div { display: flex; flex-direction: column; }
.sf-stats div + div { border-left: 1px solid var(--border); padding-left: 22px; }
.sf-stats strong {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.sf-stats span { font-size: 0.8rem; color: var(--text-muted); }
.sf-skyline { width: 460px; max-width: 42%; height: auto; color: var(--fg-xc7d7f0); flex: none; }

.sf-copy, .sf-credit { margin: 0; font-size: 0.8rem; }
.sf-credit { color: var(--text-dark); font-weight: 600; }
.sf-credit a { color: var(--accent); text-decoration: none; }
.sf-credit span {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  color: var(--text-muted);
}
.site-footer .sf-grid > * { min-width: 0; }
.footer-mobile-break { display: none; }

@media (max-width: 860px) {
  .site-footer { margin-top: 32px; padding: 26px 20px 24px; }
  .sf-grid { grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 22px; }
  .sf-brand    { grid-area: 1 / 1 / 2 / 3; }
  .sf-platform { grid-area: 2 / 1 / 3 / 2; }
  .sf-resources{ grid-area: 2 / 2 / 3 / 3; }
  .sf-mid      { grid-area: 3 / 1 / 4 / 3; }
  /* Legal and the credit each get a full row of their own — side by side they
     left one column four links tall and the other three lines of wrapped text. */
  .sf-legal    { grid-area: 4 / 1 / 5 / 3; }
  .sf-credit   { grid-area: 5 / 1 / 6 / 3; text-align: left; }
  .sf-copy     { grid-area: 6 / 1 / 7 / 3; text-align: center; }
  /* Full width, so the links read as one row instead of a tall stack. A dot
     between them: spacing alone left three separate links looking like three
     unfinished lines once they wrapped. The dot is drawn from the link before
     it, so it never starts a wrapped line on its own. */
  .sf-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .sf-legal h2 { flex-basis: 100%; margin: 0 0 2px; }
  .sf-legal a { margin-bottom: 0; }
  /* var(--bg-gray-400), not var(--border): the border grey is var(--bg-gray-200), which is meant to
     be seen against a panel edge and all but disappears as a character on
     white. A separator has to be lighter than the links without vanishing. */
  .sf-legal a:not(:last-child)::after { content: '\00B7'; margin-left: 10px; color: var(--fg-gray-400); pointer-events: none; }
  .sf-legal a:hover::after { color: var(--fg-gray-400); }
  .sf-wordmark { font-size: 1.6rem; }
  .sf-tagline { max-width: none; }
  .sf-skyline { display: none; }
  .sf-mid { padding: 0 0 18px; gap: 16px; }
  .sf-wa-cta { width: 100%; justify-content: center; margin-right: 0; }
  .sf-stats { justify-content: space-between; width: 100%; gap: 0; }
  .sf-stats div { flex: 1; align-items: center; text-align: center; }
  .sf-stats div + div { padding-left: 0; }
  .footer-mobile-break { display: inline; }
}

/* ---------- Agent profile meta line ---------- */
.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}
.agent-meta .item:not(:first-child)::before {
  content: "-";
  margin-right: 6px;
  color: var(--fg-slate-300);
}
.agent-meta a { color: var(--telegram); text-decoration: none; font-weight: 600; }
@media (max-width: 640px) {
  .agent-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .agent-meta .item:not(:first-child)::before { content: none; }
}

/* ---------- Left-aligned page variant (agent profile page) ---------- */
/* Matches the nav bar's max-width (1200px) so this content's left edge lines up with the logo, instead of hugging the browser edge or floating centered with the old 1100px width. */
.container-left {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 20px;
}
@media (max-width: 640px) {
  .container-left {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- Search bar ---------- */
.search-bar {
  display: flex;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto 28px;
}
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.search-bar button {
  background: var(--accent);
  border: none;
  color: var(--fg-w);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

/* ---------- Listing age note ---------- */
.listing-age {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.listing-age-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* The agent name takes whatever room is left, so the date must not be the
   thing that wraps when a long name turns up. */
.listing-posted { white-space: nowrap; flex-shrink: 0; }
.listing-agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.listing-agent-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ---------- WTB compact rows (one per line, no image) ---------- */
.wtb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wtb-row {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  /* The price track was a fixed 100px, which "RM5,000/month" overflowed
     straight across the agent's name. It now takes the width it needs. */
  grid-template-columns: 1.6fr 1.3fr 1.3fr minmax(110px, max-content) 1.1fr 250px;
  align-items: center;
  gap: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.wtb-title { font-weight: 700; }
/* Each fact on its own line: "Freehold · Bumi Lot" and the posted date were
   run together with a dot and read as one long string. */
.wtb-meta { color: var(--text-muted); font-size: 0.85rem; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wtb-meta .wtb-type { color: var(--fg-slate-600); font-weight: 600; }
.wtb-date { font-size: 0.78rem; color: var(--fg-slate-400); }
.wtb-loan-pill { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-green-100); color: var(--fg-green-700); white-space: nowrap; }
.wtb-tenure-date-row { display: flex; align-items: baseline; gap: 8px; }
.wtb-tenure:empty { visibility: hidden; }
.wtb-budget { color: var(--accent); font-weight: 700; white-space: nowrap; }
.wtb-agent { font-size: 0.85rem; color: var(--text-muted);
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wtb-agent a { color: var(--text-dark); font-weight: 600; text-decoration: none; }
.wtb-buttons-row { display: flex; gap: 8px; justify-content: flex-end; }
.wtb-match-slot, .wtb-action-slot { text-align: right; }
.wtb-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 8px;
  background: var(--bg-x25d366);
  color: var(--fg-w);
  text-decoration: none;
}

@media (max-width: 900px) {
  .wtb-row {
    grid-template-columns: 1fr;
    row-gap: 4px;
    padding: 16px;
  }
  /* Desktop keeps the tenure/land slot as an invisible-but-occupied grid
     cell so every row's columns stay aligned regardless of which rows
     happen to have that data — on mobile there's no column grid to keep
     aligned, so an empty one should just disappear instead of leaving an
     awkward blank line. */
  .wtb-tenure:empty { display: none; }
  .wtb-meta { gap: 1px; }
  .wtb-title { font-size: 1.05rem; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line-slate-100); }
  .wtb-tenure-date-row { margin: 2px 0; }
  .wtb-date { font-size: 0.78rem; }
  .wtb-budget { font-size: 1.1rem; display: block; margin: 4px 0; }
  .wtb-agent { display: block; margin-bottom: 10px; }
  .wtb-buttons-row {
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--line-slate-100);
  }
  .wtb-match-slot, .wtb-action-slot { text-align: center; flex: 1 1 0; }
  .wtb-match-slot a, .wtb-match-slot span.btn, .wtb-action-slot a { display: block; width: 100%; box-sizing: border-box; text-align: center; }
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 36px 0 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.section-heading h2 { margin: 0; font-size: 1.2rem; }
@media (max-width: 480px) {
  .section-heading { flex-wrap: nowrap; }
  .section-heading h2 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .section-heading .btn { flex-shrink: 0; padding: 6px 12px; font-size: 0.8rem; }
}

/* ---------- About page ---------- */
.about-content { line-height: 1.7; color: var(--text-dark); }
.about-content h2 { font-size: 1.15rem; margin: 28px 0 10px; }
.about-content h2:first-child { margin-top: 0; }
.about-content p { margin: 0 0 12px; color: var(--fg-gray-700); }
.about-content ul { margin: 0 0 14px; padding-left: 22px; }
.about-content li { margin-bottom: 4px; color: var(--fg-gray-700); }

/* ---------- Admin Sidebar Shell ---------- */
.admin-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}
.admin-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--bg-slate-800);
  color: var(--fg-slate-300);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-weight: 800;
  color: var(--fg-w);
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-sidebar-logo small { color: var(--accent); font-size: 0.75rem; letter-spacing: 1px; }
.admin-sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  overflow-y: auto;
}
.admin-nav-link {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--fg-slate-300);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.admin-nav-link:hover { background: rgba(255,255,255,0.06); color: var(--fg-w); }
.admin-nav-link.active { background: var(--accent); color: var(--fg-w); }
.admin-nav-lang summary { cursor: pointer; list-style: none; }
.admin-nav-lang summary::-webkit-details-marker { display: none; }
.admin-nav-lang summary::after { content: '\25BE'; float: right; }
.admin-nav-lang[open] summary::after { content: '\25B4'; }
.admin-nav-lang-option {
  display: block;
  padding: 8px 14px 8px 40px;
  color: var(--fg-slate-400);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.admin-nav-lang-option:hover { color: var(--fg-w); }
.admin-nav-lang-option.active { color: var(--accent); }
.admin-sidebar-divider {
  margin: 14px 14px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--fg-slate-500);
}
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; }
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bg-w);
  border-bottom: 1px solid var(--border);
}
.admin-hamburger {
  display: none;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--fg-gray-700);
}
.admin-hamburger-icon { font-size: 1.3rem; line-height: 1; }
.admin-hamburger-text { font-size: 0.85rem; font-weight: 700; color: var(--fg-blue-600); }
.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg-gray-800);
  font-weight: 600;
  font-size: 0.88rem;
}
.admin-content { padding: 24px; flex: 1; }

.admin-welcome h2 { margin: 0 0 4px; font-size: 1.4rem; }
/* "Online" pill beside the welcome name (it used to live in the sidebar footer). */
.cl-online {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  margin-left: 8px; padding: 3px 10px 3px 8px; border-radius: 999px;
  background: var(--bg-green-100); color: var(--fg-green-700); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.02em; position: relative; top: -2px;
}
.cl-online > span { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-green-500); display: inline-block; }
.admin-welcome p { margin: 0 0 20px; color: var(--fg-gray-500); }

.admin-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-two-col {
  display: grid;
  /* minmax(0, …): a long title or link inside can't widen its column past half */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .admin-two-col { grid-template-columns: minmax(0, 1fr); } }
/* Swaps the two halves on a desktop only, so the phone keeps the DOM order. */
@media (min-width: 901px) {
  .admin-two-col-swap > *:first-child { order: 2; }
  .admin-two-col-swap > *:last-child { order: 1; }
}

.admin-panel {
  background: var(--bg-w);
  border: 1px solid var(--line-xeef0f3);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  padding: 20px;
}
.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.admin-panel-header h3 { margin: 0; font-size: 1.05rem; }
.admin-panel-header .btn { padding: 6px 14px; font-size: 0.8rem; }

.admin-mini-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-mini-table th, .admin-mini-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line-slate-100); }
.admin-mini-table th { color: var(--fg-gray-400); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.admin-mini-table .icon-btn { text-decoration: none; color: var(--fg-gray-500); margin-right: 6px; font-size: 0.95rem; }
.admin-view-all { display: inline-block; margin-top: 12px; font-size: 0.85rem; font-weight: 600; color: var(--telegram); text-decoration: none; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 700px) { .summary-cards { grid-template-columns: 1fr 1fr; } }
.summary-card {
  background: var(--bg-w);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
}
.summary-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.summary-card .num { font-size: 1.3rem; font-weight: 800; }
.summary-card .lbl { font-size: 0.78rem; color: var(--fg-gray-500); }
.summary-card .sub { font-size: 0.68rem; color: var(--fg-gray-400); }

.match-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-green-600);
  color: var(--fg-w);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 6px;
}
.match-count-badge.zero { background: var(--bg-gray-200); color: var(--fg-gray-400); }

/* ---------- Matching page listing cards (admin/matching.php) — same visual
   language as the public homepage's listing cards, for consistency, but
   linking to view_matches.php instead of opening the public detail modal. ---------- */
.match-listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.match-listing-card { text-decoration: none; color: inherit; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.match-listing-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.match-listing-card .card-thumb-wrap { position: relative; }
.match-listing-card .match-count-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  height: auto;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ---------- Matching page WTB cards — same card family as
   .match-listing-card above, but without a photo (WTB requests are just
   text criteria: location, house type, budget). The badge sits inline in
   its own top row instead of overlaid on an image. ---------- */
.match-wtb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.match-wtb-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card-bg, var(--bg-w));
  border: 1px solid var(--border, var(--line-gray-200));
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.match-wtb-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.match-wtb-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.match-wtb-card-top .card-title { margin: 0; }
.match-wtb-card .match-count-badge { flex-shrink: 0; }

@media (max-width: 640px) {
  /* Force 2 columns on mobile — the default auto-fill(minmax(220px, 1fr))
     only fits ONE column on a narrow phone screen (220px x2 exceeds
     available width), which looked sparse/wasteful for a page that's
     mostly small cards. */
  .match-listing-grid,
  .match-wtb-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ---------- Dashboard preview rows (mobile-friendly, no horizontal scroll) ---------- */
.preview-list { display: flex; flex-direction: column; }
.preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-slate-100);
  flex-wrap: wrap;
}
.preview-row:last-child { border-bottom: none; }
.preview-main { flex: 1 1 160px; min-width: 0; }
.preview-main strong { display: block; font-size: 0.88rem; }
.preview-meta { display: block; font-size: 0.76rem; color: var(--fg-gray-500); margin-top: 1px; }
.preview-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.preview-price { font-size: 0.85rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
@media (max-width: 480px) {
  .preview-row { padding: 12px 0; }
  .preview-side { width: 100%; justify-content: space-between; order: 3; margin-top: 4px; }
}

@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    left: -240px;
    z-index: 100;
    transition: left 0.2s ease;
  }
  .admin-sidebar.open { left: 0; }
  .admin-hamburger { display: flex; }
}

.admin-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}
.admin-table-wrap table { min-width: 560px; }

@media (max-width: 640px) {
  .admin-content { padding: 14px; }
  .admin-topbar { padding: 12px 14px; }
  .admin-topbar-user span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-welcome h2 { font-size: 1.15rem; }
  .admin-quick-actions .btn { flex: 1 1 auto; text-align: center; font-size: 0.82rem; padding: 8px 10px; }
  .admin-panel { padding: 14px; }
  .summary-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-card { padding: 12px; }


}

@media (max-width: 900px) {
  /* Responsive table -> stacked cards on tablet/mobile */
  .admin-table-wrap table.admin-table-responsive,
  .admin-table-wrap table.admin-table-responsive thead,
  .admin-table-wrap table.admin-table-responsive tbody,
  .admin-table-wrap table.admin-table-responsive th,
  .admin-table-wrap table.admin-table-responsive td,
  .admin-table-wrap table.admin-table-responsive tr {
    display: block;
    width: 100%;
  }
  .admin-table-wrap table.admin-table-responsive { min-width: 0; }
  .admin-table-wrap table.admin-table-responsive thead { display: none; }
  .admin-table-wrap table.admin-table-responsive tr {
    border: 1px solid var(--border, var(--line-gray-200));
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-w);
  }
  .admin-table-wrap table.admin-table-responsive td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-align: right;
  }
  .admin-table-wrap table.admin-table-responsive td[data-label]::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted, var(--fg-gray-500));
    text-align: left;
    flex-shrink: 0;
  }
  .admin-table-wrap table.admin-table-responsive td:empty,
  .admin-table-wrap table.admin-table-responsive td:not([data-label]):not(.ls-mobile-title-td) {
    display: none;
  }
  /* The label text is translated, so the attribute value changes with the
     language — .cl-cell-actions is the stable hook. Keep the old selectors too
     for any table that still relies on them. */
  .admin-table-wrap table.admin-table-responsive td.cl-cell-actions,
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }
  .admin-table-wrap table.admin-table-responsive td.cl-cell-actions::before,
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"]::before {
    flex-shrink: 0;
    align-self: center;
    margin-right: auto;
  }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > a.btn,
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > button.btn {
    flex: 0 0 auto;
  }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > a.btn:first-of-type { flex: 0 0 20%; font-size: 0.80rem; padding: 5px 4px; }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > button.btn:nth-of-type(1) { flex: 0 0 30%; font-size: 0.80rem; padding: 5px 4px; }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > button.btn:nth-of-type(2) { flex: 0 0 20%; font-size: 0.80rem; padding: 5px 4px; }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > form,
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > div {
    flex: 1 1 100%;
    width: 100%;
  }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] form button,
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > div button {
    width: 100%;
    text-align: center;
  }
  /* A one-button form (Delete, Remove, Approve…) sits beside the other
     buttons like a normal button instead of taking a whole line. */
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > form[style*="display:inline"] {
    flex: 0 0 auto;
    width: auto;
  }
  .admin-table-wrap table.admin-table-responsive td[data-label="Actions"] > form[style*="display:inline"] button {
    width: auto;
    font-size: 0.80rem;
    padding: 5px 12px;
  }
}

/* ---------- Platform checkboxes ---------- */
.platform-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.platform-checklist label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 400;
  background: var(--bg-gray-50);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.platform-checklist input { width: auto; }
.platform-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.platform-tag {
  background: var(--bg-indigo-50);
  color: var(--fg-indigo-700);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- WTB info cards ---------- */
.wtb-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 720px) {
  .wtb-info-cards { grid-template-columns: 1fr; }
}
.wtb-promo-card, .wtb-explain-card {
  border-radius: 16px;
  padding: 24px;
}
.wtb-promo-card {
  background: linear-gradient(135deg, var(--bg-amber-100) 0%, var(--bg-amber-50) 100%);
}
.wtb-explain-card {
  background: linear-gradient(135deg, var(--bg-blue-100) 0%, var(--bg-blue-50) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wtb-promo-card h3, .wtb-explain-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.wtb-promo-card h3 { color: var(--fg-amber-800); }
.wtb-explain-card h3 { color: var(--fg-blue-800); }
.wtb-promo-card p, .wtb-explain-card p {
  margin: 0 0 14px;
  color: var(--fg-x57534e);
  font-size: 0.9rem;
}
.wtb-explain-card p { color: var(--fg-x3b4a63); margin-bottom: 0; }
.wtb-promo-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.wtb-promo-card li {
  font-size: 0.88rem;
  color: var(--fg-amber-900);
  padding: 5px 0;
}

/* ---------- Daily posting checklist page ---------- */
.checklist-list { display: flex; flex-direction: column; gap: 14px; }
.checklist-card {
  background: var(--bg-w);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.checklist-card-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .checklist-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}
.checklist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
@media (min-width: 641px) {
  .checklist-actions { min-width: 220px; justify-content: flex-end; }
}
/* Web (default): simple nested flex, no width constraint — Download+Telegram
   cluster together, Push+Buang cluster together, both clusters flow as
   normal items within the outer .checklist-actions row (so on a wide
   screen everything ends up reading left-to-right in one row anyway).
   Avoiding display:contents here deliberately — it has had inconsistent
   behaviour in some mobile browsers, not worth the risk for this. */
.checklist-buttons {
  display: flex;
  gap: 8px;
}
.checklist-buttons .tg-btn {
  margin-top: 0;
  min-height: auto;
}
.checklist-push-row {
  display: flex;
  gap: 8px;
}
.checklist-push-row .btn-danger { flex: 1; }
@media (max-width: 640px) {
  .checklist-actions {
    width: 100%;
    border-top: 1px solid var(--line-gray-100);
    padding-top: 10px;
  }
  .checklist-actions .btn, .checklist-actions .tg-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .checklist-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .checklist-buttons:has(> :only-child) {
    grid-template-columns: 1fr;
  }
  .checklist-buttons .btn, .checklist-buttons .tg-btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .checklist-push-row {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .checklist-push-row form { flex: 3; }
  .checklist-push-row form button { width: 100%; }
  .checklist-push-row .btn-danger { flex: 1; }
  .checklist-actions .btn, .checklist-actions .tg-btn, .checklist-actions form {
    flex: 1 1 auto;
    min-width: fit-content;
  }
}
.checklist-title-wrap { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) {
  .checklist-title-wrap { width: 100%; }
}
.checklist-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.checklist-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-gray-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.checklist-progress {
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-gray-100);
}
.checklist-progress-count { font-size: 0.85rem; font-weight: 700; color: var(--fg-gray-600); }
.checklist-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-gray-200);
  margin-top: 6px;
  overflow: hidden;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--bg-green-600);
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* ---------- Listing detail popup modal ---------- */
.listing-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}
.listing-modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.listing-modal {
  position: relative;
  background: var(--bg-w);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  margin: auto;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  touch-action: manipulation;
}
.listing-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 5;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: var(--fg-w);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.listing-modal-loading {
  padding: 80px 20px;
  text-align: center;
  color: var(--fg-gray-400);
}
.listing-modal-details { padding: 18px 20px 20px; }
.listing-modal-price { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); }
.listing-modal-agent-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Gallery — horizontal scroll-snap, swipeable natively on touch, no JS
   swipe library needed. Arrows/dots are enhancements for desktop/clarity. */
.listing-gallery {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-gray-900);
  touch-action: pan-x;
}
.listing-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  height: 100%;
  scrollbar-width: none;
  touch-action: pan-x;
}
.listing-gallery-track::-webkit-scrollbar { display: none; }
.listing-gallery-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  touch-action: pan-x;
  -webkit-user-select: none;
  user-select: none;
}
.listing-gallery-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-gray-500);
}
.listing-gallery-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--rgb-surface),0.85);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.listing-gallery-arrow-left { left: 10px; }
.listing-gallery-arrow-right { right: 10px; }
.listing-gallery-dots {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
  z-index: 3;
}
.listing-gallery-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(var(--rgb-surface),0.5);
}
.listing-gallery-dot.active { background: var(--bg-w); width: 18px; border-radius: 3px; }

@media (max-width: 640px) {
  .listing-modal-overlay { padding: 0; }
  .listing-modal { border-radius: 0; max-width: 100%; min-height: 100vh; }
}

/* ---------- 2-column mobile grid — All Listing page only ---------- */
@media (min-width: 900px) {
  .grid-2col-mobile {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 640px) {
  .grid-2col-mobile {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .grid-2col-mobile .card-body { padding: 10px; }
  .grid-2col-mobile .card-title {
    font-size: 0.82rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .grid-2col-mobile .card-state {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .grid-2col-mobile .card-specs { font-size: 0.68rem; }
  .grid-2col-mobile .card-row { flex-wrap: nowrap; gap: 6px; }
  .grid-2col-mobile .price { font-size: 0.95rem; }
  .grid-2col-mobile .old-price { font-size: 0.68rem; }
  .grid-2col-mobile .badge { font-size: 0.55rem; padding: 2px 6px; }
  .grid-2col-mobile .card-status-badge { width: 26px; height: 26px; padding: 0; font-size: 0.68rem; }
  /* Both Telegram and Download stay reachable via the listing popup (tap
     the photo) — hiding the whole footer row keeps the compact 2-column
     card focused on the key info (price/specs/agent) without a cramped
     button row squeezed underneath. */
  .grid-2col-mobile .tg-btn,
  .grid-2col-mobile .card-body > div[style*="display:flex"] { display: none !important; }
  /* Exception — brand-site's card footer (Details + WhatsApp) uses the
     same .tg-btn/flex-wrapper classes as the main site's Telegram/Download
     row, but isn't redundant with any popup here, so it should stay
     visible even in the compact 2-column view. */
  .grid-2col-mobile .card-body > div[style*="display:flex"]:has(.btn-whatsapp) {
    display: flex !important;
  }
  .grid-2col-mobile .tg-btn.btn-whatsapp {
    display: flex !important;
  }
  /* 0.6rem is 9.6px. Everything in this card had been shrunk to fit a
     167px column, and these were the ones that went under what a phone
     can comfortably read - two of them being buttons an agent is meant
     to press. Raised to 11px, which still fits without wrapping. */
  .grid-2col-mobile .card-view-hint,
  .grid-2col-mobile .photo-count-badge { font-size: 0.68rem; padding: 2px 6px; }
  .grid-2col-mobile .card-agent-avatar { width: 24px; height: 24px; }
  .grid-2col-mobile .coa-mark-btn,
  .grid-2col-mobile .not-my-listing-badge,
  .grid-2col-mobile .no-coa-badge { font-size: 0.7rem; padding: 3px 7px; }
  /* "Disiarkan X ago · Ejen: Name" — truncate to one line instead of
     wrapping/pushing the card taller at this narrow width. */
  .grid-2col-mobile .listing-age-split {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .grid-2col-mobile .listing-posted { font-size: 0.7rem; }
  .grid-2col-mobile .listing-agent-row {
    width: 100%;
    justify-content: space-between;
    font-size: 0.68rem;
  }
  .grid-2col-mobile .listing-agent-name { max-width: 100%; }
  /* Telegram/Download side-by-side would be unreadably narrow at 2 columns
     — stack them instead. */
  .grid-2col-mobile .card-body > div[style*="display:flex"] {
    flex-direction: column;
  }
  .grid-2col-mobile .tg-btn { font-size: 0.75rem; padding: 8px 6px; margin-top: 6px; }
}

/* ---------- Shared listing filter bar (Buy/Rent tabs, Location checkbox
   tree, Property Type/Price/Tenure/Land/Status pills) — listing_filter.php ---------- */
.lf-wrap { margin-bottom: 20px; }
.lf-tabs { display: flex; align-items: flex-end; gap: 4px; margin-bottom: 0; }
.lf-tab {
  padding: 10px 28px;
  border-radius: 10px 10px 0 0;
  background: var(--bg-xe5edff);
  color: var(--fg-gray-700);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
}
.lf-tab.active { background: var(--bg-blue-600); color: var(--fg-w); }
.lf-tab-static {
  background: var(--bg-gray-100);
  color: var(--fg-gray-500);
  cursor: default;
}
.lf-tab-agency {
  background: var(--bg-amber-500);
  color: var(--fg-w);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.3;
}
.lf-tab-agency:hover { background: var(--bg-amber-600); }

.lf-form { background: var(--bg-xeef4ff); border-radius: 0 0 16px 16px; padding: 16px; }
.lf-main-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.lf-secondary-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.lf-search-wrap {
  flex: 1 1 260px;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: stretch;
}
.lf-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}
input.lf-search-input {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line-gray-300);
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--bg-w);
  transition: padding-right 0.1s ease;
}
/* Only reserve room for the Go button once it's actually visible — with
   it hidden (the common case, nothing typed/selected yet), the full width
   is free for the placeholder text instead of leaving 70px permanently
   blocked off for a button that isn't there, which was especially
   noticeable on narrow mobile screens truncating the placeholder. */
.lf-search-wrap.has-go-btn input.lf-search-input {
  padding-right: 70px;
}
.lf-search-btn {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  background: linear-gradient(135deg, var(--bg-gray-100), var(--bg-gray-200));
  color: var(--fg-red-700);
  border: 1px solid var(--line-gray-300);
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.88rem;
}

.lf-dropdown { position: relative; }
.lf-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-w);
  border: 1px solid var(--line-gray-300);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-gray-700);
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
}
.lf-pill-btn.active {
  background: var(--bg-red-50);
  border-color: var(--line-red-200);
  color: var(--fg-red-600);
}
.lf-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.lf-location-btn { justify-content: flex-start; }
.lf-caret { font-size: 1rem; color: var(--fg-gray-400); margin-left: 2px; }
.lf-pill-btn.active .lf-caret { color: var(--fg-red-600); }
.lf-badge {
  /* A circle, not a sliver: a single digit in an inline-block came out
     narrower than it was tall. The min-width ties the width to the height
     so "1" is round, while the side padding still lets a two-digit count
     stretch it into a pill instead of clipping. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 5px;
  box-sizing: border-box;
  background: var(--bg-red-600);
  color: var(--fg-w);
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
  border-radius: 999px;
  margin-left: 2px;
}
.lf-clear-all {
  font-size: 0.85rem;
  color: var(--fg-red-600);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}
.lf-clear-all-x { margin-left: 4px; }
.lf-clear-all-mobile-slot:empty { display: none; }

/* "More Filter" reveal — desktop: hidden until toggled, then shows inline
   as extra pills in the same row (wraps naturally). Mobile: irrelevant on
   its own since the WHOLE secondary row is already hidden/shown as one
   unit by the mobile Filter toggle — this just needs to not add an extra
   layer of hiding on top of that. */
.lf-more-filters {
  display: none;
}
.lf-more-filters.lf-more-open {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 10px;
}

.lf-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  background: var(--bg-w);
  border: 1px solid var(--line-gray-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 14px;
  min-width: 240px;
}
.lf-panel.open { display: block; }
.lf-panel label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg-gray-500);
  margin: 8px 0 4px;
}
.lf-panel label:first-child { margin-top: 0; }
.lf-panel select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line-gray-300);
  border-radius: 8px;
  font-size: 0.85rem;
}
.lf-panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.lf-panel-clear {
  background: var(--bg-gray-100); border: none; color: var(--fg-gray-700); font-size: 0.85rem;
  font-weight: 700; cursor: pointer; padding: 8px 18px; border-radius: 8px;
  flex: 1;
}
.lf-panel-done {
  background: var(--bg-blue-600); color: var(--fg-w); border: none; border-radius: 8px;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; padding: 8px 18px;
  flex: 1;
}
.lf-panel-mobile-header { display: none; }

/* ---- Simple labeled native-select fields (Min/Max Price, Bedrooms,
   Bathrooms, Tenure Type, Land Title, Status) — the field shows its own
   current value directly and opens as an ordinary browser <select>, no
   custom JS panel needed. Matches the "label above, value below" look. ---- */
@media (min-width: 1025px) {
  .lf-more-filters .lf-dropdown {
    min-width: 150px;
  }
}
.lf-field-box {
  position: relative;
  border: 1px solid var(--line-gray-300);
  border-radius: 8px;
  background: var(--bg-w);
  min-width: 150px;
  flex: 1 1 150px;
  height: 44px;
  display: flex;
  align-items: center;
}
.lf-field-box.has-value {
  background: var(--bg-red-50);
  border-color: var(--line-red-200);
}
.lf-field-box label {
  display: none;
  position: absolute;
  top: 5px; left: 12px;
  font-size: 0.64rem;
  color: var(--fg-gray-500);
  font-weight: 700;
  pointer-events: none;
}
.lf-field-box.has-value label { display: block; color: var(--fg-red-600); }
.lf-field-box .lf-placeholder {
  position: absolute;
  left: 12px; right: 28px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-gray-700);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lf-field-box.has-value .lf-placeholder { display: none; }
.lf-field-box select {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: transparent; /* native text hidden by default — .lf-placeholder shows the field name instead */
  padding: 0 28px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}
.lf-field-box.has-value select {
  color: var(--fg-red-600); /* real selected value now visible, red like other active filters */
  padding-top: 13px; /* room for the floating label above it */
}
.lf-field-box::after {
  content: '';
  position: absolute;
  right: 12px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--line-gray-400);
  border-bottom: 2px solid var(--line-gray-400);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.lf-field-box.has-value::after {
  border-right-color: var(--line-red-600);
  border-bottom-color: var(--line-red-600);
}

/* ---- Location checkbox tree ---- */
.lf-panel-scroll { width: 300px; padding: 10px; }
.lf-loc-search {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-gray-300);
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.lf-loc-tree { max-height: 320px; overflow-y: auto; }
.lf-loc-state { border-bottom: 1px solid var(--line-gray-100); }
.lf-loc-state-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; }
.lf-loc-checkbox-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; color: var(--fg-gray-800); cursor: pointer; flex: 1;
}
.lf-loc-checkbox-label input[type="checkbox"] { width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--bg-blue-600); }
.lf-loc-expand {
  background: none; border: none; cursor: pointer; color: var(--fg-gray-500);
  font-size: 0.75rem; padding: 6px 8px; transition: transform 0.15s;
}
.lf-loc-state.expanded .lf-loc-expand { transform: rotate(180deg); }
.lf-loc-districts { display: none; padding: 0 4px 8px 26px; background: var(--bg-gray-50); }
.lf-loc-state.expanded .lf-loc-districts { display: block; }
.lf-loc-district-label { padding: 5px 0; font-size: 0.84rem; }

/* Property Type only — show just the first 3 types per category by
   default (mobile especially looked overwhelming showing everything at
   once); a "+ See More" link reveals the rest. Location's tree is
   untouched (different class scope). */
.lf-loc-tree .lf-loc-districts .lf-loc-district-label:nth-of-type(n+4) {
  display: none;
}
.lf-loc-tree .lf-loc-districts.lf-show-all .lf-loc-district-label {
  display: flex;
}
/* While the location box is being typed in, every match has to be
   reachable - otherwise a district the search found sits hidden behind
   the collapse rule and the search reads as broken. */
.lf-loc-tree.lf-searching .lf-loc-districts .lf-loc-district-label {
  display: flex;
}
.lf-loc-tree.lf-searching .lf-see-more-btn {
  display: none;
}
.lf-see-more-btn {
  display: block;
  background: none;
  border: none;
  color: var(--fg-blue-600);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
}

/* ---- Mobile-only "Filter" toggle for the secondary row ---- */
.lf-mobile-filter-toggle { display: none; }
.lf-mobile-sort-slot { display: none; }
.lf-mobile-filter-header { display: none; }
.lf-mobile-filter-search { display: none; }

@media (max-width: 1024px) {
  /* iOS Safari auto-zooms the page when focusing any input/select with
     font-size under 16px — force 16px minimum on every field here so
     typing/tapping a dropdown doesn't trigger that zoom. */
  input.lf-search-input,
  .lf-field-box select,
  .lf-loc-search,
  .lf-panel select {
    font-size: 16px;
  }
  .lf-form { padding: 10px; border-radius: 0 0 10px 10px; }
  .lf-tab { padding: 8px 20px; font-size: 0.85rem; }
  /* Full width only on real phones — on tablets/small laptops a Buy/Rent-sized
     pill reads better than one long orange bar across the filter head. */
  .coa-public .lf-tab-agency { flex: 0 1 auto; padding: 8px 18px; }
  /* The portals want the opposite: the firm's tab runs to the end of the
     row however short the name is, so the tab strip has no ragged gap. */
  .coa-brand .lf-tab-agency { flex: 1 1 auto; }
  .lf-main-row { gap: 8px; }
  /* Row 1: Search input (80%) + Search button (20%). */
  .lf-main-row .lf-search-wrap { flex: 1 1 100%; order: 1; height: 42px; }
  .lf-main-row .lf-search-btn { padding: 0 12px; font-size: 0.76rem; }
  /* Row 2: Location (38%) + Property Type (47%) + Filter (15%) — no Sort
     here, coalisting.com's sort lives separately below the search bar. */
  .lf-main-row .lf-dropdown { min-width: 0; order: 2; }
  .lf-main-row .lf-dropdown-location { flex: 0 1 calc(32% - 12px); }
  .lf-main-row .lf-dropdown-category { flex: 0 1 calc(44% - 16px); }
  .lf-main-row .lf-dropdown .lf-pill-btn { width: 100%; font-size: 0.8rem; padding-left: 10px; padding-right: 10px; }
  .lf-mobile-filter-toggle { order: 2; flex: 0 1 calc(12% - 5px); min-width: 0; padding: 6px 2px; font-size: 0.82rem; flex-direction: column; gap: 2px; background: var(--bg-xeef4ff); border: none; border-radius: 0; }
  .lf-mobile-sort-slot { order: 2; flex: 0 1 calc(12% - 5px); min-width: 0; display: flex; }
  /* height:100% on a flex-stretched parent is unreliable (percentage
     heights need the containing block to have an explicit height, which
     a stretched-but-not-explicitly-sized flex parent doesn't count as in
     every browser) — align-self:stretch uses the actual flex stretch
     mechanism instead, which is what correctly matches this to the
     Filter button's height every time. */
  .lf-mobile-sort-slot > div {
    display: flex !important;
    align-self: stretch;
    width: 100%;
  }
  .lf-mobile-sort-slot button {
    width: 100% !important;
    flex: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px !important;
    padding: 6px 2px !important;
    font-size: 0.68rem !important;
    background: var(--bg-xeef4ff) !important;
    border: none !important;
    border-radius: 0 !important;
  }
  .lf-mobile-sort-slot svg { width: 15px; height: 15px; }
  /* On a phone this used to be a full-width "Clear all x" bar on a row of
     its own, which is a lot of screen for a thing you press once. It is
     now the fifth control on the Sort row, the same size and shape as
     Filter and Sort beside it, showing the cross alone.

     The row was already full: location 32% + type 44% + Filter 12% +
     Sort 12% left 14px of 323, and the cross needs 42 with its gap. The
     14% comes off the two pills, but only when the cross is there - with
     no filters set there is nothing to clear, and they keep their width.
     The pills lose their inner padding at the same time, so the labels
     end up about where they were: "Selangor" had 52px and keeps 49. */
  .lf-main-row.lf-has-clear .lf-dropdown-location { flex: 0 1 calc(28% - 9px); }
  .lf-main-row.lf-has-clear .lf-dropdown-category { flex: 0 1 calc(40% - 13px); }
  .lf-main-row.lf-has-clear .lf-mobile-filter-toggle,
  .lf-main-row.lf-has-clear .lf-mobile-sort-slot { flex: 0 1 calc(12% - 4px); }
  /* The pills give up their inner padding rather than their words: at
     these widths "Selangor" and "Property Type" both still fit whole,
     which they would not if the padding had stayed. */
  .lf-main-row.lf-has-clear .lf-dropdown .lf-pill-btn { padding-left: 6px; padding-right: 6px; gap: 4px; }
  .lf-clear-all-mobile-slot {
    order: 2;
    flex: 0 1 calc(8% - 2px);
    min-width: 0;
    display: flex;
  }
  /* No tinted tile: Filter and Sort beside it are bare on the row, and a
     filled box here would read as the loudest control in the bar. */
  .lf-clear-all-mobile-slot .lf-clear-all {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: var(--fg-red-600);
  }
  /* The word goes, not the link: the cross alone is the control, and the
     a still carries the full wording for anyone reading it aloud. */
  .lf-clear-all-mobile-slot .lf-clear-all-text { display: none; }
  .lf-clear-all-mobile-slot .lf-clear-all-x { margin: 0; font-size: 1.15rem; line-height: 1; font-weight: 700; }

  /* Filter toggle reveals the secondary row (Min/Max Price, Bedrooms,
     etc.) in place — no popup, no duplicated fields. */
  .lf-mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-xeef4ff);
    border: none;
    border-radius: 0;
    font-weight: 700;
    color: var(--fg-gray-700);
    cursor: pointer;
  }
  .lf-mobile-sort-slot { display: flex; }
  .lf-pill-icon { display: none; }
  .lf-secondary-row {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 14px;
  }
  .lf-secondary-row.lf-mobile-open {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    background: var(--bg-w);
    margin-top: 0;
    padding: 0 16px 16px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .lf-mobile-filter-header {
    display: none;
  }
  .lf-panel.open .lf-panel-mobile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    background: var(--bg-w);
    padding: 16px 0 16px 16px;
    margin: 0 -16px 12px;
    border-bottom: 1px solid var(--line-gray-100);
  }
  .lf-secondary-row.lf-mobile-open .lf-mobile-filter-header {
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    background: var(--bg-w);
    padding: 16px 0;
    margin: 0 -16px 4px;
    padding-left: 16px;
    border-bottom: 1px solid var(--line-gray-100);
    order: -2;
  }
  .lf-mobile-filter-back {
    background: none;
    border: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--fg-gray-800);
    padding: 4px;
  }
  .lf-mobile-filter-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--fg-gray-800);
  }
  .lf-mobile-filter-search {
    display: none;
  }
  .lf-secondary-row.lf-mobile-open .lf-mobile-filter-search {
    display: block;
    position: sticky;
    bottom: 0;
    width: 100%;
    background: var(--bg-red-600);
    color: var(--fg-w);
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    margin-top: auto;
  }
  .lf-secondary-row .lf-dropdown { width: 100%; }
  .lf-secondary-row .lf-pill-btn { width: 100%; justify-content: space-between; height: 42px; }
  .lf-secondary-row .lf-field-box,
  .lf-secondary-row .lf-more-filters { width: 100%; }
  .lf-secondary-row .lf-field-box {
    flex: 0 0 auto;
    height: 44px;
    min-width: 0;
  }
  .lf-more-filter-wrap { display: none; }
  .lf-more-filters { display: flex !important; flex-direction: column; gap: 14px; width: 100%; }

  /* Location/Property Type panels — TRUE full-screen takeover on mobile.
     Deliberately NOT using percentage-based centering (top:X%, translateX,
     etc.) since that math depends on the trigger button's own size/position
     and easily ends up pushing content (like the search box at the top of
     the list) off-screen or behind other elements. Filling the whole
     viewport sidesteps all of that — guaranteed visible regardless of
     content height or which button opened it. */
  .lf-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    transform: none;
    border-radius: 0;
    z-index: 600;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: none;
  }
  .lf-panel.open { display: flex; flex-direction: column; }
  .lf-panel-scroll { width: 100%; }
  .lf-loc-tree { flex: 1 1 auto; max-height: none; }
  .lf-panel-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg-w);
    padding-top: 10px;
    margin-top: auto;
  }
  .lf-clear-all { text-align: center; width: 100%; margin-top: 4px; }
}

/* More dropdown menu (listing_saya.php) */
.ls-more-item {
  /* Flex, not block: the social items carry an icon that has to sit on the
     same line as the words without nudging the text off the left edge. */
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 14px; font-size: 0.85rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-dark); border-radius: 7px;
  text-decoration: none; box-sizing: border-box;
}
.ls-more-item:hover { background: var(--bg-slate-100); }
.ls-more-item svg { flex: none; opacity: 0.75; }

/* Title cell with thumbnail (listing_saya.php) */
.ls-title-cell { display: flex; flex-direction: column; gap: 4px; }
.ls-title-bottom { display: flex; gap: 10px; align-items: center; }
.ls-title-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; display: none; }
.ls-title-thumb-empty { width: 40px; height: 40px; border-radius: 6px; background: var(--bg-slate-100); display: none; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.ls-title-desktop { flex: 1; min-width: 0; overflow: hidden; }
.ls-title-desktop > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

/* Fix admin table title column to consistent width */
table.admin-table td[data-label="Title"] { width: 320px; max-width: 320px; padding-right: 19px; }
table.admin-table td[data-label="Title"] .ls-title-desktop,
table.admin-table td[data-label="Title"] .ls-title-text { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-title-meta { font-size: 0.72rem; color: var(--fg-gray-400); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.ls-title-meta .ls-meta-item + .ls-meta-item::before { content: "\00B7"; margin-right: 6px; }

@media (max-width: 900px) {
  /* Views and WhatsApp clicks stack — side by side they ran into the row edge. */
  .ls-title-meta { flex-direction: column; align-items: flex-start; gap: 3px; }
  .ls-title-meta .ls-meta-item + .ls-meta-item::before { content: none; }
  /* Titles stay on one line; the rest is an ellipsis. */
  .ls-mobile-title-td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ls-standalone-thumb { display: none !important; }
  .ls-title-desktop { display: none; }
  .ls-title-thumb { display: block; }
  .ls-title-thumb-empty { display: flex; }
}

/* Fix title to 1 line */
.ls-mobile-only { display: none; }
@media (max-width: 900px) { .ls-mobile-only { display: flex; } }
.ls-desktop-only { display: flex; }
@media (max-width: 900px) { .ls-desktop-only { display: none; } }

.ls-in-trash-label { font-size:0.78rem; color:var(--fg-gray-400); font-weight:700; }
.ls-mobile-title-row { display: none; }
@media (max-width: 900px) {
  .ls-mobile-title-row { display: table-row; }
  .ls-mobile-title-row td { background: var(--bg-w); border-bottom: none !important; padding-bottom: 0 !important; }
  /* Group title row + data row — remove top border on data row that follows title row */
  .ls-mobile-title-row + tr { border-top: none !important; }
  /* Wrap both rows in one visual card — title row gets top border+radius, data row gets bottom */
  .admin-table-wrap table.admin-table-responsive .ls-mobile-title-row {
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .admin-table-wrap table.admin-table-responsive .ls-mobile-title-row + tr {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-bottom: 12px;
  }
}

/* Admin page tabs (bookmark_checklist.php etc) */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: 10px 20px;
  border-radius: 8px 8px 0 0;
  background: var(--bg-gray-100);
  color: var(--fg-gray-700);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-bottom: none;
  margin-bottom: -2px;
}
.tab-btn.active { background: var(--bg-w); color: var(--fg-blue-600); border-color: var(--border); border-bottom-color: var(--line-w); }
.tab-btn:hover:not(.active) { background: var(--bg-xe5edff); }


/* Type column - smaller font on listing tables */
table.admin-table td[data-label="Type"] { font-size: 0.68rem; }




/* Admin line icons (App\Support\Icon) */
.cl-ico { display: inline-block; vertical-align: -4px; flex-shrink: 0; }
.admin-nav-link .cl-ico { margin-right: 8px; opacity: 0.75; transition: opacity 0.12s ease; }
.admin-nav-link:hover .cl-ico, .admin-nav-link.active .cl-ico { opacity: 1; }
.admin-topbar .cl-ico, .admin-hamburger-icon .cl-ico { vertical-align: middle; }
.admin-topbar-menu a .cl-ico, details .cl-ico { margin-right: 6px; }
.cl-logo-mark { display: inline-block; width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 3px 8px rgba(37,99,235,0.35)); }
.cl-logo-mark .cl-ico { vertical-align: 0; }

/* Owner-section group tabs (partials/group-tabs) — same underline look as the page tabs */
.cl-group-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid var(--line-gray-200); overflow-x: auto; }
.cl-group-tabs a { padding: 10px 20px; text-decoration: none; font-weight: 700; font-size: 0.92rem; color: var(--fg-gray-500); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.cl-group-tabs a:hover { color: var(--fg-gray-800); }
.cl-group-tabs a.active { color: var(--fg-blue-600); border-bottom-color: var(--line-blue-600); }
/* A grouped page's own tabs sit under the group tabs as smaller pills. */
.cl-group-tabs ~ .cl-inner-tabs { border-bottom: none !important; gap: 6px !important; }
.cl-group-tabs ~ .cl-inner-tabs a { padding: 6px 14px !important; border: 1px solid var(--line-gray-200) !important; border-radius: 999px; font-size: 0.85rem !important; margin-bottom: 0 !important; }
.cl-group-tabs ~ .cl-inner-tabs a[style*="var(--bg-blue-600)"] { background: var(--bg-blue-50); border-color: var(--line-blue-200) !important; }

/* ---------- Admin polish (scoped to the admin shell) ---------- */
.admin-shell { font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.admin-shell button, .admin-shell input, .admin-shell select, .admin-shell textarea { font-family: inherit; }
.admin-content { background: radial-gradient(1200px 400px at 100% -10%, rgba(37,99,235,0.06), transparent 60%), var(--bg-xf5f7fb); }

/* Headings */
.admin-welcome h2 { font-weight: 800; letter-spacing: -0.02em; color: var(--fg-slate-900); }
.admin-welcome p { color: var(--fg-slate-500); }
.admin-shell h3 { letter-spacing: -0.01em; color: var(--fg-slate-900); }

/* Panels & cards */
.admin-panel { border: 1px solid var(--line-xe8ecf2); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 16px rgba(15,23,42,0.04); }
.admin-panel-header { padding-bottom: 12px; border-bottom: 1px solid var(--line-xf1f4f8); }
.summary-card { border: 1px solid var(--line-xe8ecf2); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,0.04); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.summary-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,0.08); }
.summary-icon { border-radius: 12px; }

/* Tables */
.admin-shell table.admin-table { border: 1px solid var(--line-xe8ecf2); border-collapse: separate; border-spacing: 0; border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
.admin-shell table.admin-table th { background: var(--bg-slate-50); color: var(--fg-slate-500); font-size: 0.72rem; letter-spacing: 0.06em; border-bottom: 1px solid var(--line-xe8ecf2); }
.admin-shell table.admin-table td { border-bottom: 1px solid var(--line-xe6eaf0); color: var(--fg-slate-800); }
.admin-shell table.admin-table tbody tr:hover { background: var(--bg-xf8fbff); }
.admin-panel table.admin-table { box-shadow: none; }
.admin-mini-table tbody tr:hover { background: var(--bg-xf8fbff); }

/* Buttons */
.admin-shell .btn { border-radius: 10px; font-weight: 700; letter-spacing: 0.005em; }
.admin-shell .btn-primary { background: linear-gradient(180deg, var(--bg-blue-500), var(--bg-blue-600)); box-shadow: 0 1px 2px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.15); }
.admin-shell .btn-primary:hover { box-shadow: 0 6px 16px rgba(37,99,235,0.3); }
.admin-shell .btn-outline { border-color: var(--line-xdfe4ec); color: var(--fg-slate-800); }
.admin-shell .btn-outline:hover { border-color: var(--line-xc7d2e0); background: var(--bg-slate-50); }
.admin-shell .btn:focus-visible, .admin-shell a:focus-visible { outline: 2px solid rgba(37,99,235,0.5); outline-offset: 2px; }

/* Forms */
.admin-shell input[type="text"], .admin-shell input[type="email"], .admin-shell input[type="password"],
.admin-shell input[type="number"], .admin-shell input[type="tel"], .admin-shell input[type="url"],
.admin-shell input[type="date"], .admin-shell input[type="datetime-local"], .admin-shell input[type="search"],
.admin-shell select, .admin-shell textarea { border-color: var(--line-xdfe4ec); border-radius: 10px; }
.admin-shell input::placeholder, .admin-shell textarea::placeholder { color: var(--fg-slate-400); }
.admin-shell label { color: var(--fg-slate-700); font-weight: 600; }

/* Alerts */
.admin-shell .alert { border-radius: 12px; padding: 12px 16px; border: 1px solid transparent; border-left-width: 4px; font-weight: 500; }
.admin-shell .alert-success { background: var(--bg-green-50); color: var(--fg-green-800); border-color: var(--line-green-200); border-left-color: var(--line-green-500); }
.admin-shell .alert-error { background: var(--bg-red-50); color: var(--fg-red-800); border-color: var(--line-red-200); border-left-color: var(--line-red-500); }

/* Empty state & pagination */
.admin-shell .empty-state { border: 1.5px dashed var(--line-xdbe2ea); border-radius: 14px; background: var(--bg-xfbfcfe); color: var(--fg-slate-500); padding: 40px 20px; }
.admin-shell .pagination a, .admin-shell .pagination span, .admin-shell .pagination button { border-radius: 10px; }

/* Sidebar scrollbar */
.admin-sidebar-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }
@media (max-width: 900px) {
  .admin-shell .admin-table-wrap table.admin-table-responsive { border: none; box-shadow: none; background: transparent; border-radius: 0; }
  .admin-shell .admin-table-wrap table.admin-table-responsive tr { border-color: var(--line-xe8ecf2); border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
}
.cl-group-tabs { scrollbar-width: none; }
.cl-group-tabs::-webkit-scrollbar { display: none; }

/* Dashboard invite + check-in boxes: compact on phones */
@media (max-width: 640px) {
  .dash-referral, .dash-checkin { padding: 14px !important; border-radius: 14px; }
  .dash-referral p { font-size: 0.8rem !important; margin-bottom: 8px !important; }
  .dash-referral > div { flex-wrap: nowrap !important; }
  .dash-referral input { min-width: 0 !important; padding: 7px 10px; font-size: 0.78rem !important; }
  .dash-referral .btn { padding: 7px 12px; font-size: 0.8rem; }
  .dash-checkin > p:first-child { font-size: 0.86rem !important; margin-bottom: 8px !important; }
  .dash-checkin > div:first-of-type { gap: 4px !important; margin-bottom: 8px !important; }
  .dash-checkin > div:first-of-type > div { padding: 4px 1px !important; border-radius: 6px !important; }
  .dash-checkin > div:first-of-type > div > div:first-child { font-size: 0.56rem !important; }
  .dash-checkin > div:first-of-type > div > div:nth-child(2) { font-size: 0.8rem !important; line-height: 1.2; }
  .dash-checkin > div:first-of-type > div > div:nth-child(3) { font-size: 0.62rem !important; }
  .dash-checkin p { font-size: 0.76rem !important; margin-bottom: 8px !important; }
  .dash-checkin .btn { padding: 8px 12px; font-size: 0.84rem; }
}
/* Grid/flex children may shrink below their content (e.g. the reminder card row scrolls instead of widening the page). */
.admin-two-col > * { min-width: 0; }
.hscroll { max-width: 100%; }
/* Phones: each row is its own card, so the last row keeps its field lines too. */
@media (max-width: 900px) {
  .admin-shell table.admin-table.admin-table-responsive tbody tr:last-child td { border-bottom: 1px solid var(--line-xe6eaf0); }
}
/* Phones: listing title row + its data row form one card, with a line under the title. */
@media (max-width: 900px) {
  .admin-shell .admin-table-wrap table.admin-table-responsive tr.ls-mobile-title-row { border-radius: 14px 14px 0 0; border-bottom: none; box-shadow: none; margin-bottom: 0; }
  .admin-shell .admin-table-wrap table.admin-table-responsive tr.ls-mobile-title-row + tr { border-top: none; border-radius: 0 0 14px 14px; }
  .admin-shell .admin-table-wrap table.admin-table-responsive tr.ls-mobile-title-row td { padding-bottom: 10px !important; border-bottom: 1px solid var(--line-xe6eaf0) !important; }
}
/* Small two-column summary tables (e.g. Reports "by status") fit the phone width. */
.admin-table-wrap table.admin-mini-table { min-width: 0; }
/* Notifications: the 4 tabs stay on one row on phones (icon above a short label). */
@media (max-width: 640px) {
  .notif-tabs { flex-wrap: nowrap !important; }
  .notif-tabs > a { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 8px 2px !important; font-size: 0.72rem !important; text-align: center; position: relative; line-height: 1.2; }
  .notif-tabs .notif-tab-icon { font-size: 1.05rem; }
  .notif-tabs .notif-tab-label { white-space: normal; }
  .notif-tabs > a > span:last-child:not(.notif-tab-label) { position: absolute; top: 2px; right: 50%; margin: 0 -24px 0 0 !important; }
}
/* Long text in a table cell: two lines on a desktop, one on a phone, cut off
   with an ellipsis either way. No "View full" link — the full text is on the
   listing itself, and the link only added noise to a tight row. */
.cl-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 260px; word-break: break-word; }
@media (max-width: 900px) {
  .cl-clamp { max-width: 100%; text-align: right; -webkit-line-clamp: 1; }
}
td > .cl-clamp { min-width: 150px; }
/* Wide tables scroll sideways inside their box on smaller laptop screens instead of spilling past the page
   (the "More" menus are position:fixed modals, so they're not clipped). */
@media (min-width: 901px) { .admin-table-wrap { overflow-x: auto; } }
/* Line icons inside buttons/tabs/links (App\Support\AdminHtml) and status dots */
a .cl-ico, button .cl-ico, summary .cl-ico { vertical-align: -3px; }
.btn .cl-ico { vertical-align: 0; }
.cl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; flex-shrink: 0; }
/* Admin toasts (shell-bottom) */
.cl-toasts { position: fixed; top: 76px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.cl-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; background: var(--bg-w); border: 1px solid var(--line-xe8ecf2); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,0.14); font-size: 0.88rem; color: var(--fg-slate-800); animation: clToastIn 0.25s ease; transition: opacity 0.25s ease, transform 0.25s ease; }
.cl-toast.out { opacity: 0; transform: translateX(16px); }
.cl-toast-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.cl-toast-ok .cl-toast-dot { background: var(--bg-green-500); box-shadow: 0 0 0 4px var(--bg-green-100); }
.cl-toast-err .cl-toast-dot { background: var(--bg-red-500); box-shadow: 0 0 0 4px var(--bg-red-100); }
.cl-toast-err { border-color: var(--line-red-200); }
.cl-toast-msg { flex: 1; line-height: 1.45; }
.cl-toast-x { background: none; border: none; font-size: 1.2rem; line-height: 1; color: var(--fg-slate-400); cursor: pointer; padding: 0 2px; }
.cl-toast-x:hover { color: var(--fg-slate-800); }
@keyframes clToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .cl-toasts { top: 68px; right: 16px; left: 16px; max-width: none; } }
/* One Edit button everywhere: pencil + "Edit", compact */
.admin-shell .btn.cl-btn-edit { font-size: 0.8rem; padding: 6px 12px; gap: 5px; }
.admin-shell .btn.cl-btn-edit .cl-ico { width: 15px; height: 15px; }
/* Table cells line up on their middle, so buttons sit level with the text beside them. */
.admin-shell table.admin-table td { vertical-align: middle; }
/* Buttons in table rows: same height, centred on one line (icon or no icon) — e.g. Edit / Trash / More. */
.admin-shell .btn { vertical-align: middle; }
.admin-shell table td .btn, .admin-shell table td form { vertical-align: middle; }
@media (min-width: 901px) {
  .admin-shell table.admin-table td .btn { min-height: 32px; padding: 0 12px; font-size: 0.8rem !important; line-height: 1; }
}
/* Listing photo popup (shell-bottom) */
.cl-lightbox { position: fixed; inset: 0; z-index: 4000; background: rgba(15,23,42,0.88); display: none; align-items: center; justify-content: center; padding: 56px 16px; }
.cl-lightbox.open { display: flex; }
.cl-lightbox img { max-width: min(1000px, 100%); max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.cl-lb-x { position: absolute; top: 12px; right: 16px; background: rgba(255,255,255,0.12); border: none; color: var(--fg-w); width: 40px; height: 40px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.cl-lb-x:hover { background: rgba(255,255,255,0.25); }

/* ---------- Public site polish (html.coa-public: main coalisting.com pages, not brand sites) ---------- */
.coa-public body { font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; background: var(--bg-xf5f7fb); }
.coa-public button, .coa-public input, .coa-public select, .coa-public textarea { font-family: inherit; }
/* Headings: tighter tracking only — the colour stays as each section sets it (hero banners are white on a gradient). */
.coa-public h1, .coa-public h2, .coa-public h3 { letter-spacing: -0.02em; }

/* Header */
.coa-public .topbar { background: rgba(var(--rgb-surface),0.88); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); border-bottom-color: var(--line-xe8ecf2); }
.coa-public .nav-link { transition: color 0.15s ease; }
.coa-public .nav-link.active { color: var(--fg-blue-600); box-shadow: inset 0 -2px 0 var(--bg-blue-600); }

/* Listing / agent cards */
.coa-public .card { border: 1px solid var(--line-xe8ecf2); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 14px rgba(15,23,42,0.04); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.coa-public .card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,0.10); border-color: var(--line-xdbe3ee); }
.coa-public .card-thumb-wrap { overflow: hidden; }
.coa-public .card-thumb-wrap > img:not(.card-agent-avatar) { transition: transform 0.35s ease; }
.coa-public .card:hover .card-thumb-wrap > img:not(.card-agent-avatar) { transform: scale(1.04); }
.coa-public .card-title { color: var(--fg-slate-900); letter-spacing: -0.01em; }
.coa-public .price { color: var(--fg-blue-700); font-weight: 800; }
.coa-public .agent-rank-card { border: 1px solid var(--line-xe8ecf2); border-radius: 14px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.coa-public .agent-rank-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,0.08); }

/* Buttons & form fields */
.coa-public .btn { border-radius: 10px; font-weight: 700; }
.coa-public .btn-primary { background: linear-gradient(180deg, var(--bg-blue-500), var(--bg-blue-600)); box-shadow: 0 1px 2px rgba(37,99,235,0.3), inset 0 1px 0 rgba(255,255,255,0.15); }
.coa-public .btn-primary:hover { box-shadow: 0 6px 16px rgba(37,99,235,0.3); }
.coa-public .btn-outline { border-color: var(--line-xdfe4ec); }
.coa-public .btn-outline:hover { border-color: var(--line-xc7d2e0); background: var(--bg-slate-50); }
.coa-public input[type="text"], .coa-public input[type="email"], .coa-public input[type="password"], .coa-public input[type="tel"],
.coa-public input[type="number"], .coa-public input[type="search"], .coa-public select, .coa-public textarea { border-color: var(--line-xdfe4ec); border-radius: 10px; }
.coa-public .form-box { border-radius: 16px; border: 1px solid var(--line-xe8ecf2); box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 16px rgba(15,23,42,0.04); }
.coa-public .alert { border-radius: 12px; }
.coa-public .empty-state { border: 1.5px dashed var(--line-xdbe2ea); border-radius: 14px; background: var(--bg-xfbfcfe); }

/* Pagination */
.coa-public .pagination a, .coa-public .pagination span, .coa-public .pagination button { border-radius: 10px; }
/* Readability: a few public-site texts sat too light against their background. */
.coa-public .sf-col a:hover, .coa-public .sf-credit a { color: var(--fg-x15719c); }
.coa-public .old-price, .coa-public .wtb-simple-time, .coa-public .lf-caret { color: var(--fg-gray-500); }
.coa-public .tgcp-card-cta { color: var(--fg-x15719c); }
/* "+ Add Listing" uses the same gold as the listing Download button. */
.coa-public .lf-tab-agency { background: var(--bg-xf5a623); color: var(--fg-w); }
.coa-public .lf-tab-agency:hover { background: var(--bg-xe0940f); }
.coa-public .agent-row-badge { color: var(--fg-green-700); }
/* WhatsApp button: WhatsApp's darker brand green, so the white label is readable. */
.coa-public .wtb-whatsapp-btn { background: var(--bg-x128c7e); }
/* Facilities/Amenities pickers sit in the same rows as the select fields — same height and text size. */
.coa-public .lf-dropdown-facilities > .lf-pill-btn, .coa-public .lf-dropdown-amenities > .lf-pill-btn { height: 44px; font-size: 1rem; }
/* Listing cards. The title used to reserve two lines so rows lined up, but that
   left a one-line title floating above its location — the grid already stretches
   the cards, so the slack belongs at the bottom, not mid-card. */
.coa-public .card-title { line-height: 1.3; }
/* Agent name under the card: a quiet label, not an underlined link. */
.coa-public .listing-agent-name { text-decoration: none; font-weight: 600; color: var(--fg-slate-600); }
.coa-public .listing-agent-name:hover { color: var(--fg-blue-600); }
.coa-public .listing-agent-row { gap: 10px; }
/* Listing popup footer buttons (Telegram / Download / Share): one pill style. */
.coa-public .tg-btn { padding: 0 16px; border-radius: 10px; font-size: 0.9rem; letter-spacing: 0.01em; }
.coa-public .tg-btn .cl-ico { flex-shrink: 0; }
.coa-public .wa-contact-btn + .tg-btn { margin-top: 8px; }
@media (max-width: 1024px) {
  /* Filter button sat larger than Sort next to it — same icon and label size now. */
  .coa-public .lf-mobile-filter-toggle,
  .coa-brand .lf-mobile-filter-toggle { font-size: 0.68rem; }
  .coa-public .lf-mobile-filter-toggle svg,
  .coa-brand .lf-mobile-filter-toggle svg { width: 15px; height: 15px; }
}

@media (max-width: 640px) {
  .coa-public .lf-tab-agency { flex: 1; padding: 8px 12px; }
}

/* Help Center → Help Centre card: on a phone the button ran past the card's
   right edge, so it drops to its own full-width line instead. */
.hc-guides-card .btn { flex: none; }
@media (max-width: 640px) {
  .hc-guides-card { gap: 10px; }
  .hc-guides-card .btn { flex: 1 1 100%; text-align: center; }
}

/* Bed/bath icons on listing cards — the same visual language as FindHartanah,
   while the numbers stay compact the way agents scan them. */
.card-specs .cs-ic, .listing-modal .cs-ic { display: inline-flex; vertical-align: -2px; margin-right: 3px; color: var(--fg-slate-400); }
.card-specs .cs-ic + .cs-ic, .card-specs .cs-ic:not(:first-child) { margin-left: 8px; }

.admin-shell .perm-await { display: inline-block; margin-top: 3px; font-size: 0.72rem; font-weight: 700; color: var(--fg-amber-700); background: var(--bg-orange-50); border: 1px solid var(--line-orange-200); border-radius: 999px; padding: 2px 8px; }

/* Dashboard right column: WTB above, Telegram set-up below. */
.admin-shell .dash-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.admin-shell .dash-stack > .admin-panel { margin: 0; }
.admin-shell .dash-tg .admin-panel-header h3 { display: flex; align-items: center; gap: 8px; }
.admin-shell .dash-tg-on { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--fg-green-700); background: var(--bg-green-100); border-radius: 999px; padding: 4px 10px; }
.admin-shell .dash-tg-lead { margin: 0 0 12px; color: var(--fg-slate-600); font-size: 0.88rem; line-height: 1.6; }
.admin-shell .dash-tg-steps { margin: 0 0 14px; padding-left: 20px; color: var(--fg-slate-700); font-size: 0.87rem; line-height: 1.7; }
.admin-shell .dash-tg-steps li { margin-bottom: 4px; }
.admin-shell .dash-tg-have { list-style: none; padding-left: 0; }
.admin-shell .dash-tg-have li { position: relative; padding-left: 22px; }
.admin-shell .dash-tg-have li::before { content: '✓'; position: absolute; left: 0; color: var(--fg-green-600); font-weight: 800; }
.admin-shell .dash-tg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-shell .dash-tg-actions .btn { flex: 1 1 auto; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.admin-shell .dash-tg-guide { display: inline-block; margin-top: 10px; font-size: 0.82rem; font-weight: 700; color: var(--fg-blue-600); text-decoration: none; }

/* ---------- Toggle switch (feature switches in admin) ---------- */
.cl-switch-row { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; padding: 4px 0; }
.cl-switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.cl-switch {
  flex: none; position: relative; width: 46px; height: 27px; border-radius: 999px;
  background: var(--bg-slate-300); transition: background 0.18s ease; margin-top: 2px;
}
.cl-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--bg-w); box-shadow: 0 1px 3px rgba(15,23,42,0.28);
  transition: transform 0.18s ease;
}
.cl-switch-row input:checked + .cl-switch { background: var(--bg-blue-600); }
.cl-switch-row input:checked + .cl-switch::after { transform: translateX(19px); }
.cl-switch-row input:focus-visible + .cl-switch { box-shadow: 0 0 0 3px rgba(37,99,235,0.25); }
.cl-switch-text strong { display: block; color: var(--fg-slate-900); font-size: 0.92rem; }
.cl-switch-text small { display: block; margin-top: 3px; color: var(--fg-gray-500); font-size: 0.8rem; line-height: 1.5; }
.cl-switch-state { margin-left: auto; flex: none; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.cl-switch-row input:checked ~ .cl-switch-state { background: var(--bg-green-100); color: var(--fg-green-700); }
.cl-switch-row input:not(:checked) ~ .cl-switch-state { background: var(--bg-slate-100); color: var(--fg-slate-500); }

/* ---------- Agent brand sites (html.coa-brand) ---------- */
/* The search icon inherits currentColor; inside a brand site's dark hero the
   surrounding text is white, so on the white search input it disappeared and
   left an empty gap before the placeholder. */
.coa-brand .lf-search-icon { color: var(--fg-gray-500); }
.coa-brand body { font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.coa-brand button, .coa-brand input, .coa-brand select, .coa-brand textarea { font-family: inherit; }
.coa-brand h1, .coa-brand h2, .coa-brand h3 { letter-spacing: -0.02em; }
.coa-brand .card { border: 1px solid var(--line-xe8ecf2); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 14px rgba(15,23,42,0.04); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.coa-brand .card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,0.10); }
.coa-brand .card-thumb-wrap { overflow: hidden; }
.coa-brand .card-thumb-wrap > img:not(.card-agent-avatar) { transition: transform 0.35s ease; }
.coa-brand .card:hover .card-thumb-wrap > img:not(.card-agent-avatar) { transform: scale(1.04); }
.coa-brand .btn { border-radius: 10px; font-weight: 700; }
.coa-brand input[type="text"], .coa-brand input[type="email"], .coa-brand input[type="tel"], .coa-brand input[type="number"],
.coa-brand input[type="search"], .coa-brand select, .coa-brand textarea { border-color: var(--line-xdfe4ec); border-radius: 10px; }
.coa-brand .cl-ico { vertical-align: -3px; }

/* Buy stays blue, Rent is green — matching the Sale / Rent tags on the cards. */
.lf-tab.lf-tab-rent.active { background: var(--bg-green-700); }

/* Poster thumbnails: a small badge on the corner so agents can see the photo
   makes a poster, instead of having to discover the click. */
.pt-wrap { position: relative; display: inline-block; line-height: 0; flex-shrink: 0; cursor: pointer; }
.pt-wrap img { display: block; }
.pt-wrap .ls-title-thumb { display: block; }
.pt-badge { position: absolute; right: -5px; bottom: -5px; width: 19px; height: 19px; border-radius: 7px;
  background: var(--accent, var(--bg-blue-600)); color: var(--fg-w); display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-w); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35); pointer-events: none; }
.pt-badge svg { width: 11px; height: 11px; display: block; }
.ls-title-thumb-wrap { display: none; }
@media (max-width: 900px) { .ls-title-thumb-wrap { display: inline-block; } }

/* ── Listing search box + status filter (admin lists and All Listings) ── */
/* .filter-bar button is blue by default, so these are scoped to beat it. */
.ls-search { position: relative; flex: 1; min-width: 200px; display: flex; }
.filter-bar .ls-search input[type="text"] { width: 100%; font-size: 16px; padding-right: 108px; }
.filter-bar .ls-search-go { position: absolute; top: 4px; right: 4px; bottom: 4px; display: none;
  align-items: center; gap: 5px; padding: 0 12px; border: 0; border-radius: 6px;
  background: var(--accent, var(--bg-blue-600)); color: var(--fg-w); font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.filter-bar .ls-search.has-text .ls-search-go { display: inline-flex; }
/* Phone: search box and Status stay on one row (Reset drops below if shown). */

.ls-sort { position: relative; }
.filter-bar .ls-sort-btn { display: flex; align-items: center; gap: 6px; background: var(--bg-xf7f8fa); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 14px; font-size: 0.85rem; font-weight: 700; color: var(--fg-gray-700); cursor: pointer; font-family: inherit; }
.filter-bar .ls-sort-btn:hover { background: var(--bg-xeef1f6); filter: none; }
.filter-bar .ls-sort-btn.on { background: var(--bg-blue-50); border-color: var(--line-blue-200); color: var(--accent, var(--fg-blue-600)); }
.ls-sort-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-w);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,0.14);
  min-width: 210px; z-index: 120; overflow: hidden; padding: 6px 0; }
.ls-sort-menu.open { display: block; }
.ls-sort-head { margin: 4px 16px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--fg-gray-400); }
.filter-bar .ls-sort-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; border: 0;
  background: var(--bg-w); text-align: left; font-size: 0.9rem; font-weight: 500; font-family: inherit; color: var(--fg-gray-800);
  cursor: pointer; border-radius: 0; }
.filter-bar .ls-sort-opt:hover { background: var(--bg-slate-50); filter: none; }
.filter-bar .ls-sort-opt.on { background: var(--bg-gray-100); font-weight: 700; }
.ls-sort-opt > span { width: 14px; color: var(--accent, var(--fg-blue-600)); flex: none; }
/* Clear search + status: a plain × instead of a wide "Reset" button. */
.ls-clear { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 0; background: none; color: var(--fg-red-500); font-size: 1.35rem; line-height: 1; text-decoration: none; }
.ls-clear:hover { color: var(--fg-red-700); }
/* Backdrop for the mobile bottom sheet (created by shell-bottom). */
.ls-sheet-back { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 1290; }
.ls-sheet-back.open { display: block; }

@media (max-width: 640px) {
  .filter-bar { padding: 12px; gap: 8px; }
  /* The input must be allowed to shrink, or its own min-content width keeps
     the row too wide and Status wraps to a line of its own. */
  .ls-search { min-width: 0; flex: 1 1 120px; }
  .filter-bar .ls-search input[type="text"] { min-width: 0; }
  .filter-bar .ls-sort-btn { flex: none; white-space: nowrap; padding: 9px 12px; }
  .ls-sort { flex: none; }
}
@media (max-width: 420px) {
  .filter-bar .ls-search-go span { display: none; }
  .filter-bar .ls-search input[type="text"] { padding-right: 46px; }
  .filter-bar .ls-sort-btn span { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
}
/* Phone: the dropdown becomes a bottom sheet — the small menu was easy to miss. */
@media (max-width: 640px) {
  .ls-sort-menu { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; min-width: 0;
    border: 0; border-radius: 18px 18px 0 0; padding: 10px 0 max(20px, env(safe-area-inset-bottom));
    box-shadow: 0 -10px 34px rgba(15,23,42,0.28); z-index: 1300; max-height: 80vh; overflow-y: auto; }
  .ls-sort-menu::before { content: ''; display: block; width: 42px; height: 4px; background: var(--bg-gray-300);
    border-radius: 999px; margin: 2px auto 12px; }
  .ls-sort-head { margin: 0 20px 6px; font-size: 0.78rem; }
  .filter-bar .ls-sort-opt { padding: 15px 20px; font-size: 1rem; }
  .ls-sort-opt > span { width: 18px; }
}

/* ---------- No zoom-on-focus ----------
   iOS Safari zooms the whole page in whenever a focused text field is smaller
   than 16px, and then leaves the page zoomed. Every typable control gets a
   16px floor on phones; the visual size barely changes, and the jump is gone.
   Kept last in the file so it wins over the per-component sizes above. */
@media (max-width: 640px) {
  input[type="text"], input[type="number"], input[type="tel"], input[type="email"],
  input[type="password"], input[type="search"], input[type="url"], input[type="date"],
  input[type="time"], input:not([type]), select, textarea {
    /* !important on purpose: individual pages set their own 0.9rem and each one
       would bring the zoom back. This is a floor, not a design choice. */
    font-size: 16px !important;
  }
}

/* One-line nudge above the listing tables. The corner badge on each thumbnail
   is easy to miss, and agents were not discovering the poster generator at
   all — so the pages that have it say so in words, once, at the top. */
.poster-tip { display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
  padding: 10px 14px; border-radius: 10px; background: var(--bg-blue-50); border: 1px solid var(--line-blue-200);
  color: var(--fg-blue-800); font-size: 0.85rem; line-height: 1.5; }
.poster-tip-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent, var(--bg-blue-600)); color: var(--fg-w); display: flex; align-items: center; justify-content: center; }
.poster-tip-icon svg { width: 15px; height: 15px; display: block; }

/* ── Timeline: booking → signing ───────────────────────────────────────── */
/* A booked listing is a deal in progress, not a finished one. The row shows
   how far it has come and how long it has sat; the detail opens in place so
   a list of forty deals stays scannable. */
.tl-card { padding: 0; overflow: hidden; }
.tl-card.tl-stalled { border-left: 4px solid var(--line-amber-500); }
/* A grid rather than a row: on a phone the title needs the full width, and
   the badge belongs beside the age instead of stacked above it. */
.tl-head { display: grid; grid-template-columns: auto 1fr;
  grid-template-areas: "thumb main" "thumb metarow" "thumb dots";
  align-items: center; gap: 5px 14px; padding: 16px 18px; cursor: pointer; }
.tl-thumb { grid-area: thumb; align-self: center; }
.tl-head-main { grid-area: main; }
.tl-meta-row { grid-area: metarow; display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-badge-slot { min-width: 0; }
.tl-dots { grid-area: dots; }
.tl-age { margin-left: auto; }
.tl-head:hover { background: var(--bg-slate-50); }
.tl-thumb { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.tl-head-main { min-width: 0; }
.tl-title { display: block; font-size: 0.95rem; line-height: 1.35; }
.tl-meta { font-size: 0.78rem; color: var(--fg-gray-500); margin-top: 2px; }
.tl-dots { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; min-width: 0; }
.tl-dot { width: 22px; height: 6px; border-radius: 99px; background: var(--bg-gray-200); }
.tl-dot.on { background: var(--accent, var(--bg-blue-600)); }
.tl-step-label { font-size: 0.74rem; font-weight: 700; color: var(--fg-gray-700); margin-left: 6px; }
.tl-age { font-size: 0.76rem; color: var(--fg-gray-400); text-align: right; white-space: nowrap; }
.tl-age-bad { color: var(--fg-amber-700); font-weight: 700; }

.tl-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--line-slate-100); }
.tl-body.open { display: block; }
.tl-steps { list-style: none; margin: 14px 0 0; padding: 0; }
.tl-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-slate-50); }
.tl-step-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-gray-200); color: var(--fg-gray-500);
  display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.tl-step.done .tl-step-mark { background: var(--bg-green-600); color: var(--fg-w); }
.tl-step.next .tl-step-mark { background: var(--accent, var(--bg-blue-600)); color: var(--fg-w); }
.tl-step-text { flex: 1; min-width: 0; font-size: 0.88rem; }
.tl-step.done .tl-step-text strong { color: var(--fg-green-600); }
.tl-hint { display: block; font-size: 0.74rem; color: var(--fg-gray-400); font-style: normal; margin-top: 2px; }
.tl-when { display: block; font-size: 0.74rem; color: var(--fg-gray-400); margin-top: 2px; }
.tl-inline { margin: 0; flex-shrink: 0; }
.btn.btn-sm { padding: 5px 12px; font-size: 0.78rem; }

.tl-keys { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px;
  background: var(--bg-green-50); border: 1px solid var(--line-green-200); border-radius: 9px; font-size: 0.85rem; }
.tl-note { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tl-note label { font-size: 0.78rem; font-weight: 700; color: var(--fg-gray-700); }
.tl-note textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-gray-300); border-radius: 8px;
  font-family: inherit; font-size: 0.85rem; resize: vertical; }
.tl-actions { margin-top: 14px; }
/* Cancelling is destructive and easy to misread as finishing a sale, so it
   stays folded away, and reads as a warning once opened. */
.tl-cancel { margin-top: 14px; font-size: 0.82rem; }
.tl-cancel summary { cursor: pointer; color: var(--fg-gray-500); font-weight: 700; padding: 6px 0; list-style: none; }
.tl-cancel summary::-webkit-details-marker { display: none; }
.tl-cancel summary::before { content: '\25B8'; display: inline-block; margin-right: 7px;
  transition: transform 0.15s ease; }
.tl-cancel[open] summary::before { transform: rotate(90deg); }
.tl-cancel summary:hover { color: var(--fg-red-700); }
.tl-cancel-box { margin-top: 6px; padding: 14px 16px; background: var(--bg-red-50);
  border: 1px solid var(--line-red-200); border-radius: 10px; }
.tl-cancel-box p { margin: 0 0 12px; color: var(--fg-red-900); font-size: 0.8rem; line-height: 1.55; }
.tl-cancel-box form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.tl-cancel-field { flex: 1; min-width: 260px; }
.tl-cancel-box label { display: block; font-size: 0.76rem; font-weight: 700; color: var(--fg-red-900); margin-bottom: 5px; }
.tl-cancel-box input[type="text"] { width: 100%; padding: 9px 12px; border: 1px solid var(--line-red-300);
  border-radius: 8px; font-family: inherit; font-size: 0.85rem; background: var(--bg-w); }
.tl-cancel-box input[type="text"]:focus { outline: none; border-color: var(--line-red-600); }
.btn.tl-btn-cancel { background: var(--bg-red-600); color: var(--fg-w); border: 1px solid var(--line-red-600);
  height: 38px; min-height: 38px; display: inline-flex; align-items: center; }
.btn.tl-btn-cancel:hover { background: var(--bg-red-700); border-color: var(--line-red-700); }

@media (max-width: 640px) {
  /* Title first and full width, then the badge and the age sharing a line,
     then the progress row on its own. */
  /* Title first and full width, then the badge and the age sharing a line,
     then the progress row on its own. */
  .tl-head { padding: 13px; gap: 7px 11px; align-items: start; }
  .tl-meta-row { flex-wrap: wrap; }
  .tl-thumb { width: 44px; height: 44px; align-self: start; }
  .tl-age { font-size: 0.7rem; align-self: center; }
  .tl-dot { width: 15px; }
  .tl-cancel-box form { display: block; }
  .tl-cancel-field { min-width: 0; margin-bottom: 10px; }
  .btn.tl-btn-cancel { width: 100%; justify-content: center; }
}

/* Who brought the buyer. A booking on your own listing is not always your own
   sale, and the difference decides whether there is a commission to chase. */
.tl-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tl-sum-total { font-size: 0.85rem; font-weight: 800; color: var(--fg-gray-700); }
.tl-by { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 3px 9px;
  border-radius: 99px; margin-top: 6px; white-space: nowrap; }
.tl-summary .tl-by { margin-top: 0; }
.tl-by-self { background: var(--bg-green-100); color: var(--fg-green-700); }
.tl-by-coa { background: var(--bg-amber-100); color: var(--fg-amber-700); }
.tl-by-unset { background: var(--bg-slate-100); color: var(--fg-slate-400); }

.tl-by-form { margin: 14px 0 0; padding: 12px 14px; background: var(--bg-slate-50);
  border: 1px solid var(--line-gray-200); border-radius: 9px; }
.tl-by-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--fg-gray-700); margin-bottom: 8px; }
.tl-by-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.tl-radio { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; }
.tl-radio input { margin: 0; }
.tl-by-who { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tl-by-who select, .tl-by-who input[type="text"] { padding: 7px 10px; border: 1px solid var(--line-gray-300);
  border-radius: 8px; font-family: inherit; font-size: 0.82rem; background: var(--bg-w); }
.tl-by-who input[type="text"] { min-width: 200px; }
@media (max-width: 640px) {
  .tl-by-who select, .tl-by-who input[type="text"] { width: 100%; min-width: 0; }
}

/* Three outcomes, three weights: your own deal is the loud one, a co-agency
   deal is shared, and an outside sale needs nothing from you at all. */
.tl-by-out { background: var(--bg-red-100); color: var(--fg-red-700); }
.tl-hidden { display: none !important; }
.tl-by-warn { margin: 10px 0 0; font-size: 0.76rem; color: var(--fg-red-700); }
.tl-card.tl-muted .tl-head { opacity: 0.62; }
.tl-card.tl-muted:hover .tl-head { opacity: 1; }

/* A month of silence is an unanswered question, not a delay — so it is asked
   plainly, with both answers next to it. */
.tl-by-lost { background: var(--bg-slate-200); color: var(--fg-slate-600); }
.tl-card.tl-decide { border-left: 4px solid var(--line-red-600); }
.tl-decide-box { margin-top: 14px; padding: 13px 15px; background: var(--bg-red-50);
  border: 1px solid var(--line-red-200); border-radius: 9px; }
.tl-decide-box strong { display: block; font-size: 0.85rem; color: var(--fg-red-700); }
.tl-decide-box p { margin: 6px 0 10px; font-size: 0.8rem; color: var(--fg-red-900); line-height: 1.5; }

/* Answered once, then collapsed to the answer — same handling as the licence
   row on Edit Profile, for the same reason: it is set once and rarely changed,
   so leaving it open invites accidental edits. */
.tl-by-done { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 11px 14px; background: var(--bg-slate-50); border: 1px solid var(--line-gray-200); border-radius: 9px; }
.tl-by-done-label { display: block; font-size: 0.72rem; color: var(--fg-gray-400); }
.tl-by-done strong { font-size: 0.88rem; color: var(--fg-gray-700); }

/* Sale and rent are different procedures, so they get different tabs rather
   than one mixed list. */
.tl-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tl-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 99px;
  border: 1px solid var(--line-gray-200); background: var(--bg-w); color: var(--fg-gray-500); font-size: 0.85rem;
  font-weight: 700; text-decoration: none; }
.tl-tab:hover { border-color: var(--accent, var(--line-blue-600)); color: var(--accent, var(--fg-blue-600)); }
.tl-tab.active { background: var(--accent, var(--bg-blue-600)); border-color: var(--accent, var(--line-blue-600)); color: var(--fg-w); }
.tl-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px;
  height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bg-slate-100); color: var(--fg-slate-600); font-size: 0.72rem; }
.tl-tab.active .tl-tab-count { background: rgba(255, 255, 255, 0.25); color: var(--fg-w); }
.btn.tl-btn-danger { border-color: var(--line-red-200); color: var(--fg-red-700); }
.btn.tl-btn-danger:hover { border-color: var(--line-red-600); background: var(--bg-red-50); }
.tl-by-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tl-by-close { background: none; border: none; font-size: 1.25rem; line-height: 1; color: var(--fg-gray-400);
  cursor: pointer; padding: 0 2px; margin-top: -2px; }
.tl-by-close:hover { color: var(--fg-gray-700); }

/* Approved and Rejected sat at different heights: one carries a border and
   the other does not, and the row aligns to the top. Both get the same box. */
.tl-step { align-items: center; }
.tl-step .tl-inline { display: flex; align-items: center; }
/* .btn-outline.btn-sm carries a min-height of 44px, which a plain height
   cannot override — so both are set here. */
.tl-step .btn.btn-sm { height: 36px; min-height: 36px; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid transparent; }
/* Approved and Rejected are one choice with two answers, so they match. */
.tl-step .btn.tl-btn-pair { min-width: 96px; }
.tl-step .btn.btn-outline { border-color: var(--line-gray-300); }
.tl-step .btn.tl-btn-danger { border-color: var(--line-red-200); }

/* "Loan submitted" needs to say where, or there is nobody to chase later. */
.tl-lender { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.tl-lender-label { font-size: 0.78rem; font-weight: 700; color: var(--fg-gray-500); }
.tl-lender select, .tl-lender input[type="text"] { padding: 7px 10px; border: 1px solid var(--line-gray-300);
  border-radius: 8px; font-family: inherit; font-size: 0.82rem; background: var(--bg-w); }
@media (max-width: 640px) {
  .tl-step { flex-wrap: wrap; }
  .tl-lender { width: 100%; margin-top: 8px; }
  .tl-lender select, .tl-lender input[type="text"] { flex: 1; min-width: 0; }
}
.tl-note-done { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 11px 14px; background: var(--bg-slate-50); border: 1px solid var(--line-gray-200); border-radius: 9px; }
.tl-note-done p { margin: 2px 0 0; font-size: 0.88rem; color: var(--fg-gray-700); white-space: pre-wrap; }
.tl-note .tl-by-head { width: 100%; }
.tl-by-coagent { background: var(--bg-violet-100); color: var(--fg-violet-700); }
.tl-coagent-note { margin: 14px 0 0; padding: 11px 14px; background: var(--bg-purple-50);
  border: 1px solid var(--line-purple-200); border-radius: 9px; font-size: 0.82rem; color: var(--fg-violet-700); line-height: 1.5; }

/* An agent whose domain is already connected is shown the link, not the
   instructions for requesting one. */
.bsp-mydomain { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 12px; padding: 14px 18px; background: var(--bg-green-50);
  border: 1px solid var(--line-green-200); border-radius: 10px; }
.bsp-mydomain-label { display: block; font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-green-700); }
.bsp-mydomain-url { display: inline-block; margin-top: 2px; font-size: 1.25rem; font-weight: 800;
  color: var(--fg-green-900); text-decoration: none; letter-spacing: -0.01em; }
.bsp-mydomain-url:hover { text-decoration: underline; }
.bsp-mydomain p { margin: 6px 0 0; font-size: 0.82rem; color: var(--fg-green-800); line-height: 1.5; }
.bsp-mydomain-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 640px) {
  .bsp-mydomain-actions { width: 100%; }
  .bsp-mydomain-actions .btn { flex: 1; }
}
.tl-more-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 700;
  color: var(--accent, var(--fg-blue-600)); cursor: pointer; text-decoration: underline; }
.tl-more { display: block; margin-top: 4px; }

/* Listing detail: the agent's full name, truncated only when it would run
   into the WhatsApp button beside it. */
.lm-agent { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lm-agent-name { color: inherit; text-decoration: none; font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }

/* ── Listing flags: the owner asking an agent to fix a published listing ── */
.fl-badge {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 6px;
  background: var(--bg-red-50); color: var(--fg-red-700); border: 1px solid var(--line-red-200);
  font-size: 0.68rem; font-weight: 800; cursor: help;
}
.fl-row > td { background: var(--bg-amber-50); border-top: none; }
.fl-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fl-form select, .fl-form input[type="text"] {
  padding: 8px 10px; border: 1px solid var(--line-gray-300); border-radius: 8px; font: inherit;
}
.fl-form input[type="text"] { flex: 1 1 220px; min-width: 0; }
/* The verification form. The class was on the markup with nothing behind it,
   so every label fell inline beside its field and every input took the
   browser's default 195px - on a phone the licence number ended up 152px off
   the right edge, where an agent could neither see nor reach it. Only this
   one form carries the class. */
.admin-form label {
  display: block; margin: 14px 0 5px; font-weight: 700; font-size: 0.86rem; color: var(--fg-gray-700);
}
.admin-form input[type="text"], .admin-form input[type="file"], .admin-form select {
  width: 100%; max-width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid var(--line-gray-300); border-radius: 8px; font: inherit;
}
.admin-form input[readonly] { background: var(--bg-gray-100); color: var(--fg-gray-500); }

/* The quick edit reuses the flag row's shape but not its colour: amber reads
   as a warning, and editing a listing is not one. */
.qe-row > td { background: var(--bg-slate-50); }
.fl-form input.qe-title { flex: 2 1 260px; }
.fl-form input.qe-price { flex: 0 0 130px; }
.qe-full { font-size: 0.8rem; font-weight: 600; color: var(--fg-blue-600); text-decoration: none; white-space: nowrap; }
.qe-full:hover { text-decoration: underline; }
.fl-banner {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-red-50); border: 1px solid var(--line-red-200); color: var(--fg-red-800); font-weight: 700;
}
.fl-agent-row > td { background: var(--bg-red-50); border-top: none; color: var(--fg-red-800); }
.fl-agent-inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fl-agent-what { flex: 1 1 auto; }
.fl-agent-hint { color: var(--fg-red-700); font-weight: 500; font-size: 0.8rem; }
/* On a phone the row is already stacked and narrow — the long hint only makes
   it taller, so the flag stays to the reason and the Edit button. */
@media (max-width: 900px) {
  .fl-agent-hint { display: none; }
  .fl-agent-inner { gap: 6px; font-size: 0.82rem; text-align: left; }
  /* The stacked-card rules hide any cell without a data-label and turn every
     row into its own white card — the flag needs both undone. */
  .admin-table-wrap table.admin-table-responsive tr.fl-agent-row,
  .admin-table-wrap table.admin-table-responsive tr.fl-row {
    background: var(--bg-red-50); border-color: var(--line-red-200); margin-top: -8px;
  }
  /* Beats the "hide any cell without a data-label" rule, which is otherwise
     more specific and was swallowing the whole strip on a phone. */
  .admin-table-wrap table.admin-table-responsive tr.fl-agent-row > td.fl-agent-td,
  .admin-table-wrap table.admin-table-responsive tr.fl-row > td.fl-agent-td {
    display: block; text-align: left;
  }
}
/* Dashboard: the flagged listings get their own block above the preview, since
   the preview only shows the three newest and could miss them entirely. */
.fl-banner-item {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-red-200); font-weight: 600;
}
.fl-banner-item span { flex: 1 1 160px; font-weight: 500; font-size: 0.84rem; }
.fl-preview-note {
  flex-basis: 100%; margin-top: 6px; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-red-50); border: 1px solid var(--line-red-200); color: var(--fg-red-800);
  font-size: 0.8rem; font-weight: 600;
}

/* ── Info Hartanah: editorial posts for the FindHartanah Page ── */
.ip-hint { font-size: 0.78rem; color: var(--fg-gray-500); margin: 0 0 6px; }
.ip-edit-thumb { margin-bottom: 8px; max-width: 220px; border-radius: 8px; display: block; }
.ip-body { margin: 4px 0 0; color: var(--fg-gray-500); font-size: 0.8rem; }
.ip-meta { margin: 4px 0 0; font-size: 0.74rem; color: var(--fg-gray-400); }
.ip-noimg {
  width: 40px; height: 40px; border-radius: 6px; background: var(--bg-slate-100);
  display: flex; align-items: center; justify-content: center; color: var(--fg-slate-400);
}
.ip-form-actions { margin-top: 18px; display: flex; gap: 8px; align-items: center; }
/* Matches the "+ Add Listing" placement above the My Listings table. */
.cl-page-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.ip-error { margin-top: 4px; font-size: 0.74rem; color: var(--fg-red-700); }
.ip-dests { margin: 0 0 12px; font-size: 0.82rem; color: var(--fg-gray-500); }
.ip-warn {
  margin: 10px 0 0; padding: 8px 10px; border-radius: 8px;
  background: var(--bg-amber-50); border: 1px solid var(--line-amber-200); color: var(--fg-amber-800);
  font-size: 0.8rem; font-weight: 600;
}
.ip-badge-btn { border: none; cursor: pointer; font: inherit; font-size: 0.65rem; font-weight: 800; }
.ip-caret { opacity: 0.7; font-size: 0.7em; }
.ip-when { margin-top: 4px; }

/* ── Connection health: a dead token, said out loud before a post fails ── */
.sh-box {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-red-50); border: 1px solid var(--line-red-200); color: var(--fg-red-800);
}
.sh-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-red-200);
}
.sh-what { font-weight: 700; }
.sh-why { flex: 1 1 200px; font-size: 0.82rem; color: var(--fg-red-700); }

/* ── "Still being built" notice on My Auto-Post ── */
.apd-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-amber-100); color: var(--fg-amber-800); border: 1px solid var(--line-amber-200);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em;
}
.apd-lead { margin: 12px 0 0; color: var(--fg-gray-700); }
.apd-list { margin: 12px 0 0; padding-left: 20px; color: var(--fg-gray-700); font-size: 0.88rem; }
.apd-list li { margin-bottom: 6px; }
.apd-foot { margin: 14px 0 12px; font-size: 0.84rem; color: var(--fg-gray-500); }

/* ── My Auto-Post → Post Log ── */
.apl-left { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.apl-chip {
  padding: 6px 12px; border-radius: 999px; background: var(--bg-slate-100);
  border: 1px solid var(--line-slate-200); font-size: 0.8rem; color: var(--fg-slate-600);
}
.apl-plat {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 800;
}
.apl-facebook { background: var(--bg-blue-50); color: var(--fg-blue-700); border: 1px solid var(--line-blue-200); }
.apl-instagram { background: var(--bg-pink-50); color: var(--fg-pink-700); border: 1px solid var(--line-pink-200); }
.apl-threads { background: var(--bg-slate-100); color: var(--fg-slate-700); border: 1px solid var(--line-slate-300); }
.apl-tiktok { background: var(--bg-pink-50); color: var(--fg-gray-900); border: 1px solid var(--line-pink-300); }
.apl-youtube { background: var(--bg-red-50); color: var(--fg-red-700); border: 1px solid var(--line-red-200); }
a.apl-plat { text-decoration: none; }
a.apl-plat:hover { filter: brightness(0.95); }
.apl-title {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--primary, var(--fg-blue-600)); cursor: pointer; text-align: left;
}
.apl-title:hover { text-decoration: underline; }
.apl-modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 9999;
  align-items: center; justify-content: center; padding: 16px;
}
.apl-modal-box {
  position: relative; background: var(--bg-w); border-radius: 16px; overflow: hidden;
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.apl-modal-x {
  position: absolute; top: 8px; right: 10px; z-index: 1;
  background: rgba(var(--rgb-surface),0.9); border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--fg-slate-600);
}
.apl-modal-box img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.apl-modal-body { padding: 16px; }
.apl-modal-price { font-size: 1.25rem; font-weight: 800; color: var(--primary, var(--fg-blue-600)); }
.apl-modal-body h3 { margin: 6px 0 10px; font-size: 1.05rem; }
.apl-modal-line { margin: 0 0 6px; color: var(--fg-gray-700); font-size: 0.88rem; }
.apl-modal-status {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--bg-slate-100); color: var(--fg-slate-600); font-size: 0.75rem; font-weight: 700;
}
.apl-modal-body .btn { margin-top: 12px; width: 100%; text-align: center; }
.sq-interval { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.sq-interval label { font-size: 0.8rem; color: var(--fg-slate-600); }
.sq-interval input { width: 80px; padding: 5px 8px; border: 1px solid var(--line-gray-300); border-radius: 8px; }
.sq-state { margin-top: 3px; font-size: 0.74rem; font-weight: 800; }
.sq-PENDING { color: var(--fg-yellow-700); }
.sq-SENT { color: var(--fg-green-700); }
.sq-FAILED { color: var(--fg-red-700); }
.sq-SKIPPED { color: var(--fg-gray-500); }
.sq-interval input[readonly] { background: var(--bg-gray-100); color: var(--fg-gray-500); }
.sq-interval input.sq-unlocked { background: var(--bg-w); color: inherit; }
.sq-warn {
  margin: 0 0 14px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg-amber-50); border: 1px solid var(--line-amber-200); color: var(--fg-amber-800);
  font-size: 0.8rem; max-width: 560px;
}

/* ── AI Lead Manager (private) ── */
.lm-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.lm-card {
  flex: 1 1 130px; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: var(--bg-w); border: 1px solid var(--line-gray-200); color: var(--fg-gray-500); font-size: 0.8rem;
}
.lm-card span { display: block; font-size: 1.5rem; font-weight: 800; color: var(--text-dark, var(--fg-gray-900)); }
.lm-card.on { border-color: var(--primary, var(--line-blue-600)); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); }
.lm-card-warn span { color: var(--fg-red-700); }
.lm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.lm-filters input[type="text"], .lm-filters select {
  padding: 8px 10px; border: 1px solid var(--line-gray-300); border-radius: 8px; font: inherit;
}
.lm-filters input[type="text"] { flex: 1 1 200px; min-width: 0; }
.lm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.lm-chips .apl-chip { text-decoration: none; }
.lm-chips .apl-chip.on { border-color: var(--primary, var(--line-blue-600)); color: var(--primary, var(--fg-blue-600)); }
.lm-import { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lm-state { font-size: 0.72rem; font-weight: 800; }
.lm-NEW { color: var(--fg-blue-700); }
.lm-PENDING_REPLY, .lm-FOLLOW_UP { color: var(--fg-yellow-700); }
.lm-CONTACTED, .lm-IN_PROGRESS { color: var(--fg-teal-700); }
.lm-COMPLETED { color: var(--fg-green-700); }
.lm-CLOSED { color: var(--fg-gray-500); }
.lm-overdue { color: var(--fg-red-700); font-weight: 700; }
.lm-detail { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.lm-detail .form-box { flex: 1 1 320px; }
.lm-side { flex: 1 1 380px; min-width: 0; }
.lm-ai-row { margin: 0 0 8px; font-size: 0.86rem; }
.lm-ai-row strong { display: block; font-size: 0.74rem; color: var(--fg-gray-500); text-transform: uppercase; letter-spacing: 0.03em; }
.lm-chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.lm-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 0.86rem; white-space: pre-wrap; }
.lm-msg-in { align-self: flex-start; background: var(--bg-slate-100); }
.lm-msg-out { align-self: flex-end; background: var(--bg-green-100); }
.lm-msg-time { margin-top: 3px; font-size: 0.68rem; color: var(--fg-slate-400); }

/* Post to TikTok: the reel being made and uploaded (tiktok-post.js). */
.tt-overlay {
  position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.tt-box {
  background: var(--bg-w); border-radius: 16px; padding: 18px; width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; box-sizing: border-box;
}
.tt-canvas { width: 150px; height: auto; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--bg-gray-900); display: block; margin: 0 auto 12px; }
.tt-status { margin: 0 0 10px; font-weight: 600; font-size: 0.9rem; white-space: pre-line; }
.tt-bar { height: 6px; background: var(--bg-slate-100); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.tt-bar span { display: block; height: 100%; width: 0; background: var(--bg-pink-500); transition: width 0.2s; }
.tt-close { width: 100%; }
.tt-box [hidden] { display: none; }
.tt-close { margin-top: 8px; }

/* ── Topbar search ──────────────────────────────────────────────
   A pill on desktop, where it sits over the page heading; on a phone it
   collapses to the icon beside the hamburger, which is why the hamburger
   lost its "Menu" label — two labels there left no room for anything else. */
.admin-topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  background: var(--bg-slate-50);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-gray-500);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-topbar-search:hover { background: var(--bg-blue-50); border-color: var(--line-blue-200); color: var(--fg-blue-600); }
.admin-topbar-search .cl-ico { flex: 0 0 auto; }

.cl-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  padding: 80px 16px 16px;
  overflow-y: auto;
}
.cl-search-overlay.open { display: block; }
.cl-search-box {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-w);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  padding: 22px;
}
.cl-search-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cl-search-head h3 {
  flex: 1;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-gray-500);
}
.cl-search-x {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--fg-gray-400);
  cursor: pointer;
}
.cl-search-field { position: relative; }
.cl-search-field .cl-search-ic {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--fg-gray-400);
  line-height: 0;
}
.cl-search-field input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--fg-gray-900);
}
.cl-search-field input:focus { outline: none; border-color: var(--line-blue-600); }
.cl-search-results { max-height: 52vh; overflow-y: auto; margin-top: 8px; }
.cl-search-group { margin-top: 14px; }
.cl-search-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-gray-400);
  padding: 0 4px 6px;
}
.cl-search-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--fg-gray-900);
}
.cl-search-hit:hover { background: var(--bg-slate-100); }
.cl-search-hit-ic { color: var(--fg-blue-600); line-height: 0; flex: 0 0 auto; }
.cl-search-hit-main { flex: 1; min-width: 0; }
.cl-search-hit-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-search-hit-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--fg-gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-search-hit-tag {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-slate-600);
  background: var(--bg-slate-100);
  border-radius: 999px;
  padding: 3px 9px;
}
.cl-search-tip { margin: 14px 4px 0; font-size: 0.8rem; color: var(--fg-gray-500); }

/* Shares the search pill's shape; only the hover colour differs, so the two
   read as one pair rather than a button and a link. */
.admin-topbar-help { text-decoration: none; }

@media (max-width: 900px) {
  /* The bar now carries search, the guides and the language, so it buys back
     its own width: a tighter gutter and gap, and a name that ends in an
     ellipsis rather than being cut mid-letter. Measured at 375px: 411px of
     content before this, 361px after. */
  .admin-topbar { gap: 10px; padding: 12px 14px; }
  .topbar-user { min-width: 0; }
  .topbar-user-info { min-width: 0; }
  /* 221 of 332 agents have a name longer than 15 characters and the longest
     is 42, so this is the normal case, not an edge one: the name gets a fixed
     box and ends in an ellipsis instead of pushing the bar past the screen. */
  .topbar-user-info { max-width: 76px; }
  .topbar-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Label gone, so each becomes a circle: equal width and height, centred. */
  .admin-topbar-search-text { display: none; }
  .admin-topbar-search {
    /* flex: none, or the topbar's flex squeezes the circle into an oval on a
       narrow phone — measured at 20x38 before this. */
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }
  .cl-search-overlay { padding: 20px 12px 12px; }
}

/* "Show more" inside a dashboard notice — a link, not a button: it reveals the
   rest of the same sentence rather than going anywhere. */
.cl-show-more {
  background: none;
  border: none;
  padding: 0;
  margin: 3px 0 0;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  display: block;
}
/* The hidden tail reads as its own paragraph once it is open. */
.cl-more-rest:not([hidden]) { display: block; margin-top: 3px; }
.cl-show-more-inline { display: inline; margin: 0 0 0 6px; text-decoration-color: currentColor; }

/* Linkren's own wordmark, for the menus where it sits beside the COAListing
   and FindHartanah marks. Light backgrounds only — "Link" is near-black. */
.lr-wm b { color: var(--fg-gray-900); font-weight: 800; }
.lr-wm i { color: var(--fg-blue-700); font-style: normal; font-weight: 800; }

/* The referral challenge, sitting directly above the bio row and built from
   the same parts, so Summary reads as one stack of rows rather than a panel
   with a feature bolted on top. It is taller than the rows below it because
   it carries a bar and a split, which is the one thing on this page asking
   the agent to act today. */
.dash-ref {
  margin-top: 14px;
  padding: 13px 15px;
  background: var(--bg-orange-50);
  border: 1px solid var(--line-orange-200);
  border-radius: 12px;
}
.dash-ref-top { display: flex; align-items: flex-start; gap: 12px; }
.dash-ref-ico { flex: none; line-height: 0; color: var(--fg-amber-700); }
.dash-ref-main { flex: 1; min-width: 0; }
.dash-ref-main b { display: block; font-size: 0.88rem; color: var(--fg-amber-800); }
.dash-ref-main span { display: block; font-size: 0.78rem; color: var(--fg-amber-900); line-height: 1.5; }
.dash-ref-count { flex: none; display: flex; align-items: baseline; gap: 4px; }
.dash-ref-count b { font-size: 1.5rem; font-weight: 800; color: var(--fg-amber-700); }
.dash-ref-count span { font-size: 0.8rem; font-weight: 600; color: var(--fg-amber-700); }

.dash-ref-bar {
  height: 8px;
  margin-top: 11px;
  border-radius: 999px;
  background: var(--bg-w);
  overflow: hidden;
}
.dash-ref-bar div { height: 100%; border-radius: 999px; background: var(--bg-amber-500); }

/* The two sources, then how many are left. Small and grey: it answers a
   question the agent may have, it does not pose one. */
.dash-ref-split {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 9px;
  font-size: 0.76rem;
  color: var(--fg-amber-900);
}
.dash-ref-left { margin-left: auto; font-weight: 700; color: var(--fg-amber-800); }

/* The credits offer, second line of the card. Smaller than the challenge
   blurb above it: it is the standing reward, not the thing being asked. */
.dash-ref-credits {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-orange-200);
  font-size: 0.76rem;
  color: var(--fg-amber-900);
  line-height: 1.5;
}
.dash-ref-credits a { color: inherit; font-weight: 700; }

.dash-ref-act { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.dash-ref-act .dash-lr-url { flex: 1; min-width: 200px; justify-content: space-between; }
.dash-ref-act form { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-ref-act input {
  padding: 8px 11px;
  min-width: 170px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-w);
  font: inherit;
  font-size: 0.82rem;
  color: var(--fg-gray-800);
}
.dash-ref-act .dash-lr-btn { border: 0; cursor: pointer; }
.bsp-free {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-green-100);
  color: var(--fg-green-600);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: .03em;
  vertical-align: middle;
}
.dash-ref-claimed { font-size: 0.8rem; font-weight: 700; color: var(--fg-green-600); }

@media (max-width: 900px) {
  .dash-ref-ico { display: none; }
  /* On a phone the count kept its column all the way down, squeezing the
     text into what was left beside "26 / 100". Now the heading and the
     count share the first line, and the text below runs the full width. */
  .dash-ref-top { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px; align-items: baseline; }
  .dash-ref-main { display: contents; }
  .dash-ref-main b { grid-column: 1; grid-row: 1; }
  .dash-ref-count { grid-column: 2; grid-row: 1; }
  .dash-ref-main span { grid-column: 1 / -1; }
  .dash-ref-act .dash-lr-url { flex: 1 0 100%; }
  .dash-ref-act form { flex: 1 0 100%; }
  .dash-ref-act input { flex: 1 1 0; min-width: 0; }
}

/* The linkren row at the foot of Summary. Quiet by design: it is an offer,
   not a warning, so it borrows the panel's own greys rather than a colour. */
.dash-lr {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 13px 15px;
  background: var(--bg-slate-50);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dash-lr-ico { flex: none; line-height: 0; color: var(--fg-blue-600); }
.dash-lr-main { flex: 1; min-width: 190px; }
.dash-lr-main b { display: block; font-size: 0.88rem; color: var(--fg-gray-900); }
.dash-lr-main span { font-size: 0.78rem; color: var(--fg-gray-500); line-height: 1.5; }
.dash-lr-url {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 8px 12px;
  background: var(--bg-w);
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-gray-700);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-lr-url:hover { border-color: var(--line-blue-200); color: var(--fg-blue-600); }
.dash-lr-url svg { flex: none; opacity: .65; }
.dash-lr-btn {
  flex: none;
  padding: 8px 15px;
  border-radius: 9px;
  background: var(--bg-blue-600);
  color: var(--fg-w);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.dash-lr-btn-alt { background: var(--bg-xeef2f7); color: var(--fg-gray-700); }

/* Stacks from the same width the sidebar collapses at, not a narrower one:
   between the two, the buttons wrapped one per line and the row looked
   broken rather than deliberately stacked. */
@media (max-width: 900px) {
  /* Phone: three stacked rows, in this order — what it is, the address, then
     the two buttons side by side. Left to wrap on its own, Open rode up beside
     the text and Set up was left alone on the line below. */
  .dash-lr { gap: 10px; }
  .dash-lr-ico { display: none; }
  .dash-lr-main { order: 1; flex: 1 0 100%; min-width: 0; }
  .dash-lr-url { order: 2; flex: 1 0 100%; justify-content: space-between; }
  .dash-lr-btn { order: 3; flex: 1 1 0; min-width: 0; text-align: center; }
}

/* The verify row, same shape as the bio row above it, tinted by state:
   amber while the tick is still missing, blue once it is being checked. */
.dash-lr-warn { background: var(--bg-amber-50); border-color: var(--line-amber-200); }
.dash-lr-warn .dash-lr-ico, .dash-lr-warn .dash-lr-main b { color: var(--fg-amber-800); }
.dash-lr-warn .dash-lr-main span { color: var(--fg-amber-900); }
.dash-lr-wait { background: var(--bg-sky-50); border-color: var(--line-sky-200); }
.dash-lr-wait .dash-lr-ico, .dash-lr-wait .dash-lr-main b { color: var(--fg-sky-800); }
.dash-lr-wait .dash-lr-main span { color: var(--fg-sky-900); }

/* Inside a Summary row the toggle ends the sentence it belongs to rather than
   taking a line of its own — on its own line it read as a third line of text
   that was not there before it was pressed. */
.dash-lr .cl-show-more { display: inline; margin: 0 0 0 5px; }
/* The Telegram steps, once unfolded inside the Summary row. */
.dash-lr .dash-tg-steps { margin: 8px 0 0; padding-left: 20px; font-size: 0.78rem; line-height: 1.7; }
.dash-lr .dash-tg-guide { display: inline-block; margin-top: 6px; font-size: 0.78rem; font-weight: 700; color: var(--fg-blue-600); text-decoration: none; }
.dash-lr .dash-tg-guide:hover { text-decoration: underline; }
.dash-lr .dash-tg-on {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-green-100);
  color: var(--fg-green-700);
  font-size: 0.66rem;
  font-weight: 800;
  vertical-align: middle;
}

/* ── Display preferences (admin/settings) ───────────────────────────────
   Set per agent and carried on <html>, so a page is already in the right
   shape when it paints. */

/* Larger text. The scale is on the root font size because nearly every size
   in this stylesheet is in rem, so one number moves the whole page together —
   including the parts a per-element override would miss. 112% rather than
   something bolder: past that the admin topbar and table headers start to
   wrap, and a wrapped bar helps nobody. */
html.ui-text-large { font-size: 112%; }
html.ui-text-xlarge { font-size: 125%; }
/* Inputs stay at 16px: below that iOS zooms the page on focus, and the zoom
   is more disorienting than the smaller text it was meant to fix. */
html.ui-text-large input, html.ui-text-large select, html.ui-text-large textarea,
html.ui-text-xlarge input, html.ui-text-xlarge select, html.ui-text-xlarge textarea { font-size: 16px; }

/* Enlarged text pushes the public top bar past the screen on a phone — the
   agent's name is the part that grows without a limit, so it gets a box and an
   ellipsis there, exactly as it does in the admin bar. */
@media (max-width: 900px) {
  /* Measured at 375px with Extra large: brand 206 + actions 172 + gap and
     gutters = 418. The gutter gives some back and the wordmark, which is the
     one part nobody needs to read, gives the rest. */
  html.ui-text-large .topbar-row,
  html.ui-text-xlarge .topbar-row { padding-left: 14px; padding-right: 14px; gap: 10px; }
  html.ui-text-large .topbar-brand,
  html.ui-text-xlarge .topbar-brand { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  html.ui-text-large .topbar-brand span,
  html.ui-text-xlarge .topbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.ui-text-large .topbar-actions,
  html.ui-text-xlarge .topbar-actions { flex: none; }
  html.ui-text-large .topbar-user-wrap,
  html.ui-text-xlarge .topbar-user-wrap { min-width: 0; }
  html.ui-text-large .topbar-user-info,
  html.ui-text-xlarge .topbar-user-info { min-width: 0; max-width: 76px; }
  html.ui-text-large .topbar-user-name,
  html.ui-text-xlarge .topbar-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* One listing card per row on a phone. The widths these override are set in
   several places, so each is named rather than relying on a blanket rule. */
@media (max-width: 900px) {
  html.ui-cards-one .listings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  html.ui-cards-one .grid-2col-mobile,
  html.ui-cards-one .match-listing-grid,
  html.ui-cards-one .match-wtb-grid,
  html.ui-cards-one .agents-grid { grid-template-columns: minmax(0, 1fr); }

  /* A card built for a 166px column leaves half the row empty once it has the
     full width: the photo keeps its 160px and every line of text ends well
     short of the right edge. So the one-per-row card turns on its side —
     photo on the left, details filling the rest. */
  html.ui-cards-one .grid-2col-mobile > .card,
  html.ui-cards-one .match-listing-grid > .card { flex-direction: row; align-items: stretch; }
  html.ui-cards-one .grid-2col-mobile > .card > .card-thumb-wrap,
  html.ui-cards-one .match-listing-grid > .card > .card-thumb-wrap {
    flex: 0 0 40%;
    max-width: 40%;
    /* A photo that fails to load falls back to its alt text, which is the
       listing title — in a 40% column that spills across the details beside
       it. The column clips instead. */
    overflow: hidden;
  }
  /* The listing photo only. The agent's avatar also lives inside this wrapper,
     and :not() is what keeps it its own circle instead of being stretched to
     the height of the card.

     It fills the column absolutely rather than sitting in the flow: a tall
     photo was setting the card's height from its own proportions, and one
     portrait shot in the list made that row twice as deep as its neighbours.
     Out of the flow, the column is as tall as the details beside it and the
     photo is cropped to fit, whatever shape it arrives in. */
  html.ui-cards-one .grid-2col-mobile > .card > .card-thumb-wrap img:not(.card-agent-avatar),
  html.ui-cards-one .match-listing-grid > .card > .card-thumb-wrap img:not(.card-agent-avatar) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* The photo is now painted after the badges, so they need to be lifted back
     above it — they come earlier in the markup. */
  html.ui-cards-one .grid-2col-mobile > .card .card-badges-topleft,
  html.ui-cards-one .match-listing-grid > .card .card-badges-topleft { z-index: 2; }
  /* Both markers share a 136px-wide column here, so they move to its corners
     and give up a little of their padding — at the old size they met in the
     middle. */
  html.ui-cards-one .grid-2col-mobile > .card .card-badges-topleft,
  html.ui-cards-one .match-listing-grid > .card .card-badges-topleft { top: 6px; left: 6px; }
  html.ui-cards-one .grid-2col-mobile > .card .coa-mark-btn,
  html.ui-cards-one .match-listing-grid > .card .coa-mark-btn { font-size: 0.56rem; padding: 2px 6px; }
  html.ui-cards-one .grid-2col-mobile > .card .card-agent-avatar,
  html.ui-cards-one .match-listing-grid > .card .card-agent-avatar { width: 28px; height: 28px; top: 6px; right: 6px; }
  /* Along the bottom edge the two markers sat 136px apart at most, so each
     gives up a little of its inset. The hint itself is two icons now, in every
     card on the board, so there is nothing left to shorten here. */
  html.ui-cards-one .grid-2col-mobile > .card .card-view-hint,
  html.ui-cards-one .match-listing-grid > .card .card-view-hint { bottom: 6px; left: 6px; }
  /* The count keeps the bottom-right corner it has everywhere else. Once the
     hint lost its "View/" half the two fit on one 136px edge, with 5px to
     spare — tight, but they no longer touch. */
  html.ui-cards-one .grid-2col-mobile > .card .photo-count-badge,
  html.ui-cards-one .match-listing-grid > .card .photo-count-badge { bottom: 6px; right: 6px; font-size: 0.64rem; padding: 2px 6px; }
  /* The brand sites put this badge on the left, and the rule above pins
     the right. An absolutely positioned box given both sides stretches
     between them, so on an agent's or an agency's site in one-per-row
     the count for a single number ran 122px wide - a grey bar across
     the photo. One side only, and it stays the side those sites chose. */
  html.ui-cards-one .grid-2col-mobile > .card.bs-card .photo-count-badge,
  html.ui-cards-one .grid-2col-mobile > .card.bsa-card .photo-count-badge { right: auto; left: 6px; }
  html.ui-cards-one .grid-2col-mobile > .card > .card-body,
  html.ui-cards-one .match-listing-grid > .card > .card-body { flex: 1; min-width: 0; justify-content: center; }
  /* The photo is about as tall as four lines of text, so the title may use a
     third line here: turned on its side the title column is narrower than it
     was stacked, and two lines put the ellipsis back in the middle of a taman
     name — the one thing an agent is scanning for. */
  html.ui-cards-one .grid-2col-mobile > .card .card-title,
  html.ui-cards-one .match-listing-grid > .card .card-title { -webkit-line-clamp: 3; }
  /* The agent cards stay upright — a square portrait on its side reads as a
     mistake, and that grid is faces, not listings. */
  html.ui-cards-one .agents-grid > .card { flex-direction: column; }
}

/* Settings → Display: the radio rows. */
.set-lbl { display: block; font-size: 0.78rem; font-weight: 700; color: var(--fg-gray-500); margin-bottom: 8px; }
.set-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.set-choice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-w);
  cursor: pointer;
}
.set-choice:has(input:checked) { border-color: var(--line-blue-600); background: var(--bg-blue-50); color: var(--fg-blue-700); font-weight: 700; }
.set-choice input { accent-color: var(--bg-blue-600); width: 17px; height: 17px; }
.set-preview {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-slate-50);
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--fg-slate-700);
  line-height: 1.6;
}
.set-preview-tag { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-slate-400); }

/* The site-preferences menu. Each group says what it is; a column of
   controls with no name is only obvious to whoever built it. */
.cl-pref-label {
  padding: 8px 16px 2px; font-weight: 800; font-size: 0.82rem;
  letter-spacing: 0.02em; color: var(--fg-gray-500); text-transform: uppercase;
}
.cl-mobile-pref-label {
  margin: 8px 0 2px; padding-left: 16px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--fg-gray-400);
}

/* ---------- List, on a desktop screen too ----------
   The setting is one choice covering both widths: grid is this board's own
   look — four across — and list is one wide card per row, which is what
   FindHartanah shows by default.

   Below 900px the rules further up already turn the card on its side. These
   do the same above it, against the desktop grids rather than the phone
   ones: the same element carries .grid for desktop and .grid-2col-mobile for
   the phone, so each width needs naming separately. */
@media (min-width: 901px) {
  /* Listing grids only. The setting is called Listing layout and the
     sideways card below is built out of a listing card's parts, so the
     Agent Directory and the WTB grid are left alone — an agent card given
     a whole row just stretches its portrait across the screen. */
  html.ui-cards-one .grid,
  html.ui-cards-one .listings-grid,
  html.ui-cards-one .match-listing-grid { grid-template-columns: minmax(0, 1fr); }

  /* Photo left, details right. A card drawn for a 260px column leaves most
     of a 1100px row empty if it simply stretches. 300px rather than the
     phone's 40%: a proportion of a wide row would give the photo more than
     half the card. */
  html.ui-cards-one .grid > .card,
  html.ui-cards-one .listings-grid > .card,
  html.ui-cards-one .match-listing-grid > .card { flex-direction: row; align-items: stretch; }
  html.ui-cards-one .grid > .card > .card-thumb-wrap,
  html.ui-cards-one .listings-grid > .card > .card-thumb-wrap,
  html.ui-cards-one .match-listing-grid > .card > .card-thumb-wrap {
    flex: 0 0 300px;
    max-width: 300px;
    position: relative;
    overflow: hidden;
  }
  /* The listing photo only — :not() keeps the agent's avatar a circle. Out
     of the flow for the same reason as on the phone: a portrait shot would
     otherwise set the row's height from its own proportions. */
  html.ui-cards-one .grid > .card > .card-thumb-wrap img:not(.card-agent-avatar),
  html.ui-cards-one .listings-grid > .card > .card-thumb-wrap img:not(.card-agent-avatar),
  html.ui-cards-one .match-listing-grid > .card > .card-thumb-wrap img:not(.card-agent-avatar) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  html.ui-cards-one .grid > .card .card-badges-topleft,
  html.ui-cards-one .listings-grid > .card .card-badges-topleft,
  html.ui-cards-one .match-listing-grid > .card .card-badges-topleft { z-index: 2; }
  html.ui-cards-one .grid > .card > .card-body,
  html.ui-cards-one .listings-grid > .card > .card-body,
  html.ui-cards-one .match-listing-grid > .card > .card-body { flex: 1; min-width: 0; }
}

/* The activity feed. Each row is an avatar and two short lines, so across
   the full 1200px container the text ended a third of the way in and the
   rest was empty. Narrower, and centred under the heading. */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 760px;
  margin-inline: auto;
}

/* ---------- The FindHartanah banner, beside a list ----------
   Hidden by default, which covers the grid at every width and a phone at
   every layout: a four-across grid already fills the row, and a phone has
   no room beside anything. It appears only where there is room for it —
   a list on a wide screen, where each row is a thousand pixels of card
   and the right of the page was empty.

   The banner is a 1:2 portrait drawn for a sidebar, so it gets a column
   of its own rather than a slot in the flow. Placed explicitly, so it
   sits at the top of that column whatever its position in the markup. */
.cl-fh-promo { display: none; }

@media (min-width: 901px) {
  /* The banner takes a 300px column with a 20px gap beside the listings, so
     the row above them ends where they do rather than running the full
     width of the container. */
  html.ui-cards-one .al-results-head { padding-right: 320px; }
  /* Same thing on the home page, where the grid's gap is 16px not 20px. */
  html.ui-cards-one .cl-listings-head { padding-right: 316px; }
}

@media (min-width: 901px) {
  html.ui-cards-one .grid,
  html.ui-cards-one .listings-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  html.ui-cards-one .grid > .card,
  html.ui-cards-one .listings-grid > .card { grid-column: 1; }

  html.ui-cards-one .cl-fh-promo {
    display: block;
    grid-column: 2;
    /* grid-row comes from the markup — the real number of cards. */
    align-self: start;
    /* Follows the list down, so it is still there at the fiftieth row —
       which is the point, on a page this long. */
    position: sticky;
    top: 90px;
  }
  html.ui-cards-one .cl-fh-promo img {
    width: 100%;
    height: auto;
    /* The artwork's own shape, so the column is the right size before the
       file arrives and nothing jumps when it does. */
    aspect-ratio: 887 / 1773;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
  }
}

/* ---------- The small explain-this modal ----------
   Written once here rather than inline on each page: Settings and the
   dashboard both open one, and two copies of the same box drift apart. */
.tgw-open { background:none; border:none; padding:0; margin:0 0 10px; font-family:inherit; font-size:0.78rem;
  font-weight:700; color:var(--fg-blue-600); text-decoration:underline; cursor:pointer; }
.tgw-modal { display:none; position:fixed; inset:0; background:rgba(15,23,42,0.55); z-index:1200;
  align-items:center; justify-content:center; padding:16px; }
.tgw-modal.open { display:flex; }
.tgw-box { background:var(--bg-w); border-radius:16px; padding:26px 24px 20px; max-width:430px; width:100%;
  position:relative; box-shadow:0 24px 60px rgba(15,23,42,0.28); max-height:88vh; overflow-y:auto; }
.tgw-x { position:absolute; top:10px; right:12px; background:none; border:none; font-size:1.5rem;
  color:var(--fg-gray-400); cursor:pointer; line-height:1; font-family:inherit; }
.tgw-box h3 { margin:0 0 10px; font-size:1.1rem; color:var(--fg-slate-900); }
.tgw-box p { margin:0 0 14px; font-size:0.9rem; line-height:1.7; color:var(--fg-slate-600); }
.tgw-box ol { margin:0 0 14px; padding-left:20px; color:var(--fg-slate-600); font-size:0.9rem; line-height:1.8; }
.tgw-box ol li { margin-bottom:6px; }
.tgw-note { background:var(--bg-orange-50); border:1px solid var(--line-orange-200); border-radius:10px; padding:10px 12px;
  font-size:0.84rem; line-height:1.6; color:var(--fg-orange-800); margin:0 0 18px; }
.tgw-ok { width:100%; background:var(--bg-blue-600); color:var(--fg-w); border:none; border-radius:10px; padding:11px;
  font-weight:700; font-size:0.9rem; font-family:inherit; cursor:pointer; }

/* ---------- Accessibility tab (desktop only) ----------
   The topbar button shows the language code, so that is what people read it
   as — nobody opens it looking for text size. This tab says nothing but
   "settings for how this page looks", which is the one thing the dropdown
   could not say from the outside.

   Left edge, not right: on a 1024-1280px laptop the page container already
   reaches the right edge, and a tab there would sit on top of the sticky
   FindHartanah column in List layout. */
/* No transform here, however tempting translateY(-50%) is for the centring:
   a transformed element becomes the containing block for position:fixed
   descendants, and the phone panel — fixed to the bottom of the screen —
   would then be fixed to this 28px tab instead. A negative margin of half
   the tab's height centres it just as well and creates no containing block. */
.cl-a11y { display: block; position: fixed; left: 0; top: 50%; margin-top: -27px; z-index: 90; }

@media (min-width: 901px) {
  .cl-a11y-tab {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 54px; padding: 0; cursor: pointer;
    background: var(--bg-w); color: var(--fg-gray-500);
    border: 1px solid var(--border); border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.07);
    transition: color 0.15s, background 0.15s;
  }
  .cl-a11y-tab:hover,
  .cl-a11y-tab:focus-visible { color: var(--fg-blue-600); background: var(--bg-slate-50); }

  .cl-a11y-panel {
    display: none;
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    width: 250px; padding: 8px 0;
    background: var(--bg-w); border: 1px solid var(--line-gray-200); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
  .cl-a11y.open .cl-a11y-panel { display: block; }
  .cl-a11y.open .cl-a11y-tab { color: var(--fg-blue-600); }

  .cl-a11y-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px 10px; font-weight: 800; font-size: 0.9rem; color: var(--fg-x12101a);
  }
  .cl-a11y-close { background: none; border: none; cursor: pointer; color: var(--fg-gray-400); padding: 2px; line-height: 0; }
  .cl-a11y-close:hover { color: var(--fg-gray-700); }
  .cl-a11y-row { display: flex; gap: 6px; padding: 4px 14px 10px; }
  .cl-a11y-row a {
    flex: 1; text-align: center; padding: 7px 4px; border-radius: 8px;
    text-decoration: none; border: 1px solid var(--line-gray-200); color: var(--fg-gray-700);
  }
  .cl-a11y-row a.on { border-color: var(--line-blue-600); color: var(--fg-blue-600); }
  .cl-a11y-opt {
    display: flex; align-items: center; gap: 10px; padding: 9px 14px;
    text-decoration: none; color: var(--fg-gray-800); font-size: 0.9rem;
  }
  .cl-a11y-opt:hover { background: var(--bg-slate-50); }
  .cl-a11y-dot {
    width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-gray-300);
    display: inline-flex; align-items: center; justify-content: center; flex: none;
  }
  .cl-a11y-opt.on .cl-a11y-dot { border-color: var(--line-blue-600); }
  .cl-a11y-opt.on .cl-a11y-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-blue-600); }
}

@media (max-width: 900px) {
  .cl-a11y { margin-top: -23px; }   /* half of the 46px tab */

  /* Same tab on a phone, a little smaller, and the panel opens as a sheet
     from the bottom instead of beside it — beside it there is no room, and
     a 250px card pinned to the left edge would cover the card being read. */
  .cl-a11y-tab {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 46px; padding: 0; cursor: pointer;
    background: var(--bg-w); color: var(--fg-gray-500);
    border: 1px solid var(--border); border-left: none;
    border-radius: 0 9px 9px 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.07);
  }
  .cl-a11y.open .cl-a11y-tab { color: var(--fg-blue-600); }

  .cl-a11y-panel {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; transform: none;
    width: auto; padding: 8px 0 16px;
    background: var(--bg-w); border: none; border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.18);
    /* Taller than the screen on a small phone at the largest text size,
       so it scrolls rather than putting Language out of reach. */
    max-height: 80vh; overflow-y: auto;
  }
  .cl-a11y.open .cl-a11y-panel { display: block; }
  .cl-a11y.open::before {
    content: ''; position: fixed; inset: 0; background: rgba(17, 24, 39, 0.35);
  }

  .cl-a11y-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px 12px; font-weight: 800; font-size: 1rem; color: var(--fg-x12101a);
  }
  .cl-a11y-close { background: none; border: none; cursor: pointer; color: var(--fg-gray-500); padding: 4px; line-height: 0; }
  .cl-a11y-row { display: flex; gap: 8px; padding: 4px 18px 12px; }
  .cl-a11y-row a {
    flex: 1; text-align: center; padding: 12px 4px; border-radius: 10px;
    text-decoration: none; border: 1px solid var(--line-gray-200); color: var(--fg-gray-700);
  }
  .cl-a11y-row a.on { border-color: var(--line-blue-600); color: var(--fg-blue-600); }
  .cl-a11y-opt {
    display: flex; align-items: center; gap: 12px; padding: 13px 18px;
    text-decoration: none; color: var(--fg-gray-800); font-size: 0.95rem;
  }
  .cl-a11y-dot {
    width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-gray-300);
    display: inline-flex; align-items: center; justify-content: center; flex: none;
  }
  .cl-a11y-opt.on .cl-a11y-dot { border-color: var(--line-blue-600); }
  .cl-a11y-opt.on .cl-a11y-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--bg-blue-600); }
}

/* ---------- Portal list layout, and the card beside it ---------- */
/* The board's own list rules reach these pages through html.ui-cards-one,
   but its grid rule does not win here: the portal grid carries a second
   class of its own. The card rules applying without the grid rule is what
   left a 300px photo inside a 277px card, with the badges clipped off its
   edge. Named for these sites so neither site depends on the other's
   selectors winning by accident. */
@media (min-width: 901px) {
  /* An id, not the class. With the class selector every other
     declaration in this rule took effect and grid-template-columns alone
     did not - something in the sheet beats it that a reading of the file
     does not show. Rather than leave the layout resting on which rule
     wins, the one property that has to land is pinned to a selector that
     cannot lose. Verified in the browser, both ways. */
  html.ui-cards-one.coa-brand #bsListGrid {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  html.ui-cards-one.coa-brand #bsListGrid > .card { grid-column: 1; }

  /* Sort belongs over the listings, not over the card beside them. The
     head is a full-width row above the grid, so in list layout it is
     held back by the width of the rail and its gap - the same trick the
     board uses for its own banner. */
  html.ui-cards-one.coa-brand .bsl-result-bar,
  html.ui-cards-one.coa-brand .bs-section-title { padding-right: 320px; }
}

/* The agency sites' heading row. Sort belongs at the end of the listing
   column, not at the end of the page - at the page's edge it sits over
   the Property Tools rail, pointing at cards it does not order. Held
   back in both layouts, since the rail is there either way. The heading
   inside this row gives its own pull-back back, or the two paddings
   stack and the row wraps. */
/* The All Listing banner, on the agent and agency sites. The filter bar
   is pulled up 20px so its tabs sit on the dark - that overlap is what
   makes the band read as the page's own head rather than a stripe above
   it. Lived in the agent page's own <style> until the agency wanted the
   same page. */
.bsl-header {
  background: var(--pt-mid, var(--bg-x1c1930));
  color: var(--fg-w);
  padding: 28px 20px 40px;
  text-align: center;
}
.bsl-header h1 { margin: 0; font-size: 1.6rem; }
/* On a phone the sentence and the firm's name each get their own line,
   rather than the name starting halfway along the first one. Left to wrap
   on its own below that: a name longer than the screen has to break
   somewhere, and nowrap would push the page sideways instead. */
@media (max-width: 640px) {
  .bsl-header h1 { font-size: 1.3rem; }
  .bsl-h1-name { display: block; }
}
.bsl-filter-wrap { max-width: 1100px; margin: -20px auto 28px; padding: 0 16px; }

/* All Listing only: the filter panel is a very pale blue on a pale grey
   page, so it reads as part of the background rather than as the box the
   tabs belong to. A line down each side and along the bottom in the
   site's own accent gives it an edge; the top is left open because the
   tabs sit on it. The home pages do not need this - there the panel has
   the dark hero band behind it. */
.bsl-filter-boxed .lf-form {
  border: 1px solid var(--pt-accent, var(--line-blue-600));
  border-top: 0;
}

/* Desktop: the line closes along the top as well, but only across the
   part the tabs leave bare - it runs from the end of the agency tab to
   the right edge, so the tabs read as sitting on the box rather than
   beside it. An ::after on the tab row, not a border on the panel: a
   border there would draw under the tabs too. On a phone there is no
   bare part, because the agency tab stretches into it. */
/* The dark band stops 20px above the tabs' own bottom edge, because the
   filter is pulled up by 20px while the tab row is taller than that. To
   the right of the tabs that left a pale strip between the band and the
   line. This paints the band's colour across the full width of the tab
   row, so the dark reaches the line. A pseudo-element rather than a
   bigger negative margin: the row's height moves with the reader's text
   size, and a fixed -39px would open the gap again at another size.
   100vw is safe here - body is overflow-x: clip. */
.bsl-filter-boxed .lf-tabs { position: relative; }
.bsl-filter-boxed .lf-tabs::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  background: var(--pt-mid, var(--bg-x1c1930));
  z-index: 0;
}
.bsl-filter-boxed .lf-tabs > * { position: relative; z-index: 1; }

@media (min-width: 1025px) {
  .bsl-filter-boxed .lf-tabs::after {
    content: "";
    flex: 1 1 auto;
    border-bottom: 1px solid var(--pt-accent, var(--line-blue-600));
    position: relative;
    z-index: 1;
  }
}

/* Phone: the filter runs 6px wider on each side than the page's own
   16px gutter.
   On a home page it used to escape the hero band's 20px gutter with a
   negative margin as well, landing 10px from the screen edge while every
   other thing in that band sat at 20px - the filter looked pressed
   against the wall. It now keeps the hero's own gutter: sides only, so
   the vertical pull-up that seats it against the band is untouched. The
   html prefix stays because the pages set this wrapper's margin in their
   own <style>, read after this file. */
@media (max-width: 640px) {
  .bsl-filter-wrap { padding: 0 10px; }
  html .bs-hero-v2 .bsl-filter-wrap,
  html .bsa-hero-filter .bsl-filter-wrap {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}
.bsl-result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

/* The line that names what the filters chose, on the agent and agency
   sites. Quiet type: it sits above the listings as a caption for them,
   not as a banner - the page's own heading is in the band above. Lived
   in the agent page's own <style> until the agency sites wanted it too. */
.bsl-results-line {
  margin: 0;
  color: var(--fg-gray-500);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
}

@media (min-width: 901px) {
  /* A heading over something that has no rail beside it. */
  html.ui-cards-one.coa-brand .bs-section-title.bsa-title-full { padding-right: 0; }
}

/* The listings line up with the filter above them. The filter panel is
   1100px and the container under it was 1200px, so the cards started
   further left than the box they were filtered from and ended further
   right - a 50px step on each side that reads as a mistake because it
   is one. These two must move together, or the step comes back. */
.coa-brand .bs-list-wrap { max-width: 1100px; }
@media (min-width: 901px) {

  .cl-portal-promo { display: none; }
  /* Hidden here rather than globally: a rule written after the phone's
     block would win there too, and both copies vanished. */
  .cl-portal-promo-after { display: none; }
  html.ui-cards-one.coa-brand #bsListGrid .cl-portal-promo {
    display: block;
    grid-column: 2;
    grid-row: 1 / span var(--pp-rows, 1);
    /* Stretch, not start. The grid sets align-items: start for the cards,
       and an item sized to its own content gives the sticky box inside it
       nothing to travel down - it looked pinned in place because it had
       nowhere to go. */
    align-self: stretch;
  }
  /* Follows the list down, so it is still there at the fortieth row. */
  html.ui-cards-one.coa-brand .cl-portal-promo-inner {
    position: sticky;
    top: 86px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}
/* Below that width the cards are a grid again and there is no column to
   sit in; the two cards go under the list instead of vanishing. */
@media (max-width: 900px) {
  /* The grid's copy steps aside and the one after the list takes over, so
     Load More stays with the listings it loads rather than sitting under
     two cards about something else. */
  #bsListGrid .cl-portal-promo { display: none; }
  .cl-portal-promo-after { display: block; margin-top: 22px; }
  .cl-portal-promo-inner { display: flex; flex-direction: column; gap: 12px; }
}

.cl-pp-card {
  display: block;
  background: var(--bg-w);
  border: 1px solid var(--line-xe8ecf2);
  border-radius: 16px;
  padding: 18px;
  text-decoration: none;
  color: var(--fg-x12101a);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 14px rgba(15,23,42,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cl-pp-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,23,42,0.10); }
.cl-pp-kicker {
  display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-blue-600); background: var(--bg-blue-50);
  padding: 3px 9px; border-radius: 999px; margin-bottom: 10px;
}
.cl-pp-card strong { display: block; font-size: 1.02rem; line-height: 1.35; margin-bottom: 6px; }
.cl-pp-sub { display: block; color: var(--fg-gray-500); font-size: 0.85rem; line-height: 1.55; }
.cl-pp-go { display: inline-block; margin-top: 12px; font-size: 0.85rem; font-weight: 800; color: var(--fg-blue-600); }
.cl-pp-sell { background: var(--bg-x12101a); color: var(--fg-w); border-color: var(--line-x12101a); }
.cl-pp-sell .cl-pp-sub { color: var(--fg-slate-300); }
.cl-pp-sell .cl-pp-go { color: var(--fg-blue-300); }

/* ---------- Social buttons at the foot of a portal ---------- */
/* They were two flat grey circles with no space around them, reading as
   something taped on after the fact. A ring rather than a fill: the
   footer is near-black and a 10% white disc just turns muddy. The theme's
   accent arrives on hover, which is also the only moment it means
   anything. */
/* Who this is on the left, where to find them on the right. Stacked and
   centred on a phone, where two columns of three words each read worse
   than one. */
.bs-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  text-align: left;
}
.bs-footer-row-alone { justify-content: center; text-align: center; }
.bs-footer-left p { margin: 0 0 4px; }
.bs-footer-left p:last-child { margin-bottom: 0; }
.bs-footer-links a { color: var(--fg-slate-300); text-decoration: none; }
.bs-footer-links a:hover { color: var(--fg-w); text-decoration: underline; }
/* The agent's FindHartanah link shares the policy links' line; on a phone,
   where the three do not fit, it takes a line of its own. */
.bs-footer-fh { white-space: nowrap; }
@media (max-width: 520px) {
  .bs-footer-fh-sep { display: none; }
  .bs-footer-fh { display: block; }
}
@media (max-width: 620px) {
  .bs-footer-row { flex-direction: column; text-align: center; gap: 14px; }
}

.bs-social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.bs-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255,255,255,0.86);
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.bs-social a:hover,
.bs-social a:focus-visible {
  background: var(--pt-accent, var(--bg-blue-600));
  border-color: var(--pt-accent, var(--line-blue-600));
  color: var(--fg-w);
  transform: translateY(-2px);
}
.bs-social a:focus-visible { outline: 2px solid var(--line-w); outline-offset: 2px; }
/* A hairline under them, so the row reads as its own thing and the
   copyright below reads as the end. */


/* ---------- What a firm does, on its About page ---------- */
.bsa-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
.bsa-fact {
  background: var(--bg-w);
  border: 1px solid var(--line-xe8ecf2);
  border-radius: 14px;
  padding: 16px 18px;
}
.bsa-fact h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.bsa-fact ul { list-style: none; margin: 0; padding: 0; }
.bsa-fact li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-slate-100);
  font-size: 0.9rem;
  color: var(--fg-gray-700);
}
.bsa-fact li:last-child { border-bottom: 0; }
/* The figure is the point of each row, so it is the heavier of the two. */
.bsa-fact li b { font-weight: 800; color: var(--fg-x12101a); font-variant-numeric: tabular-nums; }
.bsa-fact-note { margin: 10px 0 0; font-size: 0.74rem; line-height: 1.55; color: var(--fg-gray-400); }

/* The linkren on/off switch. A checkbox underneath, so the form posts the
   same field it always did; everything here is the look. */
.lrs-switch { display: flex; align-items: flex-start; gap: 13px; margin: 14px 0 4px; padding: 14px 16px;
              border: 1px solid var(--border, var(--line-gray-200)); border-radius: 12px; background: var(--bg-gray-50); cursor: pointer; }
.lrs-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.lrs-track { flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--bg-slate-300);
             position: relative; transition: background .16s ease; margin-top: 1px; }
.lrs-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
            background: var(--bg-w); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .16s ease; }
.lrs-switch input:checked + .lrs-track { background: var(--bg-green-600); }
.lrs-switch input:checked + .lrs-track .lrs-knob { transform: translateX(20px); }
.lrs-switch input:focus-visible + .lrs-track { outline: 2px solid var(--line-blue-600); outline-offset: 2px; }
.lrs-switch-text { min-width: 0; }
.lrs-switch-text strong { display: block; font-size: .95rem; }
.lrs-switch-text em { font-style: normal; font-size: .76rem; font-weight: 800; text-transform: uppercase;
                      letter-spacing: .05em; color: var(--fg-slate-500); margin-left: 6px; }
.lrs-switch input:checked ~ .lrs-switch-text em { color: var(--fg-green-600); }
.lrs-switch-text small { display: block; margin-top: 3px; font-size: .8rem; color: var(--fg-gray-500); line-height: 1.5; }

/* Broadcast queue counters. */
.bq-chip { display:inline-flex; align-items:baseline; gap:6px; background:var(--bg-gray-100); border:1px solid var(--line-gray-200);
           border-radius:999px; padding:6px 14px; font-size:0.84rem; color:var(--fg-gray-700); }
.bq-chip b { font-size:0.98rem; font-weight:800; font-variant-numeric:tabular-nums; }
.bq-chip.bq-ok { background:var(--bg-green-50); border-color:var(--line-green-200); color:var(--fg-green-700); }
.bq-chip.bq-bad { background:var(--bg-red-50); border-color:var(--line-red-200); color:var(--fg-red-700); }


/* Move a photo without dragging it.
   HTML5 drag-and-drop does not fire on a touch screen at all, so on a
   phone the photo order was whatever order they happened to be picked
   in. These two sit along the bottom of each tile; dragging still works
   where a mouse exists. */
.extra-photo-move { position: absolute; left: 0; right: 0; bottom: 0; display: flex;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0)); }
.extra-photo-move-btn { flex: 1; appearance: none; border: 0; background: none; color: var(--fg-w);
  font-size: 1.05rem; line-height: 1; padding: 7px 0 6px; cursor: pointer; font-family: inherit; }
.extra-photo-move-btn:disabled { color: rgba(255,255,255,.28); cursor: default; }
.extra-photo-move-btn:not(:disabled):active { background: rgba(255,255,255,.22); }
@media (max-width: 640px) {
  /* A 90px tile leaves each arrow a 45px-wide target; the taller hit
     area is what makes them usable with a thumb. */
  .extra-photo-item { width: 104px; height: 104px; }
  .extra-photo-move-btn { padding: 10px 0 9px; font-size: 1.15rem; }
}

/* ── Light / dark switch in the admin topbar ─────────────────────────
   Shaped like the search and guides pills beside it, with a small track
   on the end so it reads as an on/off rather than another button. The
   link carries the opposite theme, so one tap is one switch. */
.admin-theme-toggle { text-decoration: none; }
.admin-theme-track {
  position: relative; flex: 0 0 auto; width: 30px; height: 17px;
  border-radius: 999px; background: var(--bg-gray-300);
  transition: background 0.15s ease;
}
.admin-theme-knob {
  position: absolute; top: 2px; left: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--bg-w);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}
.admin-theme-toggle[aria-checked="true"] .admin-theme-track { background: var(--bg-blue-600); }
.admin-theme-toggle[aria-checked="true"] .admin-theme-knob { transform: translateX(13px); }

@media (max-width: 820px) {
  /* Search, the guides, this switch and the language code are tools, not
     content - on a phone they give their width back to the agent's own
     name and the bell. Smaller circles, and the switch keeps only its
     icon: the track would say nothing the sun and moon do not. */
  .admin-topbar-search { flex: 0 0 32px !important; width: 32px !important; height: 32px !important; }
  .admin-theme-track { display: none; }
  .admin-topbar-lang-summary { padding: 6px 8px !important; font-size: 0.74rem !important; }
}

/* An iPhone 15 is 393px across and the bar was 9px over it once the switch
   joined, with the agent's own name the thing being clipped.
   Hiding "Profile" was the wrong way to pay for it: .topbar-user-role is
   the public board's nav too, so it took the caret off coalisting.com's
   own profile menu, nowhere near the switch. And it bought no width
   anyway - the name and the role are stacked in a column, so the role is
   never the wider of the two.
   The width comes from the two things beside the switch instead: the
   language code, which is two letters in a pill sized for more, and the
   flexible gap before it, which gives way as soon as the name asks. */
@media (max-width: 430px) {
  .admin-topbar { gap: 6px; }
  .admin-topbar-lang-summary { padding: 6px 6px !important; font-size: 0.7rem !important; }
  .topbar-user-info { max-width: 104px; }
}

/* First steps (dashboard). Blue like the rest of the agent's own rows; the
   next undone step is the only one with a solid button. */
.dash-fs { margin: 0 0 20px; padding: 16px 18px; background: var(--bg-blue-50); border: 1px solid var(--line-blue-200); border-radius: 14px; }
.dash-fs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dash-fs-head b { display: block; font-size: 0.98rem; color: var(--fg-gray-900); }
.dash-fs-head span { display: block; font-size: 0.8rem; color: var(--fg-gray-500); margin-top: 2px; }
.dash-fs-count { flex: none; font-size: 1.35rem !important; font-weight: 800; color: var(--fg-blue-600) !important; margin: 0 !important; }
.dash-fs-bar { height: 7px; margin: 12px 0 6px; background: var(--bg-w); border-radius: 99px; overflow: hidden; }
.dash-fs-bar > div { height: 100%; background: var(--bg-blue-600); border-radius: 99px; }
.dash-fs-list { list-style: none; margin: 0; padding: 0; }
.dash-fs-step { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-blue-100); }
.dash-fs-step:first-child { border-top: 0; }
.dash-fs-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 800; background: var(--bg-w); color: var(--fg-gray-500); border: 1px solid var(--border); }
.dash-fs-text { flex: 1; min-width: 0; }
.dash-fs-text b { display: block; font-size: 0.88rem; color: var(--fg-gray-900); }
.dash-fs-text small { display: block; font-size: 0.77rem; color: var(--fg-gray-500); line-height: 1.45; }
.dash-fs-go { flex: none; padding: 8px 14px; border-radius: 9px; background: var(--bg-blue-600); color: var(--fg-w); font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.dash-fs-go-alt { background: var(--bg-w); color: var(--fg-gray-700); border: 1px solid var(--border); }
.dash-fs-step.is-next .dash-fs-mark { background: var(--bg-blue-600); color: var(--fg-w); border-color: var(--line-blue-600); }
.dash-fs-step.is-done .dash-fs-mark { background: var(--bg-green-100); color: var(--fg-green-700); border-color: var(--bg-green-100); }
.dash-fs-step.is-done .dash-fs-text b { color: var(--fg-gray-500); text-decoration: line-through; }
.dash-fs-step.is-wait .dash-fs-mark { background: var(--bg-amber-50); color: var(--fg-amber-700); border-color: var(--line-amber-200); }
@media (max-width: 600px) {
  .dash-fs { padding: 14px; }
  .dash-fs-step { flex-wrap: wrap; align-items: flex-start; }
  .dash-fs-text { flex: 1 1 calc(100% - 40px); }
  .dash-fs-go { margin-left: 40px; padding: 7px 14px; }
}

/* Each extra photo says where it stands (listing-form.js render()). */
.extra-photo-state { position: absolute; left: 4px; right: 4px; top: 50%; transform: translateY(-50%); font-size: 0.62rem; font-weight: 700; line-height: 1.25; padding: 2px 5px; border-radius: 6px; background: rgba(255,255,255,0.94); color: var(--fg-gray-500); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.extra-photo-state.is-ok { color: var(--fg-green-700); }
.extra-photo-state.is-fail { color: var(--fg-w); background: var(--fg-red-600); white-space: normal; }
.extra-photo-item.is-failed { border-color: var(--fg-red-600); background: var(--bg-gray-100); }
/* A photo the phone would not hand over: one box above the photos, with what to do (listing-form.js). */
.photo-unreadable { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-red-50); border: 1px solid var(--line-red-200); color: var(--fg-red-700); }
.photo-unreadable strong { display: block; font-size: 0.9rem; }
.photo-unreadable p { margin: 4px 0 10px; font-size: 0.84rem; line-height: 1.5; color: var(--fg-gray-700); }
.photo-unreadable-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-unreadable-acts .btn { margin: 0; padding: 8px 14px; font-size: 0.84rem; }
.extra-photo-item.is-failed img { opacity: 0.55; }
#extraPhotosCount .photo-sum.is-ok { color: var(--fg-green-700); font-weight: 700; }
#extraPhotosCount .photo-sum.is-up { color: var(--fg-gray-500); font-weight: 700; }
#extraPhotosCount .photo-sum.is-fail { color: var(--fg-red-600); font-weight: 700; }
.photo-retry-all { margin-left: 8px; padding: 3px 10px; border-radius: 7px; border: 1px solid var(--fg-red-600); background: var(--bg-w); color: var(--fg-red-600); font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer; }

/* ── "Load more listings" on the home page ────────────────────────────────
   Bigger than an ordinary button (19 Nov 2026): it is the only way further
   down the board, and at 38px tall it read as a footnote. A press shows -
   the button gives a little under the thumb - and while the next eight are
   fetched it turns over a spinner instead of only changing its words. The
   cards that arrive come in one after another rather than all at once, so
   it is plain where the new ones start. */
.load-more-btn {
  gap: 8px;
  min-height: 50px; min-width: min(100%, 300px);
  padding: 12px 24px; border-radius: 12px;
  font-size: 1rem; font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.load-more-btn:active:not(:disabled) { transform: scale(0.96); }
.load-more-btn:disabled { cursor: progress; opacity: 0.85; }
/* A plus before the words - "more" - drawn in CSS, because the script
   rewrites the button's text while it loads and would take an icon with it.
   While loading, the same spot turns into the spinner. */
.load-more-btn::before {
  content: ''; width: 14px; height: 14px; flex: none;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
              linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
}
.load-more-btn.is-loading::before {
  width: 16px; height: 16px; background: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: load-more-spin 0.7s linear infinite;
}
@keyframes load-more-spin { to { transform: rotate(360deg); } }
.load-more-new { animation: load-more-in 0.45s ease both; }
@keyframes load-more-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .load-more-btn:active:not(:disabled) { transform: none; }
  .load-more-btn.is-loading::before { animation-duration: 2s; }
  .load-more-new { animation: none; }
}
