/* Anonymous word-limit banner — redesign 20/8, same action card as
   skrivebord: document icon, black headline with the excess, instruction,
   {current}/{limit} count over a capped sage progress track, and an ACTIVE
   Log ind. Calm, not an error alert. Card sits at the editor's bottom edge;
   the craft glass pill (.st-source-footer.counter-nav-div, oversaettelse-
   craft.css: bottom:32px z-index:30) lifts ABOVE it via the
   body.ss-public-over-limit flag — mock-consistent, popover stacking kept. */
#ss-public-limit-banner {
  position: absolute; z-index: 20; left: 12px; right: 12px; bottom: 8px;
  min-height: 82px; box-sizing: border-box;
  display: none;
  grid-template-columns: 44px minmax(0, 1fr) 150px 110px;
  align-items: center; gap: 16px; padding: 14px 16px;
  background: #fbf8f2;
  border: 1px solid rgba(74, 122, 104, 0.28);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(58, 47, 38, 0.07);
  color: #5c4d43;
  animation: ss-anon-banner-in 0.18s ease-out;
}
#ss-public-limit-banner.ss-anon-limit-visible { display: grid; }
#ss-public-limit-banner .ss-anon-limit-banner__icon {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(58, 47, 38, 0.10); border-radius: 50%;
  background: #efede8; color: #3a2f26;
}
#ss-public-limit-banner .ss-anon-limit-banner__icon svg { width: 20px; height: 20px; stroke-width: 1.75; }
#ss-public-limit-banner .ss-anon-limit-banner__message { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#ss-public-limit-banner .ss-anon-limit-banner__title {
  color: #3a2f26; font-size: 16px; font-weight: 700; line-height: 1.25; text-decoration: none;
}
#ss-public-limit-banner .ss-anon-limit-banner__help { color: #5c4d43; font-size: 13.5px; font-weight: 400; line-height: 1.4; }
#ss-public-limit-banner .ss-anon-limit-banner__meter { display: flex; flex-direction: column; gap: 8px; }
#ss-public-limit-banner .ss-anon-limit-banner__count {
  color: #5c4d43; font-size: 13px; font-weight: 600; line-height: 1.3; text-align: right; white-space: nowrap;
}
#ss-public-limit-banner .ss-anon-limit-banner__track {
  width: 100%; max-width: 136px; margin-left: auto; height: 4px; overflow: hidden;
  border-radius: 999px; background: rgba(110, 138, 126, 0.16);
}
#ss-public-limit-banner .ss-anon-limit-banner__fill {
  display: block; width: 100%; height: 100%; border-radius: inherit; background: #6e8a7e;
}
#ss-public-limit-banner .ss-anon-limit-banner__login {
  min-width: 110px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; padding: 0 18px; border: 0; border-radius: 11px;
  background: linear-gradient(135deg, #6e8a7e, #5a7a6c) !important;
  box-shadow: 0 6px 18px rgba(90, 122, 108, 0.18);
  color: #fffefb !important; font-size: 14px; font-weight: 600; line-height: 1;
  text-align: center; text-decoration: none !important; white-space: nowrap;
  opacity: 1; filter: none;
  transition: filter 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
#ss-public-limit-banner .ss-anon-limit-banner__login:hover { filter: brightness(0.96); }
#ss-public-limit-banner .ss-anon-limit-banner__login:active { transform: translateY(1px); filter: brightness(0.92); }
#ss-public-limit-banner .ss-anon-limit-banner__login:focus-visible { outline: 3px solid rgba(110, 138, 126, 0.38); outline-offset: 3px; }
@keyframes ss-anon-banner-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* While the card is up: lift the craft pill clear of it, reserve editor
   bottom space, and white out the whole target side — nothing clickable. */
body.ss-public-over-limit .st-source-footer.counter-nav-div { bottom: 122px !important; }
body.ss-public-over-limit .st-editor-wrap .ql-editor { padding-bottom: 118px !important; }
body.ss-public-over-limit .st-target-panel {
  opacity: 0.22; filter: saturate(0.35); pointer-events: none; user-select: none;
  transition: opacity 160ms ease, filter 160ms ease;
}
/* Dark mode — same limit tokens as skrivebord; the button stays full strength. */
[data-theme="dark"] #ss-public-limit-banner {
  background: #252a27; border-color: rgba(122, 158, 125, 0.30); color: #d2c9c1;
}
[data-theme="dark"] #ss-public-limit-banner .ss-anon-limit-banner__title { color: #e8e0d8; }
[data-theme="dark"] #ss-public-limit-banner .ss-anon-limit-banner__help,
[data-theme="dark"] #ss-public-limit-banner .ss-anon-limit-banner__count { color: #d2c9c1; }
[data-theme="dark"] #ss-public-limit-banner .ss-anon-limit-banner__icon {
  background: rgba(143, 186, 170, 0.12); color: #e8e0d8; border-color: rgba(122, 158, 125, 0.30);
}
@media (max-width: 900px) {
  #ss-public-limit-banner { grid-template-columns: 40px minmax(0, 1fr) 104px; gap: 12px; padding: 12px 14px; }
  #ss-public-limit-banner .ss-anon-limit-banner__icon { width: 40px; height: 40px; }
  #ss-public-limit-banner .ss-anon-limit-banner__meter { grid-column: 2; }
  #ss-public-limit-banner .ss-anon-limit-banner__count { text-align: left; }
  #ss-public-limit-banner .ss-anon-limit-banner__track { margin-left: 0; }
  #ss-public-limit-banner .ss-anon-limit-banner__login { grid-column: 3; grid-row: 1 / span 2; min-width: 104px; }
}
@media (max-width: 600px) {
  /* Single-row phone card (20/8, same as skrivebord): the source editor is
     short on a phone and the four-row stack covered most of it. ONE row —
     icon + count/progress + Log ind — and the headline/instruction go
     screen-reader-only. --ss-pub-banner-h is declared on <body> because the
     source pill and .ql-editor read it and are NOT descendants of the banner;
     a custom property on the banner would never reach them. */
  body.ss-public-over-limit { --ss-pub-banner-h: 78px; }
  #ss-public-limit-banner {
    left: 8px; right: 8px; bottom: 6px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px; padding: 12px;
    min-height: 0;
  }
  /* Clipped, never display:none: the icon and the whole meter are
     aria-hidden, so removing the message would leave this role="status"
     live region with nothing to announce when the limit is crossed. */
  #ss-public-limit-banner .ss-anon-limit-banner__message {
    position: absolute !important;
    width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
  #ss-public-limit-banner .ss-anon-limit-banner__icon {
    grid-column: 1; grid-row: 1; width: 36px; height: 36px;
  }
  #ss-public-limit-banner .ss-anon-limit-banner__icon svg { width: 18px; height: 18px; }
  #ss-public-limit-banner .ss-anon-limit-banner__meter {
    grid-column: 2; grid-row: 1; gap: 6px;
  }
  #ss-public-limit-banner .ss-anon-limit-banner__count { font-size: 12.5px; text-align: left; }
  #ss-public-limit-banner .ss-anon-limit-banner__track { max-width: none; margin-left: 0; }
  #ss-public-limit-banner .ss-anon-limit-banner__login {
    grid-column: 3; grid-row: 1;
    width: auto; min-width: 96px; min-height: 44px; padding: 0 16px;
  }
  body.ss-public-over-limit .st-source-footer.counter-nav-div {
    bottom: calc(var(--ss-pub-banner-h, 78px) + 8px) !important;
  }
  body.ss-public-over-limit .st-editor-wrap .ql-editor {
    padding-bottom: calc(var(--ss-pub-banner-h, 78px) + 24px) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #ss-public-limit-banner,
  #ss-public-limit-banner .ss-anon-limit-banner__login,
  body.ss-public-over-limit .st-target-panel { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
}

@media (prefers-reduced-motion: reduce) {
}
