/* QUEADS – single stylesheet (no build step required) */
:root {
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0f172a;
    --slate-950: #020617;
    --sky-50: #f0f9ff;
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --sky-700: #0369a1;
    --red-50: #fef2f2;
    --red-600: #dc2626;
    --green-50: #f0fdf4;
    --green-700: #15803d;
    --amber-50: #fffbeb;
    --amber-700: #b45309;
    --radius: 5px;
    /* Button design system */
    --button-height: 40px;
    --button-height-sm: 34px;
    --button-height-lg: 46px;
    --button-padding-x: 16px;
    --button-padding-x-sm: 12px;
    --button-padding-x-lg: 22px;
    --button-font-size: 14px;
    --button-font-weight: 600;
    --button-text-transform: none;
    --button-letter-spacing: .01em;
    --button-border-radius: 6px;
    --button-icon-size: 16px;
    --button-gap: 8px;
    --button-transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
    --button-primary-bg: #0284c7;
    --button-primary-hover: #0369a1;
    --button-primary-active: #075985;
    --button-secondary-bg: #f1f5f9;
    --button-secondary-hover: #e2e8f0;
    --button-secondary-color: #334155;
    --button-danger-bg: #dc2626;
    --button-danger-hover: #b91c1c;
    --button-disabled-opacity: .55;
    --control-height: var(--button-height);
    /* inputs and selects match standard buttons */
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--slate-700);
    background: var(--slate-100);
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--sky-600);
}

a:hover {
    color: var(--sky-700);
}

h1,
h2,
h3 {
    color: var(--slate-900);
    line-height: 1.2;
    margin: 0 0 .5rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

h2 {
    font-size: 1.25rem;
    font-weight: 800;
}

.h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

p {
    margin: 0 0 1rem;
}

.muted {
    color: var(--slate-500);
}

.small {
    font-size: .85rem;
}

.center {
    text-align: center;
}

.right {
    text-align: right;
}

.mt {
    margin-top: 1rem;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #fff;
    padding: .5rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 2px solid var(--sky-500);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container.narrow {
    max-width: 820px;
}

.section {
    padding-top: 1.75rem;
    padding-bottom: 2.5rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--slate-200);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 1rem;
}

.brand img {
    display: block;
    height: 48px;
    width: 48px;
    object-fit: contain;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    height: var(--button-height);
    box-sizing: border-box;
    font-size: var(--button-font-size);
    font-weight: var(--button-font-weight);
    line-height: 1;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--slate-900);
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    padding: 0 var(--button-padding-x-sm);
    border-radius: var(--radius);
}

.nav-link {
    color: var(--slate-500);
    text-decoration: none;
    border-radius: var(--radius);
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.nav-link:hover {
    color: var(--sky-600);
    background: var(--slate-50);
}

.inline-form {
    display: inline;
    margin: 0;
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    width: var(--button-height);
    height: var(--button-height);
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--slate-700);
    margin: 6px 0;
    transition: transform .2s;
}

/* =====================================================================
   Buttons: one design system.  <a> and <button> share the same classes.
   Size:    (default 40px) .btn-sm 34px  .btn-lg 46px  .btn-icon 40x40 (.btn-sm.btn-icon 34x34)
   Variant: .btn-primary .btn-secondary .btn-outline .btn-danger .btn-outline-danger .btn-ghost
            .btn-dark .btn-light .btn-whatsapp
   Layout:  .btn-block (full width), .btn-group (aligned action row)
   ===================================================================== */
.btn {
    --btn-bg: transparent;
    --btn-color: inherit;
    --btn-border: transparent;
    --btn-hover-bg: var(--btn-bg);
    --btn-hover-color: var(--btn-color);
    --btn-hover-border: var(--btn-border);
    --btn-spinner: #fff;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--button-gap);
    box-sizing: border-box;
    height: var(--button-height);
    min-width: var(--button-height);
    padding: 0 var(--button-padding-x);
    margin: 0;
    font-family: inherit;
    font-size: var(--button-font-size);
    font-weight: var(--button-font-weight);
    letter-spacing: var(--button-letter-spacing);
    text-transform: var(--button-text-transform);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--btn-color);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: var(--button-border-radius);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: var(--button-transition);
}

.btn:hover {
    color: var(--btn-hover-color);
    background: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
}

.btn:active:not(:disabled):not(.is-loading) {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 3px solid var(--sky-500);
    outline-offset: 2px;
}

.btn svg,
.btn img,
.btn .icon {
    flex: 0 0 auto;
    width: var(--button-icon-size);
    height: var(--button-icon-size);
}

/* Sizes */
.btn-sm {
    height: var(--button-height-sm);
    min-width: var(--button-height-sm);
    padding: 0 var(--button-padding-x-sm);
}

.btn-xs {
    height: var(--button-height-sm);
    min-width: var(--button-height-sm);
    padding: 0 var(--button-padding-x-sm);
}

/* legacy alias of .btn-sm */
.btn-lg {
    height: var(--button-height-lg);
    min-width: var(--button-height-lg);
    padding: 0 var(--button-padding-x-lg);
}

.btn-icon {
    width: var(--button-height);
    padding: 0;
}

.btn-icon.btn-sm {
    width: var(--button-height-sm);
}

.btn-icon.btn-lg {
    width: var(--button-height-lg);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Variants */
.btn-primary {
    --btn-bg: var(--button-primary-bg);
    --btn-color: #fff;
    --btn-border: var(--button-primary-bg);
    --btn-hover-bg: var(--button-primary-hover);
    --btn-hover-border: var(--button-primary-hover);
}

.btn-primary:active {
    background: var(--button-primary-active);
    border-color: var(--button-primary-active);
}

.btn-secondary {
    --btn-bg: var(--button-secondary-bg);
    --btn-color: var(--button-secondary-color);
    --btn-border: var(--slate-300);
    --btn-hover-bg: var(--button-secondary-hover);
    --btn-spinner: var(--slate-600);
}

.btn-outline {
    --btn-bg: #fff;
    --btn-color: var(--slate-700);
    --btn-border: var(--slate-300);
    --btn-hover-bg: var(--sky-50);
    --btn-hover-color: var(--sky-700);
    --btn-hover-border: var(--sky-500);
    --btn-spinner: var(--slate-600);
}

.btn-danger {
    --btn-bg: var(--button-danger-bg);
    --btn-color: #fff;
    --btn-border: var(--button-danger-bg);
    --btn-hover-bg: var(--button-danger-hover);
    --btn-hover-border: var(--button-danger-hover);
}

.btn-outline-danger {
    --btn-bg: #fff;
    --btn-color: var(--slate-700);
    --btn-border: var(--slate-300);
    --btn-hover-bg: var(--red-50);
    --btn-hover-color: var(--red-600);
    --btn-hover-border: var(--red-600);
    --btn-spinner: var(--red-600);
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-color: var(--slate-600);
    --btn-border: transparent;
    --btn-hover-bg: var(--slate-100);
    --btn-hover-color: var(--sky-700);
    --btn-spinner: var(--slate-600);
}

.btn-dark {
    --btn-bg: var(--slate-900);
    --btn-color: #fff;
    --btn-border: var(--slate-900);
    --btn-hover-bg: var(--button-primary-bg);
    --btn-hover-border: var(--button-primary-bg);
}

.btn-light {
    --btn-bg: #fff;
    --btn-color: var(--sky-700);
    --btn-border: #fff;
    --btn-hover-bg: var(--slate-50);
    --btn-hover-border: var(--slate-50);
    --btn-spinner: var(--sky-700);
}

.btn-whatsapp {
    --btn-bg: #16a34a;
    --btn-color: #fff;
    --btn-border: #16a34a;
    --btn-hover-bg: #15803d;
    --btn-hover-border: #15803d;
}

/* Disabled and loading keep the exact dimensions (spinner is overlaid, text stays in the layout) */
.btn:disabled,
.btn[disabled],
.btn[aria-disabled=true] {
    opacity: var(--button-disabled-opacity);
    cursor: not-allowed;
    pointer-events: none;
}

.btn.is-loading {
    color: transparent;
    cursor: progress;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--button-icon-size);
    height: var(--button-icon-size);
    margin: calc(var(--button-icon-size) / -2) 0 0 calc(var(--button-icon-size) / -2);
    border: 2px solid var(--btn-spinner);
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin .7s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Action groups: equal heights, consistent gaps, wrap instead of overflow */
.btn-group,
.form-actions,
.contact-actions,
.owner-bar,
.ad-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.btn-group>.inline-form,
.form-actions>.inline-form,
.owner-bar>.inline-form,
.ad-actions>.inline-form {
    display: inline-flex;
}

/* Link-style navigation items share the button metrics so they line up with .btn in the header */
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--button-height);
    padding: 0 var(--button-padding-x-sm);
    font-family: inherit;
    font-size: var(--button-font-size);
    font-weight: var(--button-font-weight);
    letter-spacing: var(--button-letter-spacing);
    text-transform: var(--button-text-transform);
    line-height: 1;
    white-space: nowrap;
}

/* Alerts */
.alert {
    margin: 1rem 0 0;
    padding: .8rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    border: 1px solid;
}

.alert-success {
    background: var(--green-50);
    color: var(--green-700);
    border-color: #bbf7d0;
}

.alert-error {
    background: var(--red-50);
    color: var(--red-600);
    border-color: #fecaca;
}

.alert-info {
    background: var(--sky-50);
    color: var(--sky-700);
    border-color: #bae6fd;
}

/* Hero */
.hero {
    background: radial-gradient(1200px 400px at 50% -20%, rgba(14, 165, 233, .25), transparent), var(--slate-950);
    color: #fff;
    padding: 2.5rem 0 2rem;
    text-align: center;
}

.hero h1 {
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    margin-bottom: .75rem;
}

.hero .accent {
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.hero .lead {
    color: var(--slate-400);
    max-width: 720px;
    margin: 0 auto 1.5rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .8rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, .1);
    border: 1px solid rgba(14, 165, 233, .25);
    color: #38bdf8;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sky-500);
}

.hero-filter {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    padding: .75rem;
    text-align: left;
}

.hero .field-label {
    color: var(--slate-300);
}

/* Filter form */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    align-items: end;
}

.field-wide {
    grid-column: span 3;
}

.field-action {
    grid-column: span 1;
}

.panel-pad .field-label {
    color: var(--slate-500);
}

/* Page head */
.page-head {
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    padding: 1.25rem 0 1.5rem;
}

.breadcrumb {
    font-size: .8rem;
    color: var(--slate-500);
    margin-bottom: .75rem;
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb .sep {
    margin: 0 .4rem;
    color: var(--slate-300);
}

/* Layout */
.layout-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 3rem;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 84px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: .75rem;
}

.chip {
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: #fff;
    border: 1px solid var(--slate-200);
    padding: .35rem .75rem;
    border-radius: 999px;
    color: var(--slate-600);
    white-space: nowrap;
}

.panel {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-pad {
    padding: 1.25rem;
}

.panel-title {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--slate-500);
    padding: 1rem 1rem .5rem;
    margin: 0;
}

.city-list {
    list-style: none;
    margin: 0;
    padding: 0 .5rem .75rem;
}

.city-list .city-list-item {
    list-style: none;
    margin-bottom: 8px;
}

.city-list .city-list-item .city-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.city-list .city-list-item .city-link:hover {
    background-color: #f3f4f6;
}

.city-list .city-list-item .city-name {
    font-weight: 500;
    font-size: 13px;
    text-align: left;
}

.city-list .city-list-item .policy-count {
    font-size: 11px;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 12px;
    font-weight: 600;
    text-align: left;
}

.city-list .city-list-item .province-name {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

.promo {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #0284c7);
}

.promo h3 {
    color: #fff;
    margin-bottom: .4rem;
}

.promo p {
    font-size: .85rem;
    opacity: .85;
}

/* Ad cards */
.ad-list {
    display: grid;
    gap: .9rem;
}

.ad-card {
    display: flex;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}

.ad-card:hover {
    box-shadow: var(--shadow);
    border-color: #bae6fd;
}

.ad-thumb {
    position: relative;
    flex: 0 0 120px;
    width: 120px;
    background: var(--slate-100);
}

.ad-thumb img {
    width: 120px;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    display: block;
}

.badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(2, 132, 199, .92);
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 6px;
    border-radius: 3px;
}

.badge-inline {
    position: static;
    display: inline-block;
    margin-bottom: .5rem;
}

.ad-body {
    flex: 1;
    min-width: 0;
    padding: .7rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.ad-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.ad-title {
    font-size: 0.90rem;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.ad-title a {
    color: var(--slate-900);
    text-decoration: none;
}

.ad-title a:hover {
    color: var(--sky-600);
}

.ad-price {
    text-align: right;
    font-weight: 800;
    color: var(--sky-600);
    white-space: nowrap;
    font-size: .75rem;
}

.ad-price small {
    display: block;
    font-size: .6rem;
    text-transform: uppercase;
    color: var(--slate-400);
    letter-spacing: .05em;
}

.ad-card-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.ad-excerpt {
    margin: 0;
    font-size: .9rem;
    color: var(--slate-600);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    font-size: .72rem;
    color: var(--slate-400);
    margin-top: auto;
    align-items: center;
}

.ad-actions {
    margin-left: auto;
    flex-wrap: nowrap;
}

.ad-actions .stat {
    margin-right: .25rem;
}

.empty {
    text-align: center;
    max-width: 460px;
    margin: 2rem auto;
    padding: 2.5rem 1.5rem;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
}

.error-code {
    font-size: 3rem;
    font-weight: 900;
    color: var(--slate-300);
    margin: 0;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: var(--button-height-sm);
    min-width: var(--button-height-sm);
    padding: 0 var(--button-padding-x-sm);
    border: 1px solid var(--slate-200);
    background: #fff;
    border-radius: var(--button-border-radius);
    text-decoration: none;
    font-size: var(--button-font-size);
    font-weight: var(--button-font-weight);
    line-height: 1;
    color: var(--slate-700);
    transition: var(--button-transition);
}

.pagination a:hover {
    border-color: var(--sky-500);
    color: var(--sky-700);
}

.pagination .current {
    background: var(--sky-600);
    border-color: var(--sky-600);
    color: #fff;
    font-weight: 700;
}

.pagination .gap {
    border: 0;
    background: none;
}

/* Ad detail */
.ad-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}

.ad-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.ad-detail-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--sky-600);
    text-align: right;
}

.ad-detail-price small {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    color: var(--slate-400);
    letter-spacing: .05em;
}

.gallery-main {
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--slate-100);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    min-height: 200px;
    cursor: zoom-in;
}

.gallery-main:focus-visible {
    outline: 3px solid #0284c7;
    outline-offset: 2px;
}

.gallery-empty {
    cursor: default;
}

.gallery-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .75);
    color: #fff;
    font-size: .8rem;
}

.gallery-thumbs button:focus-visible {
    outline: 3px solid #0284c7;
    outline-offset: 1px;
}

.gallery-main img {
    max-height: 460px;
    width: auto;
    object-fit: contain;
}

.gallery-thumbs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0;
    margin: .6rem 0 1.25rem;
}

.gallery-thumbs button {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

.gallery-thumbs button.active {
    border-color: var(--sky-500);
}

.gallery-thumbs img {
    display: block;
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 2px;
}

.ad-content {
    overflow-wrap: anywhere;
    margin-bottom: 1rem;
}

.ad-content p {
    margin: 0 0 .75rem;
}

.contact-line {
    font-weight: 700;
}

.share {
    display: flex;
    gap: .9rem;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--slate-100);
    font-size: .85rem;
}

.owner-bar {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--slate-100);
}

.reply-box {
    position: sticky;
    top: 84px;
}

/* Forms */
.field {
    display: block;
    margin-bottom: 1rem;
}

.field-label {
    display: block;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--slate-500);
    margin-bottom: .35rem;
}

.req {
    color: var(--red-600);
}

input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=search],
input[type=file],
select,
textarea {
    width: 100%;
    font: inherit;
    font-size: 16px;
    min-height: var(--control-height);
    color: var(--slate-900);
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius);
    padding: .6rem .75rem;
}

textarea {
    resize: vertical;
    min-height: 6rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--sky-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .2);
}

.has-error input,
.has-error select,
.has-error textarea {
    border-color: var(--red-600);
}

.field-error {
    color: var(--red-600);
    font-size: .8rem;
    margin: .3rem 0 0;
}

.field-hint {
    color: var(--slate-400);
    font-size: .78rem;
    margin: .3rem 0 0;
}

.field-check {
    display: flex;
    align-items: flex-end;
}

.check,
.radio-row label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    cursor: pointer;
}

.radio-row {
    display: flex;
    gap: 1.5rem;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 1.5rem;
}

legend {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--slate-900);
    border-bottom: 1px solid var(--slate-100);
    padding: 0 0 .6rem;
    margin-bottom: 1rem;
    width: 100%;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

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

.form-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--slate-100);
    padding-top: 1rem;
}

.thumb-grid {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 0;
    margin: 0 0 1rem;
}

.thumb-grid img {
    display: block;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: .25rem;
}

.file-preview {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0;
    margin: .6rem 0 0;
}

.file-preview img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--slate-200);
}

.auth-wrap {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card.wide {
    max-width: 680px;
}

.divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--slate-400);
    font-size: .8rem;
    margin: 1.25rem 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--slate-200);
}

.prose h2 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
}

.prose ul {
    padding-left: 1.25rem;
}

.prose li {
    margin-bottom: .4rem;
}

/* Footer & cookie banner */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--slate-200);
    padding: 1rem 0;
    font-size: .8rem;
    color: var(--slate-500);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.footer-inner p {
    margin: 0;
}

.footer-links a {
    margin-left: 1rem;
    font-weight: 600;
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 720px;
    margin: 0 auto;
    z-index: 60;
    background: var(--slate-900);
    color: #fff;
    padding: .9rem 1rem;
    border-radius: var(--radius);
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner p {
    margin: 0;
    font-size: .85rem;
}

.cookie-banner a {
    color: #7dd3fc;
}

/* Responsive */
@media (max-width: 900px) {

    .layout-two,
    .ad-detail {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .reply-box {
        position: static;
    }

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

    .field-wide {
        grid-column: span 2;
    }

    .field-action {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #fff;
        border-bottom: 1px solid var(--slate-200);
        padding: .75rem 1rem 1rem;
        gap: .5rem;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav .btn,
    .site-nav .nav-link {
        width: 100%;
    }

    .nav-toggle[aria-expanded=true] span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle[aria-expanded=true] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded=true] span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .grid-2,
    .grid-3,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .field-wide,
    .field-action {
        grid-column: auto;
    }

    .ad-thumb {
        flex-basis: 84px;
        width: 84px;
    }

    .ad-thumb img {
        width: 84px;
    }

    .ad-head {
        flex-direction: column;
        gap: .15rem;
    }

    .ad-price {
        text-align: left;
        font-size: 0.75rem;
    }

    .ad-detail-price {
        text-align: left;
    }

    .crumbs {
        display: none;
    }

    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
    }
}

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

/* ---- Customer experience additions ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn[disabled],
.btn.is-loading {
    opacity: .65;
    cursor: progress;
    pointer-events: none;
}

.btn-whatsapp {
    background: #16a34a;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #15803d;
    color: #fff;
}

textarea,
input,
select {
    max-width: 100%;
}

textarea {
    min-height: 7rem;
    line-height: 1.5;
}

/* Category quick links: one scrollable row on phones */
.cat-strip {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-top: 1rem;
    padding-bottom: .25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.cat-chip {
    flex: 0 0 auto;
    padding: .45rem .9rem;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 5px;
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--slate-700);
    white-space: nowrap;
}

.cat-chip:hover {
    border-color: var(--sky-500);
    color: var(--sky-700);
    background: var(--sky-50);
}

/* Active filters */
.active-filters {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0;
    margin: 0 0 1rem;
    align-items: center;
}

.active-filters a {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    padding: .35rem .75rem;
    background: var(--sky-50);
    border: 1px solid #bae6fd;
    color: var(--sky-700);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 36px;
}

.active-filters a:hover {
    background: #e0f2fe;
}

.active-filters .clear a {
    background: none;
    border: 0;
    color: var(--slate-500);
    text-decoration: underline;
}

.filter-panel summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--slate-900);
    list-style: none;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.filter-panel summary::-webkit-details-marker {
    display: none;
}

.filter-panel summary::after {
    content: "+";
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--slate-400);
}

.filter-panel[open] summary::after {
    content: "\2212";
}

.filter-panel[open] summary {
    margin-bottom: 1rem;
}

/* Ad detail contact */
.contact-actions {
    margin: 1rem 0;
}

.safety {
    padding-left: 1.1rem;
    margin: .75rem 0 0;
}

.safety li {
    margin-bottom: .25rem;
}

.ad-card time {
    white-space: nowrap;
}

/* Small phones: keep filters compact (2 columns) and thumbnails readable */
@media (max-width: 640px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: .6rem;
    }

    .field-wide,
    .field-action {
        grid-column: span 2;
    }

    .contact-actions .btn,
    .owner-bar .btn {
        flex: 1 1 100%;
    }

    .owner-bar .inline-form {
        flex: 1 1 100%;
        display: flex;
    }

    .owner-bar .inline-form .btn {
        width: 100%;
    }

    .ad-actions {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    h1 {
        font-size: 1.45rem;
    }

    .hero {
        padding: 1.75rem 0 1.25rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .layout-two {
        padding-top: 1.25rem;
        gap: 1.5rem;
    }
}

/* ---------- Multi-image uploader ---------- */
.uploader-drop {
    position: relative;
    text-align: center;
    padding: 28px 16px;
    border: 2px dashed #7dd3fc;
    border-radius: 14px;
    background: #f0f9ff;
    color: #334155;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.uploader-drop:hover,
.uploader-drop.is-active {
    border-color: #0284c7;
    background: #e0f2fe;
}

.uploader-drop.is-disabled {
    opacity: .6;
    cursor: not-allowed;
}

.uploader-icon {
    color: #0284c7;
}

.uploader-title {
    margin: 8px 0 4px;
    font-size: 1.1rem;
}

.uploader-text {
    margin: 0 0 6px;
}

.uploader-hint {
    margin: 6px 0 0;
    font-size: .85rem;
    color: #64748b;
}

.uploader-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.uploader-count {
    margin: 12px 0 4px;
    font-weight: 600;
    color: #0369a1;
}

.uploader-msg {
    margin: 0 0 8px;
    min-height: 1.2em;
    font-size: .9rem;
    color: #15803d;
}

.uploader-msg.is-error {
    color: #b91c1c;
}

.uploader-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.uploader-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f1f5f9;
    cursor: grab;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.uploader-item:hover,
.uploader-item:focus-visible {
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, .25);
    transform: translateY(-2px);
    outline: none;
}

.uploader-item.is-new {
    border-style: dashed;
}

.uploader-item.is-dragging {
    opacity: .4;
}

.uploader-item.is-over {
    border-color: #0284c7;
    background: #e0f2fe;
}

.uploader-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploader-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: var(--button-height-sm);
    height: var(--button-height-sm);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .75);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.uploader-remove:hover,
.uploader-remove:focus-visible {
    background: #b91c1c;
}

.uploader-tag {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-size: .72rem;
}

.uploader-tag.is-main {
    background: #0284c7;
}

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

/* ---------- Fullscreen gallery (lightbox) ---------- */
html.lb-open,
html.lb-open body {
    overflow: hidden;
}

.lb {
    position: fixed;
    inset: 0;
    z-index: 1000;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: rgba(8, 12, 20, .96);
    color: #fff;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overscroll-behavior: contain;
}

.lb[hidden] {
    display: none;
}

.lb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.lb-brand {
    font-weight: 700;
    letter-spacing: .08em;
    color: #38bdf8;
}

.lb-count {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-variant-numeric: tabular-nums;
    font-size: .95rem;
}

.lb-btn {
    border: 0;
    border-radius: 50%;
    width: var(--button-height);
    height: var(--button-height);
    padding: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.lb-btn:hover {
    background: #0284c7;
}

.lb-btn:focus-visible,
.lb-thumbs button:focus-visible {
    outline: 3px solid #38bdf8;
    outline-offset: 2px;
}

.lb-btn[hidden] {
    display: none;
}

.lb-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.lb-prev {
    left: 12px;
}

.lb-next {
    right: 12px;
}

.lb-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity .25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.lb-img.is-loaded {
    opacity: 1;
}

.lb-spinner {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .2);
    border-top-color: #0284c7;
    animation: lb-spin .8s linear infinite;
}

.lb-spinner[hidden],
.lb-error[hidden] {
    display: none;
}

.lb-error {
    position: absolute;
    padding: 12px 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .1);
}

@keyframes lb-spin {
    to {
        transform: rotate(360deg);
    }
}

.lb-thumbs {
    list-style: none;
    margin: 0;
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.lb-thumbs[hidden] {
    display: none;
}

.lb-thumbs li {
    flex: 0 0 auto;
}

.lb-thumbs button {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    opacity: .6;
    transition: opacity .15s, border-color .15s;
}

.lb-thumbs button:hover {
    opacity: 1;
}

.lb-thumbs button.active {
    border-color: #0284c7;
    opacity: 1;
    box-shadow: 0 0 0 1px #38bdf8;
}

.lb-thumbs img {
    display: block;
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

@media (max-width: 640px) {
    .lb-nav {
        width: 40px;
        height: 40px;
    }

    .lb-prev {
        left: 6px;
    }

    .lb-next {
        right: 6px;
    }

    .lb-thumbs {
        padding: 6px 10px;
        gap: 6px;
    }

    .lb-thumbs img {
        width: 48px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .lb-img,
    .lb-btn,
    .lb-thumbs button {
        transition: none;
    }

    .lb-spinner {
        animation-duration: 2s;
    }
}

/* Rich-text ad descriptions */
.ad-content h2,
.ad-content h3 {
    margin: 1rem 0 .5rem;
    line-height: 1.3;
}

.ad-content ul,
.ad-content ol {
    margin: 0 0 .75rem;
    padding-left: 1.5rem;
}

.ad-content ul {
    list-style: disc;
}

.ad-content ol {
    list-style: decimal;
}

.ad-content a {
    color: #0284c7;
    text-decoration: underline;
}

/* Segmented Yes/No control (radio group; reusable for other Yes/No fields) */
.segmented {
    display: inline-flex;
    width: 100%;
    max-width: 240px;
    padding: 3px;
    gap: 3px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f1f5f9;
}

.segmented-option {
    position: relative;
    flex: 1 1 0;
    margin: 0;
    cursor: pointer;
}

.segmented-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.segmented-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    border-radius: 8px;
    font-weight: 600;
    color: #475569;
    transition: background .15s, color .15s, box-shadow .15s;
}

.segmented-option:hover span {
    background: #e2e8f0;
}

.segmented-option input:checked+span {
    background: #0284c7;
    color: #fff;
    box-shadow: 0 1px 3px rgba(2, 132, 199, .4);
}

.segmented-option input:focus-visible+span {
    outline: 3px solid #38bdf8;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .segmented-option span {
        transition: none;
    }
}

/* Quill editor sizing (ad form only) */
#editor {
    min-height: 200px;
    background: #fff;
}

.ql-editor {
    min-height: 200px;
    font-size: 15px;
}

/* =====================================================================
   Responsive layer (mobile first, content driven)
   ===================================================================== */
:root {
    --container: 1200px;
    --gutter: clamp(.75rem, 3vw, 2rem);
}

/* Never allow accidental horizontal scrolling; media and long words stay inside their boxes. */
body {
    overflow-x: clip;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

h1,
h2,
h3,
.ad-title,
.ad-detail-head h1,
.ad-content {
    overflow-wrap: anywhere;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.container {
    max-width: var(--container);
    padding-inline: var(--gutter);
}

.container.narrow {
    max-width: min(820px, 100%);
}

.section {
    padding-block: clamp(1rem, 3vw, 2.5rem);
}

h1 {
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem);
}

.page-intro {
    max-width: 70ch;
    margin: .25rem 0 .75rem;
    color: var(--slate-600);
}

/* Listing grid: as many columns as the available width allows (cards stay horizontal) */
.ad-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 25rem), 1fr));
    gap: clamp(.65rem, 1.2vw, 1.1rem);
}

.ad-card {
    min-width: 0;
    height: 100%;
}

.ad-excerpt {
    overflow-wrap: anywhere;
}

.related {
    margin-top: 2rem;
}

/* Tablet: keep the header on one line without the long user label */
@media (min-width: 641px) and (max-width: 820px) {
    .nav-user {
        display: none;
    }

    .nav-link {
        padding-inline: .5rem;
    }
}

/* Very small phones (320px) */
@media (max-width: 360px) {
    .header-inner {
        gap: .5rem;
    }

    .ad-thumb {
        flex-basis: 72px;
        width: 72px;
    }

    .ad-thumb img {
        width: 72px;
    }
}

/* Laptops and desktops */
@media (min-width: 1281px) {
    :root {
        --container: 1320px;
    }

    .layout-two {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

/* Full HD and above: wider content, proportionally larger spacing and type (kept readable, not oversized) */
@media (min-width: 1921px) {
    :root {
        --container: 1680px;
    }

    html {
        font-size: 112.5%;
    }

    .layout-two {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 2.5rem;
    }

    .ad-detail {
        grid-template-columns: minmax(0, 1fr) 400px;
    }
}

/* 4K and projectors */
@media (min-width: 2561px) {
    :root {
        --container: 2000px;
    }

    html {
        font-size: 125%;
    }
}

/* Long-form text never gets excessively wide lines */
.ad-content,
.privacy,
.page-intro {
    max-width: 75ch;
}

/* Touch targets and focus */
.cat-chip {
    min-height: var(--button-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--sky-500);
    outline-offset: 2px;
}

.skip-link:focus {
    outline-offset: 0;
}

/* Logout (a <button> styled like a nav link): same metrics as .nav-link, no native chrome */
.nav-link-button {
    background: none;
    border: 0;
    cursor: pointer;
}

.nav-link:focus-visible {
    outline: 3px solid var(--sky-500);
    outline-offset: 2px;
}

/* Keep large displays from stretching buttons: only .btn-block fills its container */
@media (min-width: 1921px) {
    .btn-block {
        max-width: 100%;
    }

    .auth-card .btn-block {
        max-width: none;
    }
}

/* Single-line controls match standard button height exactly at every root font size */
input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=search],
select {
    height: var(--control-height);
    padding-block: 0;
}