/* =====================================================================
   Dashboard listing cards (staff / agent / provider)
   Markup: templates/partials/dashboard_card.html
   Data:   properties/dashboard_cards.py

   Plain CSS on purpose rather than Tailwind @apply in base.html: the card
   has enough moving parts (band, carousel, action rows, More dialog)
   that it reads better as one component, and it doesn't depend on the
   Tailwind CDN's JIT pass to look right on first paint.

   Layout:
     band (who / status)  ->  photo with arrows, counter, video
     ->  price, title, location  ->  facts + WhatsApp / call / email
     ->  two action rows: tools (Edit, Photos, Location, More) over
         state switches (Availability, Publish, Archive, Delete).
   The More button opens .knd-more-dialog (bottom of this file).
   ===================================================================== */

.knd-dcard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    /* Cards in a row share a height, so their action strips line up. */
    align-items: stretch;
}

.knd-dcard {
    --dc-ink: #1e293b;          /* slate-800 */
    --dc-muted: #64748b;        /* slate-500 */
    --dc-line: #e2e8f0;         /* slate-200 */
    --dc-soft: #f8fafc;         /* slate-50  */
    --dc-teal: #0f766e;         /* teal-700  */
    --dc-teal-bright: #0d9488;  /* teal-600  */
    --dc-green: #15803d;        /* green-700 */
    --dc-red: #dc2626;          /* red-600   */

    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--dc-line);
    border-radius: 0.75rem;
    background: #fff;
    color: var(--dc-ink);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    container-type: inline-size;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.knd-dcard:hover {
    border-color: #cbd5e1;      /* slate-300 */
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.10);
}
.knd-dcard:has(.knd-dcard-link:focus-visible) {
    outline: 3px solid #5eead4; /* teal-300 */
    outline-offset: 2px;
}

/* The whole card opens the listing's private detail page: the title link
   is stretched over the card, and everything interactive (arrows,
   contact buttons, owner band, action rows) sits above it. */
.knd-dcard-link {
    color: inherit;
    text-decoration: none;
}
.knd-dcard-link:focus { outline: none; }
.knd-dcard-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.knd-dcard-float,
.knd-dcard-nav,
.knd-dcard-contact,
.knd-dcard-actions {
    position: relative;
    z-index: 2;
}

/* Dashboard pages give every <form> vertical spacing (base.html:
   `main form { space-y-4 }`), which would push each button below its
   hidden CSRF input. Card forms are single inline controls. */
.knd-dcard form { margin: 0; }
.knd-dcard form > * { margin-top: 0 !important; }

.knd-dcard :focus-visible {
    outline: 2px solid var(--dc-teal-bright);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Band — staff: who owns it; agent/provider: where it is in approval
   --------------------------------------------------------------------- */
.knd-dcard-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0.5rem 0.75rem;
    color: #fff;
    background: var(--dc-teal);
}
.knd-dcard-band--agent    { background: #c2410c; }                 /* orange-700 */
.knd-dcard-band--provider { background: #fbbf24; color: #422006; } /* amber-400  */
.knd-dcard-band--knd      { background: var(--dc-teal); }
.knd-dcard-band--pending  { background: #fbbf24; color: #422006; }
.knd-dcard-band--live     { background: var(--dc-teal); }
.knd-dcard-band--archived { background: #475569; }                 /* slate-600  */

.knd-dcard-logo {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    overflow: hidden;
    border-radius: 0.375rem;
    background: #fff;
    color: var(--dc-teal);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.knd-dcard-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.knd-dcard-band-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    line-height: 1.2;
}
.knd-dcard-band-name {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.925rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.knd-dcard-band-sub {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.85;
    white-space: nowrap;
}
.knd-dcard-band-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.925rem;
    font-weight: 700;
}

/* ---------------------------------------------------------------------
   Photo + carousel
   --------------------------------------------------------------------- */
.knd-dcard-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e2e8f0;
    touch-action: pan-y; /* horizontal swipes page through photos */
}
.knd-dcard-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.knd-dcard-nophoto {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--dc-muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.knd-dcard-nophoto i { font-size: 1.6rem; opacity: 0.7; }

.knd-dcard-chips {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 2;
    display: flex;
    max-width: calc(100% - 4rem);
    flex-wrap: wrap;
    gap: 0.35rem;
    pointer-events: none;
}
.knd-dcard-chip {
    padding: 0.15rem 0.55rem;
    border-radius: 0.375rem;
    background: #fff;
    color: var(--dc-ink);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.knd-dcard-chip--pending  { background: #fef3c7; color: #78350f; } /* amber-100/900 */
.knd-dcard-chip--live     { background: #ccfbf1; color: #115e59; } /* teal-100/800  */
.knd-dcard-chip--archived { background: #e2e8f0; color: #334155; }
.knd-dcard-chip--off      { background: #dc2626; color: #fff; }

.knd-dcard-float {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.45);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease;
}
.knd-dcard-float:hover { background: rgba(15, 23, 42, 0.7); color: #fff; }
.knd-dcard-public {
    top: 0.6rem;
    right: 0.6rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.95rem;
}
.knd-dcard-video {
    bottom: 0.6rem;
    left: 0.6rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.knd-dcard-nav {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: -1.125rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.35);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.knd-dcard-nav:hover { background: rgba(15, 23, 42, 0.65); }
.knd-dcard-nav--prev { left: 0.6rem; }
.knd-dcard-nav--next { right: 0.6rem; }

.knd-dcard-count {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    z-index: 2;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: none;
}

/* ---------------------------------------------------------------------
   Body
   --------------------------------------------------------------------- */
.knd-dcard-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.75rem 0.875rem 0.875rem;
}
.knd-dcard-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.5rem;
    margin: 0;
}
.knd-dcard-price-amt {
    color: var(--dc-teal);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}
.knd-dcard-price-pre,
.knd-dcard-price-per {
    color: var(--dc-muted);
    font-size: 0.8rem;
    font-weight: 600;
}
/* Amount and "/month" stay glued together when the row wraps. */
.knd-dcard-price-main { white-space: nowrap; }
.knd-dcard-price-per { margin-left: 0.15rem; }
.knd-dcard-price-none { color: var(--dc-muted); font-size: 1rem; }
.knd-dcard-deposit {
    color: var(--dc-muted);
    font-size: 0.8rem;
}

.knd-dcard-title {
    margin: 0;
    overflow: hidden;
    color: var(--dc-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.knd-dcard-title-suffix {
    color: var(--dc-muted);
    font-weight: 500;
}

.knd-dcard-loc,
.knd-dcard-units {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    overflow: hidden;
    color: #475569; /* slate-600 */
    font-size: 0.85rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.knd-dcard-loc i { color: var(--dc-teal-bright); }
.knd-dcard-units { color: var(--dc-muted); font-size: 0.8rem; }

.knd-dcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.85rem;
    margin: 0.15rem 0 0;
    color: var(--dc-muted);
    font-size: 0.75rem;
}
.knd-dcard-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.knd-dcard-kcode {
    color: var(--dc-ink);
    font-weight: 700;
}

.knd-dcard-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.6rem;
}
.knd-dcard-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
}
.knd-dcard-facts span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.knd-dcard-facts img {
    width: 1rem;
    height: 1rem;
    opacity: 0.75;
}

.knd-dcard-contact {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}
.knd-dcard-contact a {
    display: inline-flex;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.4rem;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease;
}
.knd-dcard-wa {
    padding: 0 0.8rem;
    border: 1.5px solid var(--dc-green);
    color: var(--dc-green);
}
.knd-dcard-wa i { font-size: 1.05rem; }
.knd-dcard-wa:hover { background: #f0fdf4; color: var(--dc-green); }
.knd-dcard-call,
.knd-dcard-mail { width: 2.35rem; }
.knd-dcard-call {
    border: 1.5px solid var(--dc-red);
    color: var(--dc-red);
}
.knd-dcard-call:hover { background: #fef2f2; color: var(--dc-red); }
.knd-dcard-mail {
    border: 1.5px solid #cbd5e1;
    color: #475569;
}
.knd-dcard-mail:hover { background: var(--dc-soft); color: var(--dc-ink); }
.knd-dcard-nocontact {
    color: var(--dc-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* Narrow cards: the WhatsApp button keeps its icon and drops the word. */
@container (max-width: 21rem) {
    .knd-dcard-wa { width: 2.35rem; padding: 0; }
    .knd-dcard-wa span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ---------------------------------------------------------------------
   Action strip — what this viewer can do to the listing
   --------------------------------------------------------------------- */
.knd-dcard-actions {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--dc-line);
    background: var(--dc-soft);
}
/* Each row shares its width equally among however many buttons this
   viewer gets, so a Field Agent's lone Availability switch fills its row. */
.knd-dcard-actrow {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
}
/* Scoped under .knd-dcard-actions so it outranks .knd-dcard-act's
   `border: 0` — otherwise link cells (Edit, Photos) lose their divider. */
.knd-dcard-actions .knd-dcard-actrow > * + * { border-left: 1px solid var(--dc-line); }
.knd-dcard-actrow form { display: flex; }
/* The state row sits a shade darker: tools above, switches below. */
.knd-dcard-actrow--state {
    border-top: 1px solid var(--dc-line);
    background: #eef2f6;
}

.knd-dcard-act {
    display: flex;
    width: 100%;
    min-height: 3rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #334155; /* slate-700 */
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.knd-dcard-act i { font-size: 1.05rem; }
.knd-dcard-act:hover { background: #fff; color: var(--dc-teal); }
.knd-dcard-act.is-disabled,
.knd-dcard-act.is-disabled:hover {
    background: transparent;
    color: #94a3b8; /* slate-400 */
    cursor: not-allowed;
}

.knd-dcard-act--primary {
    background: var(--dc-teal-bright);
    color: #fff;
}
.knd-dcard-act--primary:hover { background: var(--dc-teal); color: #fff; }
.knd-dcard-act--danger { color: var(--dc-red); }
.knd-dcard-act--danger:hover { background: #fef2f2; color: #b91c1c; }

/* Availability is a state you flip, so it looks like a switch showing
   the current state rather than a verb button. */
.knd-dcard-switch-track {
    position: relative;
    display: inline-block;
    width: 1.9rem;
    height: 1.05rem;
    border-radius: 9999px;
    background: #cbd5e1;
    transition: background 0.15s ease;
}
.knd-dcard-switch-knob {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}
.knd-dcard-switch.is-on .knd-dcard-switch-track { background: #16a34a; }
.knd-dcard-switch.is-on .knd-dcard-switch-knob { transform: translateX(0.85rem); }
.knd-dcard-switch:not(.is-on) { color: #b91c1c; }

/* ---------------------------------------------------------------------
   Page furniture around a grid
   --------------------------------------------------------------------- */
.knd-dcard-empty {
    padding: 2rem 1rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
    color: var(--dc-muted);
    font-size: 0.9rem;
    text-align: center;
}
.knd-dcard-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin: 0 0 0.9rem;
    color: var(--dc-muted, #64748b);
    font-size: 0.85rem;
}
.knd-dcard-summary strong { color: #1e293b; }
.knd-dcard-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 700;
}

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

/* ---------------------------------------------------------------------
   Staff: the agency/provider band is a link to that partner
   (partials/dashboard_card.html). The link fills the band so the whole
   strip is the target, and sits above the card's stretched title link.
   --------------------------------------------------------------------- */
.knd-dcard-band--owner { padding: 0; }
.knd-dcard-owner {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    min-width: 0;
    align-self: stretch;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease;
}
.knd-dcard-owner:hover { background: rgba(0, 0, 0, 0.08); }
.knd-dcard-owner:hover .knd-dcard-band-name {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.knd-dcard-owner-hint { margin-left: 0.15rem; font-size: 0.8rem; }
.knd-dcard .knd-dcard-owner:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}
.knd-dcard .knd-dcard-band--provider .knd-dcard-owner:focus-visible { outline-color: #422006; }

/* =====================================================================
   Partner card — staff_dashboard/partials/partner_card.html
   On the Partners page and in the pop-up opened from a listing card's
   owner band. Its colour follows the partner type so the pop-up picks up
   the band that was clicked: orange for agencies, amber for providers.
   The body sits on tints of that colour rather than plain white; the
   actions live in a dark bar along the bottom.
   ===================================================================== */
.knd-pcard {
    --pc-accent: #0f766e;
    --pc-accent-2: #134e4a;
    --pc-deep: #134e4a;
    --pc-on-accent: #fff;
    --pc-chip: rgba(255, 255, 255, 0.18);
    --pc-chip-ring: rgba(255, 255, 255, 0.35);
    --pc-tint: #f0fdfa;
    --pc-tint-2: #ccfbf1;
    --pc-line: #99f6e4;
    --pc-ink: #0f172a;
    --pc-text: #334155;
    --pc-muted: #64748b;
    --pc-bar: #1e293b;
    --pc-bar-line: rgba(148, 163, 184, 0.22);

    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--pc-line);
    border-radius: 1.1rem;
    background: linear-gradient(180deg, var(--pc-tint) 0%, #f3f6f9 70%, #eef2f6 100%);
    color: var(--pc-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.knd-pcard--agent {
    --pc-accent: #c2410c;   /* orange-700: the agency band colour */
    --pc-accent-2: #7c2d12; /* orange-900 */
    --pc-deep: #9a3412;     /* orange-800 */
    --pc-tint: #fff7ed;     /* orange-50  */
    --pc-tint-2: #ffedd5;   /* orange-100 */
    --pc-line: #fed7aa;     /* orange-200 */
}
.knd-pcard--provider {
    --pc-accent: #fbbf24;   /* amber-400: the provider band colour */
    --pc-accent-2: #d97706; /* amber-600 */
    --pc-deep: #92400e;     /* amber-800 */
    --pc-on-accent: #422006;
    --pc-chip: rgba(66, 32, 6, 0.1);
    --pc-chip-ring: rgba(66, 32, 6, 0.22);
    --pc-tint: #fffbeb;     /* amber-50  */
    --pc-tint-2: #fef3c7;   /* amber-100 */
    --pc-line: #fde68a;     /* amber-200 */
}
.knd-pcard--listed:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 18px 36px -16px rgba(15, 23, 42, 0.3);
}
.knd-pcard a { text-decoration: none; }
.knd-pcard :focus-visible { outline: 2px solid #0d9488; outline-offset: 2px; }

/* Same fix as .knd-dcard forms: base.html's `main form { space-y-4 }`
   would push each action button below its hidden inputs. */
.knd-pcard form { margin: 0; }
.knd-pcard form > * { margin-top: 0 !important; }

/* --- banner ----------------------------------------------------------- */
.knd-pcard-banner {
    position: relative;
    height: 6.5rem;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.22) 0%, transparent 55%),
        linear-gradient(135deg, var(--pc-accent) 0%, var(--pc-accent-2) 100%);
    color: var(--pc-on-accent);
}
/* The partner type, drawn big and faint in the corner. */
.knd-pcard-watermark {
    position: absolute;
    right: -0.5rem;
    bottom: -1.4rem;
    font-size: 6.5rem;
    line-height: 1;
    opacity: 0.14;
    pointer-events: none;
}
.knd-pcard-chips {
    position: absolute;
    top: 0.9rem;
    left: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.knd-pcard-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}
.knd-pcard-chip--type {
    background: var(--pc-chip);
    box-shadow: inset 0 0 0 1px var(--pc-chip-ring);
    color: var(--pc-on-accent);
    backdrop-filter: blur(4px);
}
.knd-pcard-chip--active { background: rgba(255, 255, 255, 0.92); color: #047857; }
.knd-pcard-chip--archived { background: #1e293b; color: #fde68a; }
.knd-pcard-chip--active::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background: #10b981;
}

/* --- identity ---------------------------------------------------------- */
.knd-pcard-body {
    flex: 1;
    padding: 0 1.1rem 1.1rem;
}
.knd-pcard-id {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: -2.75rem;
}
.knd-pcard-avatar {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 5.5rem;
    height: 5.5rem;
    overflow: hidden;
    border-radius: 1rem;
    background: #fff; /* logos are drawn for a white ground */
    box-shadow: 0 0 0 4px var(--pc-tint), 0 10px 20px -8px rgba(15, 23, 42, 0.35);
    color: var(--pc-deep);
    font-size: 1.6rem;
    font-weight: 800;
}
.knd-pcard-avatar img { width: 100%; height: 100%; object-fit: cover; }
.knd-pcard-avatar--initials { background: var(--pc-tint-2); }

.knd-pcard-reach { display: flex; gap: 0.4rem; padding-bottom: 0.2rem; }
.knd-pcard-reach a {
    display: flex;
    width: 2.35rem;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    font-size: 0.95rem;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.knd-pcard-reach a:hover { transform: translateY(-1px); filter: brightness(0.96); }
.knd-pcard-wa   { background: #dcfce7; color: #15803d; }
.knd-pcard-call { background: var(--pc-tint-2); color: var(--pc-deep); }
.knd-pcard-mail { background: #e2e8f0; color: #334155; }

.knd-pcard-name {
    display: block;
    margin-top: 0.8rem;
    overflow: hidden;
    color: var(--pc-ink);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.knd-pcard-name:hover { color: var(--pc-deep); }
.knd-pcard-type {
    margin: 0.1rem 0 0;
    color: var(--pc-deep);
    font-size: 0.82rem;
    font-weight: 600;
}

/* --- numbers ------------------------------------------------------------ */
.knd-pcard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0.95rem 0 0;
}
.knd-pcard-stat {
    padding: 0.6rem 0.4rem 0.55rem;
    border-radius: 0.8rem;
    background: var(--pc-tint-2);
    box-shadow: inset 0 0 0 1px var(--pc-line);
    text-align: center;
}
.knd-pcard-stat-value {
    margin: 0;
    color: var(--pc-ink);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
}
.knd-pcard-stat-value.is-date { font-size: 0.85rem; line-height: 1.7; }
.knd-pcard-stat-label {
    margin: 0.1rem 0 0;
    color: var(--pc-deep);
    font-size: 0.7rem;
    font-weight: 600;
}

/* --- where / how to reach them ------------------------------------------ */
.knd-pcard-info {
    margin: 0.8rem 0 0;
    padding: 0.15rem 0.85rem;
    list-style: none;
    border-radius: 0.8rem;
    background: rgba(203, 213, 225, 0.35); /* slate-300, lightly */
    font-size: 0.85rem;
}
.knd-pcard-info li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.55rem 0;
}
.knd-pcard-info li + li { border-top: 1px solid rgba(148, 163, 184, 0.3); }
.knd-pcard-info i { flex-shrink: 0; width: 1rem; margin-top: 0.1rem; color: var(--pc-deep); text-align: center; }
.knd-pcard-info-main { min-width: 0; flex: 1; }
.knd-pcard-info-label { display: block; color: var(--pc-muted); font-size: 0.72rem; font-weight: 600; }
.knd-pcard-info-value {
    display: block;
    overflow: hidden;
    color: var(--pc-ink);
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}
a.knd-pcard-info-value:hover { color: var(--pc-deep); text-decoration: underline; }
.knd-pcard-info-value.is-missing { color: #94a3b8; font-weight: 500; }

/* --- actions: a dark bar along the bottom ------------------------------- */
.knd-pcard-bar {
    display: flex;
    background: var(--pc-bar);
}
.knd-pcard-actions {
    display: grid;
    flex: 1;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
}
.knd-pcard-bar .knd-pcard-actions > * + * { border-left: 1px solid var(--pc-bar-line); } /* outranks .knd-pcard-act { border: 0 } */
.knd-pcard-actions form { display: flex; }
.knd-pcard-act {
    display: flex;
    width: 100%;
    min-height: 3.4rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.knd-pcard-act i { font-size: 1.05rem; }
.knd-pcard-act:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.knd-pcard-act--listings i { color: #5eead4; }  /* teal-300    */
.knd-pcard-act--edit i     { color: #cbd5e1; }  /* slate-300   */
.knd-pcard-act--archive i  { color: #fcd34d; }  /* amber-300   */
.knd-pcard-act--restore i  { color: #6ee7b7; }  /* emerald-300 */
.knd-pcard-act--delete     { color: #fecaca; }
.knd-pcard-act--delete i   { color: #fca5a5; }  /* red-300     */
.knd-pcard-act--delete:hover { background: rgba(239, 68, 68, 0.18); color: #fff; }
.knd-pcard-close {
    display: flex;
    width: 3.4rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-left: 1px solid var(--pc-bar-line);
    background: #0f172a;
    color: #cbd5e1;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.knd-pcard-close:hover { background: #020617; color: #fff; }

/* ---------------------------------------------------------------------
   Dialogs: the partner pop-up and a listing card's More pop-up
   --------------------------------------------------------------------- */
html.knd-dialog-open { overflow: hidden; }  /* page stays put behind a pop-up */

.knd-pcard-dialog,
.knd-more-dialog {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: inherit;
}
.knd-pcard-dialog { width: min(28rem, calc(100vw - 2rem)); }
.knd-more-dialog  { width: min(34rem, calc(100vw - 2rem)); }
.knd-pcard-dialog::backdrop,
.knd-more-dialog::backdrop { background: rgba(15, 23, 42, 0.55); }

/* The partner card scrolls inside the dialog on a short screen; its
   action bar (close included) stays pinned to the bottom. */
.knd-pcard-dialog .knd-pcard {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 25px 50px -12px rgba(2, 6, 23, 0.5);
}
.knd-pcard-dialog .knd-pcard-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Loading / couldn't-load states, before the partner card arrives. */
.knd-pcard-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    border-radius: 1.1rem;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}
.knd-pcard-status p { flex-basis: 100%; margin: 0; }
.knd-pcard-status a,
.knd-pcard-status button {
    padding: 0.5rem 1rem;
    border: 0;
    border-radius: 0.6rem;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.knd-pcard-status a { background: #0d9488; color: #fff; }
.knd-pcard-status button { background: #e2e8f0; color: #334155; }
.knd-pcard-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid #99f6e4;
    border-top-color: #0f766e;
    border-radius: 50%;
    animation: knd-pcard-spin 0.7s linear infinite;
}
@keyframes knd-pcard-spin { to { transform: rotate(360deg); } }

/* --- More: description and features of one listing ---------------------- */
.knd-more {
    display: flex;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.1rem;
    background: #f3f6f9;
    color: #334155;
    box-shadow: 0 25px 50px -12px rgba(2, 6, 23, 0.5);
}
.knd-more-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.95rem 1.25rem;
    background:
        radial-gradient(120% 160% at 0% 0%, rgba(255, 255, 255, 0.16) 0%, transparent 50%),
        linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    color: #fff;
}
.knd-more-heading { min-width: 0; }
.knd-more-title {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
}
.knd-more-title span { font-weight: 600; opacity: 0.8; }
.knd-more-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.8rem;
    margin: 0.4rem 0 0;
    color: #ccfbf1;
    font-size: 0.8rem;
    font-weight: 600;
}
.knd-more-sub .knd-dcard-kcode {
    padding: 0.05rem 0.45rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}
.knd-more-x {
    display: flex;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}
.knd-more-x:hover { background: rgba(255, 255, 255, 0.26); }

.knd-more-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1.15rem;
    padding: 1.1rem 1.25rem 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.knd-more-section h3 {
    margin: 0 0 0.5rem;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
}
.knd-more-text {
    margin: 0;
    padding: 0.75rem 0.9rem;
    border-left: 3px solid #14b8a6;
    border-radius: 0 0.6rem 0.6rem 0;
    background: #e8eef3;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.6;
}
.knd-more-group + .knd-more-group { margin-top: 0.7rem; }
.knd-more-group h4 {
    margin: 0 0 0.35rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}
.knd-more-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.knd-more-chips li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem 0.35rem 0.55rem;
    border-radius: 9999px;
    background: #dcefeb;
    color: #134e4a;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}
/* The feature's Lucide icon, recoloured through a mask. */
.knd-more-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    background: #0f766e;
    -webkit-mask: var(--icon) center / contain no-repeat;
            mask: var(--icon) center / contain no-repeat;
}
.knd-more-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 0.8rem;
    color: #64748b;
    text-align: center;
}
.knd-more-empty i { font-size: 1.6rem; opacity: 0.6; }
.knd-more-empty p { margin: 0; font-weight: 600; }
.knd-more-empty a { color: #0f766e; font-weight: 700; text-decoration: none; }
.knd-more-empty a:hover { text-decoration: underline; }

.knd-more-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #dbe3ea;
    background: #e8eef3;
}
.knd-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #0f766e;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}
.knd-more-link:hover { text-decoration: underline; }
.knd-more-close {
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: 0.6rem;
    background: #1e293b;
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
.knd-more-close:hover { background: #0f172a; }
.knd-more-dialog :focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.knd-more-body :focus-visible,
.knd-more-foot :focus-visible { outline-color: #0d9488; }

/* --- opening motion ------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
    .knd-pcard-dialog[open],
    .knd-more-dialog[open] { animation: knd-pop-in 0.16s ease-out; }
    .knd-pcard-dialog[open]::backdrop,
    .knd-more-dialog[open]::backdrop { animation: knd-pop-fade 0.16s ease-out; }
}
@media (prefers-reduced-motion: reduce) {
    .knd-pcard-spinner { animation-duration: 2s; }
    .knd-pcard,
    .knd-pcard * { transition: none !important; }
}
@keyframes knd-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes knd-pop-fade { from { opacity: 0; } to { opacity: 1; } }
