/* Explicit opt-in analytics settings. No backdrop or page-scroll lock. */
.analytics-consent-panel {
  position:fixed;
  left:50%;
  bottom:calc(82px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%);
  z-index:650;
  box-sizing:border-box;
  width:min(430px,calc(100vw - 24px));
  max-height:min(50dvh,300px);
  overflow-y:auto;
  color:#182536;
  background:#fff;
  border:1px solid #dbe4ef;
  border-radius:16px;
  padding:15px 17px;
  box-shadow:0 12px 40px rgba(24,38,60,.19);
  font-family:Inter,system-ui,-apple-system,Arial,sans-serif;
}
.analytics-consent-panel strong {display:block;font-size:14px;line-height:1.4}
.analytics-consent-panel p {font-size:12px;line-height:1.45;color:#4c5967;margin:8px 0 11px}
.analytics-consent-actions {display:flex;gap:8px;flex-wrap:wrap}
.analytics-consent-actions button {
  border:1px solid #cad8e9;
  border-radius:9px;
  padding:10px 13px;
  min-height:43px;
  background:#f4f8fc;
  color:#233349;
  font:600 12px/1.4 Inter,system-ui,-apple-system,Arial,sans-serif;
  cursor:pointer;
  touch-action:manipulation;
}
.analytics-consent-actions button:first-child {
  background:#0047a0;
  color:#fff;
  border-color:#0047a0;
}
.analytics-consent-panel label {
  display:block;
  font-size:12px;
  font-weight:600;
  margin:8px 0 5px;
}
.analytics-consent-panel input[type="password"] {
  display:block;
  box-sizing:border-box;
  width:100%;
  min-height:42px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  padding:8px 10px;
  font-size:14px;
  color:#1a2c40;
  background:#fff;
  margin:0 0 10px;
}
.analytics-consent-panel button:disabled { opacity:.6; cursor:default }
.analytics-settings-button {
  display:block;
  margin:15px auto 0;
  padding:9px 12px;
  border:1px solid #cad8e9;
  border-radius:8px;
  background:transparent;
  color:#385c82;
  font-size:12px;
  cursor:pointer;
}
@media (min-width:900px) {
  .analytics-consent-panel {bottom:22px}
}
@media (max-width:380px) {
  .analytics-consent-panel {padding:12px;bottom:calc(75px + env(safe-area-inset-bottom,0px))}
}


/* Compact, unobtrusive analytics choice. No overlay and no scroll lock. */
.analytics-consent-panel--compact {
  width:min(415px, calc(100vw - 24px));
  max-height:min(55dvh, 290px);
  padding:16px;
  border-radius:17px;
  border:1px solid #e2e8f2;
  box-shadow:0 16px 45px rgba(21,42,78,.14);
  background:#fff;
}
.analytics-consent-top{display:flex;align-items:flex-start;gap:11px}
.analytics-consent-symbol{
  flex:none;display:grid;place-items:center;width:34px;height:34px;
  border-radius:10px;background:#edf3ff;color:#315bd4;font-size:18px;
}
.analytics-consent-copy{min-width:0}
.analytics-consent-panel--compact strong{
  margin-top:1px;font-size:14px;font-weight:750;line-height:1.36;color:#182a48;
}
.analytics-consent-panel--compact p{
  margin:5px 0 0;font-size:12px;line-height:1.5;color:#64748b;
}
.analytics-consent-bottom{
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;
  gap:11px;margin-top:15px;
}
.analytics-consent-policy{
  color:#3861b7;font-size:11px;font-weight:650;
  text-decoration:underline;text-underline-offset:2px;
}
.analytics-consent-actions{display:flex;gap:8px;flex-wrap:nowrap}
.analytics-consent-panel--compact .analytics-consent-actions button{
  min-height:37px;padding:8px 12px;border-radius:9px;white-space:nowrap;
  font-size:11px;font-weight:700;
}
.analytics-consent-panel--compact .analytics-consent-actions button:first-child{
  background:#f2f5fa;color:#475569;border-color:#dde4ee;
}
.analytics-consent-panel--compact .analytics-consent-actions button:last-child{
  background:#315bd4;color:white;border-color:#315bd4;
}
.analytics-consent-panel--compact button:focus-visible,
.analytics-consent-panel--compact a:focus-visible,
.analytics-settings-button:focus-visible{
  outline:3px solid #91adfa;outline-offset:3px;
}
.analytics-settings-button:hover{color:#163d9c;background:#f2f6ff}
.analytics-policy-footer-link{color:inherit;font-size:11px;text-decoration:underline;text-underline-offset:2px}
@media (max-width:400px){
  .analytics-consent-panel--compact{padding:13px}
  .analytics-consent-bottom{align-items:stretch}
  .analytics-consent-policy{width:100%}
  .analytics-consent-actions{width:100%}
  .analytics-consent-panel--compact .analytics-consent-actions button{flex:1}
}
@media (prefers-reduced-motion:reduce) {
  .analytics-consent-panel--compact {scroll-behavior:auto}
}


/* Keep the choice visible above the fixed mobile navigation in iOS Safari,
   Android Chrome and Telegram WebView. It is still gated by server flags. */
@media(max-width:599px){
  .analytics-consent-panel--compact{
    position:fixed;
    left:12px;right:12px;width:auto;
    transform:none;
    bottom:calc(84px + env(safe-area-inset-bottom,0px));
    z-index:2400;
    max-height:min(52dvh,290px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
}
@media(max-height:500px){
  .analytics-consent-panel--compact{
    max-height:45dvh;
    padding:10px 12px;
  }
}
