.cps,
.cps * { box-sizing: border-box; }

.cps {
  --cps-purple: #6b5391;
  --cps-purple-hi: #7d64a8;
  --cps-text: #1a1a1a;
  --cps-muted: #6b6b6b;
  --cps-line: rgba(17, 24, 39, 0.08);
  --cps-progress: 0;
  --cps-switch: 0;
  position: relative;
  min-height: 360vh;
  background: linear-gradient(180deg, #fff 0%, #fbf8fd 40%, #f7f0fa 100%);
  color: var(--cps-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
  /* Klipper ambient-glöden men låter notislapparna sticka ut vid sidorna. */
  overflow: clip;
  overflow-clip-margin: 120px;
}

.cps .cps__ambient {
  position: absolute;
  inset: 18% 4% auto;
  height: 720px;
  background: radial-gradient(circle at 30% 20%, rgba(177, 216, 242, 0.28), transparent 45%), radial-gradient(circle at 76% 38%, rgba(201, 174, 226, 0.28), transparent 48%);
  filter: blur(60px);
  pointer-events: none;
}

.cps .cps__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 62px 48px 0;
}

.cps .cps__heading {
  position: relative;
  z-index: 2;
  width: min(820px, 70vw);
  text-align: center;
  will-change: transform;
}

.cps .cps__eyebrow,
.cps .cps__demo-label,
.cps .cps__panel-kicker {
  color: var(--cps-purple);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cps .cps__heading h2 {
  margin: 10px 0 11px;
  font-size: clamp(42px, 4vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 650;
}

.cps .cps__heading p {
  margin: 0 auto;
  max-width: 650px;
  color: var(--cps-muted);
  font-size: 16px;
  line-height: 1.55;
}

.cps .cps__stage {
  position: relative;
  width: min(1200px, calc(100vw - 112px));
  margin-top: 44px;
  perspective: 1500px;
  perspective-origin: 50% 34%;
}

.cps .cps__device {
  position: relative;
  width: 100%;
  padding: 12px 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 30px;
  background: linear-gradient(150deg, #22242b 0%, #111218 50%, #272831 100%);
  box-shadow: 0 50px 90px -35px rgba(31, 21, 48, 0.5), 0 22px 45px -26px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -2px 8px rgba(0, 0, 0, 0.75);
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.cps .cps__device::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 16% 6% -9%;
  border-radius: 40%;
  background: rgba(65, 45, 94, 0.34);
  filter: blur(38px);
  transform: translateZ(-30px);
}

.cps .cps__device-top {
  height: 19px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 0 8px;
}

.cps .cps__device-top i {
  width: 54px;
  height: 5px;
  margin-top: 1px;
  border-radius: 999px;
  background: #090a0d;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

.cps .cps__screen {
  position: relative;
  height: 610px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 17px;
  background: #fafafb;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.cps .cps__device-foot {
  width: 34%;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.cps .cps__sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  margin: 12px 0 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.87);
  box-shadow: 0 22px 40px -32px rgba(70, 52, 104, 0.38);
}

.cps .cps__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 13px 14px;
  border-bottom: 1px solid var(--cps-line);
}

.cps .cps__brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--cps-line);
  border-radius: 10px;
  background: #fff;
}

.cps .cps__brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.cps .cps__brand strong { display: block; color: var(--cps-purple); font-size: 17px; letter-spacing: -0.03em; }
.cps .cps__brand small { display: block; margin-top: 1px; color: var(--cps-muted); font-size: 9px; }

.cps .cps__nav { display: flex; flex-direction: column; gap: 3px; padding: 14px 8px; }
.cps .cps__nav > small { padding: 0 10px 5px; color: rgba(17, 24, 39, 0.42); font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.cps .cps__nav > span { min-height: 34px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--cps-muted); font-size: 11px; }
.cps .cps__nav > span.is-active { color: var(--cps-purple); background: rgba(107, 83, 145, 0.1); }
.cps .cps__nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cps .cps__nav b { flex: 1; font-weight: 550; }
.cps .cps__nav em { min-width: 18px; padding: 2px 5px; border-radius: 5px; color: #a66a21; background: #fff1df; font-size: 8px; font-style: normal; text-align: center; }

.cps .cps__profile { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 13px; border-top: 1px solid var(--cps-line); }
.cps .cps__profile > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #8b6cc0, #4e3a6e); font-size: 10px; font-weight: 750; }
.cps .cps__profile p { min-width: 0; margin: 0; }
.cps .cps__profile b, .cps .cps__profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cps .cps__profile b { font-size: 10px; font-weight: 650; }
.cps .cps__profile small { margin-top: 2px; color: var(--cps-muted); font-size: 8px; }

.cps .cps__portal { position: relative; min-width: 0; overflow: hidden; background: #fcfbfe; }
.cps .cps__view { position: absolute; inset: 0; padding: 30px 30px 28px; overflow: hidden; will-change: transform, opacity; }
.cps .cps__view.is-systems { opacity: 0; }
.cps .cps__view[aria-hidden="true"] { pointer-events: none; }
.cps .cps__aurora { position: absolute; inset: 0; background: radial-gradient(circle at 60% -10%, rgba(177, 216, 242, 0.3), transparent 43%), radial-gradient(circle at 92% 64%, rgba(232, 195, 222, 0.22), transparent 42%), radial-gradient(circle at 18% 72%, rgba(204, 184, 229, 0.2), transparent 45%); pointer-events: none; }
.cps .cps__portal > *:not(.cps__aurora) { z-index: 1; }
.cps .cps__view > * { position: relative; z-index: 1; }
.cps .cps__portal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.cps .cps__portal-head h3 { margin: 6px 0 3px; font-size: 25px; line-height: 1; letter-spacing: -0.04em; }
.cps .cps__portal-head p { margin: 0; color: var(--cps-muted); font-size: 10px; }
.cps .cps__status { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid rgba(45, 138, 86, 0.18); border-radius: 999px; color: #267849; background: rgba(230, 245, 237, 0.82); font-size: 9px; font-weight: 650; }
.cps .cps__status i { width: 6px; height: 6px; border-radius: 50%; background: #2d8a56; }

.cps .cps__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.cps .cps__metrics article { min-width: 0; min-height: 126px; padding: 14px; border: 1px solid rgba(107, 83, 145, 0.08); border-radius: 14px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 16px 30px -27px rgba(70, 52, 104, 0.38); }
.cps .cps__metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; font-size: 12px; font-weight: 750; }
.cps .cps__metric-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cps .cps__metric-icon.is-purple { color: var(--cps-purple); background: rgba(107, 83, 145, 0.11); }
.cps .cps__metric-icon.is-green { color: #2d8a56; background: #e7f5ee; }
.cps .cps__metric-icon.is-amber { color: #a66a21; background: #fff1df; }
.cps .cps__metric-icon.is-blue { color: #387fb2; background: #e8f3fa; }
.cps .cps__metrics b { display: block; margin-top: 12px; font-size: 25px; line-height: 1; letter-spacing: -0.045em; }
.cps .cps__metrics p { min-height: 24px; margin: 7px 0 0; font-size: 9px; font-weight: 650; line-height: 1.25; }
.cps .cps__metrics small { display: block; margin-top: 5px; color: var(--cps-muted); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }

.cps .cps__portal-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.88fr); gap: 14px; margin-top: 14px; }
.cps .cps__tickets, .cps .cps__system-card { border: 1px solid rgba(107, 83, 145, 0.08); border-radius: 15px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 18px 32px -26px rgba(70, 52, 104, 0.3); }
.cps .cps__tickets { padding: 16px 17px 8px; }
.cps .cps__panel-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; }
.cps .cps__panel-head h4, .cps .cps__system-card h4 { margin: 3px 0 0; font-size: 15px; letter-spacing: -0.025em; }
.cps .cps__panel-link { display: flex; align-items: center; gap: 4px; color: var(--cps-purple); font-size: 8px; font-weight: 650; }
.cps .cps__panel-link svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cps .cps__ticket { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto 32px; align-items: center; gap: 9px; min-height: 60px; border-top: 1px solid rgba(17, 24, 39, 0.06); }
.cps .cps__ticket-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--cps-purple); background: rgba(107, 83, 145, 0.08); font-size: 7px; font-weight: 800; letter-spacing: 0.04em; }
.cps .cps__ticket b { display: block; overflow: hidden; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cps .cps__ticket p { margin: 3px 0 0; overflow: hidden; color: var(--cps-muted); font-size: 7.5px; text-overflow: ellipsis; white-space: nowrap; }
.cps .cps__ticket time { color: var(--cps-muted); font-size: 7px; text-align: right; }

.cps .cps__badge { display: inline-flex; align-items: center; justify-content: center; width: max-content; padding: 4px 7px; border: 1px solid transparent; border-radius: 999px; font-size: 7px; font-weight: 750; letter-spacing: 0.02em; }
.cps .cps__badge.is-auto { color: #267849; border-color: #cbe9d8; background: #e7f5ee; }
.cps .cps__badge.is-co { color: #805619; border-color: #f2d9b8; background: #fff1df; }
.cps .cps__badge.is-human { color: #355e82; border-color: #c7ddeb; background: #e8f3fa; }
.cps .cps__badge.is-active { color: #267849; border-color: #cbe9d8; background: #e7f5ee; text-transform: uppercase; }

.cps .cps__system-card { padding: 16px; }
.cps .cps__system-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.cps .cps__system-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--cps-purple); background: rgba(107, 83, 145, 0.1); }
.cps .cps__system-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cps .cps__system-card > p { margin: 7px 0 12px; color: var(--cps-muted); font-size: 8.5px; line-height: 1.45; }
.cps .cps__mode-row { display: flex; flex-wrap: wrap; gap: 5px; }
.cps .cps__activity { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-top: 15px; padding: 11px; border-radius: 11px; background: linear-gradient(135deg, rgba(107, 83, 145, 0.08), rgba(177, 216, 242, 0.1)); }
.cps .cps__activity > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: #267849; background: #fff; font-size: 9px; font-weight: 800; }
.cps .cps__activity p { min-width: 0; margin: 0; }
.cps .cps__activity b, .cps .cps__activity small { display: block; }
.cps .cps__activity b { font-size: 8px; line-height: 1.3; }
.cps .cps__activity small { margin-top: 3px; color: var(--cps-muted); font-size: 7px; line-height: 1.4; }
.cps .cps__activity time { color: var(--cps-muted); font-size: 7px; white-space: nowrap; }

/* ── Flikrail över datorn: visar vilken portalflik scrollen står på ── */
.cps .cps__rail {
  position: relative;
  z-index: 2;
  width: min(520px, 62vw);
  margin: 26px auto 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-bottom: 11px;
}

.cps .cps__rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(17, 24, 39, 0.1);
}

.cps .cps__rail-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(17, 24, 39, 0.38);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 260ms ease;
}

.cps .cps__rail-item i {
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.cps .cps__rail-item.is-active { color: var(--cps-purple); }

.cps .cps__rail-thumb {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 2px;
  border-radius: 999px;
  background: var(--cps-purple);
  transform: translate3d(calc(var(--cps-switch) * 100%), 0, 0);
  transition: transform 60ms linear;
}

/* ── Flik 2: mina system ── */
.cps .cps__sys-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(240px, 0.9fr); gap: 14px; margin-top: 22px; }
.cps .cps__chart, .cps .cps__tools, .cps .cps__auto {
  border: 1px solid rgba(107, 83, 145, 0.08);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 32px -26px rgba(70, 52, 104, 0.3);
}
.cps .cps__chart { padding: 16px 17px 12px; }
.cps .cps__trend { color: #267849; font-size: 8px; font-weight: 700; }
.cps .cps__chart-body { height: 132px; margin-top: 4px; }
.cps .cps__chart-svg { width: 100%; height: 100%; display: block; }
.cps .cps__chart-line, .cps .cps__chart-area, .cps .cps__chart-dot { opacity: var(--cps-switch); }
.cps .cps__chart-grid { stroke: rgba(17, 24, 39, 0.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cps .cps__chart-line {
  stroke-dasharray: 600;
  stroke-dashoffset: calc(600 - 600 * var(--cps-switch));
}
.cps .cps__chart-axis { display: flex; justify-content: space-between; margin-top: 7px; color: var(--cps-muted); font-size: 7px; letter-spacing: 0.06em; text-transform: uppercase; }

.cps .cps__tools { padding: 16px 15px 10px; }
.cps .cps__tool { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid rgba(17, 24, 39, 0.06); }
.cps .cps__tool-mark { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; font-size: 9px; font-weight: 800; }
.cps .cps__tool-mark.is-blue { color: #387fb2; background: #e8f3fa; }
.cps .cps__tool-mark.is-green { color: #2d8a56; background: #e7f5ee; }
.cps .cps__tool-mark.is-teal { color: #2b7f80; background: #e4f2f2; }
.cps .cps__tool-mark.is-purple { color: var(--cps-purple); background: rgba(107, 83, 145, 0.11); }
.cps .cps__tool p { min-width: 0; margin: 0; }
.cps .cps__tool b, .cps .cps__tool small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cps .cps__tool b { font-size: 9px; font-weight: 650; }
.cps .cps__tool small { margin-top: 2px; color: var(--cps-muted); font-size: 7.5px; }
.cps .cps__dot { width: 6px; height: 6px; border-radius: 50%; background: #2d8a56; box-shadow: 0 0 0 3px rgba(45, 138, 86, 0.14); }

.cps .cps__auto-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.cps .cps__auto { padding: 14px 15px 13px; }
.cps .cps__auto-top { display: flex; align-items: center; justify-content: space-between; }
.cps .cps__auto-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--cps-purple); background: rgba(107, 83, 145, 0.1); }
.cps .cps__auto-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cps .cps__auto h5 { margin: 11px 0 0; font-size: 12px; font-weight: 650; letter-spacing: -0.02em; }
.cps .cps__auto > p { margin: 4px 0 0; color: var(--cps-muted); font-size: 8px; line-height: 1.4; }
.cps .cps__auto-bars { display: flex; align-items: flex-end; gap: 4px; height: 26px; margin-top: 11px; }
.cps .cps__auto-bars i { flex: 1; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, rgba(139, 108, 192, 0.75), rgba(139, 108, 192, 0.22)); transform: scaleY(var(--cps-switch)); transform-origin: 50% 100%; }
.cps .cps__auto-foot { display: flex; align-items: baseline; gap: 5px; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(17, 24, 39, 0.06); }
.cps .cps__auto-foot b { font-size: 17px; letter-spacing: -0.04em; }
.cps .cps__auto-foot small { color: var(--cps-muted); font-size: 7.5px; }

/* ── Notislappar: kollegornas meddelanden runt datorn ── */
.cps .cps__notes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.cps .cps__note {
  position: absolute;
  width: 224px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 44px -24px rgba(52, 38, 82, 0.44), 0 3px 10px -6px rgba(52, 38, 82, 0.3);
  opacity: 0;
  will-change: transform, opacity;
}
.cps .cps__note:nth-child(1) { top: 48%; left: -80px; }
.cps .cps__note:nth-child(2) { bottom: -3%; right: -66px; }
.cps .cps__note:nth-child(3) { bottom: 19%; left: -48px; }
.cps .cps__note-mark { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 9px; font-weight: 800; }
.cps .cps__note-mark svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cps .cps__note-mark.is-rose { color: #a3477a; background: #fbe9f2; }
.cps .cps__note-mark.is-blue { color: #387fb2; background: #e8f3fa; }
.cps .cps__note-mark.is-brand { color: #fff; background: linear-gradient(135deg, #8b6cc0, #4e3a6e); }
.cps .cps__note figcaption { min-width: 0; }
.cps .cps__note b { display: flex; align-items: baseline; gap: 5px; font-size: 9.5px; font-weight: 700; }
.cps .cps__note b small { color: var(--cps-muted); font-size: 7.5px; font-weight: 550; }
.cps .cps__note p { margin: 4px 0 0; color: #3d3646; font-size: 8.5px; line-height: 1.45; }
.cps .cps__note time { display: block; margin-top: 5px; color: var(--cps-muted); font-size: 7px; }

@media (max-width: 1279px) {
  .cps .cps__note { width: 196px; }
  .cps .cps__note:nth-child(1) { left: -34px; }
  .cps .cps__note:nth-child(2) { right: -30px; }
  .cps .cps__note:nth-child(3) { left: -20px; }
}

/* Statisk fallback (mobil / reducerad rörelse): bara flik 1, inga lappar. */
.cps.is-static { min-height: auto; }
.cps.is-static .cps__rail,
.cps.is-static .cps__notes,
.cps.is-static .cps__view.is-systems { display: none; }
.cps.is-static .cps__view.is-overview { position: relative; inset: auto; }

@media (max-width: 767px) {
  .cps .cps__rail, .cps .cps__notes, .cps .cps__view.is-systems { display: none; }
  .cps .cps__view.is-overview { position: relative; inset: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cps { min-height: auto; }
  .cps .cps__rail, .cps .cps__notes, .cps .cps__view.is-systems { display: none; }
  .cps .cps__view.is-overview { position: relative; inset: auto; }
  .cps .cps__sticky {
    position: relative;
    height: auto;
    min-height: 900px;
  }
  .cps .cps__heading,
  .cps .cps__device {
    will-change: auto;
  }
  .cps .cps__heading { transform: none !important; }
  .cps .cps__device { transform: translate3d(0, 0, 0) rotateX(0deg) scale(1) !important; }
}
