/**
 * Turnkey Solution wizard (markup in turnkey-tab.twig, behaviour in
 * turnkey-solution-finder.js). The colours only this component uses live in
 * the --tks-* palette below; white and bone come from the parent's --color-*
 * tokens and values shared with the other features from oc-tokens.css.
 */
.tks-ts {
  /* Neutrals */
  --tks-text: #44474d;
  --tks-muted: #6d7380;
  --tks-empty-text: #6a7f97;

  /* Borders */
  --tks-border: #e0e0e0;
  --tks-panel-border: #e5e5e5;
  --tks-pill-border: var(--color-bone);
  --tks-thumb-bg: #f4f4f4;

  /* Pathbar label */
  --tks-pathbar-label: #656d77;

  /* Chips (breadcrumb path) */
  --tks-chip-bg: #eff5fb;
  --tks-chip-focus: #4a5a6f;
  --tks-chip-current-bg: #e8f2fc;
  --tks-chip-empty-bg: var(--oc-surface-alt);
  --tks-chip-empty-text: #7f8a96;

  /* Result boxes */
  --tks-result-border: #bdd5f6;
  --tks-result-bg: #f1f7ff;
  --tks-result-text: #0f3e74;
  --tks-terminal-border: #f0c36d;
  --tks-terminal-bg: #fef9ed;
  --tks-terminal-text: #6b5200;

  /* Path trail */
  --tks-path-text: #3a526e;

  overflow: hidden;
}

.tks-ts__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tks-ts__description {
  p {
    max-width: 92ch;
    font-size: 1rem;
    line-height: 1.2;
  }
}

.tks-ts__viewport {
  overflow: hidden;
}

.tks-ts__final-render {
  display: none;
  margin-top: 1rem;
}

.tks-ts__final-render.is-visible {
  display: block;
}

.tks-ts__final-render-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--tks-panel-border);
  background: var(--color-white);
}

.tks-ts__final-machines {
  display: none;
  margin-top: 1rem;
}

.tks-ts__final-machines.is-visible {
  display: block;
}

.tks-ts__machines-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tks-ts__machine-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  min-height: 210px;
  border: 3px solid var(--color-blue-baby);
  text-decoration: none;
  background: var(--color-white);
  padding: 1rem 1rem 0.9rem;
  gap: 0.75rem;
}
.tks-ts__machine-card:hover {
  border-color: var(--color-blue);
  transition: border-color 0.15s ease;
}

.tks-ts__machine-card-image {
  width: 100%;
  max-height: 150px;
  height: auto;
  object-fit: contain;
}

.tks-ts__pathbar {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--tks-border);
  border-radius: 10px;
  background: var(--color-white);
}

.tks-ts__pathbar-label {
  font-size: 0.82rem;
  color: var(--tks-pathbar-label);
  margin-top: 0.28rem;
  white-space: nowrap;
}

.tks-ts__pathbar-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tks-ts__progressbar {
  display: flex;
  gap: 0;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  overflow: hidden;
}

.tks-ts__progress-segment {
  flex: 1;
  height: 5px;
  background: color-mix(in srgb, var(--color-blue-baby) 15%, transparent);
  transition: background 0.3s ease;
}

.tks-ts__progress-segment.is-filled {
  background: var(--color-blue-baby);
}

.tks-ts__pathchip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-blue);
  background: var(--tks-chip-bg);
  color: var(--color-blue-dark);
  padding: 0.1rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tks-ts__pathchip:hover {
  background: var(--tks-chip-current-bg);
  border-color: var(--color-blue);
  color: var(--color-blue-dark);
}

.tks-ts__pathchip:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--tks-chip-focus);
}

.tks-ts__pathchip:focus:not(:focus-visible) {
  box-shadow: none;
}

.tks-ts__pathchip:focus-visible {
  box-shadow: 0 0 0 2px var(--color-white), 0 0 0 4px var(--tks-chip-focus);
}

.tks-ts__pathchip--current {
  border-color: var(--color-blue-dark);
  background: var(--tks-chip-current-bg);
  font-weight: var(--font-weight-semibold);
}

.tks-ts__pathchip--empty {
  border-style: dashed;
  background: var(--tks-chip-empty-bg);
  color: var(--tks-chip-empty-text);
  cursor: default;
  pointer-events: none;
}

@keyframes tks-panel-enter {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0);    }
}

@keyframes tks-panel-enter-back {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0);     }
}

.tks-ts__track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tks-ts__track--3col {
  grid-template-columns: 1fr 1fr 1fr;
}

.tks-ts__panel--third {
  display: none;
}

.tks-ts__track--3col .tks-ts__panel--third {
  display: block;
}

.tks-ts__pills--far-preview .tks-ts__pill {
  opacity: 0.25;
}

/* Forward navigation: slide in from the right */
.tks-ts__panel--left > * {
  animation: tks-panel-enter 380ms ease both;
}

.tks-ts__panel--right > * {
  animation: tks-panel-enter 380ms ease both;
  animation-delay: 60ms;
}

.tks-ts__panel--third > * {
  animation: tks-panel-enter 380ms ease both;
  animation-delay: 120ms;
}

/* Backward navigation: slide in from the left */
.tks-ts__track.is-going-back .tks-ts__panel--left > * {
  animation-name: tks-panel-enter-back;
}

.tks-ts__track.is-going-back .tks-ts__panel--right > * {
  animation-name: tks-panel-enter-back;
}

.tks-ts__track.is-going-back .tks-ts__panel--third > * {
  animation-name: tks-panel-enter-back;
}

.tks-ts__panel {
  background: var(--color-white);
  border: 1px solid var(--tks-panel-border);
  border-radius: 12px;
  padding: 0.9rem;
  min-height: 380px;
}

/* Created by turnkey-solution-finder.js but hidden; drop the display line to
   show the panel headings. */
.tks-ts__panel-title {
  margin: 0 0 0.85rem;
  color: var(--tks-text);
  font-size: 1rem;
  display: none;
}

.tks-ts__panel-subtitle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: -0.5rem 0 0.85rem;
  font-size: 0.875rem;
  color: var(--tks-muted);
  line-height: 1.4;
}

.tks-ts__pills {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tks-ts__pill {
  border: 3px solid var(--tks-pill-border);
  background: var(--color-white);
  border-radius: 20px;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 90px;
  width: 100%;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.tks-ts__pill:hover {
  border-color: var(--color-blue);
}

.tks-ts__pill.is-selected {
  border-color: var(--color-blue);
  background: var(--tks-chip-current-bg);
}

.tks-ts__pill--preview {
  cursor: not-allowed;
  opacity: 0.4;
}

.tks-ts__thumb {
  border-radius: 20px;
  width: 140px;
  min-width: 140px;
  height: 90px;
  background: var(--tks-thumb-bg);
  overflow: hidden;
  position: relative;
  order: 2;
}

.tks-ts__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tks-ts__thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tks-muted);
  font-weight: var(--font-weight-bold);
}

.tks-ts__thumb-fallback.is-hidden {
  display: none;
}

.tks-ts__pill-label {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--tks-text);
  padding-left: 2.1rem;
  padding-right: 1rem;
  flex: 1;
  order: 1;
}

.tks-ts__result {
  border: 1px solid var(--tks-result-border);
  background: var(--tks-result-bg);
  color: var(--tks-result-text);
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 0.9rem;
}

.tks-ts__result--terminal {
  border-color: var(--tks-terminal-border);
  background: var(--tks-terminal-bg);
  color: var(--tks-terminal-text);
}

.tks-ts__terminal-description {
  margin: 0;
  line-height: 1.45;
  padding-bottom: 20px;
}

.tks-ts__terminal-title {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}

.tks-ts__path {
  margin: 0;
  padding-left: 1rem;
  color: var(--tks-path-text);
  font-size: 0.9rem;
}

.tks-ts__empty {
  margin: 0;
  color: var(--tks-empty-text);
}

@media (max-width: 920px) {
  .tks-ts__track {
    grid-template-columns: 1fr;
    transform: none !important;
  }

  .tks-ts__panel {
    min-height: auto;
  }

  .tks-ts__thumb {
    width: 128px;
    min-width: 128px;
  }

  .tks-ts__pill-label {
    font-size: 1.3rem;
    padding-left: 1rem;
  }

  .tks-ts__pathbar {
    flex-direction: column;
    gap: 0.35rem;
  }

  .tks-ts__machines-grid {
    grid-template-columns: 1fr;
  }
}
