/* widget.css — plaukiojantis DI paieškos widget'as (apačioje dešinėje) */

#dip-widget, #dip-widget * { box-sizing: border-box; }
#dip-widget {
  position: fixed; bottom: 20px; right: 20px; z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Ikona ─── */
#dip-toggle {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  background: #0984e3; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); transition: transform .15s, background .15s;
}
#dip-toggle svg { display: block; }
#dip-toggle:hover { background: #0866c4; transform: scale(1.05); }

/* ─── Teaser burbuliukas virš ikonos ─── */
#dip-widget #dip-teaser {
  position: absolute !important; bottom: 78px !important; right: 4px !important;
  background: #fff !important; color: #2d3436 !important;
  font-size: 14px !important; font-weight: 600 !important; line-height: 1.35 !important;
  padding: 10px 14px !important; border-radius: 16px !important; border: none !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.22) !important;
  max-width: 210px !important; width: max-content !important; cursor: pointer !important;
  margin: 0 !important; text-align: left !important;
  animation: dip-teaser-pop .35s ease;
}
#dip-widget #dip-teaser::after { /* uodegėlė, nukreipta į ikoną */
  content: ''; position: absolute; bottom: -7px; right: 24px;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}
#dip-widget #dip-teaser.dip-hidden { display: none !important; }
@keyframes dip-teaser-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { #dip-widget #dip-teaser { max-width: 170px !important; font-size: 13px !important; } }

/* ─── Langas ─── */
#dip-panel {
  position: absolute; bottom: 74px; right: 0;
  width: 370px; height: 520px; max-width: calc(100vw - 40px); max-height: calc(100vh - 110px);
  background: #f0f2f5; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  display: flex; flex-direction: column;
  transition: width .2s ease, height .2s ease;
}
#dip-panel.dip-large { width: 460px; height: 680px; }
#dip-panel.dip-hidden { display: none; }
@media (max-width: 520px) {
  /* Mobilioje versijoje — pilnas ekranas. Aukštį ir viršų dinamiškai valdo JS
     pagal VisualViewport: iššokus klaviatūrai langas susitraukia iki matomos
     srities, tad įvestis lieka virš klaviatūros. Čia — tik atsarginis vaizdas
     (kol JS nesuveikė ar nėra VisualViewport). transition:none — kad
     susitraukimas iššokus klaviatūrai būtų momentinis, ne „vėluojantis". */
  #dip-panel, #dip-panel.dip-large {
    position: fixed; top: 0; left: 0; right: 0; bottom: auto;
    width: 100%; height: 100vh; height: 100dvh;
    max-width: none; max-height: none; border-radius: 0;
    transition: none;
  }
}

#dip-header {
  background: #fff; padding: 12px 14px; border-bottom: 1px solid #e0e0e0;
  display: flex; align-items: center; justify-content: space-between;
}
#dip-title { font-size: 15px; font-weight: 600; color: #2d3436; }
#dip-controls button {
  background: none; border: none; cursor: pointer; font-size: 16px; color: #636e72;
  padding: 2px 6px; border-radius: 4px;
}
#dip-controls button:hover { background: #f0f2f5; color: #2d3436; }

#dip-chat { flex: 1; overflow-y: auto; padding: 14px; position: relative; }

#dip-input-bar {
  background: #fff; border-top: 1px solid #e0e0e0; padding: 10px 12px;
  display: flex; gap: 8px;
}
#dip-input {
  flex: 1; padding: 9px 12px; border: 1px solid #dfe6e9; border-radius: 8px; font-size: 14px;
}
#dip-input:focus { outline: none; border-color: #0984e3; }
#dip-send {
  background: #0984e3; color: #fff; border: none; padding: 9px 16px; border-radius: 8px;
  cursor: pointer; font-size: 14px;
}
#dip-send:hover { background: #0866c4; }
#dip-send:disabled { background: #b2bec3; cursor: not-allowed; }

/* ─── Žinutės ─── */
#dip-chat .msg { margin-bottom: 14px; max-width: 90%; }
#dip-chat .msg.user { margin-left: auto; }
#dip-chat .bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap;
}
#dip-chat .msg.user .bubble { background: #0984e3; color: #fff; border-bottom-right-radius: 4px; }
#dip-chat .msg.assistant .bubble { background: #fff; color: #2d3436; border: 1px solid #e0e0e0; border-bottom-left-radius: 4px; }
#dip-chat .msg.assistant .bubble a { color: #0984e3; }
#dip-chat .typing { color: #636e72; font-style: italic; }

/* ─── Mygtukų parinktys ─── */
#dip-chat .options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#dip-chat .options button {
  background: #f0f2f5; border: 1px solid #dfe6e9; padding: 7px 14px; border-radius: 20px;
  cursor: pointer; font-size: 13px; color: #2d3436; transition: all .15s;
}
#dip-chat .options button:hover { background: #0984e3; color: #fff; border-color: #0984e3; }
#dip-chat .options button.selected { background: #0984e3; color: #fff; border-color: #0984e3; }

/* ─── Kvietimų kortelės ─── */
#dip-chat .cards-heading { font-size: 13px; font-weight: 600; color: #636e72; margin: 6px 0 8px; }
#dip-chat .call-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
#dip-chat .call-card .title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
#dip-chat .call-card .title a { color: #0984e3; text-decoration: none; }
#dip-chat .call-card .title a:hover { text-decoration: underline; }
#dip-chat .call-card .meta { font-size: 12px; color: #636e72; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
#dip-chat .call-card .meta .tag { background: #f0f2f5; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
#dip-chat .call-card .activity { color: #667; font-size: 12px; }
#dip-chat .call-card .pending-badge {
  display: inline-block; background: #fff4e5; border: 1px solid #ffd591; color: #ad6800;
  font-size: 11px; padding: 3px 8px; border-radius: 6px; margin: 4px 0;
}
#dip-chat .call-card .reason-note {
  background: #e6f7ff; border: 1px solid #91d5ff; color: #0958a6;
  font-size: 12px; padding: 6px 10px; border-radius: 6px; margin-top: 8px; line-height: 1.4;
}
#dip-chat .badge-active { color: #00b894; font-weight: 600; }
#dip-chat .badge-expired { color: #e17055; }

/* ─── Paaiškinimas ─── */
#dip-chat .explanation {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px;
  margin-top: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap;
}
#dip-chat .explanation h3 { font-size: 14px; margin-bottom: 8px; color: #2d3436; }
#dip-chat .explanation a { color: #0984e3; }

/* ─── Paskolų kortelės ─── */
#dip-chat .loan-card { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
#dip-chat .loan-card.priority { border-color: #52c41a; box-shadow: 0 0 0 1px rgba(82,196,26,.2); }
#dip-chat .loan-card .title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
#dip-chat .loan-card .title a { color: #237804; text-decoration: none; }
#dip-chat .loan-card .title a:hover { text-decoration: underline; }
#dip-chat .loan-card .loan-company { color: #636e72; font-weight: 400; font-size: 12px; }
#dip-chat .loan-card .meta { font-size: 12px; color: #4b5563; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
#dip-chat .loan-badge { background: #d9f7be; color: #237804; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
#dip-chat .loan-note { background: #fff; border: 1px solid #b7eb8f; color: #237804; font-size: 12px; padding: 6px 10px; border-radius: 6px; margin-top: 6px; line-height: 1.4; }
#dip-chat .loan-link { background: #f6ffed; border: 1px solid #b7eb8f; color: #237804; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; margin: 6px 0; }
#dip-chat .loan-link:hover { background: #d9f7be; }
#dip-chat .muted-line { color: #636e72; font-size: 13px; font-style: italic; margin: 6px 0; }

/* ─── Viešojo sektoriaus pastaba ─── */
#dip-chat .public-note {
  background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px; padding: 12px 14px;
  margin-top: 12px; font-size: 13px; line-height: 1.5;
}

/* ─── Kontaktų forma ─── */
#dip-chat .lead-form .lead-fields { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#dip-chat .lead-form input { flex: 1; min-width: 130px; padding: 8px 12px; border: 1px solid #dfe6e9; border-radius: 6px; font-size: 14px; }
#dip-chat .lead-form input:focus { outline: none; border-color: #00b894; }
#dip-chat .lead-form button { background: #00b894; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; }
#dip-chat .lead-form button:hover { background: #00a383; }
#dip-chat .lead-form button:disabled { background: #b2bec3; cursor: not-allowed; }
#dip-chat .lead-note { font-size: 11px; color: #636e72; margin-top: 8px; }
