/* ── Chat page layout (Figma 3:1431) ──────────────── */
.dchat {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 90px);
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
    background: transparent;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
}

.dchat__messages {
    flex: 1;
    padding: 32px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Bubbles ──────────────────────────────────────── */
.dchat__bubble {
    animation: dchat-fade 0.3s ease;
    max-width: 100%;
}

.dchat__bubble-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.dchat__avatar {
    width: 41px;
    height: 41px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.dchat__avatar--user {
    display: none;
}

.dchat__avatar--bot {
    background: #fff;
    color: #3f5b65;
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
}

.dchat__avatar--bot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.dchat__sender {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 200;
    color: #8d8d8d;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dchat__text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.59;
    color: #000;
}

.dchat__text strong { font-weight: 600; }
.dchat__text em     { font-style: italic; }
.dchat__text code   {
    background: rgba(0, 0, 0, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.92em;
}

/* Bot bubble: no background, avatar + text */
.dchat__bubble--bot {
    align-self: flex-start;
    max-width: 80%;
    padding-left: 72px;
    position: relative;
    padding-top: 10px;
}

.dchat__bubble--bot .dchat__bubble-header {
    position: absolute;
    left: 0;
    top: 0;
    margin-bottom: 0;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dchat__bubble--bot .dchat__sender {
    font-size: 11px;
    font-weight: 300;
    text-transform: none;
}

/* User bubble: dark pill, right-aligned */
.dchat__bubble--user {
    align-self: flex-end;
    max-width: 60%;
}

.dchat__bubble--user .dchat__bubble-header {
    display: none;
}

.dchat__bubble--user .dchat__text {
    background: #181913;
    color: #fff;
    font-weight: 500;
    font-size: 16px;
    line-height: 1;
    padding: 17px 24px;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    display: inline-block;
}

/* ── Quick reply pills (clarifying buttons) ───────── */
.dchat__quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0 52px;
}

.dchat__chip {
    display: inline-flex;
    align-items: center;
    height: 37px;
    padding: 6px 24px;
    background: #fff;
    border: 1px solid #c7c7c7;
    border-radius: 32px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s;
}

.dchat__chip:hover {
    border-color: #181913;
    background: #f5f5f5;
}

/* ── Typing indicator ─────────────────────────────── */
.dchat__typing {
    display: flex;
    gap: 5px;
    padding: 8px 0;
    margin-left: 52px;
    align-items: center;
    animation: dchat-fade 0.3s ease;
}

.dchat__typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c7c7c7;
    animation: dchat-bounce 1.3s infinite ease-in-out;
}

.dchat__typing-dot:nth-child(2) { animation-delay: 0.2s; }
.dchat__typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dchat-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

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

/* Labeled typing indicator — used in simple mode while web_search runs.
   Shows "Searching the web…" instead of just dots, since web_search
   blocks for 5–15s and pure dots feel like the chat is hanging. */
.dchat__typing--label {
    padding: 10px 14px;
    background: #f4f4f4;
    border-radius: 14px;
    width: fit-content;
    margin-top: 4px;
    margin-bottom: 4px;
}
.dchat__typing-label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #6f6f6f;
    font-style: italic;
    position: relative;
    padding-right: 18px;
}
.dchat__typing-label::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid #c7c7c7;
    border-top-color: transparent;
    border-radius: 50%;
    animation: dchat-spin 0.9s linear infinite;
}
@keyframes dchat-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Markdown card list — used when the model returns a "**Project Name**"
   bullet followed by Price/Size/Note details. The frontend parser groups
   them into discrete cards regardless of how the model indented them, so
   each project is a self-contained block with a visible separator. */
.dchat__text .dchat__md-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 10px;
}
.dchat__text .dchat__md-card {
    background: #fafafa;
    border: 1px solid #ececec;
    border-left: 3px solid #c39d6d;
    border-radius: 8px;
    padding: 10px 14px;
}
.dchat__text .dchat__md-card-head {
    font-family: 'Lora', serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.35;
    margin-bottom: 6px;
}
.dchat__text .dchat__md-card-head-tail {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6f6f6f;
    margin-left: 4px;
}
.dchat__text .dchat__md-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dchat__text .dchat__md-card-list > li {
    position: relative;
    padding-left: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: #4a4a4a;
}
.dchat__text .dchat__md-card-list > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 4px;
    height: 1.5px;
    background: #b8b8b8;
}
.dchat__text .dchat__md-card-orphan {
    font-size: 13px;
    color: #4a4a4a;
    margin-bottom: 4px;
}

/* Plain markdown lists (no project headers) — used when the model returns
   a flat list of points without bold names. */
.dchat__text .dchat__md-ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dchat__text .dchat__md-ul > li {
    position: relative;
    padding-left: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}
.dchat__text .dchat__md-ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c39d6d;
}
.dchat__text .dchat__md-ul .dchat__md-sub-ul {
    list-style: none;
    padding: 4px 0 2px;
    margin: 0 0 0 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dchat__text .dchat__md-ul .dchat__md-sub-ul > li {
    position: relative;
    padding-left: 12px;
    font-size: 13px;
    color: #4a4a4a;
}
.dchat__text .dchat__md-ul .dchat__md-sub-ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 1.5px;
    background: #b8b8b8;
}
.dchat__text .dchat__md-ul strong {
    color: #1a1a1a;
}

/* Source chips — web_search citations under a bot bubble (simple mode). */
.dchat__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #ececec;
}
.dchat__source-chip {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 10px;
    background: #f4f4f4;
    border: 1px solid #e6e6e6;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: #4a4a4a;
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}
.dchat__source-chip:hover {
    background: #ebebeb;
    color: #1a1a1a;
}

/* ── Welcome screen ───────────────────────────────── */
.dchat__welcome {
    text-align: center;
    padding: 60px 0 40px;
}

.dchat__welcome-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 38px;
    font-weight: 400;
    color: #000;
    letter-spacing: 0.3px;
    line-height: 34px;
    margin: 0 0 24px;
}

.dchat__welcome-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #5a554c;
    margin: 0 0 32px;
}

.dchat__welcome-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 545px;
    margin: 0 auto;
}

.dchat__welcome-tags .dchat__chip {
    height: 40px;
    padding: 0 13px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 0, 0, 0.12);
    border-radius: 9999px;
    box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.02), 0 0 2px 0 rgba(0, 0, 0, 0.05);
}

/* ── Bottom input (sticky pill) ───────────────────── */
.dchat__bottom {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 0 -20px;
    padding: 32px 20px 20px;
}

.dchat__bottom::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(252, 252, 252, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%, #000 100%);
            mask-image: linear-gradient(to bottom, transparent 0%, #000 45%, #000 100%);
    pointer-events: none;
}

.dchat__input-area {
    position: relative;
    z-index: 2;
    max-width: 1286px;
    margin: 0 auto;
}

.dchat__input-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 119px;
    box-shadow: 4px 4px 4.4px 0 rgba(0, 0, 0, 0.12);
    padding: 8px 8px 8px 32px;
    height: 64px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    isolation: isolate;
}

.dchat__input-wrap:focus-within {
    border-color: #181913;
    box-shadow: 4px 4px 8px 0 rgba(0, 0, 0, 0.14);
}

.dchat__input {
    flex: 1;
    padding: 0;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    color: #000;
    background: transparent;
    border: none;
    outline: none;
    height: 100%;
}

.dchat__input::placeholder {
    color: #9a9a9a;
}

.dchat__send {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #181913;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}

.dchat__send:hover {
    background: #000;
}

.dchat__send:active {
    transform: scale(0.93);
}

.dchat__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dchat__disclaimer {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #9a9a9a;
    margin: 10px 0 0;
    line-height: 1.59;
}

/* ── Property cards (horizontal scroll) ───────────── */
.dchat__properties {
    margin: 8px 0 0 52px;
    max-width: calc(100% - 52px);
}

.dchat__properties-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 16px;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-color: #e1e1e1 #f4f4f4;
}

.dchat__properties-scroll::-webkit-scrollbar {
    height: 10px;
}

.dchat__properties-scroll::-webkit-scrollbar-track {
    background: #f4f4f4;
    border-radius: 25px;
}

.dchat__properties-scroll::-webkit-scrollbar-thumb {
    background: #e1e1e1;
    border-radius: 25px;
}

/* ── Property card — matches MyHome theme card visual language ─────
   Theme palette snapshot (from Elementor kit):
     --lprimary1: #3F5B65  slate-teal (price + featured accent)
     --lcolor1:   #1A1A1A  dark text
     --lcolor2:   #6B6B6B  muted text
     --lcolor3:   #E5E5E5  border
     --lcolor4:   #F7F8FA  chip bg
   Fonts: Lora (serif) for title/price, DM Sans for chips/body. */

.dchat__prop {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 400px;
    max-width: 92vw;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    scroll-snap-align: start;
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dchat__prop:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.10);
}

.dchat__prop-img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #F7F8FA;
    overflow: hidden;
}

/* Image slider: horizontal flex track, each slide = 100% of wrap width. */
.dchat__prop-slider-track {
    position: absolute;
    inset: 0;
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.dchat__prop-slide {
    flex: 0 0 100%;
    position: relative;
    height: 100%;
}

.dchat__prop-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dchat__prop-img--empty {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #F7F8FA 0%, #E5E5E5 100%);
}

/* Slider nav arrows — show on hover (desktop), always visible on touch. */
.dchat__prop-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.15s;
    z-index: 2;
    padding: 0;
}

.dchat__prop-slider-btn svg {
    width: 16px;
    height: 16px;
    stroke: #1A1A1A;
}

.dchat__prop-slider-btn:hover {
    background: #fff;
}

.dchat__prop-slider-btn--prev { left: 8px; }
.dchat__prop-slider-btn--next { right: 8px; }

.dchat__prop-img-wrap:hover .dchat__prop-slider-btn {
    opacity: 1;
}

.dchat__prop-slider-btn[disabled] {
    opacity: 0 !important;
    pointer-events: none;
}

/* Dots pagination at the bottom of the image. */
.dchat__prop-slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.dchat__prop-slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.15s, width 0.15s;
}

.dchat__prop-slider-dot--active {
    background: #fff;
    width: 18px;
    border-radius: 3px;
}

/* Badge strip (top-left of image). Stacks vertically when 2+ badges. */
.dchat__prop-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.dchat__prop-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 5px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #FFFFFF;
    background: #4A6B5D;    /* default — "NEW OFF-PLAN" mirrors theme FOR SALE */
}

.dchat__prop-badge--featured { background: #3F5B65; }  /* primary accent — theme FEATURED */
.dchat__prop-badge--new      { background: #4A6B5D; }  /* forest — theme FOR SALE */
.dchat__prop-badge--resale   { background: #3B5670; }  /* muted blue — theme FOR RENT */
.dchat__prop-badge--sold     { background: #6B3E3E; }  /* maroon — theme SOLD */

.dchat__prop-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.dchat__prop-title {
    font-family: 'Lora', Georgia, serif;
    font-size: 20px;
    font-weight: 500;
    color: #1A1A1A;
    line-height: 1.3;
    letter-spacing: -0.1px;
    overflow-wrap: anywhere;
}

.dchat__prop-dev {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #6B6B6B;
    font-style: italic;
    margin-top: -4px;  /* tighten under title */
}

.dchat__prop-location {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #6B6B6B;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dchat__prop-location svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #3F5B65;  /* accent pin matches theme primary */
}

.dchat__prop-price {
    font-family: 'Lora', Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: #3F5B65;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.dchat__prop-price-ccy,
.dchat__prop-price-from {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6B6B6B;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

.dchat__prop-price-from { margin-right: 6px; }
.dchat__prop-price-ccy  { margin-right: 4px; }

/* Attribute chips row — bed / handover / completion. Mirrors
   .myhome-attribute geometry (30px height, 2px radius, 5px icon gap). */
.dchat__prop-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dchat__prop-attr {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    background: #F7F8FA;
    border-radius: 2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6B6B6B;
    line-height: 1;
}

.dchat__prop-attr svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #1A1A1A;
}

/* Investment chips — same geometry, accent tint to signal value. */
.dchat__prop-attr--invest {
    background: rgba(63, 91, 101, 0.10);
    color: #25383F;
    font-weight: 500;
}

.dchat__prop-attr--invest svg {
    color: #3F5B65;
}

/* Footer row — Learn more (primary) + Call + WhatsApp. Mirrors
   theme .myhome-listing-card__bottom with top border separator. */
.dchat__prop-actions {
    margin: auto -20px -20px;
    padding: 14px 20px;
    border-top: 1px solid #E5E5E5;
    display: flex;
    gap: 8px;
    align-items: center;
}

.dchat__prop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #E5E5E5;
    border-radius: 5px;
    background: #FFFFFF;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1A1A1A;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dchat__prop-btn:hover {
    background: #F7F8FA;
    border-color: #3F5B65;
}

.dchat__prop-btn[disabled],
.dchat__prop-btn[disabled]:hover {
    opacity: 0.45;
    cursor: not-allowed;
    background: #fff;
    border-color: #E5E5E5;
}

/* Primary — Learn more. Gold fill, mirrors theme CTA accent. */
.dchat__prop-btn--learn {
    flex: 1;
    background: #3F5B65;
    border-color: #3F5B65;
    color: #FFFFFF;
}

.dchat__prop-btn--learn:hover {
    background: #3F5B65;
    border-color: #3F5B65;
    color: #FFFFFF;
}

.dchat__prop-btn--whatsapp {
    color: #25D366;
    border-color: #E5E5E5;
    padding: 0;
    width: 38px;
}

.dchat__prop-btn--whatsapp:hover {
    background: #E6F9EE;
    border-color: #25D366;
}

.dchat__prop-btn svg {
    width: 15px;
    height: 15px;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .dchat {
        padding: 0 12px;
    }

    .dchat__welcome-title {
        font-size: 28px;
        line-height: 32px;
    }

    .dchat__bubble--bot {
        padding-left: 44px;
    }

    .dchat__bubble--bot .dchat__bubble-header .dchat__avatar {
        width: 36px;
        height: 36px;
    }

    .dchat__bubble--user .dchat__text {
        font-size: 15px;
        padding: 14px 18px;
    }

    .dchat__text {
        font-size: 15px;
    }

    .dchat__quick-replies,
    .dchat__typing,
    .dchat__properties {
        margin-left: 44px;
    }

    .dchat__chip {
        font-size: 14px;
        padding: 6px 16px;
    }

    .dchat__prop {
        width: 320px;
    }

    /* Mobile: always show arrow nav (no hover state on touch devices). */
    .dchat__prop-img-wrap .dchat__prop-slider-btn {
        opacity: 0.85;
    }

    .dchat__input-wrap {
        height: 56px;
        padding: 6px 6px 6px 20px;
    }

    .dchat__input {
        font-size: 16px;
    }

    .dchat__send {
        width: 44px;
        height: 44px;
    }
}

/* ── Lead form (inline, inside a bot bubble) ────────── */
.dchat__bubble--lead {
    max-width: 440px;
}

.dchat__lead-inline {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    padding: 22px 22px 18px;
    font-family: Inter, system-ui, sans-serif;
}

.dchat__lead-title {
    font-family: Lora, Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #111;
}

.dchat__lead-sub {
    font-size: 14px;
    color: #6a6a6a;
    margin: 0 0 16px;
    line-height: 1.4;
}

.dchat__lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dchat__lead-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.dchat__lead-label input {
    height: 42px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    color: #111;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}
.dchat__lead-label input:focus {
    border-color: #111;
    background: #fff;
}
.dchat__lead-label input::placeholder { color: #bdbdbd; }

.dchat__lead-error {
    min-height: 16px;
    font-size: 13px;
    color: #c0392b;
    margin: 0;
}

.dchat__lead-submit {
    height: 44px;
    border: none;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}
.dchat__lead-submit:hover:not(:disabled) { background: #262626; }
.dchat__lead-submit:active { transform: scale(0.99); }
.dchat__lead-submit:disabled { opacity: 0.6; cursor: wait; }

.dchat__lead-done {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    padding: 14px 16px;
    background: #f5f5f2;
    border-radius: 12px;
}

@media (max-width: 480px) {
    .dchat__bubble--lead { max-width: 100%; }
    .dchat__lead-inline { padding: 18px 16px 14px; border-radius: 14px; }
    .dchat__lead-title { font-size: 18px; }
}

/* Shake + highlight when the user tries to type with the composer locked */
@keyframes dchatLeadShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.dchat__bubble--lead.dchat__bubble--attention .dchat__lead-inline {
    animation: dchatLeadShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

/* ── Required-field marker in lead form ──────────────── */
.dchat__lead-req {
    color: #d14343;
    font-style: normal;
    font-weight: 500;
    margin-left: 2px;
}

/* ── intl-tel-input — make it blend with lead form inputs ─ */
.dchat__lead-label .iti {
    display: block;
    width: 100%;
}
.dchat__lead-label .iti__tel-input,
.dchat__lead-label .iti input[type="tel"] {
    width: 100%;
    height: 42px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #111;
    background: #fafafa;
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}
.dchat__lead-label .iti__tel-input:focus,
.dchat__lead-label .iti input[type="tel"]:focus {
    border-color: #111;
    background: #fff;
}
/* Country dropdown button — flatten and align with input background */
.dchat__lead-label .iti__selected-flag {
    border-radius: 10px 0 0 10px;
    padding: 0 8px 0 12px;
    background: transparent;
}
.dchat__lead-label .iti--separate-dial-code .iti__selected-flag {
    background: #f0f0f0;
}
.dchat__lead-label .iti--separate-dial-code .iti__selected-dial-code {
    color: #333;
    font-size: 15px;
}
.dchat__lead-label .iti__country-list {
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    max-height: 260px;
    font-size: 14px;
}

/* ── Daily-limit notice (renders after 3 full searches) ─── */
.dchat__limit-notice {
    align-self: flex-start;
    max-width: 560px;
    background: #fffaf2;
    border: 1px solid #f0d9a8;
    border-radius: 16px;
    padding: 18px 20px;
    font-family: Inter, system-ui, sans-serif;
    animation: dchat-fade 0.3s ease;
}

.dchat__limit-title {
    font-family: Lora, Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: #8a5a1a;
    margin-bottom: 4px;
}

.dchat__limit-sub {
    font-size: 14px;
    color: #5a4a32;
    margin-bottom: 14px;
    line-height: 1.45;
}

.dchat__limit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .dchat__limit-notice { padding: 16px; border-radius: 14px; }
    .dchat__limit-title  { font-size: 16px; }
}

/* ── Project detail modal ────────────────────────────────
   Opens on "Learn more". Big gallery + facts + web-search-generated
   description with source chips. */
.dchat__modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 14, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: dchatModalFadeIn 0.2s ease;
}

@keyframes dchatModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dchat__modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35);
    animation: dchatModalSlideIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes dchatModalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dchat__modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    transition: background 0.15s;
}
.dchat__modal-close:hover { background: rgba(0, 0, 0, 0.75); }
.dchat__modal-close svg { width: 16px; height: 16px; }

.dchat__modal-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #eee;
    overflow: hidden;
}

.dchat__modal-gallery-track {
    position: absolute;
    inset: 0;
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.dchat__modal-slide {
    flex: 0 0 100%;
    position: relative;
    height: 100%;
}

.dchat__modal-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dchat__modal-body {
    padding: 24px 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dchat__modal-title {
    font-family: 'Lora', 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: #1a1814;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.dchat__modal-dev {
    margin: -4px 0 0;
    font-size: 14px;
    color: #8d8d8d;
    font-style: italic;
}

.dchat__modal-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
    margin-top: 4px;
    padding: 14px 16px;
    background: #faf8f3;
    border-radius: 10px;
    font-size: 13px;
}

.dchat__modal-fact {
    display: flex;
    flex-direction: column;
}
.dchat__modal-fact-k {
    color: #8d8d8d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.dchat__modal-fact-v {
    color: #1a1814;
    font-weight: 500;
}

.dchat__modal-insight {
    margin-top: 6px;
}

.dchat__modal-insight-header {
    font-size: 13px;
    font-weight: 600;
    color: #8d8d8d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.dchat__modal-insight-text {
    font-size: 14px;
    line-height: 1.65;
    color: #332e25;
}
.dchat__modal-insight-text p { margin: 0 0 12px; }
.dchat__modal-insight-text p:last-child { margin-bottom: 0; }
.dchat__modal-insight-text strong { color: #1a1814; font-weight: 600; }
.dchat__modal-insight-text a {
    color: #0b6b4a;
    text-decoration: none;
    border-bottom: 1px dashed #0b6b4a;
}

.dchat__modal-insight-error {
    font-size: 14px;
    color: #a04d39;
    padding: 14px;
    background: #faeee8;
    border-radius: 8px;
}

/* Shimmer placeholders while insight is loading (first view is ~10-30s
   because of web_search). Keeps the modal from looking broken. */
.dchat__modal-shimmer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 2px;
}
.dchat__shimmer-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #efece5 0%, #f7f4ee 50%, #efece5 100%);
    background-size: 200% 100%;
    animation: dchatShimmer 1.4s ease infinite;
}
.dchat__shimmer-line--short { width: 60%; }
@keyframes dchatShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.dchat__shimmer-hint {
    font-size: 12px;
    color: #a39e92;
    font-style: italic;
    margin-top: 4px;
}

.dchat__modal-sources-label {
    font-size: 11px;
    font-weight: 600;
    color: #8d8d8d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 14px 0 6px;
}

.dchat__modal-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dchat__modal-source {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f4f1eb;
    border: 1px solid #e8e3d6;
    border-radius: 999px;
    font-size: 12px;
    color: #5a554c;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.dchat__modal-source:hover {
    background: #ebe6d9;
    border-color: #d9d1bf;
}

.dchat__modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.dchat__modal-actions .dchat__prop-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 14px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .dchat__modal-overlay { padding: 0; }
    .dchat__modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .dchat__modal-body { padding: 18px 18px 22px; }
    .dchat__modal-title { font-size: 22px; }
    .dchat__modal-facts { grid-template-columns: 1fr 1fr; padding: 12px; }
}

/* Learn-more button — subtle accent variant of the prop-btn. */

