/* Smart English Dictionary – matches the site: navy #0b3d91, yellow #ffc928, Tajawal */
.se-dict-ui, .se-dict-ui * { box-sizing: border-box; }
.se-dict-ui {
  --sed-navy: #0b3d91;
  --sed-ink: #26364f;
  --sed-yellow: #ffc928;
  --sed-soft: #eef3fc;
  --sed-line: #dfe6f3;
  font-family: Tajawal, 'Noto Kufi Arabic', system-ui, sans-serif;
  color: var(--sed-ink);
  line-height: 1.6;
  text-align: right;
}
.se-dict-ui button { font-family: inherit; cursor: pointer; }
.se-dict-blocked .se-dict-ui { display: none !important; }

/* floating button: bottom-left, above the points pill */
.se-dict-fab {
  position: fixed; left: 16px; bottom: 70px; z-index: 999995;
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px 9px 14px; border: 0; border-radius: 999px;
  background: var(--sed-navy); color: #fff; font-size: 16px;
  box-shadow: 0 8px 22px rgba(11, 61, 145, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.se-dict-fab b { font-weight: 700; }
.se-dict-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(11, 61, 145, .34); }
.se-dict-fab:focus-visible { outline: 3px solid var(--sed-yellow); outline-offset: 2px; }
.se-dict-fab.se-dict-hidden { display: none; }

/* search panel */
.se-dict-panel {
  position: fixed; left: 16px; bottom: 70px; z-index: 999996;
  width: 360px; max-width: calc(100vw - 24px); max-height: min(560px, calc(100vh - 110px));
  display: none; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 18px; border: 1px solid var(--sed-line);
  box-shadow: 0 20px 50px rgba(16, 37, 80, .22);
}
.se-dict-panel.se-dict-open { display: flex; }
.se-dict-ptop {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--sed-navy); color: #fff; font-size: 17px;
}
.se-dict-px, .se-dict-x {
  border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 0 4px; color: inherit;
}
.se-dict-form { display: flex; gap: 8px; padding: 12px 14px 6px; }
.se-dict-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; font-size: 17px; font-family: inherit;
  border: 2px solid var(--sed-line); border-radius: 12px; color: var(--sed-ink); background: #fff;
}
.se-dict-form input:focus { outline: none; border-color: var(--sed-navy); }
.se-dict-form button {
  height: 44px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--sed-yellow); color: #1c2b45; font-weight: 800; font-size: 16px;
}
.se-dict-presult { padding: 6px 16px 10px; overflow-y: auto; flex: 1; }
.se-dict-tip { padding: 8px 16px 12px; font-size: 13px; color: #6a7891; border-top: 1px solid var(--sed-line); }
.se-dict-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.se-dict-recent button {
  display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px;
  border: 1px solid var(--sed-line); border-radius: 10px; background: var(--sed-soft); font-size: 15px; color: var(--sed-ink);
}
.se-dict-recent small { font-size: 12px; color: #6a7891; }

/* popup */
.se-dict-pop {
  position: fixed; z-index: 999997; width: 330px; max-width: calc(100vw - 16px);
  display: none; padding: 14px 16px 14px; background: #fff;
  border-radius: 16px; border: 1px solid var(--sed-line); border-top: 4px solid var(--sed-yellow);
  box-shadow: 0 18px 44px rgba(16, 37, 80, .22);
}
.se-dict-pop.se-dict-open { display: block; animation: sedIn .14s ease-out; }
.se-dict-pop .se-dict-x { position: absolute; top: 6px; left: 8px; color: #8a96ab; }
.se-dict-pop.se-dict-sheet {
  left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; max-width: none;
  max-height: 70vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
@keyframes sedIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* entry */
.se-dict-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; text-align: left; padding-right: 24px; }
.se-dict-word { font-size: 26px; font-weight: 800; color: var(--sed-navy); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.se-dict-word.se-dict-ar { font-family: inherit; }
.se-dict-phon { color: #6a7891; font-size: 15px; font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', system-ui, sans-serif; }
.se-dict-sound { display: inline-flex; gap: 4px; }
.se-dict-say {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--sed-soft);
  font-size: 17px; line-height: 36px; padding: 0; text-align: center;
}
.se-dict-say:hover { background: #dde8fa; }
.se-dict-slow { font-size: 15px; }
.se-dict-base { margin-top: 6px; font-size: 14px; color: #6a7891; }
.se-dict-go {
  border: 0; background: none; padding: 0 2px; color: var(--sed-navy); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; font-size: inherit; font-family: system-ui, sans-serif;
}
.se-dict-means, .se-dict-results { list-style: none; margin: 10px 0 0; padding: 0; }
.se-dict-means li, .se-dict-results li {
  display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--sed-line); font-size: 19px;
}
.se-dict-means li:last-child, .se-dict-results li:last-child { border-bottom: 0; }
.se-dict-results .se-dict-go { font-size: 19px; }
.se-dict-results .se-dict-sound { margin-inline-start: auto; }
.se-dict-pos {
  flex: none; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: #fff4d0; color: #7a5600;
}
.se-dict-mean { font-weight: 700; }
.se-dict-gloss { margin-inline-start: auto; font-size: 12px; color: #8a96ab; max-width: 45%; text-align: left; line-height: 1.3; font-family: system-ui, sans-serif; }
.se-dict-label { font-size: 14px; color: #6a7891; margin: 8px 0 4px; }
.se-dict-more { margin-top: 10px; font-size: 14px; }
.se-dict-more summary { cursor: pointer; color: var(--sed-navy); font-weight: 700; }
.se-dict-more p { margin: 6px 0; text-align: left; font-family: system-ui, sans-serif; }
.se-dict-more .se-dict-say { width: 28px; height: 28px; line-height: 28px; font-size: 13px; }
.se-dict-ex { color: #4b5a73; font-style: italic; }
.se-dict-badge { margin-top: 8px; font-size: 13px; color: #127a3f; }
.se-dict-loading { display: flex; align-items: center; gap: 8px; color: #6a7891; padding: 6px 0; }
.se-dict-loading span {
  width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--sed-line); border-top-color: var(--sed-navy);
  animation: sedSpin .7s linear infinite;
}
@keyframes sedSpin { to { transform: rotate(360deg); } }
.se-dict-err { color: #b3261e; padding: 6px 0; }

/* phone "ترجم" chip after long-press */
.se-dict-chip {
  position: fixed; z-index: 999998; display: none; padding: 8px 14px; border: 0; border-radius: 999px;
  background: var(--sed-navy); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 6px 18px rgba(11, 61, 145, .3);
}
.se-dict-chip.se-dict-open { display: block; }

@media (max-width: 639px) {
  .se-dict-fab { bottom: 66px; left: 12px; padding: 8px 13px; font-size: 15px; }
  .se-dict-panel { left: 8px; right: 8px; width: auto; bottom: 8px; max-height: calc(100vh - 80px); }
}
@media (prefers-reduced-motion: reduce) {
  .se-dict-pop.se-dict-open { animation: none; }
  .se-dict-fab { transition: none; }
}

/* ---- Theme guard: Eduma/Elementor style every <button> (yellow fill, shadows, uppercase).
   These rules keep the dictionary's own look on any theme. ---- */
html body .se-dict-ui button {
  background: transparent !important; background-image: none !important; border: 0 !important;
  box-shadow: none !important; text-transform: none !important; letter-spacing: normal !important;
  min-height: 0 !important; min-width: 0 !important; height: auto; margin: 0; font-family: inherit !important;
}
html body button.se-dict-fab {
  background: #0b3d91 !important; color: #fff !important; padding: 9px 16px 9px 14px !important;
  box-shadow: 0 8px 22px rgba(11, 61, 145, .28) !important; line-height: 1.4 !important;
}
html body button.se-dict-fab:hover { background: #0a3480 !important; }
html body .se-dict-ui button.se-dict-say {
  background: #eef3fc !important; width: 36px !important; height: 36px !important; padding: 0 !important;
  border-radius: 50% !important; line-height: 36px !important; color: inherit !important;
}
html body .se-dict-ui button.se-dict-say:hover { background: #dde8fa !important; }
html body .se-dict-more button.se-dict-say { width: 28px !important; height: 28px !important; line-height: 28px !important; }
html body .se-dict-ui button.se-dict-x { color: #8a96ab !important; padding: 0 4px !important; font-size: 26px !important; line-height: 1 !important; }
html body .se-dict-ui button.se-dict-px { color: #fff !important; padding: 0 4px !important; font-size: 26px !important; line-height: 1 !important; }
html body .se-dict-ui button.se-dict-go { color: #0b3d91 !important; padding: 0 2px !important; text-decoration: underline !important; }
html body .se-dict-form button[type="submit"] {
  background: #ffc928 !important; color: #1c2b45 !important; height: 44px !important; padding: 0 16px !important; border-radius: 12px !important;
}
html body .se-dict-recent button {
  background: #eef3fc !important; border: 1px solid #dfe6f3 !important; border-radius: 10px !important;
  padding: 4px 10px !important; color: #26364f !important;
}
html body button.se-dict-chip {
  background: #0b3d91 !important; color: #fff !important; padding: 8px 14px !important; border-radius: 999px !important;
  box-shadow: 0 6px 18px rgba(11, 61, 145, .3) !important;
}
html body .se-dict-form input[type="search"] { height: 44px !important; margin: 0 !important; box-shadow: none !important; }

html body .se-dict-ui button.se-dict-say.se-dict-busy { animation: sedPulse .8s ease-in-out infinite; }
@keyframes sedPulse { 50% { opacity: .45; } }
