/* Ask Mr. K chat widget styles (loaded without blocking the page; markup in resources/views/front/partials/chatbot-widget.blade.php) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap');
  #keystone-chat-widget{
    --navy-deep:#092037;   /* Keystone LIV navy */
    --navy-panel:#14365A;
    --gold:#C18632;        /* Keystone LIV gold */
    --gold-light:#E0AE52;
    --paper:#F7F4EC;
    --paper-dim:#EAE4D3;
    --ink:#1C2833;
    --ink-soft:#5B6B78;
    --line:rgba(201,154,60,0.28);
    --line-strong:rgba(201,154,60,0.55);
  }
  /* Scoped reset — only affects elements inside the widget, never the host page */
  #keystone-chat-widget, #keystone-chat-widget *{box-sizing:border-box;margin:0;padding:0;}

  /* Fixed positioning wrapper so the widget floats over your site's own layout
     instead of taking over the page like the standalone demo did.
     Every rule below is prefixed with #keystone-chat-widget so nothing here
     can ever leak out and affect your site's own CSS (e.g. Bootstrap's .row,
     generic .chip/.avatar/.bubble classes, etc). */
  #keystone-chat-widget{
    position:fixed;right:24px;bottom:24px;z-index:9999;
    display:flex;align-items:flex-end;justify-content:flex-end;
    font-family:'Inter',sans-serif;line-height:normal;text-align:left;
  }
  #keystone-chat-widget #launcher-wrap, #keystone-chat-widget #panel{position:relative;}

  /* ---------- Launcher + greeting nudge ---------- */
  #keystone-chat-widget #launcher-wrap{display:flex;align-items:center;gap:12px;}

  #keystone-chat-widget #greet-bubble{
    background:#fff;border:1px solid var(--paper-dim);border-radius:14px;
    padding:11px 16px;font-size:13px;color:var(--ink);max-width:210px;
    box-shadow:0 8px 24px rgba(1,30,72,0.16);position:relative;cursor:pointer;
    animation:kcwFloatIn .4s ease;
  }
  #keystone-chat-widget #greet-bubble strong{color:var(--navy-deep);}
  #keystone-chat-widget #greet-bubble .close-nudge{
    position:absolute;top:-7px;right:-7px;width:20px;height:20px;border-radius:50%;
    background:var(--ink);color:#fff;border:2px solid var(--paper);cursor:pointer;
    display:flex;align-items:center;justify-content:center;font-size:11px;line-height:1;
  }
  @keyframes kcwFloatIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}

  #keystone-chat-widget #launcher{
    width:66px;height:66px;border-radius:50%;padding:3px;
    background:linear-gradient(155deg,var(--gold-light),var(--gold));
    border:none;cursor:pointer;flex-shrink:0;position:relative;
    box-shadow:0 10px 30px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
    transition:transform .25s ease, box-shadow .25s ease;
  }
  #keystone-chat-widget #launcher:hover{transform:translateY(-2px) scale(1.03);}
  #keystone-chat-widget #launcher img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;border:2px solid var(--paper);}
  #keystone-chat-widget #launcher .online-dot{
    position:absolute;bottom:1px;right:1px;width:15px;height:15px;border-radius:50%;
    background:#5FCB8F;border:2.5px solid var(--paper);box-shadow:0 0 5px rgba(0,0,0,0.25);
  }
  #keystone-chat-widget #launcher .pulse{
    position:absolute;inset:-6px;border-radius:50%;border:1.5px solid var(--gold-light);
    opacity:0;animation:kcwPulse 2.6s ease-out infinite;
  }
  @keyframes kcwPulse{0%{opacity:.55;transform:scale(0.85);}100%{opacity:0;transform:scale(1.35);}}

  /* ---------- Panel ---------- */
  #keystone-chat-widget #panel{
    width:396px;height:648px;max-height:calc(100vh - 48px);
    background:var(--paper);border-radius:20px;
    box-shadow:0 30px 70px rgba(0,0,0,0.42);
    display:none;flex-direction:column;overflow:hidden;margin-right:16px;
    border:1px solid rgba(0,0,0,0.06);
  }
  #keystone-chat-widget #panel.open{display:flex;animation:kcwRise .35s cubic-bezier(.2,.9,.25,1);}
  @keyframes kcwRise{from{opacity:0;transform:translateY(18px) scale(0.98);}to{opacity:1;transform:translateY(0) scale(1);}}

  /* ---------- Header ---------- */
  #keystone-chat-widget #header{
    background:
      radial-gradient(130% 150% at 12% -25%, rgba(224,180,92,0.26), transparent 55%),
      radial-gradient(90% 120% at 105% 115%, rgba(224,180,92,0.10), transparent 60%),
      linear-gradient(160deg, var(--navy-panel), var(--navy-deep));
    padding:18px 18px 16px;position:relative;flex-shrink:0;
  }
  #keystone-chat-widget #header::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--line-strong);}
  #keystone-chat-widget #header-top{display:flex;align-items:center;justify-content:space-between;}
  #keystone-chat-widget #brand{display:flex;align-items:center;gap:10px;}
  #keystone-chat-widget #brand-mark{
    width:38px;height:38px;border-radius:50%;flex-shrink:0;overflow:hidden;
    border:2px solid var(--gold-light);box-shadow:0 2px 8px rgba(0,0,0,0.3);
  }
  #keystone-chat-widget #brand-mark img{width:100%;height:100%;object-fit:cover;display:block;}
  #keystone-chat-widget #brand-text .name{font-family:'Fraunces',serif;color:var(--paper);font-size:15.5px;font-weight:600;line-height:1.15;}
  #keystone-chat-widget #brand-text .role{font-family:'IBM Plex Mono',monospace;color:var(--gold-light);font-size:10px;letter-spacing:.6px;text-transform:uppercase;margin-top:3px;}
  #keystone-chat-widget #header-actions{display:flex;align-items:center;gap:2px;flex-shrink:0;}
  #keystone-chat-widget #close-btn{background:none;border:none;cursor:pointer;color:var(--paper);opacity:.55;padding:6px;border-radius:8px;transition:opacity .2s,background .2s;}
  #keystone-chat-widget #shortlist-btn{position:relative;background:none;border:none;cursor:pointer;color:var(--paper);opacity:.75;padding:6px;border-radius:8px;transition:opacity .2s,background .2s;}
  #keystone-chat-widget #shortlist-btn:hover, #keystone-chat-widget #close-btn:hover{opacity:1;background:rgba(255,255,255,0.08);}
  #keystone-chat-widget #shortlist-btn svg{width:19px;height:19px;display:block;}
  #keystone-chat-widget #shortlist-btn.has-items svg{fill:var(--gold);stroke:var(--gold);}
  #keystone-chat-widget #speak-toggle{background:none;border:none;cursor:pointer;color:var(--paper);opacity:.55;padding:6px;border-radius:8px;transition:opacity .2s,background .2s;}
  #keystone-chat-widget #speak-toggle:hover{opacity:1;background:rgba(255,255,255,0.08);}
  #keystone-chat-widget #speak-toggle svg{width:19px;height:19px;display:block;}
  #keystone-chat-widget #speak-toggle .icon-on{display:none;}
  #keystone-chat-widget #speak-toggle .icon-off{display:block;}
  #keystone-chat-widget #speak-toggle.on{opacity:1;color:var(--gold);}
  #keystone-chat-widget #speak-toggle.on .icon-on{display:block;}
  #keystone-chat-widget #speak-toggle.on .icon-off{display:none;}
  #keystone-chat-widget #speak-toggle.speaking{animation:keystoneSpeakPulse 1s ease-in-out infinite;}
  @keyframes keystoneSpeakPulse{0%,100%{opacity:1;}50%{opacity:.5;}}
  #keystone-chat-widget #shortlist-badge{
    position:absolute;top:1px;right:1px;min-width:15px;height:15px;padding:0 3px;
    background:var(--gold);color:var(--navy-deep);border-radius:20px;
    font-family:'IBM Plex Mono',monospace;font-size:9.5px;font-weight:700;line-height:15px;text-align:center;
  }
  #keystone-chat-widget #close-btn:hover{opacity:1;background:rgba(255,255,255,0.08);}
  #keystone-chat-widget #close-btn svg{width:16px;height:16px;display:block;}
  #keystone-chat-widget #status-line{margin-top:11px;font-family:'IBM Plex Mono',monospace;font-size:10px;color:rgba(247,244,236,0.8);letter-spacing:.3px;display:flex;align-items:center;gap:6px;}
  #keystone-chat-widget #status-line .dot{width:6px;height:6px;border-radius:50%;background:#5FCB8F;box-shadow:0 0 6px #5FCB8F;}
  #keystone-chat-widget #usp-row{display:flex;gap:6px;margin-top:12px;flex-wrap:wrap;}
  #keystone-chat-widget .usp-chip{font-family:'IBM Plex Mono',monospace;font-size:9px;letter-spacing:.3px;color:var(--gold-light);background:rgba(224,180,92,0.12);border:1px solid rgba(224,180,92,0.5);border-radius:20px;padding:3px 8px;}

  /* ---------- Messages ---------- */
  #keystone-chat-widget #messages{flex:1;overflow-y:auto;padding:16px 15px;display:flex;flex-direction:column;gap:11px;background:var(--paper);}
  #keystone-chat-widget #messages::-webkit-scrollbar{width:6px;}
  #keystone-chat-widget #messages::-webkit-scrollbar-thumb{background:var(--paper-dim);border-radius:10px;}
  #keystone-chat-widget .row{display:flex;gap:8px;max-width:100%;}
  #keystone-chat-widget .row.bot{justify-content:flex-start;}
  #keystone-chat-widget .row.user{justify-content:flex-end;}
  #keystone-chat-widget .avatar{width:26px;height:26px;border-radius:50%;flex-shrink:0;overflow:hidden;margin-top:2px;background:var(--navy-deep);}
  #keystone-chat-widget .avatar img{width:100%;height:100%;object-fit:cover;display:block;}
  #keystone-chat-widget .bubble{padding:10px 13px;border-radius:14px;font-size:13.4px;line-height:1.5;max-width:260px;}
  #keystone-chat-widget .row.bot .bubble{background:#fff;color:var(--ink);border:1px solid rgba(0,0,0,0.06);border-top-left-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,0.03);}
  #keystone-chat-widget .row.user .bubble{background:var(--navy-deep);color:var(--paper);border-top-right-radius:4px;}
  #keystone-chat-widget .typing{display:flex;gap:4px;padding:4px 2px;}
  #keystone-chat-widget .typing span{width:6px;height:6px;border-radius:50%;background:var(--ink-soft);opacity:.4;animation:kcwBlink 1.2s infinite;}
  #keystone-chat-widget .typing span:nth-child(2){animation-delay:.2s;}
  #keystone-chat-widget .typing span:nth-child(3){animation-delay:.4s;}
  @keyframes kcwBlink{0%,60%,100%{opacity:.25;}30%{opacity:.8;}}

  #keystone-chat-widget #quick-replies{display:flex;flex-wrap:wrap;gap:7px;padding:0 15px 4px;background:var(--paper);}
  #keystone-chat-widget .chip{font-family:'Inter',sans-serif;font-size:12.3px;font-weight:500;padding:8px 13px;border-radius:20px;background:#fff;color:var(--navy-deep);border:1.3px solid var(--paper-dim);cursor:pointer;transition:all .15s ease;line-height:normal;}
  #keystone-chat-widget .chip:hover{border-color:var(--gold);color:var(--gold);transform:translateY(-1px);}

  /* ---------- Combined Name + Mobile inline form ----------
     Used everywhere the bot needs a name AND a phone number (site visit,
     home loan, talk-to-advisor) — asked together as one step with two
     boxes, instead of two separate back-and-forth chat messages. */
  #keystone-chat-widget .inline-form{
    background:#fff;border:1px solid rgba(1,30,72,0.08);border-radius:14px;
    max-width:262px;padding:12px 13px 13px;box-shadow:0 1px 2px rgba(0,0,0,0.03);
    border-top-left-radius:4px;display:flex;flex-direction:column;gap:9px;
  }
  #keystone-chat-widget .inline-form .if-field{display:flex;flex-direction:column;gap:4px;}
  #keystone-chat-widget .inline-form label{font-family:'IBM Plex Mono',monospace;font-size:9.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--ink-soft);}
  #keystone-chat-widget .inline-form input{
    font-family:'Inter',sans-serif;font-size:13px;padding:8px 10px;border-radius:8px;
    border:1.3px solid var(--paper-dim);background:var(--paper);color:var(--ink);outline:none;
    transition:border-color .15s ease;
  }
  #keystone-chat-widget .inline-form input:focus{border-color:var(--gold);}
  #keystone-chat-widget .inline-form input:disabled{opacity:.6;}
  #keystone-chat-widget .inline-form .if-error{font-size:11.5px;color:#B3402F;display:none;}
  #keystone-chat-widget .inline-form .if-submit{
    margin-top:2px;font-family:'Inter',sans-serif;font-size:13px;font-weight:600;
    padding:9px;border:none;border-radius:9px;background:var(--navy-deep);color:#fff;
    cursor:pointer;transition:opacity .15s ease;
  }
  #keystone-chat-widget .inline-form .if-submit:hover{opacity:.9;}
  #keystone-chat-widget .inline-form .if-submit:disabled{opacity:.55;cursor:default;}
  #keystone-chat-widget .inline-form.done{opacity:.75;}

  /* ---------- Compare picker: live-search suggestion dropdown ----------
     Custom-built instead of relying on native <datalist>, which renders
     inconsistently (or not at all) in many mobile/in-app browsers — this
     works the same everywhere and behaves like a real search box: type,
     see matches update live, tap one to select it. */
  #keystone-chat-widget .cmp-field{position:relative;}
  #keystone-chat-widget .cmp-suggest{
    position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:20;
    background:#fff;border:1.3px solid var(--paper-dim);border-radius:10px;
    max-height:168px;overflow-y:auto;box-shadow:0 8px 20px rgba(1,30,72,0.18);
    display:none;
  }
  #keystone-chat-widget .cmp-suggest.open{display:block;}
  #keystone-chat-widget .cmp-suggest-item{
    padding:8px 12px;font-size:12.8px;color:var(--ink);cursor:pointer;
    border-bottom:1px solid var(--paper-dim);
  }
  #keystone-chat-widget .cmp-suggest-item:last-child{border-bottom:none;}
  #keystone-chat-widget .cmp-suggest-item:hover, #keystone-chat-widget .cmp-suggest-item.active{
    background:var(--paper-dim);
  }
  #keystone-chat-widget .cmp-suggest-item .sub{display:block;font-size:10.5px;color:var(--ink-soft);margin-top:1px;}
  #keystone-chat-widget .cmp-suggest-empty{padding:8px 12px;font-size:12px;color:var(--ink-soft);}
  #keystone-chat-widget .if-field.confirmed input{border-color:var(--gold);background:rgba(201,154,60,0.06);}

  /* ---------- Comparison table ---------- */
  #keystone-chat-widget .bubble.cmp-bubble{max-width:320px;}
  #keystone-chat-widget .bubble.cmp-bubble-wide{max-width:340px;}
  #keystone-chat-widget .cmp-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
  #keystone-chat-widget .cmp-table{width:100%;min-width:100%;border-collapse:collapse;font-size:12px;margin-top:6px;}
  #keystone-chat-widget .cmp-table.cmp-cols-3, #keystone-chat-widget .cmp-table.cmp-cols-4{min-width:440px;}
  #keystone-chat-widget .cmp-table.cmp-cols-3 th.cmp-name, #keystone-chat-widget .cmp-table.cmp-cols-4 th.cmp-name{font-size:11px;}
  #keystone-chat-widget .cmp-table th, #keystone-chat-widget .cmp-table td{
    padding:6px 7px;text-align:left;vertical-align:top;border-bottom:1px solid var(--paper-dim);
  }
  #keystone-chat-widget .cmp-table th{
    font-family:'IBM Plex Mono',monospace;font-size:9.5px;text-transform:uppercase;
    letter-spacing:.3px;color:var(--ink-soft);font-weight:500;
  }
  #keystone-chat-widget .cmp-table th.cmp-name{color:var(--navy-deep);font-size:12px;text-transform:none;letter-spacing:0;font-weight:600;}
  #keystone-chat-widget .cmp-table td:first-child{
    font-family:'IBM Plex Mono',monospace;font-size:9.5px;text-transform:uppercase;
    letter-spacing:.3px;color:var(--ink-soft);white-space:nowrap;
  }
  #keystone-chat-widget .cmp-table tr:last-child td{border-bottom:none;}
  #keystone-chat-widget .cmp-table td.cmp-better{color:var(--gold);font-weight:600;}
  #keystone-chat-widget .cmp-note{font-size:11.5px;color:var(--ink-soft);margin-top:8px;display:block;}

  /* ---------- EMI calculator ---------- */
  #keystone-chat-widget .emi-card{
    background:#fff;border:1px solid rgba(1,30,72,0.08);border-radius:14px;
    max-width:262px;padding:12px 13px 13px;box-shadow:0 1px 2px rgba(0,0,0,0.03);
    border-top-left-radius:4px;display:flex;flex-direction:column;gap:9px;
  }
  #keystone-chat-widget .emi-field{display:flex;flex-direction:column;gap:4px;}
  #keystone-chat-widget .emi-field label{font-family:'IBM Plex Mono',monospace;font-size:9.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--ink-soft);display:flex;justify-content:space-between;}
  #keystone-chat-widget .emi-field label .emi-val{color:var(--navy-deep);font-weight:600;}
  #keystone-chat-widget .emi-field input[type="range"]{width:100%;accent-color:var(--gold);}
  #keystone-chat-widget .emi-result{
    background:var(--navy-deep);border-radius:10px;padding:12px 13px;text-align:center;margin-top:2px;
  }
  #keystone-chat-widget .emi-result .emi-amount{font-family:'Fraunces',serif;font-size:22px;font-weight:600;color:var(--paper);}
  #keystone-chat-widget .emi-result .emi-label{font-family:'IBM Plex Mono',monospace;font-size:9px;text-transform:uppercase;letter-spacing:.4px;color:var(--gold-light);margin-top:2px;}
  #keystone-chat-widget .emi-breakdown{font-size:11px;color:var(--ink-soft);display:flex;justify-content:space-between;margin-top:6px;}
  #keystone-chat-widget .emi-cta{
    margin-top:2px;font-family:'Inter',sans-serif;font-weight:600;font-size:13px;color:#fff;
    background:linear-gradient(155deg,var(--gold-light),var(--gold));border:none;border-radius:10px;
    padding:10px;cursor:pointer;
  }
  #keystone-chat-widget .emi-cta:hover{opacity:.92;}


  /* ---------- Property card ----------
     Solid card with a gold accent strip (echoes the header's gold-on-navy
     line pattern) instead of the old dashed placeholder-style border, so it
     reads as a finished, premium listing rather than a wireframe. */
  #keystone-chat-widget .listing-card{
    position:relative;
    background:#fff;border:1px solid rgba(1,30,72,0.08);border-radius:14px;
    max-width:272px;overflow:hidden;
    box-shadow:0 4px 14px rgba(1,30,72,0.08);
    transition:box-shadow .2s ease;
  }
  #keystone-chat-widget .lc-fav-btn{
    flex-shrink:0;width:24px;height:24px;
    display:flex;align-items:center;justify-content:center;
    background:rgba(1,30,72,0.05);border:1px solid rgba(1,30,72,0.1);border-radius:50%;
    cursor:pointer;transition:transform .12s,background .15s;padding:0;
  }
  #keystone-chat-widget .lc-fav-btn:hover{transform:scale(1.08);}
  #keystone-chat-widget .lc-fav-btn:active{transform:scale(0.94);}
  #keystone-chat-widget .lc-fav-btn svg{width:14px;height:14px;color:var(--ink-soft);transition:color .15s;}
  #keystone-chat-widget .lc-fav-btn.saved{background:rgba(201,154,60,0.16);}
  #keystone-chat-widget .lc-fav-btn.saved svg{color:var(--gold);fill:var(--gold);}
  #keystone-chat-widget .lc-remove{
    width:100%;background:#fff;color:#b23b3b;border:1px solid rgba(178,59,59,0.35);border-radius:9px;
    padding:8px 10px;font-family:'Inter',sans-serif;font-size:11.8px;font-weight:600;cursor:pointer;
    margin-top:7px;transition:background .15s;
  }
  #keystone-chat-widget .lc-remove:hover{background:rgba(178,59,59,0.08);}
  #keystone-chat-widget .listing-card:hover{box-shadow:0 8px 22px rgba(1,30,72,0.13);}
  #keystone-chat-widget .listing-card .lc-accent{height:3px;background:linear-gradient(90deg,var(--gold-light),var(--gold));}
  #keystone-chat-widget .listing-card .lc-body{padding:13px 14px 14px;}
  #keystone-chat-widget .listing-card .lc-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;gap:8px;}
  #keystone-chat-widget .listing-card .lc-top-right{display:flex;align-items:center;gap:6px;flex-shrink:0;}
  #keystone-chat-widget .listing-card .lc-price{font-family:'Fraunces',serif;font-weight:600;font-size:15px;color:var(--navy-deep);line-height:1.3;}
  #keystone-chat-widget .listing-card .lc-tag{font-family:'IBM Plex Mono',monospace;font-size:9px;color:var(--navy-deep);background:rgba(201,154,60,0.16);border:1px solid var(--line-strong);border-radius:20px;padding:3px 9px;letter-spacing:.3px;white-space:nowrap;flex-shrink:0;}
  #keystone-chat-widget .listing-card .lc-name{font-size:13.5px;color:var(--ink);font-weight:700;margin-bottom:3px;line-height:1.3;}
  #keystone-chat-widget .listing-card .lc-addr{display:flex;align-items:center;gap:4px;font-size:11.5px;color:var(--ink-soft);margin-bottom:9px;}
  #keystone-chat-widget .listing-card .lc-addr svg{width:11px;height:11px;flex-shrink:0;opacity:.65;}
  #keystone-chat-widget .listing-card .lc-specs{display:flex;gap:13px;font-family:'IBM Plex Mono',monospace;font-size:10.5px;color:var(--ink-soft);border-top:1px dashed var(--paper-dim);padding-top:8px;margin-bottom:10px;}
  #keystone-chat-widget .listing-card .lc-specs span{display:flex;align-items:center;gap:4px;}
  #keystone-chat-widget .listing-card .lc-specs svg{width:11px;height:11px;opacity:.55;flex-shrink:0;}
  #keystone-chat-widget .listing-card .lc-select{width:100%;background:var(--navy-deep);color:var(--paper);border:none;border-radius:9px;padding:9px 10px;font-family:'Inter',sans-serif;font-size:12.3px;font-weight:600;cursor:pointer;transition:background .15s,transform .1s;display:flex;align-items:center;justify-content:center;gap:6px;}
  #keystone-chat-widget .listing-card .lc-select:hover{background:var(--gold);color:var(--navy-deep);}
  #keystone-chat-widget .listing-card .lc-img{display:block;aspect-ratio:2/1;background:var(--paper-dim);overflow:hidden}
  #keystone-chat-widget .listing-card .lc-img img{width:100%;height:100%;object-fit:cover;display:block}
  #keystone-chat-widget .listing-card .lc-actions{display:flex;gap:8px}
  #keystone-chat-widget .listing-card .lc-actions .lc-select{flex:1.4}
  #keystone-chat-widget .listing-card .lc-view{flex:1;display:flex;align-items:center;justify-content:center;border:1.3px solid var(--paper-dim);border-radius:9px;padding:8px 6px;font-size:12.3px;font-weight:600;color:var(--navy-deep);text-decoration:none;background:#fff}
  #keystone-chat-widget .listing-card .lc-view:hover{border-color:var(--gold)}
  #keystone-chat-widget .kk-link{color:var(--navy-deep);font-weight:600;text-decoration:underline;text-decoration-color:var(--gold);text-underline-offset:3px}
  #keystone-chat-widget .listing-card .lc-select:active{transform:scale(0.98);}
  #keystone-chat-widget .listing-card.selected{box-shadow:0 4px 18px rgba(201,154,60,0.28);}
  #keystone-chat-widget .listing-card.selected .lc-accent{height:4px;}
  #keystone-chat-widget .listing-card .lc-selected-tag{
    display:flex;align-items:center;justify-content:center;gap:6px;
    background:rgba(201,154,60,0.14);color:var(--navy-deep);
    font-family:'Inter',sans-serif;font-weight:600;font-size:12px;
    border-radius:9px;padding:9px 10px;
  }
  #keystone-chat-widget .listing-card .lc-selected-tag svg{width:13px;height:13px;flex-shrink:0;color:var(--gold);}

  /* ---------- Keyboard focus (visible focus ring for anyone navigating via keyboard) ---------- */
  #keystone-chat-widget .chip:focus-visible,
  #keystone-chat-widget .listing-card .lc-select:focus-visible,
  #keystone-chat-widget #send-btn:focus-visible,
  #keystone-chat-widget #launcher:focus-visible,
  #keystone-chat-widget #close-btn:focus-visible{
    outline:2px solid var(--gold);outline-offset:2px;
  }

  /* ---------- Input ---------- */
  #keystone-chat-widget #input-bar{flex-shrink:0;padding:12px 14px;background:#fff;border-top:1px solid var(--paper-dim);display:flex;gap:8px;align-items:center;}
  #keystone-chat-widget #text-input{flex:1;min-width:0;width:100%;border:1.4px solid var(--paper-dim);border-radius:22px;padding:11px 15px;font-size:13.4px;font-family:'Inter',sans-serif;outline:none;color:var(--ink);background:var(--paper);transition:border-color .15s;height:auto;box-shadow:none;}
  #keystone-chat-widget #text-input:focus{border-color:var(--gold);box-shadow:none;}
  #keystone-chat-widget #send-btn{width:38px;height:38px;border-radius:50%;border:none;cursor:pointer;background:var(--navy-deep);display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s;}
  #keystone-chat-widget #send-btn:hover{background:var(--gold);}
  #keystone-chat-widget #send-btn svg{width:16px;height:16px;}

  /* ---------- Voice search (mic + EN/हिं language toggle) ---------- */
  /* Keep the legacy one-shot mic node for JS compatibility, but show only Talk Mode. */
  #keystone-chat-widget #mic-btn{width:38px;height:38px;border-radius:50%;border:1.4px solid var(--paper-dim);cursor:pointer;background:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:background .15s,border-color .15s;color:var(--navy-deep);}
  #keystone-chat-widget #mic-btn{display:none !important;}
  #keystone-chat-widget #mic-btn:hover{border-color:var(--gold);color:var(--gold);}
  #keystone-chat-widget #mic-btn svg{width:16px;height:16px;}
  #keystone-chat-widget #mic-btn.listening{background:#B3402F;border-color:#B3402F;color:#fff;animation:kcwMicPulse 1.1s ease-in-out infinite;}
  @keyframes kcwMicPulse{0%,100%{box-shadow:0 0 0 0 rgba(179,64,47,0.35);}50%{box-shadow:0 0 0 6px rgba(179,64,47,0);}}

  /* Talk Mode entry point — deliberately a SEPARATE, visually distinct
     button from the plain mic icon, same two-mode split as ChatGPT's app
     (a small mic for one-off dictation vs. a dedicated voice-conversation
     button). Filled navy circle so it reads as "the other mode", not a
     second mic. */
  #keystone-chat-widget #talk-mode-btn{
    width:38px;height:38px;border-radius:50%;border:none;cursor:pointer;
    background:var(--navy-deep);display:flex;align-items:center;justify-content:center;
    flex-shrink:0;transition:background .15s,transform .15s;color:var(--gold-light);
  }
  #keystone-chat-widget #talk-mode-btn:hover{background:#1f2f4d;}
  #keystone-chat-widget #talk-mode-btn svg{width:17px;height:17px;}
  #keystone-chat-widget #talk-mode-btn.active{
    background:#B3402F;color:#fff;
    animation:kcwMicPulse 1.1s ease-in-out infinite;
  }
  #keystone-chat-widget #lang-toggle{
    font-family:'IBM Plex Mono',monospace;font-size:9.5px;font-weight:600;letter-spacing:.3px;
    border:1.3px solid var(--paper-dim);background:#fff;color:var(--ink-soft);border-radius:20px;
    padding:5px 8px;cursor:pointer;flex-shrink:0;transition:border-color .15s,color .15s;line-height:1;
  }
  #keystone-chat-widget #lang-toggle:hover{border-color:var(--gold);color:var(--gold);}
  #keystone-chat-widget #disclaimer{text-align:center;font-family:'IBM Plex Mono',monospace;font-size:8.7px;color:var(--ink-soft);opacity:.6;padding:6px 0 0;letter-spacing:.2px;}

  /* ---------- Hands-free "Talk Mode" (Siri-style loop) ---------- */
  /* Deliberately styled as a distinct MODE (like ChatGPT's separate voice
     view), not just a status strip above the usual typing bar — a taller
     bar with a breathing orb, and the input bar underneath visually
     recedes so the panel reads "you're talking right now", not "you're
     typing, and also something is listening in the background". */
  #keystone-chat-widget #voice-mode-bar{
    display:none;align-items:center;gap:10px;flex-shrink:0;
    padding:14px 16px;background:var(--navy-deep);color:var(--paper);
    font-family:'IBM Plex Mono',monospace;font-size:12px;letter-spacing:.2px;
  }
  #keystone-chat-widget #voice-mode-bar.active{display:flex;}
  #keystone-chat-widget #voice-mode-dot{
    width:14px;height:14px;border-radius:50%;background:#B3402F;flex-shrink:0;
    box-shadow:0 0 0 0 rgba(179,64,47,0.45);
    animation:kcwMicPulse 1.1s ease-in-out infinite;
  }
  #keystone-chat-widget #voice-mode-bar.speaking #voice-mode-dot{background:var(--gold);box-shadow:0 0 0 0 rgba(212,175,55,0.45);animation:keystoneSpeakPulse 1s ease-in-out infinite;}
  #keystone-chat-widget #voice-mode-text{flex:1;opacity:.92;font-size:12.5px;}
  #keystone-chat-widget #voice-mode-stop{
    background:none;border:1px solid rgba(255,255,255,0.35);color:var(--paper);
    border-radius:14px;padding:4px 12px;font-family:inherit;font-size:10.5px;cursor:pointer;
    transition:border-color .15s,background .15s;flex-shrink:0;
  }
  #keystone-chat-widget #voice-mode-stop:hover{border-color:var(--gold);background:rgba(255,255,255,0.08);}
  #keystone-chat-widget #mic-btn.voice-mode-on{background:var(--navy-deep);border-color:var(--navy-deep);color:var(--gold);}

  /* While Talk Mode is on, the typing bar recedes (still usable — tapping
     it and typing just answers that one turn silently, see submitText) so
     attention stays on the voice bar above it, the way a dedicated voice
     screen would. */
  #keystone-chat-widget #panel.voice-mode #input-bar{opacity:.45;transition:opacity .2s;}
  #keystone-chat-widget #panel.voice-mode #input-bar:focus-within{opacity:1;}
  #keystone-chat-widget #panel.voice-mode #messages{padding-bottom:4px;}

  @media (max-width:480px){
    #keystone-chat-widget{right:12px;bottom:94px;}
    /* height uses 100vh first (old-browser fallback), then 100dvh — mobile
       Chrome/Safari's address bar shows/hides as you scroll, and 100vh is
       measured against the LARGEST possible viewport (bar hidden). Since
       this panel is bottom-anchored, a too-tall panel pushed its header
       (with the minimize/close button) above the visible screen whenever
       the address bar was showing — with no way to reach it. 100dvh tracks
       the actual visible viewport instead, so the header always stays on
       screen. (Declaring both is safe: browsers that don't understand dvh
       simply ignore that line and keep the vh value.) */
    #keystone-chat-widget{
      right:max(12px, env(safe-area-inset-right));
      bottom:calc(94px + env(safe-area-inset-bottom));
    }
    #keystone-chat-widget #panel{
      width:calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
      height:calc(100vh - 96px - env(safe-area-inset-top));
      height:calc(var(--kcw-visual-viewport-height, 100dvh) - 96px - env(safe-area-inset-top));
      max-height:calc(var(--kcw-visual-viewport-height, 100dvh) - 96px - env(safe-area-inset-top));
      max-width:calc(100vw - 24px);
      margin-right:0;
    }
    #keystone-chat-widget #messages{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
    #keystone-chat-widget #text-input{min-width:0;font-size:16px;}
    #keystone-chat-widget #mic-btn,
    #keystone-chat-widget #talk-mode-btn,
    #keystone-chat-widget #send-btn{min-width:40px;min-height:40px;}
    #keystone-chat-widget #header-actions button{min-width:36px;min-height:36px;}
    /* Keep EN + input + Talk + send inside the panel on narrow phones */
    #keystone-chat-widget #input-bar{padding:10px 10px;gap:6px;}
    #keystone-chat-widget #text-input{padding:9px 13px;}
    #keystone-chat-widget #lang-toggle{padding:5px 6px;}
  }

  @media (prefers-reduced-motion: reduce){
    #keystone-chat-widget *{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important;}
  }
#keystone-chat-widget{visibility:visible}
  #keystone-chat-widget .if-skipped .inline-form, #keystone-chat-widget .if-skipped{opacity:.55;}
