/* ── Agrovaru Tools Frontend ────────────────────────────── */
:root {
  --agt-green:  #ffb900;
  --agt-gm:     #e6a700;
  --agt-light:  #fff3cc;
  --agt-dark:   #3c464b;
  --agt-white:  #ffffff;
  --agt-radius: 10px;
  --agt-shadow: 0 8px 40px rgba(0,0,0,.18);
}

/* ── FLOATING TOOLBAR – keskel paremal ─────────────────── */
.agt-toolbar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity .3s ease;
}
.agt-toolbar.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Tööriistade sulgemisnupp */
.agt-toolbar-dismiss {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--agt-green);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(255,185,0,.45);
  transition: background .15s, transform .15s;
  padding: 0;
  flex-shrink: 0;
}
.agt-toolbar-dismiss::before, .agt-toolbar-dismiss::after { content: none !important; }
.agt-toolbar-dismiss:hover { background: #ca0101; transform: translateX(-50%) scale(1.1); }
.agt-toolbar-dismiss svg { display: block; }
.agt-toolbar.overlap .agt-toolbar-dismiss { display: flex; }

@media (max-width: 1200px) {
  .agt-toolbar { padding-top: 36px; }
  .agt-toolbar .agt-toolbar-dismiss { display: flex; }
  body.agt-panel-open .agt-toolbar-dismiss { display: none !important; }
}

/* Taastamisnupp */
.agt-toolbar-restore {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--agt-green);
  border: none;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255,185,0,.4);
  z-index: 99989;
  transition: transform .15s;
  padding: 0;
}
.agt-toolbar-restore::before, .agt-toolbar-restore::after { content: none !important; }
.agt-toolbar-restore.show { display: flex; animation: agtFadeIn .2s ease; }
.agt-toolbar-restore:hover { transform: scale(1.1); }
.agt-toolbar-restore svg { width: 16px; height: 16px; fill: currentColor; display: block; }
@keyframes agtFadeIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 480px) {
  .agt-toolbar { right: 12px; top: 50%; transform: translateY(-50%); }
  .agt-toolbar-restore { right: 12px; top: 50%; transform: translateY(-50%); }
}

.agt-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--agt-green);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 3px 14px rgba(255,185,0,.45);
  transition: background .2s, transform .15s, box-shadow .2s;
  padding: 0;
}
.agt-tool-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.agt-tool-btn:hover {
  background: var(--agt-gm);
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(255,185,0,.55);
}
.agt-tool-btn.active {
  background: var(--agt-dark);
  box-shadow: 0 3px 14px rgba(0,0,0,.3);
}

/* ── PANELS ─────────────────────────────────────────────── */
.agt-panel {
  position: fixed;
  right: -380px;
  top: var(--agt-panel-top, 0px);
  bottom: 0;
  width: 360px;
  background: var(--agt-white);
  box-shadow: var(--agt-shadow);
  /* Kõrgem kui Divi sticky header (99999) */
  z-index: 100100;
  display: flex;
  flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.agt-panel.open {
  right: 0;
}
.admin-bar .agt-panel {
  top: var(--agt-panel-top, 32px);
}
@media screen and (max-width: 782px) {
  .admin-bar .agt-panel { top: var(--agt-panel-top, 46px); }
}

.agt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #ffe8a0;
  flex-shrink: 0;
}
.agt-panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--agt-dark);
  margin: 0;
}
.agt-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background .15s, color .15s;
  padding: 0;
}
.agt-panel-close::before, .agt-panel-close::after { content: none !important; }
.agt-panel-close:hover { background: #fff8e0; color: var(--agt-green); }

.agt-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ── OVERLAY ────────────────────────────────────────────── */
.agt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60,70,75,.4);
  z-index: 100099;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.agt-overlay.show { opacity: 1; pointer-events: all; }

/* ── ACCESSIBILITY PANEL ─────────────────────────────────── */
.agt-a11y-section {
  margin-bottom: 24px;
}
.agt-a11y-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #888;
  margin: 0 0 10px;
}
.agt-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.agt-a11y-btn {
  padding: 8px 14px;
  border: 1.5px solid #ffd966;
  border-radius: 7px;
  background: #fff;
  color: var(--agt-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  flex: 1;
  min-width: 60px;
}
.agt-a11y-btn:hover { border-color: var(--agt-green); color: var(--agt-green); }
.agt-a11y-btn.active { background: var(--agt-green); color: #fff; border-color: var(--agt-green); }

.agt-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #fff8e0;
  font-size: 14px;
  color: var(--agt-dark);
}
.agt-toggle-row:last-child { border-bottom: none; }

/* Toggle switch shared */
.agt-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 24px;
  background: #ddd;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s;
  flex-shrink: 0;
}
.agt-toggle-switch[aria-checked="true"] { background: var(--agt-green); }
.agt-sw-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
}
.agt-toggle-switch[aria-checked="true"] .agt-sw-thumb { left: 23px; }

/* Lähtesta nupp */
.agt-a11y-reset-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  margin-right: 6px;
  padding: 5px 10px;
  background: none;
  border: 1.5px solid #ffd966;
  border-radius: 20px;
  color: #aaa;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.agt-a11y-reset-btn::before, .agt-a11y-reset-btn::after { content: none !important; }
.agt-a11y-reset-btn:hover { border-color: #ca0101; color: #ca0101; background: #fff5f5; }
.agt-a11y-reset-btn svg { flex-shrink: 0; }

/* ── SEARCH PANEL ───────────────────────────────────────── */
.agt-search-form { margin-bottom: 24px; }
.agt-search-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--agt-green);
  border-radius: 8px;
  overflow: hidden;
}
.agt-search-input-wrap svg { width: 18px; height: 18px; fill: var(--agt-gm); flex-shrink: 0; margin-left: 12px; }
.agt-search-input-wrap input {
  flex: 1;
  padding: 12px 10px;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--agt-dark);
}
.agt-search-input-wrap button {
  background: var(--agt-green);
  color: #fff;
  border: none;
  padding: 0 18px;
  height: 48px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.agt-search-input-wrap button:hover { background: var(--agt-gm); }
.agt-search-hints p { font-size: 12px; color: #888; margin-bottom: 8px; }
.agt-hint-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.agt-hint-pill {
  padding: 5px 12px;
  background: #fff8e0;
  color: #cc9800;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #ffd966;
  transition: all .15s;
}
.agt-hint-pill:hover { background: #ffd966; color: var(--agt-green); }

/* ── COOKIE PANEL ───────────────────────────────────────── */
.agt-cookie-intro { font-size: 13px; color: #666; margin-bottom: 20px; line-height: 1.5; }
.agt-cookie-category {
  padding: 14px 0;
  border-bottom: 1px solid #ffe8a0;
}
.agt-cookie-category:last-of-type { border-bottom: none; }
.agt-cookie-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.agt-cookie-cat-header strong { display: block; font-size: 14px; color: var(--agt-dark); }
.agt-cookie-desc { display: block; font-size: 12px; color: #888; margin-top: 2px; }
.agt-cookie-always {
  font-size: 11px;
  font-weight: 700;
  color: var(--agt-green);
  white-space: nowrap;
  padding: 4px 10px;
  background: #fff8e0;
  border-radius: 20px;
}
.agt-cookie-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.agt-cookie-links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
}
.agt-cookie-links a { color: var(--agt-green); text-decoration: none; }
.agt-cookie-links a:hover { text-decoration: underline; }

/* Shared buttons */
.agt-btn-primary {
  flex: 1;
  padding: 11px 16px;
  background: var(--agt-green);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.agt-btn-primary:hover { background: var(--agt-gm); }
.agt-btn-secondary {
  flex: 1;
  padding: 11px 16px;
  background: #fff;
  color: var(--agt-green);
  border: 1.5px solid var(--agt-green);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.agt-btn-secondary:hover { background: #fff8e0; }

/* ── COOKIE BANNER ──────────────────────────────────────── */
.agt-cookie-banner {
  /* CLS fix: kasutame transform-i bottom asemel, sest Lighthouse
     loeb bottom-i muutust layout shiftiks, aga transform on composite-only
     ja ei põhjusta CLS-i. */
  position: fixed;
  bottom: 20px;
  left: 50%;
  width: min(700px, calc(100vw - 32px));
  background: var(--agt-white);
  border-radius: 14px;
  box-shadow: 0 8px 48px rgba(0,0,0,.2);
  z-index: 99996;
  /* Peidetud alguses: ekraanist allpool + horisontaalselt tsentreeritud */
  transform: translate(-50%, calc(100% + 40px));
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  will-change: transform;
  border: 1px solid #ffe8a0;
}
.agt-cookie-banner.show {
  transform: translate(-50%, 0);
}

.agt-banner-inner {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.agt-banner-text { flex: 1; min-width: 200px; }
.agt-banner-text strong { display: block; font-size: 15px; color: var(--agt-dark); margin-bottom: 4px; }
.agt-banner-text p { font-size: 13px; color: #666; line-height: 1.4; margin: 0; }
.agt-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.agt-banner-btn { padding: 10px 20px; white-space: nowrap; }
.agt-banner-links {
  width: 100%;
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #ffe8a0;
  font-size: 12px;
}
.agt-banner-links a { color: var(--agt-green); text-decoration: none; }
.agt-banner-links a:hover { text-decoration: underline; }

/* ── ACCESSIBILITY BODY CLASSES ─────────────────────────────
   Kõik režiimid vastavad WCAG 2.1 standardile
─────────────────────────────────────────────────────────── */

/* Teksti suurendamine – käsitleb JS zoom kaudu (#agt-font-style element) */

/* Kõrge kontrast – WCAG AA (4.5:1 ja üle).
   NB: filter rakendub #agt-contrast-overlay kaudu (backdrop-filter), mitte body-le.
   body-le rakendatud filter muudaks keha fixed-elementide containing block'iks,
   mis rikub toolbar'i ja paneelide positsioneerimise. */
body.agt-high-contrast {
  /* filter eemaldatud tahtlikult – vaata #agt-contrast-overlay */
}

/* Tume režiim – inverteerib värvid, piltidel taastab. */
body.agt-dark-mode {
  /* filter eemaldatud tahtlikult */
}
body.agt-dark-mode img,
body.agt-dark-mode video,
body.agt-dark-mode svg image,
body.agt-dark-mode [style*="background-image"] {
  filter: invert(1) hue-rotate(180deg);
}

/* Kollane/must – WCAG AAA ligipääsetavuse standard nägemispuudega inimestele.
   Must tekst helekollase taustal, mitte kõik kollane! */
body.agt-yellow-mode {
  background-color: #fef08a !important;
  color: #000000 !important;
}
body.agt-yellow-mode h1, body.agt-yellow-mode h2, body.agt-yellow-mode h3,
body.agt-yellow-mode h4, body.agt-yellow-mode h5, body.agt-yellow-mode h6,
body.agt-yellow-mode p, body.agt-yellow-mode li, body.agt-yellow-mode td,
body.agt-yellow-mode th, body.agt-yellow-mode span, body.agt-yellow-mode label,
body.agt-yellow-mode div, body.agt-yellow-mode article, body.agt-yellow-mode section {
  color: #000000 !important;
  background-color: transparent !important;
}
body.agt-yellow-mode a {
  color: #1a00cc !important;
  background-color: transparent !important;
}
body.agt-yellow-mode a:hover { color: #0000aa !important; }
body.agt-yellow-mode header, body.agt-yellow-mode nav, body.agt-yellow-mode footer,
body.agt-yellow-mode main, body.agt-yellow-mode section, body.agt-yellow-mode article,
body.agt-yellow-mode .et_pb_section, body.agt-yellow-mode .et_pb_row {
  background-color: #fef08a !important;
}
body.agt-yellow-mode button, body.agt-yellow-mode .button,
body.agt-yellow-mode input[type=submit], body.agt-yellow-mode input[type=button] {
  background-color: #000 !important;
  color: #fef08a !important;
  border: 2px solid #000 !important;
}
/* Pildid ja meedia jäävad muutmata */
body.agt-yellow-mode img, body.agt-yellow-mode video,
body.agt-yellow-mode iframe, body.agt-yellow-mode svg { filter: none !important; }

/* Sinine filter – sinise valguse vähendamine (õhtuseks kasutuseks). */
body.agt-blue-filter { /* filter eemaldatud tahtlikult */ }

/* Lingid allajoonimisel */
body.agt-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* Laiendatud reavahe – loetavuse parandamine */
body.agt-line-height p,
body.agt-line-height li,
body.agt-line-height div,
body.agt-line-height span { line-height: 1.9 !important; }

/* Lugemisrežiim – beežikas taust, vähendab silmade väsimust */
body.agt-reading-mode {
  background-color: #f5f0e8 !important;
}
body.agt-reading-mode .et_pb_section,
body.agt-reading-mode .et_pb_row,
body.agt-reading-mode #page,
body.agt-reading-mode .site,
body.agt-reading-mode main,
body.agt-reading-mode article {
  background-color: #f5f0e8 !important;
}
body.agt-reading-mode p,
body.agt-reading-mode li { color: #2c2416 !important; }

/* Peida animatsioonid – vestibulaarprobleemid, liikumistundlikkus */
/* NB: toolbar, paneelid ja bänner on välistatud, et plugin UI töötaks normaalselt */
body.agt-no-animation *:not(.agt-toolbar):not(.agt-toolbar *):not(.agt-panel):not(.agt-panel *):not(.agt-overlay):not(.agt-cookie-banner):not(.agt-cookie-banner *):not(.agt-toolbar-restore),
body.agt-no-animation *:not(.agt-toolbar):not(.agt-toolbar *):not(.agt-panel):not(.agt-panel *):not(.agt-overlay):not(.agt-cookie-banner):not(.agt-cookie-banner *):not(.agt-toolbar-restore)::before,
body.agt-no-animation *:not(.agt-toolbar):not(.agt-toolbar *):not(.agt-panel):not(.agt-panel *):not(.agt-overlay):not(.agt-cookie-banner):not(.agt-cookie-banner *):not(.agt-toolbar-restore)::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Suur kursor */
body.agt-big-cursor,
body.agt-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath fill='%23ffb900' stroke='white' stroke-width='2' d='M4 2l26 15-11 2-5 12z'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* Fookuse rõhutamine – klaviatuurnavigatsiooni
   Divi kirjutab tihti outline: none !important üle –
   seetõttu kasutame html body... prefiksit (kõrgem spetsiifilisus) ja
   lisame :focus-visible modernse fookuslogika toetuseks */
body.agt-focus-highlight *:focus,
body.agt-focus-highlight *:focus-visible {
  outline: 3px solid #ffb900 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(255,185,0,.25) !important;
}
/* Kõrgemspetsiifilised selektorid Divi outline:none ülekirjutuste vastu */
html body.agt-focus-highlight a:focus,
html body.agt-focus-highlight a:focus-visible,
html body.agt-focus-highlight button:focus,
html body.agt-focus-highlight button:focus-visible,
html body.agt-focus-highlight input:focus,
html body.agt-focus-highlight input:focus-visible,
html body.agt-focus-highlight select:focus,
html body.agt-focus-highlight select:focus-visible,
html body.agt-focus-highlight textarea:focus,
html body.agt-focus-highlight textarea:focus-visible,
html body.agt-focus-highlight [tabindex]:focus,
html body.agt-focus-highlight [tabindex]:focus-visible {
  outline: 3px solid #ffb900 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(255,185,0,.25) !important;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .agt-toolbar { right: 6px; top: 50%; transform: translateY(-50%); gap: 6px; }
  /* Otsing/kupsised/ligipääsetavus — mobiilis väiksemad ja servale
     kinnitatud, et ei kataks sisu ära. */
  .agt-tool-btn { width: 34px; height: 34px; border-radius: 7px; }
  .agt-tool-btn svg { width: 16px; height: 16px; }
  .agt-toolbar-dismiss { width: 22px; height: 22px; top: -28px; font-size: 9px; }
  .agt-toolbar-restore { width: 30px; height: 30px; right: 6px; }
  .agt-toolbar-restore svg { width: 14px; height: 14px; }
  .agt-panel { width: 100%; right: -100%; }
  .agt-cookie-banner {
    border-radius: 14px 14px 0 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(100%);
  }
  .agt-cookie-banner.show { transform: translateY(0); }
  .agt-banner-inner { flex-direction: column; gap: 12px; }
  .agt-banner-actions { width: 100%; }
}

/* ── A11Y PANEL – uued stiilid ──────────────────────────── */
.agt-font-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.agt-font-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  font-size: 11px;
}
.agt-font-btn span { line-height: 1; font-weight: 700; }

.agt-contrast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.agt-contrast-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1.5px solid var(--color-border-tertiary, #ffd966);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: #555;
  transition: all .15s;
}
.agt-contrast-opt:hover { border-color: #ffb900; color: #ffb900; }
.agt-contrast-opt.active { border-color: #ffb900; background: #fff8e0; color: #ffb900; font-weight: 700; }
.agt-contrast-opt::before, .agt-contrast-opt::after { content: none !important; }

.agt-contrast-preview {
  width: 40px; height: 26px;
  border-radius: 5px;
  border: 1px solid #ddd;
  display: block;
  flex-shrink: 0;
}
.agt-cp-normal  { background: linear-gradient(135deg, #fff 50%, #3c464b 50%); }
.agt-cp-high    { background: #000; border-color: #333; }
.agt-cp-dark    { background: linear-gradient(135deg, #1a2e1a 0%, #16322a 100%); }
.agt-cp-yellow  { background: linear-gradient(135deg, #fef08a 50%, #000 50%); }
.agt-cp-blue    { background: linear-gradient(135deg, #fde68a 0%, #fbbf24 50%, #f59e0b 100%); }

/* ── Font size kontrolleri UI ────────────────────────────── */
.agt-font-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.agt-font-dec, .agt-font-inc, .agt-font-reset-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid #ffd966;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #ffb900;
  transition: all .15s;
  flex-shrink: 0;
  padding: 0;
}
.agt-font-dec::before, .agt-font-dec::after,
.agt-font-inc::before, .agt-font-inc::after,
.agt-font-reset-btn::before, .agt-font-reset-btn::after { content: none !important; }
.agt-font-dec:hover, .agt-font-inc:hover { background: #fff8e0; border-color: #ffb900; }
.agt-font-dec:disabled, .agt-font-inc:disabled { opacity: .35; cursor: not-allowed; }
.agt-font-reset-btn { width: 28px; height: 28px; border-color: #e0e0e0; color: #aaa; }
.agt-font-reset-btn:hover { color: #ca0101; border-color: #ca0101; background: #fff5f5; }

.agt-font-indicator {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.agt-font-preview {
  font-weight: 800;
  color: #ffb900;
  transition: font-size .2s;
  line-height: 1;
}
.agt-font-pct {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

.agt-font-scale-bar {
  height: 4px;
  background: #ffe8a0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2px;
}
.agt-font-scale-fill {
  height: 100%;
  background: #ffb900;
  border-radius: 4px;
  transition: width .2s;
  width: 50%; /* 100% = keskel, skaala 80-150% */
}

/* Peida paneel kui mobiilimenuu on lahti */
body.agrovaru-nav-open .agt-panel,
body.agrovaru-nav-open .agt-toolbar,
body.agrovaru-nav-open .agt-toolbar-restore {
  display: none !important;
}

/* ── KONTRASTI OVERLAY ──────────────────────────────────────
   backdrop-filter lahendus: filter rakendub fikseeritud overlay elemendile,
   mitte body-le. See tagab, et position:fixed plugin elemendid (toolbar,
   paneelid) jäävad alati viewport'iga seotuks, mitte keha suuruse järgi. */
#agt-contrast-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Allpool toolbar'i (99990) ja paneelide (100100), ülalpool lehtede sisu */
  z-index: 99979;
}
body.agt-high-contrast #agt-contrast-overlay {
  backdrop-filter: contrast(200%) saturate(0);
  -webkit-backdrop-filter: contrast(200%) saturate(0);
}
body.agt-dark-mode #agt-contrast-overlay {
  backdrop-filter: invert(1) hue-rotate(180deg);
  -webkit-backdrop-filter: invert(1) hue-rotate(180deg);
}
body.agt-blue-filter #agt-contrast-overlay {
  backdrop-filter: sepia(20%) saturate(80%);
  -webkit-backdrop-filter: sepia(20%) saturate(80%);
}

/* ── PLUGIN UI VÄLJANÄGEMINE KONTRASIREŽIIMIDES ──────────────
   Plugin elemendid asuvad overlay'st kõrgemal (z-index > 99979),
   nii et backdrop-filter neid ei mõjuta. Rakendame eraldi stiilid
   loetavuse tagamiseks. */

/* Kõrge kontrast: toolbar nupud mustad/valge piirjoonega */
body.agt-high-contrast .agt-tool-btn,
body.agt-high-contrast .agt-toolbar-dismiss,
body.agt-high-contrast .agt-toolbar-restore {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #ffb900 !important; /* roheline – nähtav mustal taustal */
}

/* Tume režiim: inverteeri plugin UI (peegelda dark mode väljanägemist) */
body.agt-dark-mode .agt-toolbar,
body.agt-dark-mode .agt-panel,
body.agt-dark-mode .agt-overlay,
body.agt-dark-mode .agt-cookie-banner,
body.agt-dark-mode .agt-toolbar-restore {
  filter: invert(1) hue-rotate(180deg) !important;
}


/* ══════════════════════════════════════════════════════════
   LIVE OTSING – dropdown (body-tase, fixed positsioon)
   ══════════════════════════════════════════════════════════ */
#agt-sug-dropdown {
    position: absolute;        /* JS seab top/left/width */
    z-index: 2147483647;       /* kõrgeim võimalik – üle kõige */
    background: #fff;
    border: 1px solid #dce2e6;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.14);
    overflow: hidden;
    animation: agtSugIn .14s ease;
    min-width: 260px;
}
@keyframes agtSugIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.agt-sug-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    text-decoration: none;
    color: #1a2227;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid #f2f5f6;
}
.agt-sug-item:last-of-type { border-bottom: none; }
.agt-sug-item:hover,
.agt-sug-item.agt-sug-active {
    background: #f3f7f3;
    color: #1a2227;
}
.agt-sug-thumb {
    width: 46px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #eef1f2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agt-sug-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.agt-sug-nothumb svg {
    width: 18px;
    height: 18px;
    opacity: .28;
}
.agt-sug-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.agt-sug-text strong {
    font-size: 13px;
    font-weight: 600;
    color: #1a2227;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.agt-sug-text span {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.agt-sug-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    opacity: .9;
}
.agt-sug-all {
    display: block;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--agt-green, #3a7d0e);
    text-decoration: none;
    background: #f8faf8;
    text-align: center;
    transition: background .1s;
    border-top: 1px solid #edf0f1;
}
.agt-sug-all:hover { background: #edf5ed; }
