:root {
  --jostojo-bg: rgba(12, 15, 22, .72);
  --jostojo-panel: rgba(255, 255, 255, .96);
  --jostojo-text: #111827;
  --jostojo-muted: #6b7280;
  --jostojo-border: rgba(17, 24, 39, .10);
  --jostojo-accent: #6d5dfc;
  --jostojo-accent-2: #8b5cf6;
  --jostojo-soft: rgba(109, 93, 252, .09);
  --jostojo-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

html.jostojo-open { overflow: hidden; }

.jostojo-launcher {
  position: fixed;
  inset-inline-end: 24px;
  bottom: 24px;
  z-index: 99990;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 19px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--jostojo-accent), var(--jostojo-accent-2));
  box-shadow: 0 14px 38px rgba(109, 93, 252, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}

.jostojo-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 18px 46px rgba(109, 93, 252, .42); }
.jostojo-launcher:active { transform: translateY(0) scale(.98); }
.jostojo-launcher svg { width: 25px; height: 25px; fill: currentColor; }

.jostojo-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  opacity: 0;
  transition: opacity .16s ease;
}
.jostojo-modal.is-open { opacity: 1; }
.jostojo-backdrop {
  position: absolute;
  inset: 0;
  background: var(--jostojo-bg);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.jostojo-panel {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 70px));
  margin: 7vh auto 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.54);
  border-radius: 26px;
  background: var(--jostojo-panel);
  box-shadow: var(--jostojo-shadow);
  color: var(--jostojo-text);
  transform: translateY(10px) scale(.985);
  transition: transform .18s ease;
  direction: rtl;
  font-family: inherit;
}
.jostojo-modal.is-open .jostojo-panel { transform: translateY(0) scale(1); }

.jostojo-topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--jostojo-border);
}

.jostojo-input-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid var(--jostojo-border);
  border-radius: 17px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.jostojo-input-wrap:focus-within { border-color: rgba(109, 93, 252, .46); box-shadow: 0 0 0 4px var(--jostojo-soft); }
.jostojo-input-wrap svg { flex: 0 0 auto; width: 23px; height: 23px; fill: var(--jostojo-muted); }
.jostojo-input-wrap input {
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--jostojo-text) !important;
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
}
.jostojo-input-wrap input::placeholder { color: #9ca3af; }

.jostojo-input-wrap kbd,
.jostojo-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--jostojo-border);
  border-bottom-width: 2px;
  border-radius: 7px;
  background: #f9fafb;
  color: #6b7280;
  font: 600 10px/1 inherit;
  direction: ltr;
}

.jostojo-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--jostojo-border);
  border-radius: 14px;
  background: #fff;
  color: #6b7280;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: .15s ease;
}
.jostojo-close:hover { color: #111827; background: #f9fafb; }

.jostojo-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 20px 6px;
  color: var(--jostojo-muted);
  font-size: 12.5px;
}
.jostojo-status.is-loading::before {
  content: '';
  width: 13px;
  height: 13px;
  margin-inline-end: 8px;
  border: 2px solid rgba(109, 93, 252, .20);
  border-top-color: var(--jostojo-accent);
  border-radius: 50%;
  animation: jostojo-spin .7s linear infinite;
}
@keyframes jostojo-spin { to { transform: rotate(360deg); } }

.jostojo-results {
  max-height: min(550px, calc(100vh - 240px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 12px 10px;
  scrollbar-width: thin;
}

.jostojo-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 7px 12px;
}
.jostojo-suggestions button {
  border: 1px solid rgba(109, 93, 252, .16);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--jostojo-soft);
  color: #5747dd;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.jostojo-suggestions button:hover { background: rgba(109, 93, 252, .15); }

.jostojo-list { display: grid; gap: 5px; }
.jostojo-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  color: inherit !important;
  text-decoration: none !important;
  transition: background .12s ease, transform .12s ease;
}
.jostojo-result:hover,
.jostojo-result.is-active { background: var(--jostojo-soft); }
.jostojo-result:active { transform: scale(.995); }
.jostojo-result-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--jostojo-border);
  border-radius: 13px;
  background: #fff;
  color: var(--jostojo-accent);
  font-size: 18px;
  font-weight: 800;
}
.jostojo-result-body { min-width: 0; display: grid; gap: 4px; }
.jostojo-result-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  font-weight: 750;
  color: #111827;
}
.jostojo-result-snippet {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.7;
}
.jostojo-result-type {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 9px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 700;
}

.jostojo-footer {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 11px 18px 14px;
  border-top: 1px solid var(--jostojo-border);
  color: #9ca3af;
  font-size: 10.5px;
  direction: rtl;
}
.jostojo-footer span { display: inline-flex; gap: 4px; align-items: center; }

/* Shortcode trigger: icon only, white with yellow hover */
.jostojo-inline-trigger {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color .18s ease, transform .18s ease;
}
.jostojo-inline-trigger svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.jostojo-inline-trigger:hover,
.jostojo-inline-trigger:focus-visible {
  color: #ffd400 !important;
  background: transparent !important;
  transform: translateY(-1px);
  outline: none;
}
.jostojo-inline-trigger:active { transform: scale(.96); }

@media (prefers-color-scheme: dark) {
  :root {
    --jostojo-panel: rgba(20, 24, 33, .97);
    --jostojo-text: #f9fafb;
    --jostojo-muted: #9ca3af;
    --jostojo-border: rgba(255,255,255,.10);
    --jostojo-soft: rgba(139, 92, 246, .16);
  }
  .jostojo-input-wrap,
  .jostojo-close,
  .jostojo-result-icon { background: #171b24; }
  .jostojo-input-wrap input { color: #f9fafb !important; }
  .jostojo-result-title { color: #f9fafb; }
  .jostojo-result-type,
  .jostojo-input-wrap kbd,
  .jostojo-footer kbd { background: #202531; color: #aeb6c4; }
  .jostojo-close:hover { background: #202531; color: #fff; }
}

@media (max-width: 640px) {
  .jostojo-launcher { inset-inline-end: 16px; bottom: 16px; width: 54px; height: 54px; border-radius: 17px; }
  .jostojo-panel { margin-top: 12px; width: calc(100vw - 16px); max-height: calc(100vh - 24px); border-radius: 22px; }
  .jostojo-results { max-height: calc(100vh - 210px); }
  .jostojo-input-wrap kbd { display: none; }
  .jostojo-footer { display: none; }
  .jostojo-result { grid-template-columns: 38px minmax(0,1fr); }
  .jostojo-result-icon { width: 38px; height: 38px; }
  .jostojo-result-type { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .jostojo-modal,
  .jostojo-panel,
  .jostojo-launcher,
  .jostojo-result { transition: none !important; }
}
