/* C02 1.0.1 FIX1. All component selectors are scoped; host typography is configurable. */
.qpe {
  --qpe-ink: #143d30; --qpe-dark: #104c36; --qpe-paper: #fffcf1;
  --qpe-font: 'PT Root UI', 'Wix Madefor Text', 'Manrope', system-ui, sans-serif;
  --qpe-closed: 196px; --qpe-open: 720px; --qpe-height: 64px;
  --qpe-expanded-height: 64px; --qpe-duration: 320ms; --qpe-ease: cubic-bezier(.22,.8,.24,1);
  position: relative; width: 100%; min-width: 0; height: var(--qpe-height);
  color: var(--qpe-ink); font-family: var(--qpe-font); isolation: isolate;
}
.qpe *, .qpe *::before, .qpe *::after { box-sizing: border-box; }
.qpe [hidden] { display: none !important; }
.qpe button, .qpe input { font: inherit; }
.qpe button, .qpe a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.qpe button { cursor: pointer; }
.qpe a { color: inherit; text-decoration: none; }
.qpe a:focus-visible, .qpe button:focus-visible, .qpe input:focus-visible {
  outline: 3px solid #123e31; outline-offset: 3px; box-shadow: 0 0 0 6px #fff5cb;
}
.qpe-shell {
  position: absolute; left: 0; top: 0; overflow: hidden;
  width: min(var(--qpe-closed), 100%); max-width: 100%; height: var(--qpe-height);
  background: linear-gradient(170deg, rgba(255,253,235,.97) 0%, rgba(238,240,207,.94) 58%, rgba(219,230,183,.96) 100%);
  border: 1px solid rgba(255,250,212,.95); border-radius: 34px;
  box-shadow: 0 13px 24px -12px rgba(1,25,18,.6), 0 0 0 1px rgba(97,112,63,.42), inset 0 2px 2px #fffef7, inset 0 -3px 5px rgba(110,129,53,.18);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: width var(--qpe-duration) var(--qpe-ease), height var(--qpe-duration) var(--qpe-ease), border-radius var(--qpe-duration) var(--qpe-ease);
}
.qpe[data-state='open'] .qpe-shell { width: var(--qpe-open); height: var(--qpe-expanded-height); }
.qpe[data-state='closed'] .qpe-shell { --qpe-duration: 260ms; }
.qpe-toggle {
  appearance: none; position: absolute; top: 0; left: 0; width: 100%; height: 62px;
  padding: 0 62px; border: 0; border-radius: 34px; color: var(--qpe-ink); background: transparent;
  display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 16px; font-weight: 750;
}
.qpe[data-state='open'] .qpe-toggle { width: 151px; padding: 0 8px 60px 60px; padding-bottom: 0; }
.qpe-toggle-label { position: absolute; left: 66px; top: 50%; transform: translateY(-50%); }
.qpe-caret { position: absolute; left: 120px; top: 24px; width: 14px; height: 14px; opacity: 0; transition: opacity 140ms; }
.qpe[data-state='open'] .qpe-caret { opacity: 1; }
.qpe-left-eye { position: absolute; left: 11px; top: 11px; pointer-events: none; z-index: 2; }
.qpe-right-eye { position: absolute; right: 11px; top: 11px; pointer-events: none; z-index: 3; }
.qpe-eye {
  display: block; position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 34% 18%, #effda7 0%, #c4e76e 28%, #82b747 60%, #527e29 85%, #376326 100%);
  box-shadow: 0 3px 4px rgba(30,63,9,.29), 0 0 0 1px #799443, inset 0 2px 2px #f7ffd7, inset 0 -2px 3px #5a8727;
  transform: translateZ(0);
}
.qpe-eye::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fffbe1; box-shadow: 0 0 0 1px rgba(87,110,26,.38), inset 1px 2px 4px #d4d3a2; }
.qpe-eye-aperture { position: absolute; inset: 5px; overflow: hidden; border-radius: 50%; transform: translateZ(0); }
.qpe-iris {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse at 46% 39%, #0c291a 0 37%, #547836 40%, #789b37 51%, #becd65 65%, #a9a044 72%, #5e802b 77%, #d7cb75 85%, #738b35 100%);
  border: 1px solid #697e35; box-shadow: inset 0 -2px 2px #e8db83;
  transform: translate(var(--qpe-gaze-x, 0px), var(--qpe-gaze-y, 0px));
  transition: transform 220ms ease-out;
}
.qpe-pupil { position: absolute; inset: 3px 4px 5px; border-radius: 50%; background: radial-gradient(ellipse at 45% 20%, #24362c, #081b13 72%); }
.qpe-pupil::before { content: ''; position: absolute; top: 2px; left: 2px; width: 7px; height: 8px; border-radius: 50%; background: #fffef7; transform: rotate(-25deg); }
.qpe-pupil::after { content: ''; position: absolute; bottom: 2px; right: 1px; width: 3px; height: 3px; border-radius: 50%; background: #f9ffd8; opacity: .8; }
.qpe-lid { position: absolute; z-index: 4; left: -3px; width: 36px; background: linear-gradient(180deg,#d7ed90,#9ac65c); transition: transform 220ms ease-out; }
.qpe-lid-top { top: -4px; height: 34px; border-bottom: 1.5px solid #678d3b; border-radius: 0 0 45% 45%; transform: translateY(-30px); }
.qpe-lid-bottom { bottom: -3px; height: 18px; border-top: 1.5px solid #7d9e41; border-radius: 50% 50% 0 0; transform: translateY(16px); }
.qpe[data-expression='calm'] .qpe-lid-top { transform: translateY(-24px); }
.qpe[data-expression='calm'] .qpe-iris { --qpe-gaze-y: 1px; }
.qpe[data-expression='attentive'] .qpe-iris { --qpe-gaze-x: 3px; --qpe-gaze-y: -1px; }
.qpe[data-expression='joy'] .qpe-lid-bottom { transform: translateY(8px); }
.qpe[data-expression='joy'] .qpe-lid-top { transform: translateY(-28px); }
.qpe[data-expression='kind'] .qpe-lid-top { transform: translateY(-29px); }
.qpe-close {
  display: none; position: absolute; right: 3px; top: 3px; width: 56px; height: 56px; border: none; border-radius: 50%; background: transparent;
}
.qpe[data-state='open'] .qpe-close { display: block; }
.qpe-close-mark { position: absolute; right: -1px; bottom: 1px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #214c36; color: #fff8e7; font-size: 15px; line-height: 1; z-index: 5; }
.qpe-panel { position: absolute; top: 8px; left: 151px; right: 65px; opacity: 0; visibility: hidden; transition: opacity 100ms linear; }
.qpe[data-state='open'] .qpe-panel { opacity: 1; visibility: visible; transition: opacity 170ms ease-out 110ms; }
.qpe-links { display: flex; align-items: center; gap: 3px; margin: 0; padding: 0; list-style: none; }
.qpe-links li { margin: 0; padding: 0; }
.qpe-links a, .qpe-search-open {
  display: flex; gap: 10px; align-items: center; min-height: 46px; padding: 10px 12px; border: 1px solid transparent;
  border-radius: 23px; white-space: nowrap; color: #173f30; font-size: 14px; font-weight: 650; background: transparent;
}
.qpe-links a:hover, .qpe-search-open:hover { background: #fffdf2; border-color: #b6c498; }
.qpe-links a[aria-current] { background: #245440; color: #fffbee; }
.qpe-link-icon { width: 18px; height: 18px; flex-shrink: 0; display: none; }
.qpe-search-open { width: 46px; padding: 11px; justify-content: center; }
.qpe-search-open svg { width: 20px; height: 20px; }
.qpe-search-label { display: none; }
.qpe-panel[data-view='search'] { top: 72px; left: 16px; right: 16px; }
.qpe-search-box { color: #173e30; padding: 6px 4px 12px; }
.qpe-search-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.qpe-search-back { min-height: 44px; padding: 8px 12px; border: 1px solid #8f9d77; border-radius: 12px; background: #fffdf3; color: #173f30; font-size: 14px; }
.qpe-search-input { display: block; width: 100%; min-height: 48px; padding: 12px; color: #153f2f; border: 1px solid #7a8c6f; border-radius: 12px; background: #fffdf7; font-size: 16px; }
.qpe-search-status { color: #425845; font-size: 12px; line-height: 1.5; margin: 12px 0 6px; }
.qpe-results { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.qpe-results a { display: block; padding: 12px; min-height: 44px; border-radius: 10px; background: #fffdf3; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.qpe-results a:hover { background: #d9e8bc; }
.qpe-search-empty { padding: 10px 0; margin: 0; line-height: 1.5; font-size: 14px; }
.qpe[data-layout='stack'][data-state='open'] .qpe-shell, .qpe[data-view='search'] .qpe-shell { border-radius: 32px 32px 24px 24px; }
/* V3 mobile geometry: the label follows the SAME interpolated shell width
   as the right eye. No second transition/timer: opening, closing, reversal
   and reduced motion cannot desynchronise the two. Inline stays unchanged.
   Keep the full header hit area so the moving label remains clickable. */
.qpe[data-layout='stack'] .qpe-toggle { width: 100%; }
.qpe[data-layout='stack'] .qpe-toggle-label { left: 50%; transform: translate(-50%, -50%); }
.qpe[data-layout='stack'] .qpe-caret { left: calc(50% + 30px); }
.qpe[data-layout='stack'] .qpe-panel { top: 72px; left: 16px; right: 16px; }
.qpe[data-layout='stack'] .qpe-links { flex-direction: column; align-items: stretch; gap: 4px; padding-bottom: 12px; }
.qpe[data-layout='stack'] .qpe-links a, .qpe[data-layout='stack'] .qpe-search-open { width: 100%; min-height: 48px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; padding: 11px 14px; border-radius: 12px; }
.qpe[data-layout='stack'] .qpe-links a { background: rgba(255,254,244,.7); border-color: #c2cda8; }
.qpe[data-layout='stack'] .qpe-links a[aria-current] { background: #245440; color: #fffbee; }
.qpe[data-layout='stack'] .qpe-link-icon, .qpe[data-layout='stack'] .qpe-search-label { display: inline; }
.qpe[data-layout='stack'] .qpe-search-open { justify-content: flex-start; }
.qpe[data-solid='true'] .qpe-shell { background: #edf1d8; -webkit-backdrop-filter: none; backdrop-filter: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .qpe-shell { background: #edf1d8; }
}
.qpe[data-motion='reduced'] *, .qpe[data-motion='reduced'] *::before, .qpe[data-motion='reduced'] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .qpe *, .qpe *::before, .qpe *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .qpe-shell, .qpe-links a, .qpe-search-open, .qpe-search-input { background: Canvas; color: CanvasText; border: 1px solid ButtonText; }
  .qpe-eye { forced-color-adjust: none; }
  .qpe-toggle { color: ButtonText; }
  .qpe a:focus-visible, .qpe button:focus-visible, .qpe input:focus-visible { outline-color: Highlight; }
}
/* No JavaScript: ordinary visible links, not a dead menu button. */
.qpe:not([data-ready]) { height: auto; }
.qpe:not([data-ready]) .qpe-shell { position: static; width: 100%; height: auto; border-radius: 20px; padding: 12px; }
.qpe:not([data-ready]) .qpe-toggle, .qpe:not([data-ready]) .qpe-right-eye, .qpe:not([data-ready]) .qpe-close, .qpe:not([data-ready]) .qpe-search-item { display: none; }
.qpe:not([data-ready]) .qpe-panel { position: static; visibility: visible; opacity: 1; }
.qpe:not([data-ready]) .qpe-links { flex-wrap: wrap; }

/* Keep outer controls visibly focused even while the capsule clips its reveal. */
.qpe .qpe-toggle:focus-visible, .qpe .qpe-close:focus-visible { outline-offset: -5px; box-shadow: none; }
