.it-helpdesk-story {
  --hd-bg: #071416;
  --hd-panel: #0d2325;
  --hd-panel-strong: #123034;
  --hd-line: rgba(128, 221, 199, .2);
  --hd-text: #effbf7;
  --hd-muted: #a8c7c1;
  --hd-accent: #65e3b7;
  padding: clamp(72px, 9vw, 132px) clamp(20px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="light"] .it-helpdesk-story {
  --hd-bg: #eef7f5;
  --hd-panel: #ffffff;
  --hd-panel-strong: #e5f2ef;
  --hd-line: rgba(10, 85, 72, .18);
  --hd-text: #102e2a;
  --hd-muted: #496c65;
  --hd-accent: #087a62;
}

.it-helpdesk-story__intro {
  width: min(100%, 980px);
  margin: 0 auto clamp(34px, 5vw, 64px);
}

.it-helpdesk-story__intro h2 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.it-helpdesk-story__intro > p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.helpdesk-workbench {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.helpdesk-monitor {
  position: relative;
  padding: clamp(10px, 1.5vw, 20px);
  border: 1px solid #33484b;
  border-radius: clamp(18px, 2.2vw, 32px);
  background: linear-gradient(145deg, #101718, #020606);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .28), inset 0 0 0 2px rgba(255, 255, 255, .035);
}

.helpdesk-screen {
  min-height: clamp(560px, 62vw, 720px);
  overflow: hidden;
  border-radius: clamp(10px, 1.3vw, 18px);
  background: var(--hd-bg);
  color: var(--hd-text);
}

.helpdesk-screen__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 12px clamp(16px, 2vw, 28px);
  border-bottom: 1px solid var(--hd-line);
  background: color-mix(in srgb, var(--hd-panel), var(--hd-bg) 24%);
}

.helpdesk-screen__bar > strong {
  font-size: clamp(.8rem, 1.1vw, 1rem);
  letter-spacing: .04em;
}

.helpdesk-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hd-muted);
  font-size: .78rem;
  white-space: nowrap;
}

.helpdesk-session i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hd-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hd-accent) 18%, transparent);
  animation: helpdesk-heartbeat 2.8s ease-in-out infinite;
}

.helpdesk-screen__body {
  display: grid;
  grid-template-columns: minmax(190px, 24%) minmax(0, 1fr);
  min-height: 500px;
}

.helpdesk-context {
  padding: clamp(22px, 3vw, 38px);
  border-right: 1px solid var(--hd-line);
  background: color-mix(in srgb, var(--hd-panel), var(--hd-bg) 26%);
}

.helpdesk-context__label,
.helpdesk-ticket__heading span,
.helpdesk-diagnostic span {
  color: var(--hd-muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.helpdesk-context > strong {
  display: block;
  margin: 10px 0 clamp(26px, 4vw, 48px);
  color: var(--hd-accent);
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.helpdesk-context dl,
.helpdesk-context dl > div {
  display: grid;
  gap: 6px;
}

.helpdesk-context dl {
  gap: 22px;
  margin: 0;
}

.helpdesk-context dt {
  color: var(--hd-muted);
  font-size: .72rem;
}

.helpdesk-context dd {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.35;
}

.helpdesk-ticket {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(22px, 3vw, 42px);
}

.helpdesk-ticket__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}

.helpdesk-ticket__heading h3 {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--hd-text);
  font-size: clamp(1.55rem, 3vw, 3.2rem);
  line-height: 1.03;
  letter-spacing: -.035em;
}

.helpdesk-ticket__heading > b {
  flex: none;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--hd-accent) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--hd-accent) 12%, transparent);
  color: var(--hd-accent);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.helpdesk-diagnostic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(24px, 4vw, 42px);
  border-block: 1px solid var(--hd-line);
}

.helpdesk-diagnostic > div {
  min-width: 0;
  padding: 18px 16px;
}

.helpdesk-diagnostic > div + div {
  border-left: 1px solid var(--hd-line);
}

.helpdesk-diagnostic strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(.83rem, 1.1vw, 1rem);
  line-height: 1.35;
}

.helpdesk-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(28px, 4vw, 46px) 0;
  padding: 0;
  list-style: none;
}

.helpdesk-timeline li {
  position: relative;
  display: flex;
  gap: 12px;
  min-width: 0;
  color: var(--hd-muted);
}

.helpdesk-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 16px;
  width: calc(100% - 16px);
  height: 2px;
  background: var(--hd-line);
}

.helpdesk-timeline i {
  position: relative;
  z-index: 1;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--hd-bg);
  border-radius: 50%;
  background: color-mix(in srgb, var(--hd-muted) 45%, var(--hd-bg));
  box-shadow: 0 0 0 1px var(--hd-line);
}

.helpdesk-timeline strong,
.helpdesk-timeline small {
  display: block;
}

.helpdesk-timeline strong {
  color: inherit;
  font-size: .83rem;
}

.helpdesk-timeline small {
  margin-top: 5px;
  font-size: .7rem;
  line-height: 1.35;
}

[data-helpdesk-state="new"] [data-helpdesk-node="new"],
[data-helpdesk-state="checking"] [data-helpdesk-node="new"],
[data-helpdesk-state="checking"] [data-helpdesk-node="checking"],
[data-helpdesk-state="resolved"] .helpdesk-timeline li {
  color: var(--hd-text);
}

[data-helpdesk-state="new"] [data-helpdesk-node="new"] i,
[data-helpdesk-state="checking"] [data-helpdesk-node="new"] i,
[data-helpdesk-state="checking"] [data-helpdesk-node="checking"] i,
[data-helpdesk-state="resolved"] .helpdesk-timeline i {
  background: var(--hd-accent);
  box-shadow: 0 0 0 1px var(--hd-accent), 0 0 14px color-mix(in srgb, var(--hd-accent) 34%, transparent);
}

[data-helpdesk-state="checking"] [data-helpdesk-node="new"]::after,
[data-helpdesk-state="resolved"] .helpdesk-timeline li:not(:last-child)::after {
  background: var(--hd-accent);
}

.helpdesk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.helpdesk-actions button {
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid color-mix(in srgb, var(--hd-accent) 40%, var(--hd-line));
  border-radius: 10px;
  background: transparent;
  color: var(--hd-text);
  font: 750 .82rem/1.2 system-ui, sans-serif;
  cursor: pointer;
}

.helpdesk-actions button:hover,
.helpdesk-actions button:focus-visible {
  border-color: var(--hd-accent);
  outline: 2px solid color-mix(in srgb, var(--hd-accent) 52%, transparent);
  outline-offset: 2px;
}

.helpdesk-actions button[aria-pressed="true"] {
  background: var(--hd-accent);
  color: #06231b;
}

.helpdesk-live {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: var(--hd-muted);
  font-size: .78rem;
  line-height: 1.5;
}

.helpdesk-monitor__stand {
  display: block;
  width: min(28%, 280px);
  height: 22px;
  margin: 0 auto;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(#1b2728, #080c0d);
}

.helpdesk-workbench figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
  text-align: center;
}

@keyframes helpdesk-heartbeat {
  50% { opacity: .45; box-shadow: 0 0 0 2px color-mix(in srgb, var(--hd-accent) 12%, transparent); }
}

@media (max-width: 760px) {
  .it-helpdesk-story { padding-inline: 16px; }
  .it-helpdesk-story__intro { padding-inline: 6px; }
  .it-helpdesk-story__intro h2 { font-size: clamp(2.25rem, 11vw, 3.35rem); }
  .helpdesk-monitor { padding: 7px; border-radius: 16px; }
  .helpdesk-screen { min-height: 0; border-radius: 10px; }
  .helpdesk-screen__bar { min-height: 50px; padding: 10px 12px; }
  .helpdesk-screen__bar > strong { max-width: 180px; font-size: .72rem; }
  .helpdesk-session { font-size: .66rem; }
  .helpdesk-screen__body { grid-template-columns: 1fr; min-height: 0; }
  .helpdesk-context { padding: 16px; border-right: 0; border-bottom: 1px solid var(--hd-line); }
  .helpdesk-context > strong { display: inline-block; margin: 7px 0 14px; font-size: 1.55rem; }
  .helpdesk-context dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .helpdesk-context dl > div { min-width: 0; }
  .helpdesk-context dt { font-size: .62rem; }
  .helpdesk-context dd { font-size: .7rem; overflow-wrap: anywhere; }
  .helpdesk-ticket { padding: 18px 14px 16px; }
  .helpdesk-ticket__heading { display: grid; gap: 13px; }
  .helpdesk-ticket__heading h3 { font-size: 1.65rem; }
  .helpdesk-ticket__heading > b { justify-self: start; }
  .helpdesk-diagnostic { grid-template-columns: 1fr; }
  .helpdesk-diagnostic > div { padding: 12px 8px; }
  .helpdesk-diagnostic > div + div { border-left: 0; border-top: 1px solid var(--hd-line); }
  .helpdesk-timeline { grid-template-columns: 1fr; gap: 18px; margin: 24px 0; }
  .helpdesk-timeline li:not(:last-child)::after { top: 16px; left: 7px; width: 2px; height: calc(100% + 18px); }
  .helpdesk-actions { display: grid; }
  .helpdesk-actions button { width: 100%; text-align: left; }
  .helpdesk-monitor__stand { height: 14px; }
}

.motion-paused .helpdesk-session i { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .helpdesk-session i { animation: none; }
}
