.service-detail-hero__window {
  position: absolute;
  z-index: 1;
  inset-inline-end: -3%;
  inset-block-start: 12%;
  inline-size: min(49vw, 45rem);
  aspect-ratio: 1.2;
  overflow: hidden;
  border: 1px solid var(--white-border);
  border-radius: 6px;
  background: rgba(247, 243, 236, 0.06);
  box-shadow: 0 3rem 7rem rgba(0, 0, 0, 0.28);
  opacity: 0.84;
  transform: rotate(-4deg);
}

[dir="rtl"] .service-detail-hero__window {
  transform: rotate(4deg);
}

.service-detail-hero__bar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  block-size: 8%;
  align-items: center;
  gap: 0.45rem;
  padding-inline: 1.25rem;
  border-block-end: 1px solid var(--white-border);
}

.service-detail-hero__bar i {
  inline-size: 5px;
  block-size: 5px;
  border-radius: 50%;
  background: var(--muted-text);
}

.service-detail-hero__rail {
  position: absolute;
  inset-inline-start: 8%;
  inset-block: 16% 9%;
  inline-size: 1px;
  background: var(--white-border);
}

.service-detail-hero__icon,
.service-detail-process__icon {
  position: absolute;
  display: block;
  background: var(--pure-white);
  -webkit-mask: var(--service-icon) center / contain no-repeat;
  mask: var(--service-icon) center / contain no-repeat;
}

.service-detail-hero__icon {
  inset-inline-start: 18%;
  inset-block-start: 23%;
  inline-size: 27%;
  aspect-ratio: 1;
  opacity: 0.88;
}

.service-detail-hero__signal {
  position: absolute;
  display: block;
  inset-inline-start: 55%;
  block-size: 1px;
  background: var(--white-border);
}

.service-detail-hero__signal--one {
  inset-block-start: 29%;
  inline-size: 31%;
}

.service-detail-hero__signal--two {
  inset-block-start: 43%;
  inline-size: 22%;
}

.service-detail-hero__signal--three {
  inset-block-start: 58%;
  inline-size: 36%;
  block-size: 9%;
  background: var(--time-amber);
}

.service-detail-process__icon {
  inset-inline-end: 17%;
  inset-block-start: 17%;
  inline-size: clamp(7rem, 14vw, 12rem);
  aspect-ratio: 1;
  opacity: 0.52;
}

.service-detail-body--systems .service-detail-hero__window {
  border-color: rgba(239, 228, 213, 0.32);
}

.service-detail-body--systems .service-detail-hero__icon {
  opacity: 0.74;
}

/* The AI hero carries a short standalone heading with no lead paragraph,
   so it is given the full copy width instead of the shared 12ch wrap. */
.service-detail-body--ai .web-service-hero h1 {
  max-inline-size: none;
}

/* The AI intro is a single short line rather than a paragraph, so it is set
   larger than the shared intro body used by the longer service pages. */
.service-detail-body--ai .web-service-intro__body {
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
}

/* The AI process section is a compact product moment rather than a full-screen
   interstitial. The chat connects to the server-side organization assistant. */
.service-detail-body--ai .web-service-process {
  min-block-size: 0;
  padding-block: 4rem;
}

.service-detail-body--ai .web-service-process__inner {
  min-block-size: 0;
  align-items: start;
  column-gap: clamp(2rem, 5vw, 6rem);
}

.service-detail-body--ai .web-service-process__copy {
  grid-column: 1 / -1;
  min-inline-size: 0;
  padding-inline-end: 0;
}

.service-detail-body--ai .web-service-process h2 {
  max-inline-size: 46rem;
  margin-block-start: 0;
  font-size: clamp(2.8rem, 4.6vw, 5rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.service-detail-body--ai .web-service-process__copy > p:last-child {
  max-inline-size: 34rem;
  margin-block-start: 1.35rem;
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 1.7;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.service-detail-body--ai .web-service-process__art {
  inset-inline-start: 48%;
  border-inline-start: 0;
  background:
    radial-gradient(circle at 58% 42%, rgba(211, 147, 50, 0.13), transparent 23%),
    linear-gradient(rgba(239, 228, 213, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 228, 213, 0.04) 1px, transparent 1px);
  background-size: auto, 2.8rem 2.8rem, 2.8rem 2.8rem;
}

.service-detail-body--ai .web-service-process__art::before {
  inset: 8% 7% auto auto;
  inline-size: clamp(20rem, 36vw, 33rem);
  block-size: clamp(20rem, 36vw, 33rem);
  border-color: rgba(239, 228, 213, 0.1);
  box-shadow:
    0 0 0 4.5rem rgba(239, 228, 213, 0.025),
    0 0 0 9rem rgba(239, 228, 213, 0.018);
}

.service-detail-body--ai .service-detail-process__icon {
  inset-inline-end: 7%;
  inset-block-start: 11%;
  inline-size: clamp(5rem, 8vw, 7.5rem);
  opacity: 0.12;
}

.service-detail-body--ai .web-service-process__art > span:last-child {
  inset-inline-start: 9%;
  inset-block-end: 14%;
  inline-size: 76%;
  opacity: 0.65;
  transform: rotate(-17deg);
}

/* The AI chat leads the page directly under the hero heading, so it sits in a
   plain shell rather than the process grid and keeps a readable measure. */
.web-service-chat-lead {
  background: var(--deep-forest);
  color: var(--pure-white);
  padding-block: clamp(2.75rem, 6vh, 4.5rem);
}

.web-service-chat-lead__copy h2 {
  max-inline-size: 10ch;
  margin-block-start: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.8vw, 5.8rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.95;
  text-wrap: balance;
}

.web-service-chat-lead__copy > p:last-child {
  max-inline-size: 38rem;
  margin-block-start: 1.75rem;
  color: var(--muted-text);
  line-height: 1.8;
}

.web-service-chat-lead .ai-process-chat {
  margin-block-start: 2.5rem;
}

.ai-process-chat {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  align-self: start;
  inline-size: 100%;
  min-inline-size: 0;
  justify-self: stretch;
  margin-block-start: 2.5rem;
  border-color: rgba(239, 228, 213, 0.22);
  border-radius: 1.1rem;
  background: rgba(20, 31, 27, 0.82);
  box-shadow:
    0 2.5rem 6rem rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(211, 147, 50, 0.08) inset;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: none;
}

[dir="rtl"] .ai-process-chat {
  justify-self: stretch;
  transform: none;
}

.ai-process-chat::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 18% -9% auto auto;
  inline-size: 5.5rem;
  block-size: 5.5rem;
  border: 1px solid rgba(211, 147, 50, 0.38);
  border-radius: 50%;
  box-shadow: 0 0 3rem rgba(211, 147, 50, 0.18);
}

.ai-process-chat__connector {
  display: none;
}

.ai-process-chat__connector::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: -3px;
  inline-size: 7px;
  block-size: 7px;
  border: 1px solid var(--time-amber);
  border-radius: 50%;
  background: var(--deep-forest);
}

.ai-process-chat .chat-widget__header {
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-color: rgba(239, 228, 213, 0.12);
  background: rgba(247, 243, 236, 0.06);
}

.ai-process-chat .chat-widget__header-text strong {
  color: var(--pure-white);
}

.ai-process-chat .chat-widget__header-text {
  min-inline-size: 0;
  flex: 1;
}

.ai-process-chat__title {
  display: block;
  max-inline-size: 100%;
  font-size: clamp(0.76rem, 1.15vw, 0.95rem);
  line-height: 1.25;
  white-space: nowrap;
}

.ai-process-chat .chat-widget__avatar {
  background: var(--time-amber);
}

.ai-process-chat .chat-widget__avatar img {
  filter: none;
}

.ai-process-chat__model {
  margin-inline-start: auto;
  border: 1px solid rgba(211, 147, 50, 0.4);
  border-radius: 999px;
  padding: 0.28rem 0.52rem;
  color: var(--time-amber);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ai-process-chat .chat-widget__log {
  min-block-size: 6.5rem;
  max-block-size: 12rem;
  padding: 1rem 1rem 0;
}

.ai-process-chat .chat-widget__row {
  max-inline-size: 94%;
}

.ai-process-chat .chat-widget__bubble {
  min-inline-size: 0;
  padding: 0.65rem 0.8rem;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-process-chat .chat-widget__bubble--answer {
  border-color: rgba(239, 228, 213, 0.12);
  background: rgba(247, 243, 236, 0.95);
}

.ai-process-chat__limit {
  margin: 0.75rem 1rem 0;
  color: rgba(239, 228, 213, 0.58);
  font-size: 0.66rem;
  line-height: 1.35;
}

.ai-process-chat[data-quota="exhausted"] .ai-process-chat__limit {
  color: #f1b15b;
  font-weight: 750;
}

.ai-process-chat__consent {
  margin: 0.7rem 1rem 0;
  border: 1px solid rgba(211, 147, 50, 0.28);
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: rgba(211, 147, 50, 0.08);
}

.ai-process-chat__consent[hidden] {
  display: none;
}

.ai-process-chat__consent p {
  margin: 0;
  color: rgba(247, 243, 236, 0.78);
  font-size: 0.7rem;
  line-height: 1.45;
}

.ai-process-chat__consent button {
  margin-block-start: 0.45rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--time-amber);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.ai-process-chat__form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
}

.ai-process-chat__input {
  min-inline-size: 0;
  inline-size: 100%;
  block-size: 2.8rem;
  border: 1px solid rgba(239, 228, 213, 0.2);
  border-radius: 0.8rem;
  padding-inline: 0.85rem;
  outline: 0;
  background: rgba(247, 243, 236, 0.07);
  color: var(--pure-white);
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease;
}

.ai-process-chat__input::placeholder {
  color: rgba(239, 228, 213, 0.58);
}

.ai-process-chat__input:focus {
  border-color: var(--time-amber);
  background: rgba(247, 243, 236, 0.1);
}

.ai-process-chat__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.8rem;
  block-size: 2.8rem;
  flex: none;
  border: 0;
  border-radius: 0.8rem;
  background: var(--time-amber);
  color: var(--near-black);
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.ai-process-chat__send svg {
  inline-size: 1.15rem;
  block-size: 1.15rem;
  fill: currentColor;
}

[dir="rtl"] .ai-process-chat__send svg {
  transform: scaleX(-1);
}

.ai-process-chat__send:hover,
.ai-process-chat__send:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.ai-process-chat__send:disabled,
.ai-process-chat__input:disabled {
  cursor: wait;
  opacity: 0.62;
}

.service-detail-body--interactive .service-detail-hero__window {
  background: rgba(211, 147, 50, 0.07);
}

.service-detail-body--interactive .service-detail-hero__signal--one,
.service-detail-body--interactive .service-detail-hero__signal--two {
  transform: rotate(-7deg);
  transform-origin: left;
}

@media (max-width: 900px) {
  .service-detail-hero__window {
    inset-inline-end: -20%;
    inline-size: 68vw;
    opacity: 0.52;
  }
}

@media (max-width: 700px) {
  .service-detail-hero__window {
    inset-inline-end: -64%;
    inset-block-start: 9%;
    inline-size: 120vw;
    opacity: 0.3;
  }

  .service-detail-body--ai .web-service-process h2 {
    max-inline-size: 10ch;
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .service-detail-body--ai .web-service-process__art {
    inset: 0;
    opacity: 0.34;
    border: 0;
  }
}

@media (max-width: 420px) {
  .ai-process-chat__model {
    display: none;
  }

  .ai-process-chat__title {
    font-size: 0.68rem;
  }
}

/* Scripted support conversation that plays itself under the agents section.
   Bubble styling is inherited from the shared .chat-widget rules. */
.agent-demo__widget {
  max-inline-size: 40rem;
  margin-inline: auto;
  border-radius: 1.1rem;
}

.agent-demo__log {
  gap: 0.55rem;
  max-block-size: none;
  padding: 1.5rem;
}

/* The shared bubbles size themselves against the row. These rows shrink to fit
   their own content, so a percentage cap there collapses them to a few
   characters wide -- the row carries the cap instead. */
.agent-demo__row {
  align-self: flex-end;
  max-inline-size: 80%;
}

.agent-demo__row.chat-widget__row--answer {
  align-self: flex-start;
}

.agent-demo__row .chat-widget__bubble {
  max-inline-size: 100%;
  font-weight: 500;
}

/* Hidden only once the player takes over, so the transcript stays readable
   without JavaScript. */
/* The deliberate misspelling, and the aside that explains why it still works. */
.agent-demo__typo {
  padding: 0 0.15em;
  border-block-end: 2px dashed rgba(159, 61, 50, 0.75);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-weight: 700;
}

/* The aside sits outside the chat window, beside it on wide screens. */
.agent-demo__layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

/* Hidden by the player until its message arrives; visible without JS. */
.agent-demo__aside[data-pending] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.4rem);
}

.agent-demo__aside {
  flex: 0 1 15rem;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  padding-inline-start: 0.9rem;
  border-inline-start: 2px solid var(--time-amber);
  color: var(--time-amber);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .agent-demo__layout {
    flex-direction: column;
  }

  .agent-demo__aside {
    flex: 0 0 auto;
    max-inline-size: 40rem;
  }
}

.agent-demo__row[data-pending] {
  display: none;
}

.agent-demo__row[data-entering] {
  animation: agent-demo-in 0.32s ease both;
}

@keyframes agent-demo-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-demo__row[data-entering] {
    animation: none;
  }
}

/* Demo management system: interactive, but entirely client-side and reset on
   reload. Meters use one hue for magnitude; the over-budget state adds a text
   flag so the condition is never carried by colour alone. */
.crm__app {
  max-inline-size: 62rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: 0 1.5rem 4rem var(--shadow-soft);
}

.crm__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-block-end: 1.5rem;
}

.crm__title {
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 500;
  line-height: 1.12;
}

.crm__badge {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--amber-soft);
  border-radius: 999px;
  color: var(--time-amber);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* KPI row */
.crm__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-block-end: 1.75rem;
}

.crm__stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: 0.85rem;
  background: var(--surface-alt);
}

.crm__stat-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.crm__stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.1vw, 1.65rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Tabs */
.crm__tabs {
  display: flex;
  gap: 0.4rem;
  margin-block-end: 1.25rem;
  border-block-end: 1px solid var(--line-soft);
}

.crm__tab {
  padding: 0.6rem 1rem;
  border: 0;
  border-block-end: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.crm__tab:hover {
  color: var(--ink);
}

.crm__tab[aria-selected="true"] {
  border-block-end-color: var(--time-amber);
  color: var(--ink-strong);
}

/* Customers table */
.crm__table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.crm__table th,
.crm__table td {
  padding: 0.72rem 0.6rem;
  border-block-end: 1px solid var(--line-soft);
  text-align: start;
}

.crm__table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.crm__table tbody tr:last-child td {
  border-block-end: 0;
}

.crm__number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.crm__empty {
  padding-block: 2.25rem;
  color: var(--muted);
  text-align: center;
}

/* Pipeline stage: ordered progression in one hue, always with its label */
.crm__stage {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.crm__stage:hover,
.crm__stage:focus-visible {
  border-color: var(--time-amber);
}

.crm__stage[data-stage="1"] { background: var(--amber-faint); }
.crm__stage[data-stage="2"] { background: var(--amber-soft); }

.crm__stage[data-stage="3"] {
  border-color: var(--time-amber);
  background: var(--time-amber);
  color: var(--near-black);
  font-weight: 650;
}

.crm__remove {
  inline-size: 1.7rem;
  block-size: 1.7rem;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.crm__remove:hover,
.crm__remove:focus-visible {
  border-color: var(--line);
  color: var(--ink-strong);
}

.crm__hint {
  margin-block-start: 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Budget meters */
.crm__budget {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.crm__budget-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-block-end: 0.45rem;
}

.crm__budget-name {
  font-weight: 650;
  font-size: 0.95rem;
}

.crm__budget-figures {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.crm__meter {
  block-size: 8px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.crm__meter-fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
  background: var(--time-amber);
  transition: inline-size 0.35s var(--ease-out);
}

.crm__meter-fill[data-state="over"] {
  background: var(--error);
}

.crm__budget-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-start: 0.4rem;
}

.crm__budget-pct {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.crm__flag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--error);
  color: var(--pure-white);
  font-size: 0.7rem;
  font-weight: 650;
}

/* Tasks */
.crm__tasks {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.crm__tasks-summary {
  margin-block-end: 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.crm__task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.25rem;
  border-block-end: 1px solid var(--line-soft);
}

.crm__task:last-child {
  border-block-end: 0;
}

.crm__task-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.94rem;
  cursor: pointer;
}

.crm__task-label input {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  accent-color: var(--time-amber);
  cursor: pointer;
}

.crm__task[data-done="true"] .crm__task-label span {
  color: var(--muted);
  text-decoration: line-through;
}

/* Shared forms */
.crm__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-block-start: 1.35rem;
  padding-block-start: 1.35rem;
  border-block-start: 1px solid var(--line-soft);
}

.crm__form input,
.crm__form select {
  flex: 1 1 9rem;
  min-inline-size: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--field);
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
}

.crm__form input:focus-visible,
.crm__form select:focus-visible {
  border-color: var(--time-amber);
  outline: none;
}

.crm__form button {
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--time-amber);
  border-radius: 0.6rem;
  background: var(--time-amber);
  color: var(--near-black);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.crm__note {
  margin-block-start: 1.35rem;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 760px) {
  .crm__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .crm__table th:nth-child(2),
  .crm__table td:nth-child(2) {
    display: none;
  }

  .crm__form input,
  .crm__form select,
  .crm__form button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crm__meter-fill {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agent-demo__aside {
    transition: none;
  }
}
