/* ============================================================
   GABRIEL GARÁŽ - průvodce (chat) vpravo dole. Paleta z .gg tokenů
   (grafit + značková modrá), Archivo / Instrument Sans.
   Z-index: nad mobilní tabbar (80), pod cookie lištu (95).
   ============================================================ */
.ggchat{ position:fixed; right:20px; bottom:20px; z-index:90; font-family:var(--fb,'Instrument Sans',system-ui,Arial,sans-serif); color:var(--ink,#0D1420); }
.ggchat[hidden]{ display:none; }
.ggchat__sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* bublina */
.ggchat__fab{ position:relative; width:58px; height:58px; border:0; border-radius:999px; cursor:pointer; color:#fff;
  background:linear-gradient(180deg,#3B8AE2,var(--blue,#2E7CD6) 55%,var(--blue-deep,#1E63B8));
  box-shadow:0 1px 0 rgba(255,255,255,.25) inset, 0 12px 30px -8px rgba(46,124,214,.6);
  display:flex; align-items:center; justify-content:center; transition:transform .16s ease, box-shadow .25s ease; }
.ggchat__fab:hover{ transform:translateY(-2px); box-shadow:0 1px 0 rgba(255,255,255,.3) inset, 0 16px 36px -8px rgba(46,124,214,.7); }
.ggchat__fab svg{ width:28px; height:28px; }
.ggchat__fab-close{ display:none; }
.ggchat.is-open .ggchat__fab-open{ display:none; }
.ggchat.is-open .ggchat__fab-close{ display:block; }
.ggchat__badge{ position:absolute; top:-4px; right:-4px; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:#E5484D; color:#fff; font:700 .72rem/20px var(--fh,'Archivo',system-ui,sans-serif); box-shadow:0 0 0 2px #fff; }
.ggchat__badge[hidden]{ display:none; }
.ggchat.has-badge .ggchat__fab{ animation:ggchat-pulse 1.6s ease-out 3; }
@keyframes ggchat-pulse{ 0%{ box-shadow:0 0 0 0 rgba(46,124,214,.55), 0 12px 30px -8px rgba(46,124,214,.6); } 100%{ box-shadow:0 0 0 16px rgba(46,124,214,0), 0 12px 30px -8px rgba(46,124,214,.6); } }
.ggchat__nudge{ position:absolute; right:calc(100% + 12px); top:50%; transform:translateY(-50%); white-space:nowrap; background:#fff; color:var(--ink,#0D1420); font:600 .86rem/1.2 var(--fb,'Instrument Sans',system-ui,sans-serif); padding:.6rem .85rem; border-radius:12px; box-shadow:0 10px 30px -10px rgba(13,20,32,.35); border:1px solid var(--border,#E4E9F0); }
.ggchat__nudge[hidden]{ display:none; }
.ggchat__nudge::after{ content:""; position:absolute; left:100%; top:50%; margin-top:-6px; border:6px solid transparent; border-left-color:#fff; }

/* panel */
.ggchat__panel{ position:absolute; right:0; bottom:calc(100% + 14px); width:min(380px, calc(100vw - 40px)); height:min(600px, calc(100vh - 120px));
  display:flex; flex-direction:column; background:#fff; border-radius:20px; overflow:hidden;
  box-shadow:0 30px 70px -20px rgba(13,20,32,.45), 0 0 0 1px rgba(13,20,32,.06); }
.ggchat__panel[hidden]{ display:none; }
.ggchat__backdrop{ display:none; }
.ggchat__top{ background:var(--graphite,#0B0F16); color:#fff; padding:0 14px 12px; }
.ggchat__grip{ display:none; width:40px; height:4px; border-radius:999px; background:rgba(255,255,255,.28); margin:8px auto 4px; }
.ggchat__head{ display:flex; align-items:center; gap:.7rem; padding-top:14px; }
.ggchat__avatar{ width:36px; height:36px; border-radius:999px; background:#fff; padding:4px; object-fit:contain; }
.ggchat__dot{ width:10px; height:10px; border-radius:999px; background:#34C759; box-shadow:0 0 0 2px var(--graphite,#0B0F16); margin-left:-18px; margin-top:24px; flex:none; }
.ggchat__who{ display:flex; flex-direction:column; line-height:1.15; min-width:0; flex:1; }
.ggchat__who strong{ font:700 .95rem/1.15 var(--fh,'Archivo',system-ui,sans-serif); color:#fff; }
.ggchat__who small{ font-size:.74rem; color:rgba(238,244,252,.62); }
.ggchat__hbtn{ width:34px; height:34px; border:0; border-radius:999px; background:rgba(255,255,255,.08); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.ggchat__hbtn svg{ width:18px; height:18px; }
.ggchat__hbtn:hover{ background:rgba(255,255,255,.16); }
.ggchat__close{ border:0; background:transparent; color:rgba(238,244,252,.84); font:600 .86rem var(--fb,'Instrument Sans',system-ui,sans-serif); cursor:pointer; padding:.4rem .2rem; }
.ggchat__close:hover{ color:#fff; }

.ggchat__log{ flex:1; overflow-y:auto; padding:16px 14px 6px; display:flex; flex-direction:column; gap:.55rem; background:var(--cloud,#F2F5F9); -webkit-overflow-scrolling:touch; }
.ggchat__msg{ max-width:86%; padding:.65rem .9rem; border-radius:16px; font-size:.93rem; line-height:1.5; white-space:pre-line; }
.ggchat__msg--bot{ align-self:flex-start; background:#fff; color:var(--ink,#0D1420); border-bottom-left-radius:6px; box-shadow:0 1px 2px rgba(13,20,32,.06); }
.ggchat__msg--user{ align-self:flex-end; background:var(--blue,#2E7CD6); color:#fff; border-bottom-right-radius:6px; }
.ggchat__typing{ align-self:flex-start; background:#fff; border-radius:16px; padding:.7rem .9rem; display:flex; gap:4px; }
.ggchat__typing i{ width:6px; height:6px; border-radius:999px; background:var(--muted,#56616F); opacity:.5; animation:ggchat-blink 1s infinite; }
.ggchat__typing i:nth-child(2){ animation-delay:.15s; } .ggchat__typing i:nth-child(3){ animation-delay:.3s; }
@keyframes ggchat-blink{ 0%,100%{ opacity:.25; } 50%{ opacity:1; } }

.ggchat__input{ padding:10px 14px 14px; background:var(--cloud,#F2F5F9); border-top:1px solid var(--border,#E4E9F0); }
.ggchat__opts{ display:flex; flex-wrap:wrap; gap:.45rem; justify-content:flex-end; }
.ggchat__opt{ font:600 .88rem/1.2 var(--fb,'Instrument Sans',system-ui,sans-serif); color:var(--blue-deep,#1E63B8); background:#fff; border:1px solid #C8D7EA; border-radius:999px; padding:.55rem .9rem; cursor:pointer; text-decoration:none; transition:background .15s ease, border-color .15s ease, color .15s ease; }
.ggchat__opt:hover{ background:var(--blue,#2E7CD6); border-color:var(--blue,#2E7CD6); color:#fff; }
.ggchat__form{ display:flex; flex-direction:column; gap:.5rem; }
.ggchat__row{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.ggchat__form input{ width:100%; font:500 16px/1.3 var(--fb,'Instrument Sans',system-ui,sans-serif); color:var(--ink,#0D1420); background:#fff; border:1px solid #C8D1DC; border-radius:12px; padding:.7rem .85rem; outline:none; }
.ggchat__form input:focus{ border-color:var(--blue,#2E7CD6); box-shadow:0 0 0 3px rgba(46,124,214,.18); }
.ggchat__hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.ggchat__send{ font:700 .95rem/1.2 var(--fh,'Archivo',system-ui,sans-serif); color:#fff; border:0; border-radius:12px; padding:.85rem 1rem; cursor:pointer;
  background:linear-gradient(180deg,#3B8AE2,var(--blue,#2E7CD6) 55%,var(--blue-deep,#1E63B8)); box-shadow:0 8px 24px -8px rgba(46,124,214,.55); }
.ggchat__send:disabled{ opacity:.65; cursor:default; }
.ggchat__gdpr{ margin:0; font-size:.74rem; line-height:1.4; color:var(--muted,#56616F); }
.ggchat__gdpr a{ color:var(--blue-deep,#1E63B8); }
.ggchat__err{ margin:0; font-size:.84rem; color:#C62828; }
.ggchat__err[hidden]{ display:none; }

/* mobil: bublina nad tabbarem, panel jako bottom sheet přes celou obrazovku */
@media (max-width:879px){
  .ggchat{ right:12px; bottom:calc(84px + env(safe-area-inset-bottom, 0px)); }
  .ggchat__fab{ width:52px; height:52px; }
  .ggchat__nudge{ font-size:.8rem; }
  .ggchat__backdrop{ display:block; position:fixed; inset:0; background:rgba(6,8,12,.45); z-index:0; }
  .ggchat__backdrop[hidden]{ display:none; }
  .ggchat__panel{ position:fixed; right:0; left:0; bottom:0; width:auto; height:min(88vh, 720px); border-radius:22px 22px 0 0; z-index:1; }
  .ggchat__grip{ display:block; }
  .ggchat__head{ padding-top:4px; }
  .ggchat.is-open .ggchat__fab{ display:none; }
  .ggchat__input{ padding-bottom:calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce){ .ggchat.has-badge .ggchat__fab{ animation:none; } .ggchat__typing i{ animation:none; opacity:.6; } }

/* otevřený chat má přednost před cookie lištou (z 95), zavřený zůstává pod ní */
.ggchat.is-open{ z-index:96; }

/* bublina schovaná, dokud svítí cookie lišta (otevřený panel zůstává) */
.ggchat.has-cookiebar:not(.is-open) .ggchat__fab{ display:none; }
