/* Polished layout & theme overrides for the RelayHub Developer CV shell (/contact).
   Loaded after style.css, theme CSS, and sidebar-oval.css so all 4 themes
   (Fjord, Havn, Terrakotta, Grafitt) in light + dark mode stay crisp and balanced. */

:root {
  --sidebar-width: 266px;
}

body.cv-shell-body .app-shell {
  --sidebar-width: 266px;
}

/* ==========================================================================
   1. SIDEBAR — SMALLER TYPOGRAPHY & HORIZONTAL RESIZER
   ========================================================================== */

html body.cv-shell-body #primary-sidebar {
  padding: 18px 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

html body.cv-shell-body #primary-sidebar .brand-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 2px !important;
  padding: 0 4px !important;
}

html body.cv-shell-body #primary-sidebar .brand {
  font-size: 18px !important;
  letter-spacing: -0.03em !important;
  gap: 8px !important;
  padding: 0 !important;
  line-height: 1.1 !important;
}

html body.cv-shell-body #primary-sidebar .brand-mark {
  width: 22px !important;
  height: 22px !important;
  padding: 4px !important;
  border-radius: 8px !important;
  gap: 2px !important;
}

html body.cv-shell-body #primary-sidebar .brand-mark span {
  width: 3px !important;
}
html body.cv-shell-body #primary-sidebar .brand-mark span:nth-child(1) { height: 6px !important; }
html body.cv-shell-body #primary-sidebar .brand-mark span:nth-child(2) { height: 10px !important; }
html body.cv-shell-body #primary-sidebar .brand-mark span:nth-child(3) { height: 13px !important; }

html body.cv-shell-body #primary-sidebar .cv-brand-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.3;
  white-space: nowrap;
}

html body.cv-shell-body #primary-sidebar .theme-toggle {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 10px !important;
  padding: 0 !important;
}

/* Compact contact strip under brand */
html body.cv-shell-body #primary-sidebar #mobile-sentralbord-slot {
  margin: 0 0 4px !important;
  padding: 0 6px !important;
}

html body.cv-shell-body #primary-sidebar #sentralbord-card .sentralbord-line {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  min-height: 22px !important;
}

html body.cv-shell-body #primary-sidebar #sentralbord-card strong#central-email-display {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: rgba(255, 255, 255, 0.94) !important;
}

html body.cv-shell-body #primary-sidebar #sentralbord-card p#central-location-display {
  font-size: 12.5px !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  color: #a9abb5 !important;
}

html body.cv-shell-body #primary-sidebar .cv-sidebar-link {
  color: inherit;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

html body.cv-shell-body #primary-sidebar .cv-sidebar-link:hover {
  text-decoration: underline;
}

html body.cv-shell-body #primary-sidebar .sentralbord-copy {
  opacity: 0.65;
  padding: 2px 4px !important;
  color: #cfd1da !important;
  background: transparent !important;
  border: 0 !important;
  cursor: pointer;
}

html body.cv-shell-body #primary-sidebar .sentralbord-copy:hover {
  opacity: 1;
}

/* Identity + Fokusområder compact ovals */
html body.cv-shell-body #primary-sidebar .sidebar-top-controls {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 !important;
}

html body.cv-shell-body #primary-sidebar #utility-agent-select .agent-identity {
  padding: 8px 10px !important;
  gap: 9px !important;
  border-radius: 12px !important;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

html body.cv-shell-body #primary-sidebar #utility-agent-select .user-avatar {
  width: 30px !important;
  height: 30px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
  flex: 0 0 30px !important;
}

html body.cv-shell-body #primary-sidebar #utility-agent-select .active-agent-label {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

html body.cv-shell-body #primary-sidebar #utility-agent-select .active-agent-phone {
  font-size: 12px !important;
  line-height: 1.25 !important;
}

html body.cv-shell-body #primary-sidebar .cv-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
  margin-left: auto;
  flex: 0 0 auto;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

html body.cv-shell-body #primary-sidebar .cv-online-dot.state-acw {
  background: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.22);
}

html body.cv-shell-body #primary-sidebar .cv-online-dot.state-pause,
html body.cv-shell-body #primary-sidebar .cv-online-dot.state-meeting {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

html body.cv-shell-body #primary-sidebar .cv-online-dot.state-offline {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22);
}

html body.cv-shell-body #primary-sidebar .agent-controls-rail-section {
  padding: 0 !important;
  border: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

/* 4 authentic RelayHub state buttons inside one sleek oval pill (matching style.css 17954+) */
html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions.agent-state-actions {
  position: relative !important;
  display: flex !important;
  gap: 2px !important;
  margin: 4px 0 0 !important;
  padding: 4px !important;
  width: 100% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 999px !important;
  --rh-state-pill: color-mix(in srgb, rgb(52, 211, 153) 48%, #1C1C1C);
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions:has(.state-acw.is-current) {
  --rh-state-pill: color-mix(in srgb, rgb(129, 140, 248) 58%, #1C1C1C);
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions:has(.state-pause.is-current) {
  --rh-state-pill: color-mix(in srgb, rgb(250, 204, 21) 58%, #1C1C1C);
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions:has(.state-logout.is-current) {
  --rh-state-pill: color-mix(in srgb, rgb(248, 113, 113) 58%, #1C1C1C);
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions > :is(.state-btn, .pause-control-container) {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions .state-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 4px 2px !important;
  gap: 4px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  color: rgb(var(--tone)) !important;
  position: relative;
  z-index: 1;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions .state-btn:hover:not(:disabled):not(.is-current) {
  background: rgba(255, 255, 255, 0.06) !important;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions .state-btn.is-current {
  background: transparent !important;
  color: #ffffff !important;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions:not(.rh-seg-ready) .state-btn.is-current {
  background: var(--rh-state-pill) !important;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions .state-btn svg {
  display: block !important;
  width: 17px !important;
  height: 17px !important;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions .state-btn span {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  color: rgba(245, 245, 242, 0.8) !important;
}

html body.cv-shell-body #primary-sidebar #agent-controls-rail-section #queue-agent-actions .state-btn.is-current span {
  color: #ffffff !important;
}

html body.cv-shell-body #primary-sidebar #pause-control-container {
  position: static !important;
}

html body.cv-shell-body #primary-sidebar #cv-pause-menu {
  display: none !important;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 5px;
  border-radius: 14px;
  background: #232326;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.44);
  z-index: 80;
  flex-direction: column;
  gap: 2px;
  animation: none !important;
  transition: none !important;
}

html body.cv-shell-body #primary-sidebar #cv-pause-menu.is-open {
  display: flex !important;
}

html body.cv-shell-body #primary-sidebar .cv-pause-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font: 600 12.5px var(--font);
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
}

html body.cv-shell-body #primary-sidebar .cv-pause-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-offline {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.22);
  opacity: 0.76;
}

html body.cv-shell-body #primary-sidebar .state-offline .cv-agent-dot {
  background: #9ca3af;
}

html body.cv-shell-body #primary-sidebar .state-offline .cv-agent-status-text,
html body.cv-shell-body #primary-sidebar .state-offline .cv-agent-icon {
  color: #f87171;
}

html body.cv-shell-body #primary-sidebar .queue-accordion-btn {
  padding: 9px 11px !important;
  gap: 8px !important;
  border-radius: 12px !important;
}

html body.cv-shell-body #primary-sidebar .queue-btn-text strong {
  font-size: 11.5px !important;
  letter-spacing: 0.06em !important;
  line-height: 1.25 !important;
}

html body.cv-shell-body #primary-sidebar .queue-btn-text small {
  font-size: 13px !important;
  line-height: 1.25 !important;
}

html body.cv-shell-body #primary-sidebar .queue-toggle-item {
  padding: 7px 9px !important;
}

html body.cv-shell-body #primary-sidebar .queue-toggle-item strong {
  font-size: 12.5px !important;
}

html body.cv-shell-body #primary-sidebar .queue-toggle-item small {
  font-size: 11.5px !important;
}

/* Primary nav: 15.1px (-10% from 16.8px) with proportional icons */
html body.cv-shell-body #primary-sidebar .primary-nav {
  margin-top: 4px !important;
  gap: 3px !important;
}

html body.cv-shell-body #primary-sidebar .primary-nav .nav-item {
  font-size: 15.1px !important;
  font-weight: 600 !important;
  padding: 8.5px 12px !important;
  gap: 10px !important;
  border-radius: 12px !important;
  line-height: 1.25 !important;
}

html body.cv-shell-body #primary-sidebar .primary-nav .nav-item > span:not(.nav-icon) {
  font-size: 15.1px !important;
  line-height: 1.25 !important;
}

html body.cv-shell-body #primary-sidebar .primary-nav .nav-icon {
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px !important;
  font-size: 16px !important;
}

html body.cv-shell-body #primary-sidebar .primary-nav .nav-icon svg {
  width: 17px !important;
  height: 17px !important;
}

/* Live demo agents in sidebar (authentic RelayHub status colours) */
html body.cv-shell-body #primary-sidebar .sidebar-agents-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 6px 2px 4px !important;
}

html body.cv-shell-body #primary-sidebar .cv-agents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8f929e;
  flex: 0 0 auto;
}

html body.cv-shell-body #primary-sidebar .cv-agents-summary {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #a9abb5;
  font-variant-numeric: tabular-nums;
}

html body.cv-shell-body #primary-sidebar #agents-list.cv-demo-agents {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 2px 6px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

html body.cv-shell-body #primary-sidebar .cv-agent-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px !important;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #ffffff;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

html body.cv-shell-body #primary-sidebar .cv-agent-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* RelayHub rule: Klar has no row background tint; active/busy states carry subtle tint */
html body.cv-shell-body #primary-sidebar .cv-agent-row {
  position: relative;
  overflow: hidden;
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-in_call {
  background: rgba(34, 197, 94, 0.13);
  border-color: rgba(34, 197, 94, 0.3);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-ringing {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.42);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-ended {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.38);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-transfer {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.42);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-transfer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.24), transparent);
  transform: translateX(-100%);
  animation: cvTransferSweep 1.25s ease-in-out infinite;
  pointer-events: none;
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-acw {
  background: rgba(129, 140, 248, 0.14);
  border-color: rgba(129, 140, 248, 0.28);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-pause {
  background: rgba(250, 204, 21, 0.11);
  border-color: rgba(250, 204, 21, 0.22);
}

html body.cv-shell-body #primary-sidebar .cv-agent-row.state-meeting {
  background: rgba(192, 132, 252, 0.13);
  border-color: rgba(192, 132, 252, 0.26);
}

html body.cv-shell-body #primary-sidebar .cv-agent-av {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

html body.cv-shell-body #primary-sidebar .cv-agent-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #1c1c1c;
  background: #34d399;
}

html body.cv-shell-body #primary-sidebar .state-ringing .cv-agent-dot {
  background: #f59e0b;
  animation: cvAgentPulse 0.85s ease-in-out infinite;
}

html body.cv-shell-body #primary-sidebar .state-in_call .cv-agent-dot {
  background: #22c55e;
}

html body.cv-shell-body #primary-sidebar .state-ended .cv-agent-dot {
  background: #f87171;
}

html body.cv-shell-body #primary-sidebar .state-transfer .cv-agent-dot {
  background: #38bdf8;
  animation: cvAgentPulse 0.85s ease-in-out infinite;
}

html body.cv-shell-body #primary-sidebar .state-acw .cv-agent-dot {
  background: #818cf8;
}

html body.cv-shell-body #primary-sidebar .state-pause .cv-agent-dot {
  background: #facc15;
}

html body.cv-shell-body #primary-sidebar .state-meeting .cv-agent-dot {
  background: #c084fc;
}

html body.cv-shell-body #primary-sidebar .cv-agent-info {
  min-width: 0;
  flex: 1;
}

html body.cv-shell-body #primary-sidebar .cv-agent-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html body.cv-shell-body #primary-sidebar .cv-agent-status-text {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: #a1a4b2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body.cv-shell-body #primary-sidebar .state-ringing .cv-agent-status-text { color: #fbbf24; }
html body.cv-shell-body #primary-sidebar .state-in_call .cv-agent-status-text { color: #4ade80; }
html body.cv-shell-body #primary-sidebar .state-ended .cv-agent-status-text { color: #fca5a5; }
html body.cv-shell-body #primary-sidebar .state-transfer .cv-agent-status-text { color: #7dd3fc; }
html body.cv-shell-body #primary-sidebar .state-acw .cv-agent-status-text { color: #a5b4fc; }
html body.cv-shell-body #primary-sidebar .state-pause .cv-agent-status-text { color: #fde047; }
html body.cv-shell-body #primary-sidebar .state-meeting .cv-agent-status-text { color: #d8b4fe; }

/* Right-aligned status icon + live timer */
html body.cv-shell-body #primary-sidebar .cv-agent-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  margin-left: 4px;
}

html body.cv-shell-body #primary-sidebar .cv-agent-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: #8f94a3;
}

html body.cv-shell-body #primary-sidebar .state-ringing .cv-agent-icon {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
}

html body.cv-shell-body #primary-sidebar .state-ringing .cv-agent-icon svg {
  animation: cvPhoneRing 0.52s ease-in-out infinite;
  transform-origin: center;
}

html body.cv-shell-body #primary-sidebar .state-in_call .cv-agent-icon {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
  animation: cvCallAnswerPop 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

html body.cv-shell-body #primary-sidebar .state-ended .cv-agent-icon {
  color: #f87171;
  background: rgba(248, 113, 113, 0.22);
}

html body.cv-shell-body #primary-sidebar .state-ended .cv-agent-icon svg {
  animation: cvPhoneHangup 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-origin: center;
}

html body.cv-shell-body #primary-sidebar .state-transfer .cv-agent-icon {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
}

html body.cv-shell-body #primary-sidebar .state-transfer .cv-agent-icon svg {
  animation: cvTransferSlide 0.9s ease-in-out infinite;
}

html body.cv-shell-body #primary-sidebar .state-acw .cv-agent-icon { color: #a5b4fc; }
html body.cv-shell-body #primary-sidebar .state-pause .cv-agent-icon { color: #fde047; }
html body.cv-shell-body #primary-sidebar .state-meeting .cv-agent-icon { color: #d8b4fe; }
html body.cv-shell-body #primary-sidebar .state-ready .cv-agent-icon { color: #34d399; opacity: 0.78; }

html body.cv-shell-body #primary-sidebar .cv-agent-timer {
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.72);
}

html body.cv-shell-body #primary-sidebar .state-ready .cv-agent-timer {
  color: rgba(255, 255, 255, 0.42);
}

@keyframes cvAgentPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.28); opacity: 0.65; }
}

@keyframes cvPhoneRing {
  0%, 100% { transform: rotate(0deg) scale(1); }
  14% { transform: rotate(-16deg) scale(1.08); }
  28% { transform: rotate(16deg) scale(1.08); }
  42% { transform: rotate(-14deg) scale(1.06); }
  56% { transform: rotate(14deg) scale(1.06); }
  70% { transform: rotate(-7deg) scale(1.02); }
  84% { transform: rotate(0deg) scale(1); }
}

@keyframes cvCallAnswerPop {
  0% { transform: scale(0.72); opacity: 0.4; }
  65% { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cvPhoneHangup {
  0% { transform: rotate(0deg) translateY(0) scale(1.05); opacity: 1; }
  55% { transform: rotate(135deg) translateY(2px) scale(0.95); opacity: 1; }
  100% { transform: rotate(135deg) translateY(2px) scale(0.9); opacity: 0.75; }
}

@keyframes cvTransferSlide {
  0%, 100% { transform: translateX(-2px); opacity: 0.85; }
  50% { transform: translateX(3px); opacity: 1; }
}

@keyframes cvTransferSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Horizontal drag resizer on right edge of sidebar (desktop) */
@media (min-width: 901px) {
  html body.cv-shell-body #primary-sidebar #sidebar-resizer {
    display: block !important;
    position: fixed !important;
    top: 24px !important;
    bottom: 24px !important;
    left: calc(var(--sidebar-width, 266px) * var(--ui-scale, 1) + 9px) !important;
    width: 12px !important;
    cursor: col-resize !important;
    z-index: 30 !important;
    background: transparent !important;
    touch-action: none;
  }

  html body.cv-shell-body #primary-sidebar #sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 44px;
    border-radius: 999px;
    background: var(--line);
    opacity: 0.45;
    transition: opacity 0.15s ease, height 0.15s ease, background 0.15s ease;
  }

  html body.cv-shell-body #primary-sidebar #sidebar-resizer:hover::after,
  html body.cv-shell-body #primary-sidebar #sidebar-resizer:focus-visible::after,
  html body.cv-shell-body.sidebar-resizing #primary-sidebar #sidebar-resizer::after {
    opacity: 1;
    height: 76px;
    background: var(--blue);
  }
}

body.cv-shell-body.sidebar-resizing,
body.cv-shell-body.sidebar-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* ==========================================================================
   2. TOPBAR — CLEAN FLEX LAYOUT, ZERO OVERLAP WITH SEARCH
   ========================================================================== */

html body.cv-shell-body .main-content .topbar {
  position: sticky !important;
  top: 0 !important;
  height: 64px !important;
  padding: 0 28px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 440px) minmax(max-content, 1fr) !important;
  align-items: center !important;
  gap: 16px !important;
  z-index: 10 !important;
}

html body.cv-shell-body .topbar .mobile-menu {
  grid-column: 1;
  justify-self: start;
}

html body.cv-shell-body .topbar .global-search-wrap {
  grid-column: 2 !important;
  justify-self: center !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 460px !important;
  min-width: 0 !important;
  justify-content: center !important;
}

html body.cv-shell-body .topbar .global-search {
  width: 100% !important;
  max-width: 100% !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  padding: 0 10px 0 12px !important;
  gap: 8px !important;
}

html body.cv-shell-body .topbar .global-search form {
  flex: 1;
  min-width: 0;
}

html body.cv-shell-body .topbar .global-search input {
  font-size: 13px !important;
  color: var(--ink) !important;
}

html body.cv-shell-body .topbar .topbar-actions {
  grid-column: 3 !important;
  justify-self: end !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

html body.cv-shell-body .topbar .cv-topbar-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

html body.cv-shell-body .topbar .cv-topbar-ext-link {
  height: 36px !important;
  padding: 0 12px !important;
  gap: 6px !important;
  border-radius: 999px !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

html body.cv-shell-body .topbar .cv-topbar-ext-link:hover {
  border-color: var(--blue) !important;
  color: var(--blue) !important;
  background: var(--surface) !important;
  transform: translateY(-1px);
}

html body.cv-shell-body .topbar .cv-topbar-ext-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

@media (max-width: 680px) {
  html body.cv-shell-body .topbar .cv-topbar-ext-link {
    width: 34px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  html body.cv-shell-body .topbar .cv-topbar-ext-label {
    display: none !important;
  }
}

body.cv-shell-body .cv-lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
}

body.cv-shell-body .cv-lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 700 11.5px var(--font);
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

body.cv-shell-body .cv-lang-btn.active {
  background: var(--blue);
  color: #ffffff;
}

body.cv-shell-body .cv-topbar-btn {
  height: 36px;
  padding: 0 13px;
  border-radius: 11px;
  white-space: nowrap;
}

/* Global search results dropdown */
html body.cv-shell-body .live-search-overlay {
  top: 66px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  padding: 10px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18) !important;
}

html body.cv-shell-body .live-search-overlay .search-card {
  background: var(--canvas);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

html body.cv-shell-body .live-search-overlay .search-card:hover {
  border-color: var(--blue);
}

/* ==========================================================================
   3. CONTENT SCROLL & SHARED POLISH (UNLOCK VERTICAL SCROLL ON ALL TABS)
   ========================================================================== */

html body.cv-shell-body .main-content {
  display: flex !important;
  flex-direction: column !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

html body.cv-shell-body .main-content .content-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px 28px 48px !important;
  -webkit-overflow-scrolling: touch;
}

html body.cv-shell-body .surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

html body.cv-shell-body .page-heading.compact {
  margin-bottom: 18px !important;
}

body.cv-shell-body .cv-hero-summary {
  max-width: 720px;
  line-height: 1.55;
  margin-top: 6px !important;
  font-size: 13.5px !important;
}

body.cv-shell-body .cv-sub-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 0;
}

/* ==========================================================================
   4. OVERSIKT — PULSE CHART & ACTIVITY
   ========================================================================== */

html body.cv-shell-body #dashboard-tab .cv-pulse-bars {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  align-items: end !important;
  gap: 8px !important;
  min-height: 128px !important;
}

body.cv-shell-body .cv-pulse-col {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

body.cv-shell-body .cv-pulse-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
}

body.cv-shell-body .cv-pulse-bar {
  width: 44%;
  max-width: 12px;
  min-height: 5px;
  border-radius: 5px 5px 2px 2px;
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s ease;
}

body.cv-shell-body .cv-pulse-bar.prs {
  background: linear-gradient(180deg, #34d399, #059669);
}

body.cv-shell-body .cv-pulse-bar.commits {
  background: linear-gradient(180deg, #a5b4fc, #6366f1);
  opacity: 0.78;
}

body.cv-shell-body .cv-pulse-col:hover .cv-pulse-bar {
  filter: brightness(1.08);
  opacity: 1;
}

body.cv-shell-body .cv-pulse-axis {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}

body.cv-shell-body .cv-pulse-axis span {
  position: static !important;
  transform: none !important;
  display: block;
}

html body.cv-shell-body .activity-heading {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

body.cv-shell-body .cv-activity-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

html body.cv-shell-body .call-log-list {
  border-top: 1px solid var(--line) !important;
}

html body.cv-shell-body .call-log {
  padding: 10px 18px !important;
  gap: 12px !important;
  border-bottom: 1px solid var(--line) !important;
  cursor: pointer;
  transition: background 0.14s ease;
}

html body.cv-shell-body .call-log:hover {
  background: var(--canvas);
}

html body.cv-shell-body .call-log-main strong {
  font-size: 13px !important;
  line-height: 1.3 !important;
  color: var(--ink) !important;
}

html body.cv-shell-body .call-log-main span {
  font-size: 12px !important;
  line-height: 1.3 !important;
  margin-top: 2px !important;
}

body.cv-shell-body .cv-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  flex: 0 0 28px;
  background: var(--canvas);
  border: 1px solid var(--line);
}

body.cv-shell-body .cv-activity-icon.is-project { color: var(--blue); }
body.cv-shell-body .cv-activity-icon.is-experience { color: var(--orange); }
body.cv-shell-body .cv-activity-icon.is-release { color: var(--green); }

body.cv-shell-body .cv-activity-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--canvas);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-top: 3px;
}

body.cv-shell-body .cv-activity-badge.success {
  background: var(--green-soft);
  border-color: transparent;
  color: var(--green);
}

body.cv-shell-body .cv-activity-badge.accent {
  background: var(--blue-soft);
  border-color: transparent;
  color: var(--blue);
}

/* ==========================================================================
   5. KONTAKTER (CV MASTER-DETAIL)
   ========================================================================== */

body.cv-shell-body .cv-contacts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

body.cv-shell-body .cv-inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  min-width: 220px;
  max-width: 300px;
  flex: 1 1 220px;
}

body.cv-shell-body .cv-inline-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 13px var(--font);
  width: 100%;
}

body.cv-shell-body .cv-contacts-layout {
  display: grid;
  grid-template-columns: var(--cv-pane-w, 390px) minmax(0, 1fr);
  min-height: 540px;
  overflow: hidden;
}

html body.cv-shell-body .thread-panel {
  position: relative;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  min-width: 0;
}

/* Horizontal drag resizer on split-pane lists (Kontakter, Meldinger, E-post) */
body.cv-shell-body .cv-pane-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 6;
  touch-action: none;
}

body.cv-shell-body .cv-pane-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 40px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.15s ease, height 0.15s ease;
}

body.cv-shell-body .cv-pane-resizer:hover::after,
body.cv-shell-body .cv-pane-resizer:focus-visible::after,
body.cv-shell-body.pane-resizing .cv-pane-resizer::after {
  opacity: 0.85;
  height: 72px;
}

body.cv-shell-body.pane-resizing,
body.cv-shell-body.pane-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

html body.cv-shell-body .thread-item {
  border-bottom: 1px solid var(--line);
  padding: 13px 15px;
  transition: background 0.14s ease;
}

html body.cv-shell-body .thread-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

html body.cv-shell-body .thread-item strong {
  font-size: 13.5px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
}

html body.cv-shell-body .thread-item time {
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-top: 1px;
}

html body.cv-shell-body .thread-item p {
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  margin: 4px 0 3px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

html body.cv-shell-body .thread-item .thread-meta {
  font-size: 11.5px !important;
}

html body.cv-shell-body .thread-item:hover {
  background: var(--surface);
}

html body.cv-shell-body .thread-item.active {
  background: var(--surface);
  border-left: 3px solid var(--blue);
}

body.cv-shell-body .cv-contacts-list {
  max-height: 600px;
  overflow-y: auto;
}

body.cv-shell-body .cv-contact-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

body.cv-shell-body .cv-contact-row-main {
  min-width: 0;
  flex: 1;
}

body.cv-shell-body .cv-contact-detail {
  padding: 26px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--surface);
}

body.cv-shell-body .cv-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

body.cv-shell-body .cv-detail-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

body.cv-shell-body .cv-detail-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  font: 800 15px var(--display);
  flex: 0 0 46px;
}

body.cv-shell-body .cv-detail-title h2 {
  margin: 0;
  font: 800 19px var(--display);
  letter-spacing: -0.3px;
}

body.cv-shell-body .cv-detail-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

body.cv-shell-body .cv-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.cv-shell-body .cv-detail-summary {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
}

body.cv-shell-body .cv-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.cv-shell-body .cv-detail-metric {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--canvas);
}

body.cv-shell-body .cv-detail-metric span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

body.cv-shell-body .cv-detail-metric strong {
  display: block;
  margin-top: 4px;
  font: 700 14px var(--display);
  color: var(--ink);
  word-break: break-word;
}

body.cv-shell-body .cv-detail-section h3 {
  margin: 0 0 10px;
  font: 700 11.5px var(--display);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

body.cv-shell-body .cv-detail-bullets {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.55;
}

body.cv-shell-body .cv-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

body.cv-shell-body .cv-tag-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--canvas);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* Customer 30-day statistics showcase image & zoom lightbox */
body.cv-shell-body .cv-showcase-figure {
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--canvas);
  overflow: hidden;
}

body.cv-shell-body .cv-showcase-trigger {
  display: block;
  width: 100%;
  border: 0;
  padding: 10px 10px 6px;
  background: transparent;
  cursor: zoom-in;
}

body.cv-shell-body .cv-showcase-trigger img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 11px;
  transition: transform 0.2s ease;
}

body.cv-shell-body .cv-showcase-trigger:hover img {
  transform: scale(1.008);
}

body.cv-shell-body .cv-showcase-caption {
  padding: 8px 14px 11px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

body.cv-shell-body .cv-image-modal {
  z-index: 80;
  padding: 24px;
}

body.cv-shell-body .cv-image-modal-card {
  position: relative;
  width: min(1160px, 95vw);
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

body.cv-shell-body .cv-image-modal-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

body.cv-shell-body .cv-image-modal-caption {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

body.cv-shell-body .cv-image-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 20px;
  z-index: 2;
}

/* ==========================================================================
   6. MELDINGER & E-POST — SELF-CONTAINED POLISHED WORKSPACES
   ========================================================================== */

body.cv-shell-body .cv-workspace-card {
  display: grid;
  grid-template-columns: var(--cv-pane-w, 330px) minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
}

body.cv-shell-body .cv-sms-design-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.cv-shell-body .cv-sms-design-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

body.cv-shell-body .cv-sms-group-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 15px;
}

body.cv-shell-body .cv-conv-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
}

body.cv-shell-body .cv-conv-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

html body.cv-shell-body .cv-chat-history {
  flex: 1;
  min-height: 250px;
  max-height: 360px;
  padding: 20px;
  background: var(--canvas) !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

html body.cv-shell-body .cv-chat-history .message-bubble {
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

html body.cv-shell-body .cv-chat-history .message-row.agent .message-bubble {
  background: var(--blue);
  color: #ffffff;
  border-color: transparent;
}

body.cv-shell-body .cv-quick-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

body.cv-shell-body .cv-quick-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}

body.cv-shell-body .cv-quick-chip {
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: 600 12px var(--font);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

body.cv-shell-body .cv-quick-chip:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

body.cv-shell-body .cv-composer-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

body.cv-shell-body .cv-sender-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.cv-shell-body .cv-sender-row input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink);
  font: 500 13px var(--font);
  outline: none;
}

body.cv-shell-body .cv-sender-row input:focus {
  border-color: var(--blue);
}

body.cv-shell-body .cv-sms-input-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--canvas);
}

body.cv-shell-body .cv-sms-input-box:focus-within {
  border-color: var(--blue);
}

body.cv-shell-body .cv-sms-input-box textarea {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 400 13.5px/1.5 var(--font);
  resize: none;
  min-height: 44px;
  padding: 4px 0;
}

/* E-post workspace — generous reader above, sleek compact composer docked below */
body.cv-shell-body .cv-email-page-head {
  align-items: flex-end;
}

body.cv-shell-body .cv-email-layout {
  min-height: 620px;
}

body.cv-shell-body .cv-email-panel {
  display: flex;
  flex-direction: column;
  min-height: 620px;
  background: var(--surface);
}

body.cv-shell-body .cv-email-reader {
  flex: 1 1 auto;
  padding: 22px 26px;
  min-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--ink);
  background: var(--surface);
}

body.cv-shell-body .cv-email-dock {
  flex: 0 0 auto;
  padding: 12px 18px 16px;
  background: var(--canvas);
  border-top: 1px solid var(--line);
}

body.cv-shell-body .cv-email-composer-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

body.cv-shell-body .cv-email-composer-card:focus-within {
  border-color: var(--blue);
}

body.cv-shell-body .cv-email-quick-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

body.cv-shell-body .cv-email-quick-strip .cv-quick-label {
  font-size: 11px;
}

body.cv-shell-body .cv-email-quick-strip .cv-quick-chip {
  padding: 4px 10px;
  font-size: 11.5px;
  background: var(--surface);
}

body.cv-shell-body .cv-email-inline-fields {
  display: flex;
  flex-direction: column;
}

body.cv-shell-body .cv-email-inline-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

body.cv-shell-body .cv-email-inline-pair .cv-email-inline-cell:first-child {
  border-right: 1px solid var(--line);
}

body.cv-shell-body .cv-email-inline-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 33px;
  min-width: 0;
}

body.cv-shell-body .cv-email-subject-cell {
  border-bottom: 1px solid var(--line);
}

body.cv-shell-body .cv-email-inline-cell span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  flex: 0 0 auto;
}

body.cv-shell-body .cv-email-inline-cell input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 12.5px var(--font);
  width: 100%;
  min-width: 0;
}

body.cv-shell-body .cv-email-textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  max-height: 180px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 13px/1.5 var(--font);
  resize: vertical;
  outline: none;
}

body.cv-shell-body .cv-email-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
}

body.cv-shell-body .cv-ghost-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px var(--font);
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
}

body.cv-shell-body .cv-ghost-btn:hover {
  color: var(--ink);
  background: var(--surface);
}

body.cv-shell-body .cv-compact-send {
  padding: 7px 14px;
  font-size: 12.5px;
  border-radius: 10px;
}

/* Compact title-only thread rows in Meldinger & E-post */
body.cv-shell-body .cv-thread-compact {
  padding: 11px 14px !important;
}

body.cv-shell-body .cv-thread-compact .thread-meta {
  display: inline-block;
  margin-top: 4px;
}

body.cv-shell-body .cv-hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.cv-shell-body .hidden,
body.cv-shell-body .cv-delivery-note.hidden {
  display: none !important;
}

body.cv-shell-body .cv-delivery-note {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.cv-shell-body .cv-composer-stack .cv-delivery-note {
  margin: 0;
}

body.cv-shell-body .cv-delivery-note.is-success {
  border-color: var(--green);
  background: var(--green-soft);
}

body.cv-shell-body .cv-delivery-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   7. STATISTIKK — CRISP KPI GRID, UNDISTORTED SVG CHART & RINGS
   ========================================================================== */

body.cv-shell-body .cv-stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

body.cv-shell-body .cv-stats-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.cv-shell-body .cv-stats-title-group h1 {
  margin: 0;
  font: 800 22px var(--display);
  letter-spacing: -0.5px;
}

body.cv-shell-body .cv-stats-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body.cv-shell-body .cv-stats-content {
  display: grid;
  gap: 16px;
}

body.cv-shell-body .cv-stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

body.cv-shell-body .cv-kpi-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.cv-shell-body .cv-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

body.cv-shell-body .cv-kpi-num {
  font: 800 32px var(--display);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

body.cv-shell-body .cv-kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

body.cv-shell-body .cv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
body.cv-shell-body .dot-prs { background: var(--blue); }
body.cv-shell-body .dot-commits { background: var(--green); }
body.cv-shell-body .dot-releases { background: var(--orange); }
body.cv-shell-body .dot-pace { background: var(--violet); }

body.cv-shell-body .cv-stats-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 16px;
}

body.cv-shell-body .cv-stats-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.cv-shell-body .cv-stats-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.cv-shell-body .cv-stats-card-head h2 {
  margin: 0;
  font: 700 15px var(--display);
}

body.cv-shell-body .cv-stats-chart-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body.cv-shell-body .cv-chart-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

body.cv-shell-body .cv-chart-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.cv-shell-body .cv-svg-chart-wrap {
  position: relative;
  width: 100%;
}

body.cv-shell-body .cv-chart-svg {
  width: 100%;
  height: auto;
  max-height: 270px;
  display: block;
}

body.cv-shell-body .cv-chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

body.cv-shell-body .cv-chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

body.cv-shell-body .cv-chart-bar {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: cvBarGrow 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.cv-shell-body .cv-chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: cvLineDraw 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.cv-shell-body .cv-chart-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  z-index: 5;
  white-space: nowrap;
  transform: translate(-50%, -115%);
}

@keyframes cvBarGrow {
  from { transform: scaleY(0); opacity: 0.25; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes cvLineDraw {
  to { stroke-dashoffset: 0; }
}

body.cv-shell-body .cv-ring-list {
  display: grid;
  gap: 10px;
}

body.cv-shell-body .cv-ring-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--canvas);
}

body.cv-shell-body .cv-ring-svg {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
}

body.cv-shell-body .cv-ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 5;
}

body.cv-shell-body .cv-ring-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

body.cv-shell-body .cv-ring-meta {
  min-width: 0;
  flex: 1;
}

body.cv-shell-body .cv-ring-meta strong {
  display: block;
  font-size: 13px;
}

body.cv-shell-body .cv-ring-meta small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

body.cv-shell-body .cv-ring-score {
  font: 700 12px var(--display);
  color: var(--green);
  white-space: nowrap;
}

body.cv-shell-body .cv-project-stats-table {
  display: grid;
  gap: 8px;
}

body.cv-shell-body .cv-proj-stat-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.9fr) repeat(3, minmax(72px, 0.6fr)) minmax(130px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--canvas);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

body.cv-shell-body .cv-proj-stat-row:hover {
  border-color: var(--blue);
}

body.cv-shell-body .cv-proj-stat-name strong {
  display: block;
  font-size: 13.5px;
}

body.cv-shell-body .cv-proj-stat-name small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

body.cv-shell-body .cv-proj-stat-num {
  font: 700 13px var(--display);
  font-variant-numeric: tabular-nums;
}

body.cv-shell-body .cv-proj-stat-num small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
}

body.cv-shell-body .cv-score-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 4px;
}

body.cv-shell-body .cv-score-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
}

/* ==========================================================================
   8. RESPONSIVE & PRINT
   ========================================================================== */

body.cv-shell-body .cv-mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 40;
}

@media (max-width: 1120px) {
  body.cv-shell-body .cv-stats-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.cv-shell-body .cv-stats-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body.cv-shell-body.cv-nav-open .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(290px, 84vw);
    z-index: 50;
    overflow-y: auto;
  }

  html body.cv-shell-body .main-content .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    padding: 0 14px !important;
    gap: 10px !important;
  }

  html body.cv-shell-body .content-scroll {
    padding: 8px 14px 32px !important;
  }

  body.cv-shell-body .cv-contacts-layout,
  body.cv-shell-body .cv-workspace-card {
    grid-template-columns: 1fr;
  }

  body.cv-shell-body .cv-pane-resizer {
    display: none;
  }

  body.cv-shell-body .cv-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.cv-shell-body .cv-sender-row,
  body.cv-shell-body .cv-email-inline-pair {
    grid-template-columns: 1fr;
  }

  body.cv-shell-body .cv-email-inline-pair .cv-email-inline-cell:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.cv-shell-body .cv-proj-stat-row {
    grid-template-columns: 1fr 1fr;
  }
}

.cv-print-sheet { display: none; }

@media print {
  html,
  body.cv-shell-body {
    overflow: visible !important;
    height: auto !important;
    background: #ffffff !important;
    color: #111827 !important;
  }

  body.cv-shell-body .app-shell,
  body.cv-shell-body #theme-picker,
  body.cv-shell-body #toast-container,
  body.cv-shell-body .cv-mobile-backdrop {
    display: none !important;
  }

  .cv-print-sheet {
    display: block !important;
    padding: 24px 32px;
    font-family: 'DM Sans', Arial, sans-serif;
    color: #111827;
    max-width: 820px;
    margin: 0 auto;
  }

  .cv-print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #111827;
    padding-bottom: 14px;
    margin-bottom: 18px;
  }

  .cv-print-identity {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .cv-print-photo {
    width: 84px;
    height: 84px;
    border-radius: 14px;
    object-fit: cover;
    object-position: center 20%;
    border: 1.5px solid #d1d5db;
    flex: 0 0 84px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cv-print-header h1 { margin: 0; font-size: 26px; }
  .cv-print-header p { margin: 4px 0 0; color: #4b5563; font-size: 13px; }
  .cv-print-contact { text-align: right; font-size: 12px; line-height: 1.6; }
  .cv-print-section { margin-bottom: 18px; break-inside: avoid; }
  .cv-print-section h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
    margin: 0 0 10px;
  }
  .cv-print-item { margin-bottom: 12px; break-inside: avoid; }
  .cv-print-item-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 13.5px; }
  .cv-print-item p { margin: 4px 0; font-size: 12.5px; line-height: 1.5; color: #374151; }
  .cv-print-item ul { margin: 4px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
  body.cv-shell-body .cv-chart-bar,
  body.cv-shell-body .cv-chart-line,
  body.cv-shell-body #primary-sidebar .cv-agent-icon svg,
  body.cv-shell-body #primary-sidebar .cv-agent-row.state-transfer::after,
  body.cv-shell-body #primary-sidebar .cv-agent-dot {
    animation: none !important;
    stroke-dashoffset: 0;
  }
}
