/* Skjemalosen (P22 S2): the button and the chat window, in the landing
   page's colours (site.css) and the logo's tilted red form mark. chat.js
   adds the elements only when the assistant is on. Works at 390 px. */
.svc { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font-family: var(--sans);
  pointer-events: none; }
.svc > * { pointer-events: auto; }

.svc-btn { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: #fff; font: 700 15px/1 var(--sans); letter-spacing: -.01em;
  padding: 13px 18px 13px 14px; transform-origin: 70% 100%;
  box-shadow: 0 0 0 2px #fff, 0 6px 20px rgba(19, 42, 64, .28); }  /* the ring keeps it clear over dark sections */
.svc-btn:hover { background: #0C1D2E; }
.svc-btn:focus-visible, .svc-chip:focus-visible, .svc-close:focus-visible, .svc-send:focus-visible,
.svc-hint-x:focus-visible, .svc-contact:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.svc-mark { width: 20px; height: 20px; border: 2.5px solid var(--red); border-radius: 4px; transform: rotate(-6deg);
  position: relative; display: inline-block; flex: none; background: #fff; }
.svc-mark::after { content: ""; position: absolute; left: 3px; right: 3px; top: 3.5px; bottom: 3.5px;
  border-top: 2.5px solid var(--red); border-bottom: 2.5px solid var(--red); }
.svc-open .svc-btn .svc-label { opacity: .85; }

/* The nudge: one short tilt and settle, under 600 ms. */
.svc-nudge { animation: svc-tilt 560ms cubic-bezier(.3, 1.4, .5, 1); }
@keyframes svc-tilt {
  0% { transform: rotate(0); } 30% { transform: rotate(-7deg) scale(1.04); }
  60% { transform: rotate(4deg); } 100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .svc-nudge { animation: none; } }

.svc-hint { position: relative; max-width: 260px; margin: 0; background: #fff; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 12px 12px 4px 12px; padding: 10px 34px 10px 14px; font-size: 14px;
  line-height: 1.4; box-shadow: 0 4px 14px rgba(19, 42, 64, .12); }
.svc-hint[hidden] { display: none; }
.svc-hint-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; background: none;
  color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 6px; }

.svc-panel { width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(19, 42, 64, .22); overflow: hidden; }
.svc-panel[hidden] { display: none; }
.svc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; padding: 12px 10px 12px 16px; }
.svc-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.svc-close { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; }
.svc-close:hover { background: rgba(255, 255, 255, .12); }

.svc-log { flex: 1 1 auto; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-2); min-height: 140px; }
.svc-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.45;
  overflow-wrap: anywhere; }
.svc-bot { align-self: flex-start; background: #fff; border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
.svc-you { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.svc-you a { color: #fff; }
.svc-typing { color: var(--ink-2); font-style: italic; }
.svc-contact { align-self: flex-start; display: inline-block; background: var(--red); color: #fff; font-weight: 700;
  text-decoration: none; padding: 9px 14px; border-radius: 8px; font-size: 14px; }
.svc-contact:hover { background: var(--red-2); color: #fff; }

.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; background: var(--bg-2); }
.svc-chips[hidden] { display: none; }
.svc-chip { border: 1px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; cursor: pointer;
  font: 600 13px/1.2 var(--sans); padding: 7px 11px; }
.svc-chip:hover { background: var(--ink); color: #fff; }

.svc-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 6px; border-top: 1px solid var(--rule); }
.svc-input { flex: 1; resize: none; min-height: 42px; max-height: 120px; border: 1px solid var(--rule);
  border-radius: 8px; padding: 9px 10px; font: 15px/1.35 var(--sans); color: var(--ink); }
.svc-input:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.svc-input:disabled { background: var(--bg-2); }
.svc-send { border: 0; border-radius: 8px; background: var(--red); color: #fff; font: 700 14px/1 var(--sans);
  padding: 13px 14px; cursor: pointer; }
.svc-send:hover { background: var(--red-2); }
.svc-send:disabled { background: #B9C3CC; cursor: default; }
.svc-note { margin: 0; padding: 0 14px 10px; font-size: 12px; line-height: 1.35; color: var(--ink-2); }
.svc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  .svc { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); }
  .svc-panel { width: 100%; max-height: calc(100vh - 96px); }
  .svc-btn { padding: 12px 16px 12px 12px; }
}
