.user-workflow-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workflow-examples-open {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.workflow-examples-open[hidden] { display: none; }
.workflow-examples-open:hover { border-color: #138269; background: rgba(19, 130, 105, .09); transform: translateY(-1px); }
.workflow-examples-open:focus-visible { outline: 3px solid rgba(55, 101, 255, .22); outline-offset: 2px; }
.workflow-examples-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.workflow-examples-dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  color: var(--text);
  background: transparent;
}

.workflow-examples-dialog[open] { display: grid; place-items: center; }
.workflow-examples-dialog::backdrop { background: rgba(4, 7, 12, .76); backdrop-filter: blur(8px); }

.workflow-examples-shell {
  position: relative;
  display: grid;
  width: min(1300px, 100%);
  max-height: calc(100dvh - 32px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}
.workflow-examples-shell.is-viewing-example { height: min(820px, calc(100dvh - 32px)); }

.workflow-examples-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.workflow-examples-header small { color: #138269; font-size: 8px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.workflow-examples-header h2 { margin: 3px 0 0; font-size: 22px; letter-spacing: -.025em; }
.workflow-examples-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.workflow-examples-close,
.workflow-example-viewer header button,
.workflow-example-viewer-stage button {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.workflow-examples-status { display: grid; min-height: 360px; place-items: center; padding: 32px; color: var(--muted); font-size: 11px; text-align: center; }
.workflow-examples-status[hidden] { display: none; }

.workflow-examples-carousel {
  display: grid;
  min-height: 0;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}
.workflow-examples-carousel[hidden] { display: none; }

.workflow-examples-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 16px;
}
.workflow-examples-arrow:disabled,
.workflow-example-viewer-stage button:disabled { cursor: default; opacity: .32; }

.workflow-examples-track {
  display: flex;
  min-width: 0;
  gap: 14px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--color-border-strong, #8b8f99) var(--color-canvas-subtle, var(--surface-2));
  scrollbar-width: thin;
  touch-action: pan-x;
}

.workflow-examples-track::-webkit-scrollbar { height: 9px; }
.workflow-examples-track::-webkit-scrollbar-track { border-radius: 999px; background: var(--color-canvas-subtle, var(--surface-2)); }
.workflow-examples-track::-webkit-scrollbar-thumb { border: 2px solid var(--color-canvas-subtle, var(--surface-2)); border-radius: 999px; background: var(--color-border-strong, #8b8f99); }
.workflow-examples-track::-webkit-scrollbar-button,
.workflow-examples-track::-webkit-scrollbar-button:single-button,
.workflow-examples-track::-webkit-scrollbar-button:horizontal:start:decrement,
.workflow-examples-track::-webkit-scrollbar-button:horizontal:end:increment {
  width: 0;
  min-width: 0;
  height: 0;
  min-height: 0;
  display: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.workflow-example-card {
  position: relative;
  flex: 0 0 clamp(214px, 21vw, 264px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: #07090c;
  cursor: zoom-in;
  scroll-snap-align: start;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

.workflow-example-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .22s ease; }
.workflow-example-card:hover img { transform: scale(1.018); }
.workflow-example-card:focus-visible { outline: 3px solid #3765ff; outline-offset: 2px; }

.workflow-examples-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}
.workflow-examples-footer[hidden] { display: none; }
.workflow-examples-footer strong { color: var(--text); font-size: 10px; }

.workflow-example-viewer {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--surface);
}
.workflow-example-viewer[hidden] { display: none; }
.workflow-example-viewer > header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.workflow-example-viewer > header button:first-child { justify-self: start; }
.workflow-example-viewer > header button:last-child { justify-self: end; }
.workflow-example-viewer > header strong { font-size: 10px; }
.workflow-example-viewer-stage { display: grid; min-height: 0; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 16px; padding: 18px; overflow: hidden; background: #07090c; }
.workflow-example-viewer-stage img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; justify-self: center; object-fit: contain; object-position: center; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .42); }
.workflow-example-viewer-stage button { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border-radius: 50%; font-size: 16px; }

html[data-theme="light"] .workflow-examples-shell,
html[data-theme="light"] .workflow-example-viewer { background: #fff; }
html[data-theme="light"] .workflow-examples-open,
html[data-theme="light"] .workflow-examples-close,
html[data-theme="light"] .workflow-examples-arrow,
html[data-theme="light"] .workflow-example-viewer header button { background: #f7f9fc; }
html[data-theme="light"] .workflow-examples-track { scrollbar-color: #315b71 #e5eaf0; }
html[data-theme="light"] .workflow-examples-track::-webkit-scrollbar-track { background: #e5eaf0; }
html[data-theme="light"] .workflow-examples-track::-webkit-scrollbar-thumb { border-color: #e5eaf0; }

@media (min-width: 681px) {
  .workflow-examples-shell:not(.is-viewing-example) {
    height: min(600px, calc(100dvh - 32px));
  }
}

@media (max-width: 680px) {
  .user-workflow-summary { align-items: stretch; flex-direction: column; gap: 12px; }
  .workflow-examples-open { width: 100%; }
  .workflow-examples-dialog { padding: 8px; }
  .workflow-examples-shell { max-height: calc(100dvh - 16px); border-radius: 16px; }
  .workflow-examples-shell.is-viewing-example { height: calc(100dvh - 16px); }
  .workflow-examples-header { padding: 17px 16px 14px; }
  .workflow-examples-header h2 { font-size: 18px; }
  .workflow-examples-header p { max-width: 220px; line-height: 1.45; }
  .workflow-examples-close { padding-inline: 10px; }
  .workflow-examples-carousel { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 7px; padding: 14px 9px; }
  .workflow-examples-arrow { width: 32px; height: 32px; font-size: 13px; }
  .workflow-examples-track { gap: 10px; padding-bottom: 8px; }
  .workflow-examples-track::-webkit-scrollbar { height: 9px; }
  .workflow-examples-track::-webkit-scrollbar-track { margin: 0; }
  .workflow-examples-track::-webkit-scrollbar-thumb { border-width: 2px; }
  .workflow-example-card { flex-basis: min(64vw, 260px); }
  .workflow-examples-footer { padding: 12px 15px 14px; }
  .workflow-example-viewer > header { padding: 11px 12px; }
  .workflow-example-viewer > header strong { font-size: 9px; }
  .workflow-example-viewer-stage { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 7px; padding: 10px 7px; }
  .workflow-example-viewer-stage button { width: 34px; height: 34px; }
  .workflow-example-viewer-stage img { border-radius: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .workflow-examples-track { scroll-behavior: auto; }
  .workflow-example-card img,
  .workflow-examples-open { transition: none; }
}
