/* PATIKA34 AI PRO V51 — V50 protected + single-mic voice + AI identity */
:root{
  --patika-ai-green:#176b26;--patika-ai-deep:#17332b;--patika-ai-accent:#0f6549;--patika-ai-cream:#fbf8f1;--patika-ai-line:#dbe6df;--patika-ai-muted:#4f625a;--patika-ai-bottom:calc(18px + env(safe-area-inset-bottom,0px));--patika-ai-vh:100vh;
}
#patika-ai-root,#patika-ai-root *{box-sizing:border-box}
#patika-ai-root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--patika-ai-deep);pointer-events:auto}
#patika-ai-root button,#patika-ai-root textarea,#patika-ai-root a{pointer-events:auto}
.patika-ai-launcher{position:fixed;right:16px;bottom:var(--patika-ai-bottom);z-index:2147483600;width:62px;height:62px;border:0;border-radius:999px;padding:0;cursor:pointer;display:grid;place-items:center;background:#fff;box-shadow:0 14px 36px rgba(15,101,73,.28),0 3px 10px rgba(0,0,0,.14);-webkit-tap-highlight-color:transparent;transition:transform .18s ease,box-shadow .18s ease;touch-action:manipulation}

.patika-ai-launch-ai{position:absolute;right:-3px;top:-5px;width:25px;height:25px;border-radius:999px;display:grid;place-items:center;background:#fff;color:#0f6549;border:1px solid #cfe2d5;box-shadow:0 4px 12px rgba(15,101,73,.2);pointer-events:none;animation:patikaAiMark 2.6s ease-in-out infinite}
.patika-ai-launch-ai svg{width:16px;height:16px;display:block;fill:currentColor}
.patika-ai-launcher:hover{transform:translateY(-2px)}.patika-ai-launcher:focus-visible{outline:3px solid rgba(23,107,38,.28);outline-offset:4px}
.patika-ai-launch-orb{position:relative;width:48px;height:48px;border-radius:50%;display:block;overflow:hidden;background:radial-gradient(circle at 34% 28%,#d8fff0 0 12%,#68d7b0 28%,#1b8c62 58%,#0b493a 100%);box-shadow:inset 0 0 14px rgba(255,255,255,.55),0 0 0 1px rgba(15,101,73,.12),0 0 20px rgba(29,159,111,.28);animation:patikaOrbPulse 2.2s ease-in-out infinite}
.patika-ai-launch-orb i{position:absolute;border-radius:50%;filter:blur(1px);background:rgba(255,255,255,.5);animation:patikaOrbFloat 3.8s ease-in-out infinite}.patika-ai-launch-orb i:nth-child(1){width:20px;height:20px;left:8px;top:7px}.patika-ai-launch-orb i:nth-child(2){width:14px;height:14px;right:7px;bottom:8px;animation-delay:.7s}.patika-ai-launch-orb i:nth-child(3){width:10px;height:10px;right:10px;top:9px;animation-delay:1.2s}
.patika-ai-panel{position:fixed;right:16px;bottom:calc(var(--patika-ai-bottom) + 76px);z-index:2147483599;width:min(410px,calc(100vw - 24px));height:min(650px,calc(var(--patika-ai-vh) - 120px));min-height:420px;display:grid;grid-template-rows:auto 1fr auto auto;overflow:hidden;border:1px solid rgba(23,51,43,.12);border-radius:26px;background:var(--patika-ai-cream);box-shadow:0 26px 75px rgba(23,51,43,.24),0 8px 28px rgba(0,0,0,.12);opacity:0;transform:translateY(12px) scale(.985);pointer-events:none!important;visibility:hidden;transition:opacity .18s ease,transform .18s ease,visibility .18s ease}
.patika-ai-panel.is-open{opacity:1;transform:none;pointer-events:auto!important;visibility:visible}
.patika-ai-header{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;padding:16px 56px 14px;border-bottom:1px solid var(--patika-ai-line);background:linear-gradient(180deg,#f8fbf8,#eef6f1)}
.patika-ai-brand{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center}.patika-ai-brand img{width:44px;height:44px;object-fit:contain;display:block}.patika-ai-brand strong{font-size:16px;line-height:1.12}.patika-ai-brand span{font-size:11px;color:var(--patika-ai-muted);font-weight:650}
.patika-ai-icon-btn{position:absolute;top:13px;width:36px;height:36px;border:1px solid rgba(23,51,43,.12);border-radius:999px;display:grid;place-items:center;background:#fff;color:var(--patika-ai-deep);font:800 17px/1 system-ui;cursor:pointer;box-shadow:0 3px 10px rgba(23,51,43,.06)}.patika-ai-reset{left:14px}.patika-ai-close{right:14px}
.patika-ai-messages{display:flex;flex-direction:column;gap:12px;overflow:auto;padding:16px 14px;scroll-behavior:smooth;overscroll-behavior:contain}.patika-ai-message{width:100%;display:flex;flex-direction:column;align-items:center;text-align:center}.patika-ai-message.user{align-items:flex-end;text-align:right}.patika-ai-author{font-size:10px;font-weight:850;letter-spacing:.08em;color:#6d8077;margin:0 0 4px;text-transform:uppercase;text-align:center}.patika-ai-message.user .patika-ai-author{text-align:right}.patika-ai-bubble{width:auto;max-width:92%;white-space:pre-wrap;overflow-wrap:anywhere;text-align:center;direction:auto;border-radius:3px 16px 16px 16px;padding:11px 14px;font-size:14px;line-height:1.55;border:1px solid #ebe8df;background:#f5f4f0;color:var(--patika-ai-deep);box-shadow:0 3px 10px rgba(23,51,43,.035)}.patika-ai-message.user .patika-ai-bubble{max-width:86%;text-align:right;background:#e9f5ec;color:#17332b;border-color:#cfe2d5;border-radius:16px 3px 16px 16px}
.patika-ai-sources{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-width:92%;margin-top:7px}.patika-ai-source{display:inline-flex;align-items:center;justify-content:center;max-width:100%;padding:5px 8px;border-radius:999px;border:1px solid #d7e4dc;background:#f7fbf8;color:#245744;text-decoration:none;font-size:10.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.patika-ai-welcome{width:100%;display:flex;flex-direction:column;align-items:center;text-align:center;padding:14px 8px}.patika-ai-welcome strong{font-size:16px;margin-bottom:6px}.patika-ai-welcome p{margin:0;max-width:305px;color:var(--patika-ai-muted);font-size:12.5px;line-height:1.55;text-align:center}
.patika-ai-composer{display:grid;grid-template-columns:46px 1fr 46px;gap:8px;align-items:end;padding:11px 12px 9px;border-top:1px solid var(--patika-ai-line);background:#fff}.patika-ai-input{width:100%;resize:none;min-height:46px;max-height:122px;border:1px solid #ccdcd3;border-radius:16px;padding:12px 13px;background:#fbfdfb;color:var(--patika-ai-deep);font:500 14px/1.45 inherit;text-align:center;direction:auto;outline:none}.patika-ai-input:focus{border-color:#6da58d;box-shadow:0 0 0 3px rgba(15,101,73,.10)}.patika-ai-input::placeholder{text-align:center;color:#819188}
.patika-ai-send,.patika-ai-voice-btn{width:46px;height:46px;border:0;border-radius:15px;background:var(--patika-ai-green);color:#fff;cursor:pointer;display:grid;place-items:center;box-shadow:0 5px 13px rgba(23,107,38,.22)}.patika-ai-voice-btn{background:#eef6f1;color:#176b26;border:1px solid #d3e5d9}.patika-ai-voice-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}.patika-ai-voice-btn.is-active{background:#176b26;color:#fff}.patika-ai-send:disabled,.patika-ai-input:disabled{opacity:.58;cursor:not-allowed}
.patika-ai-status{min-height:18px;margin:0;padding:0 12px 9px;text-align:center;font-size:10.5px;line-height:1.35;color:#687b72;background:#fff}.patika-ai-typing{display:inline-flex;gap:4px;align-items:center;justify-content:center}.patika-ai-typing i{width:5px;height:5px;border-radius:50%;background:#6da58d;animation:patikaAiDot 1s infinite ease-in-out}.patika-ai-typing i:nth-child(2){animation-delay:.15s}.patika-ai-typing i:nth-child(3){animation-delay:.3s}
.patika-ai-voice-stage{min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:22px 24px;gap:12px;background:radial-gradient(circle at 50% 42%,#f7fffa 0,#eef8f2 45%,#e7f1eb 100%)}.patika-ai-voice-stage[hidden]{display:none!important}.patika-ai-voice-orb{width:132px;height:132px;border:0;border-radius:50%;padding:0;cursor:pointer;position:relative;background:transparent;display:grid;place-items:center;filter:drop-shadow(0 18px 26px rgba(12,87,59,.18));touch-action:manipulation}.patika-ai-orb-core{width:112px;height:112px;border-radius:50%;display:block;background:radial-gradient(circle at 34% 28%,#effff8 0 10%,#a5f1d2 24%,#47c99a 47%,#16835f 68%,#083e31 100%);box-shadow:inset 0 0 28px rgba(255,255,255,.5),0 0 0 1px rgba(15,101,73,.12),0 0 34px rgba(43,192,139,.28);animation:patikaVoiceBreathe 2.4s ease-in-out infinite}.patika-ai-voice-stage[data-phase="hearing"] .patika-ai-orb-core{animation-duration:.8s}.patika-ai-voice-stage[data-phase="waiting"] .patika-ai-orb-core{animation-duration:1.5s;filter:hue-rotate(10deg)}.patika-ai-voice-stage[data-phase="speaking"] .patika-ai-orb-core{animation-duration:.62s;filter:saturate(1.14)}.patika-ai-voice-stage[data-phase="holding"] .patika-ai-orb-core{animation-duration:3.4s;filter:saturate(.82)}.patika-ai-voice-status{font-size:18px;color:#17332b}.patika-ai-voice-mic{font-size:11px;font-weight:800;color:#176b26;background:#fff;border:1px solid #d3e5d9;border-radius:999px;padding:6px 10px}.patika-ai-voice-hint{margin:0;max-width:320px;font-size:11.5px;line-height:1.5;color:#5d7167}
#patika-ai-root.is-voice .patika-ai-messages{display:none}#patika-ai-root.is-voice .patika-ai-composer{grid-template-columns:46px 1fr 46px}#patika-ai-root.is-voice .patika-ai-input,#patika-ai-root.is-voice .patika-ai-send{visibility:hidden;pointer-events:none}
@keyframes patikaAiMark{0%,100%{transform:scale(.94) rotate(0deg);opacity:.88}50%{transform:scale(1.08) rotate(6deg);opacity:1}}@keyframes patikaAiDot{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}@keyframes patikaOrbPulse{0%,100%{transform:scale(.96);filter:saturate(.94)}50%{transform:scale(1.03);filter:saturate(1.08)}}@keyframes patikaOrbFloat{0%,100%{transform:translate(0,0);opacity:.35}50%{transform:translate(3px,-4px);opacity:.75}}@keyframes patikaVoiceBreathe{0%,100%{transform:scale(.94);box-shadow:inset 0 0 28px rgba(255,255,255,.5),0 0 0 1px rgba(15,101,73,.12),0 0 24px rgba(43,192,139,.22)}50%{transform:scale(1.05);box-shadow:inset 0 0 30px rgba(255,255,255,.55),0 0 0 1px rgba(15,101,73,.12),0 0 46px rgba(43,192,139,.38)}}
@media(max-width:620px){.patika-ai-launcher{right:12px;width:58px;height:58px}.patika-ai-launch-orb{width:46px;height:46px}.patika-ai-panel{right:12px;width:calc(100vw - 24px);height:min(650px,calc(var(--patika-ai-vh) - 96px));bottom:calc(var(--patika-ai-bottom) + 70px);border-radius:22px}.patika-ai-header{padding:13px 50px 11px}.patika-ai-brand img{width:40px;height:40px}.patika-ai-brand strong{font-size:15px}.patika-ai-icon-btn{top:11px;width:34px;height:34px}.patika-ai-reset{left:10px}.patika-ai-close{right:10px}.patika-ai-messages{padding:13px 10px}.patika-ai-bubble{max-width:96%;font-size:13.5px}.patika-ai-composer{grid-template-columns:44px 1fr 44px;padding:9px 9px 8px}.patika-ai-input{min-height:44px}.patika-ai-send,.patika-ai-voice-btn{width:44px;height:44px}.patika-ai-voice-orb{width:120px;height:120px}.patika-ai-orb-core{width:102px;height:102px}}
@media(max-height:590px){.patika-ai-panel{height:calc(var(--patika-ai-vh) - 82px);min-height:320px}.patika-ai-voice-orb{width:105px;height:105px}.patika-ai-orb-core{width:88px;height:88px}}
@media(prefers-reduced-motion:reduce){.patika-ai-launcher,.patika-ai-panel{transition:none}.patika-ai-launch-orb,.patika-ai-launch-orb i,.patika-ai-launch-ai,.patika-ai-orb-core,.patika-ai-typing i{animation:none}}
@media print{#patika-ai-root{display:none!important}}

/* V53: only center the existing microphone in text mode. */
#patika-ai-root:not(.is-voice) .patika-ai-composer{grid-template-columns:minmax(0,1fr) 46px}
#patika-ai-root:not(.is-voice) .patika-ai-voice-btn{grid-column:1/-1;grid-row:1;justify-self:center}
#patika-ai-root:not(.is-voice) .patika-ai-input{grid-column:1;grid-row:2}
#patika-ai-root:not(.is-voice) .patika-ai-send{grid-column:2;grid-row:2}
@media(max-width:620px){#patika-ai-root:not(.is-voice) .patika-ai-composer{grid-template-columns:minmax(0,1fr) 44px}}
