/* Hjälphörnet (ersätter topbaren): orben med "?" nere till höger på dator, valen i en kolumn ovanför
   (static/js/zimla-help.js), notisinkorgen ovanför hörnet. Mobil: ?-orben i översta raden och hjälparket i peeken. */

/* ── Hörnet ─────────────────────────────────────────────────────────────────────────────── */
.zimla-help {
  right: 16px; bottom: 5.35rem; width: 56px; height: 56px;
  transition: opacity 160ms ease, right 220ms ease, visibility 0s linear 0s;
}
@media (min-width: 640px) { .zimla-help { right: 20px; bottom: 20px; } }
@media (min-width: 1024px) { .zimla-help { right: 24px; bottom: 24px; } }
@media (max-width: 1023px) { .zimla-help--desktop-only { display: none !important; } }
.zimla-help.zimla-ai-floating-widget--top { bottom: auto; top: 24px; }
.zimla-help.is-away { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 120ms ease, visibility 0s linear 120ms; }
/* Dockad chatt: hörnet står kvar till vänster om den (right sätts av zimla-help.js efter panelens bredd). */
html.tm-side-open .zimla-help { right: 420px; }
.zimla-help.is-open, .zimla-help.is-inbox, .zimla-help.is-pop { z-index: 70; } /* över sidans egna bottenrader (Kunders fält, spara-rader) och Studios start i AI-panelen (z 60) */

.zimla-help__orb { position: relative; z-index: 2; }
.zimla-help__orb:focus-visible .zimla-dock-orb { outline-color: #0f4a37; }
.zimla-help__orb.is-active .zimla-dock-orb { background: #056344; }

/* "?" uppe till vänster, olästa notiser uppe till höger. */
.zimla-help__q {
  position: absolute; z-index: 3; left: 0; top: 0; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 999px; background: #1d2420; color: #fff;
  font: 600 11px/1 Inter, system-ui, sans-serif; box-shadow: 0 0 0 2px #fff; pointer-events: none;
}
.zimla-help__q i { grid-area: 1 / 1; font-style: normal; transition: opacity 160ms ease, transform 160ms ease; }
.zimla-help__q .is-x { opacity: 0; transform: rotate(-90deg); font-size: 13px; }
.zimla-help.is-busy .zimla-help__q .is-q { opacity: 0; transform: rotate(90deg); }
.zimla-help.is-busy .zimla-help__q .is-x { opacity: 1; transform: none; }
.zimla-help__badge {
  position: absolute; z-index: 3; right: -2px; top: -2px; display: grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #0f4a37; color: #fff;
  font: 600 10.5px/1 Inter, system-ui, sans-serif; box-shadow: 0 0 0 2px #fff; pointer-events: none;
}
.zimla-help__badge[hidden], .zimla-help__count[hidden] { display: none; }

/* Klick utanför när valen är uppe: en genomskinlig yta under dem tar trycket, så det som ligger under inte träffas. */
.zimla-help__scrim { position: fixed; inset: 0; z-index: 0; display: none; }
.zimla-help.is-open .zimla-help__scrim { display: block; }

/* Valen står i orbens mitt; GSAP flyttar dem ut i en kolumn ovanför (under, för --top). */
.zimla-help__fan { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.zimla-help.is-open .zimla-help__fan { visibility: visible; pointer-events: auto; }
.zimla-help__item {
  position: absolute; right: 6px; bottom: 6px; width: 44px; height: 44px; padding: 0; border: 0;
  background: none; cursor: pointer; will-change: transform;
}
.zimla-help__icon {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  background: #fff; color: #1d2420;
  box-shadow: 0 0 0 1px rgba(29, 36, 32, .08), 0 4px 12px -6px rgba(29, 36, 32, .35);
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.zimla-help__icon svg { width: 20px; height: 20px; }
.zimla-help__item.is-ask .zimla-help__icon { background: #1f5f4c; color: #fff; }
.zimla-help__item.is-bug .zimla-help__icon { color: #b45309; }
.zimla-help__item.is-idea .zimla-help__icon { color: #b7791f; }
.zimla-help__item:hover .zimla-help__icon, .zimla-help__item:focus-visible .zimla-help__icon {
  box-shadow: 0 0 0 1px rgba(29, 36, 32, .14), 0 0 0 4px rgba(5, 99, 68, .14), 0 4px 12px -6px rgba(29, 36, 32, .35);
}
.zimla-help__item.is-ask:hover .zimla-help__icon { background: #194f40; }
.zimla-help__item:focus-visible { outline: none; }
.zimla-help__pill {
  position: absolute; right: calc(100% + 10px); top: 0; display: flex; flex-direction: column; justify-content: center;
  height: 44px; padding: 0 14px; border-radius: 12px; background: #fff; white-space: nowrap; text-align: right;
  box-shadow: 0 0 0 1px rgba(29, 36, 32, .08), 0 4px 12px -6px rgba(29, 36, 32, .35);
}
.zimla-help__pill b { font: 600 13px/1.2 Inter, system-ui, sans-serif; color: #1d2420; }
.zimla-help__pill small { font: 400 11px/1.3 Inter, system-ui, sans-serif; color: #6b7a70; }
.zimla-help__pill small.is-live { color: #056344; }
.zimla-help__count {
  position: absolute; right: -4px; top: -4px; display: grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: #0f4a37; color: #fff; font: 600 10.5px/1 Inter, system-ui, sans-serif;
  box-shadow: 0 0 0 2px #fff;
}

/* Notisinkorgen ovanför hörnet (samma inkorg som klockan hade). */
.zimla-help__inbox {
  position: absolute; right: 0; bottom: calc(100% + 12px); width: min(24rem, calc(100vw - 32px));
  max-height: calc(100dvh - 112px); overflow-y: auto; border-radius: 16px; background: #fff;
  box-shadow: 0 0 0 1px rgba(29, 36, 32, .08), 0 24px 48px -24px rgba(29, 36, 32, .45);
}
.zimla-help.zimla-ai-floating-widget--top .zimla-help__inbox { bottom: auto; top: calc(100% + 12px); }

/* Studio: rutan för Fråga / Rapportera fel / Tipsa om en idé (samma ram som notiserna). */
.zimla-help__pop { overflow: visible; }
.zimla-help__pop-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.zimla-help__pop header h2 { margin: 0; font: 500 14px/1.3 Inter, system-ui, sans-serif; color: #1d2420; }
.zimla-help__pop header p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: #6b7a70; }
.zimla-help__pop label { font-size: 12px; font-weight: 500; color: #4e5751; }
.zimla-help__pop textarea {
  width: 100%; min-height: 96px; max-height: 40vh; resize: vertical; padding: 10px 12px; border: 1px solid #dfe4df; border-radius: 10px;
  background: #fbfcfa; font: 400 14px/1.45 Inter, system-ui, sans-serif; color: #1d2420;
}
.zimla-help__pop textarea:focus { outline: none; border-color: #8fbfa5; box-shadow: 0 0 0 3px rgba(5, 99, 68, .12); }
.zimla-help__pop-meta { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 12px; color: #6b7a70; }
.zimla-help__pop-meta > span:first-child { display: inline-flex; align-items: center; gap: 4px; flex: 1; }
.zimla-help__pop-meta .material-symbols-outlined { font-size: 16px; }
.zimla-help__pop-ghost {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 1px solid #dfe4df; border-radius: 8px;
  background: #fff; font-size: 12px; color: #1d2420; cursor: pointer;
}
.zimla-help__pop-snip { position: relative; }
.zimla-help__pop-snip img { width: 48px; height: 32px; object-fit: cover; border-radius: 6px; border: 1px solid #dfe4df; }
.zimla-help__pop-snip button { position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border: 0; border-radius: 999px; background: #1d2420; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.zimla-help__pop-error { margin: 0; font-size: 12.5px; color: #b42318; }
.zimla-help__pop footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zimla-help__pop footer small { font-size: 11.5px; color: #8a958d; }
.zimla-help__pop-send {
  height: 36px; padding: 0 16px; border: 0; border-radius: 10px; background: #1f5f4c; color: #fff; font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer;
}
.zimla-help__pop-send:disabled { opacity: .45; cursor: default; }
.zimla-help__pop-done { margin: 0; padding: 18px 16px; font-size: 13.5px; color: #1d2420; }

/* ── Dator: topbaren är borta ───────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .zimla-app-shell { --zimla-app-topbar-block: 0px; --zimla-app-topbar-gap: 0px; }
  .tm-side, .pl-side { top: 16px; }
  /* Det som låg längst ner till höger flyttar undan för hörnet. */
  [data-settings-save-bar] { right: 104px !important; }
  .adv-foot { padding-right: 88px; }
  .project-shell, .ku-page { padding-bottom: 96px; }
}

/* ── Mobil: översta raden och hjälparket ─────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .zimla-global-topbar__mobile-row { height: 56px; padding-inline: 20px; }
  .zs-mobile-brand {
    position: relative; z-index: 10; display: inline-flex; align-items: center; gap: 9px; font-size: 17px;
    font-weight: 700; letter-spacing: -0.01em; color: #1d2420; text-decoration: none;
  }
  .zs-mobile-brand__dots { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
  .zs-mobile-brand__dots i { width: 9px; height: 9px; border-radius: 999px; background: #1d2420; }
  .zs-mobile-brand__dots i:nth-child(2), .zs-mobile-brand__dots i:nth-child(4) { background: #22c55e; }
  .zimla-global-topbar__end { gap: 10px; }
  .zimla-help-row-orb { --zimla-ai-fab-scale: 0.8; position: relative; display: grid; place-items: center; border-radius: 999px; }
  .zimla-help-row-orb .zimla-help__q { left: 1px; top: 1px; }
  .zimla-help-row-orb .zimla-help__badge { right: -1px; top: -1px; }
  .zs-mobile-account {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
    background: #1f6b4f; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  }
  /* Mobilloopen varv 25: märket (Hem) och kontot tar emot tummen i hela radens höjd – utseendet är oförändrat. */
  .zs-mobile-brand::after { content: ""; position: absolute; inset: -9px -8px; }
  .zs-mobile-account { position: relative; }
  .zs-mobile-account::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
}

/* Hjälparket är tätt (sidan bakom tonas av bakgrunden), även över Studios startsida. */
.zimla-ai-peek.is-help { background: #f4f5f1; -webkit-backdrop-filter: none; backdrop-filter: none; }
.zimla-help-sheet { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 6px; }
.zimla-help-sheet__head { display: flex; align-items: center; gap: 14px; padding: 2px 4px 8px; }
.zimla-help-sheet__orb { position: relative; flex: none; }
.zimla-help-sheet__orb .zimla-dock-orb { outline-width: 3px; }
.zimla-help-sheet__orb .zimla-help__q { left: -4px; top: -4px; }
.zimla-help-sheet__title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.zimla-help-sheet__title strong { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: #1d2420; }
.zimla-help-sheet__title small { font-size: 13px; line-height: 1.35; color: #5d685f; }
.zimla-help-sheet__row {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 12px;
  border: 0; border-radius: 16px; background: #fff; text-align: left; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(29, 36, 32, .06);
}
.zimla-help-sheet__row:active { background: #f6f8f4; }
.zimla-help-sheet__row:focus-visible { outline: 2px solid #087858; outline-offset: 2px; }
.zimla-help-sheet__icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 999px; }
.zimla-help-sheet__icon svg { width: 22px; height: 22px; }
.zimla-help-sheet__row.is-ask .zimla-help-sheet__icon { background: #1f5f4c; color: #fff; }
.zimla-help-sheet__row.is-bug .zimla-help-sheet__icon { background: #fbeee6; color: #b45309; }
.zimla-help-sheet__row.is-idea .zimla-help-sheet__icon { background: #fbf3dc; color: #b7791f; }
.zimla-help-sheet__row.is-inbox .zimla-help-sheet__icon { background: #e8f2ea; color: #1f5f4c; }
.zimla-help-sheet__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.zimla-help-sheet__text strong { font-size: 15px; font-weight: 600; color: #1d2420; }
.zimla-help-sheet__text small { font-size: 13px; line-height: 1.3; color: #5d685f; }
.zimla-help-sheet__chev { flex: none; color: #9aa39d; font-size: 22px; }
.zimla-help-sheet__row .zimla-help__count { position: static; box-shadow: none; }
.zimla-help-sheet__inbox { display: flex; flex-direction: column; gap: 10px; }
.zimla-help-sheet__inbox-panel { max-height: 60svh; overflow-y: auto; border-radius: 14px; background: #fff; }
.zimla-ai-peek__back { display: grid; place-items: center; width: 32px; height: 32px; margin-left: -6px; border: 0; border-radius: 999px; background: none; color: #1d2420; }

@media (prefers-reduced-motion: reduce) {
  .zimla-help, .zimla-help__icon, .zimla-help__inbox, .zimla-help__q i { transition: none !important; }
}
