/* Most variables are defined in mt-kt-frontend */
html {
  --kst-tour-primary: var(--kt-tertiary, #a54f43ff);
  --kst-tour-highlight: linear-gradient(to right, color-mix(in lab, var(kst-tour-primary) 45%, white), color-mix(in lab, var(kst-tour-primary) 20%, white));

  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* General resets */
[hidden] {
  display: none !important;
}

.kst-force-show [hidden] {
  display: block !important;
}

.kst-keep-together {
  white-space: nowrap;
}

.kst-smaller-text {
  font-size: smaller;
}

#kst-features-wrapper .wp-block-button__link {
  text-transform: initial;
}

/* Loading indicators */
.kst-loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--kt-on-secondary);
  z-index: 10;
}

.kst-loading-indicator-page {
  margin: 100px;
  border-radius: 20px;
  color: var(--kt-outline-dark);
}

/* CSS-only loading spinner */
.kst-loading-indicator::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--kt-outline-dark);
  border-top: 2px solid var(--kt-on-secondary);
  border-radius: 50%;
  display: inline-block;
  animation: kst-spin 1s linear infinite;
  margin-right: 0.5em;
}

/* Button spinner variant */
.kst-button-spinner {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: transparent;
  vertical-align: text-bottom;
}

.kst-button-spinner::before {
  width: 16px;
  height: 16px;
  margin-right: 0;
  vertical-align: super;
}

@keyframes kst-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.site-main label {
  margin: 0;
}

article.hentry {
  overflow: unset;
}

.wp-block-button__link {
  font-family: var(--theme-button-font-family, var(--theme-font-family, 'Josefin Sans'));

  &[disabled] {
    background-color: silver;

    &:hover {
      color: unset;
    }
  }
}

.kst-print-button {
  font-size: var(--kt-small);
  color: var(--kt-primary);
  background-color: transparent;
  cursor: pointer;
}

.kst-button-wrap {
  line-height: 1;
}

.kst-all-sizes,
.kst-container {
  margin: 0.5em 0;
  line-height: 1.6;
}

.kst-all-sizes {
  .size-selector-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.kst-main-title {
  display: flex;
  gap: 10px;
  margin-block-end: 0;

  .kst-table-count {
    font-family: "Josefin Sans";
  }

  small {
    display: block;
    text-transform: initial;
    font-size: 60%;
    line-height: 0.5;
    font-family: "Josefin Sans";
    padding-left: 2px;
  }
}

#kst-pattern-title {
  display: none;
}

.kst-size {
  font-size: 1.4em;
  margin: 1em 0;
}

.kst-size-selector {
  display: flex;
  align-items: center;
  gap: 1em;
  margin: 0;
}

.kst-unit-selector {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 19px;

  label {
    font-weight: 500;
  }
}

/* interactive */
.kst-table-select,
.kst-size-select {
  padding: 0.5em;
  border: 1px solid var(--kt-outline);
  border-radius: var(--kt-radius-small);
  background-color: #fff;
  min-width: 150px;
  font-size: 1em;
}

.kst-size-section {
  display: none;
}

.kst-size-section.active {
  display: block;
}

.kst-section {
  margin: 1.5em 0;

  &:first-child {
    margin-top: 0;
  }

  .grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr 1fr;
  }

  .flex {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;

    button {
      height: fit-content;
    }
  }
}

.kst-error-messages {
  background: #ffebee;
  border: 1px solid #f44336;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 4px;

  p {
    margin: 0;
  }

  p+p {
    margin-bottom: 0.5rem;
  }
}

.kst-warning-messages {
  /* background-color: color-mix(in lab, var(--kt-tertiary) 20%, white); */
  background-color: var(--kt-alternate-2);
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 4px;
  color: white;

  p {
    margin: 0;
  }

  p+p {
    margin-bottom: 0.5rem;
  }
}

.kst-size-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 87px;
  margin-top: -10px;
  font-size: 0.9em;
}

.kst-form-wrapper {
  .kst-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    grid-auto-flow: row;
    grid-template-areas:
      "label field"
      "info info";
    align-items: center;
    margin-bottom: 20px;
    text-align: left;

    select,
    input:not([type=color]) {
      padding: 5px;
    }

    &.short {
      margin-bottom: 0;
    }

    &.wide {
      grid-template-columns: 2fr 1fr;
    }
  }

  .kst-actions-row {
    margin-top: 10px;
    text-align: center;
  }

  .description {
    grid-area: info;
    font-size: smaller;
    margin-bottom: 0;
  }

  label:not(.label > label),
  .label {
    grid-area: label;
    font-weight: bold;
    font-size: 15px;
    line-height: 1.2;
  }

  .aligned {
    justify-self: flex-end;
  }

  .stacked {
    label {
      font-weight: bold;
      margin: 0;
    }

    &>span {
      display: block;
      font-weight: normal;
    }

    .description {
      padding-left: 16px;
    }
  }

  label+select,
  .label+select,
  label+input,
  .label+input,
  label+.info,
  .meta-field,
  .kst-radio-group {
    grid-area: field;

    input+input {
      margin-left: 20px;
    }
  }

  label+.info.flex,
  .label+.info.flex {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 125px;

    input[type="number"] {
      max-width: 100px;
    }

    select {
      width: 150px;
    }
  }

  .meta-field {
    display: block;
    margin: 0 0 0 16px;
  }

  [data-step-action="prev"] {
    display: block;
    margin-top: 50px;
    margin-bottom: -50px;
    background-color: transparent;
    text-decoration: underline;
    cursor: pointer;
    font-size: 1em;
    color: var(--kt-primary);

    &::before {
      content: "<";
      position: absolute;
      margin-left: -12px;
    }

    &:hover {
      color: var(--kt-secondary);
    }
  }
}

.kst-adjustment-step {
  text-align: left;
  margin-top: 10px;
}

.kst-overriden-option {
  font-weight: bold;
  font-size: larger;
  color: var(--kt-secondary);
}

.kst-overlay-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: flex-start;
  justify-items: center;

  img {
    width: 100%;
  }
}

.kst-section-content {
  margin-block: 10px;
}

.kst-note-image-content {
  button {
    float: right;
    width: clamp(200px, 20vw, 100%);
    height: auto;
    margin-left: 10px;
    margin-bottom: 10px;
    padding: 0 0 10px 10px;

    &:hover {
      background: none;
      border: none;
      cursor: pointer;
    }

    svg {
      width: 100%;
      height: auto;
    }
  }
}

.kst-wrapper {
  .kst-data-table {
    td:has(:not(.kst-row-checkbox:disabled)):hover {
      background-color: var(--kt-shade-lightest);
    }

    tr:has(.kst-row-checkbox:enabled):not(:has(.kst-row-checkbox:checked)) td {
      background-color: color-mix(in lab, var(--kt-secondary) 20%, white);

      &.kst-stitch {
        font-weight: bold;
      }

      &.kst-cell-empty {
        background: linear-gradient(to top left,
            color-mix(in lab, var(--kt-secondary) 20%, white) calc(50% - 1px),
            var(--kt-outline),
            color-mix(in lab, var(--kt-secondary) 20%, white) calc(50% + 1px));
      }
    }

    tr:has(.kst-row-checkbox:checked) {
      td {
        background: linear-gradient(0deg,
            #fff calc(50% - 1px),
            var(--kt-outline-dark),
            #fff calc(50% + 1px));
        text-decoration: line-through;
        text-decoration-color: var(--kt-outline-dark);

        &:last-child,
        &:nth-last-child(2) {
          background: unset;
        }
      }
    }
  }
}

.kst-section-title {
  margin: 0 !important;
  padding: 0;
  font-weight: 400;

  .kst-size-section & {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  small {
    font-size: 60%;
  }

  label {
    font-size: unset;
  }

  select {
    padding: var(--has-classic-forms, var(--theme-form-field-padding, 5px 15px));
  }
}

.kst-adjustment-info {
  background-color: var(--kt-shade-lightest);
  border: 1px solid var(--kt-outline);
  border-radius: var(--kt-radius-small);
  padding: 10px 15px;
  margin: 10px 0;
  font-size: var(--kt-small);

  p {
    margin: 5px 0;

    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }
}

.kst-adjustment-hint {
  font-size: smaller;
  text-align: right;
}

.kst-bu .kst-table-count {
  font-weight: 400;
}

.kst-icon-speech-bubble {
  color: var(--kt-outline, #d9d9d9);

  &.kst-has-content {
    color: var(--kt-alternate-light, #9db6de);
  }
}

.kst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--kt-medium);
  background-color: #fff;
  margin: 0;
  border: 1px solid var(--kt-outline-dark);

  a {
    text-decoration: underline;
  }

  th,
  td {
    padding: 5px;
    text-align: center;
    border-bottom: 1px solid var(--kt-outline);
    font-size: var(--kt-small);
  }

  th:has(.kst-instruction-trigger) {
    padding-bottom: 0;
  }

  th {
    position: sticky;
    top: 80px;
    background: white;
    z-index: 1;
    background-color: var(--kt-shade-lighter);
    font-weight: 400;
    text-transform: uppercase;
    border-bottom-color: var(--kt-outline-dark);
  }

  tr:last-child td {
    border-bottom: none;
  }

  tr:has(+ .kst-messages-row) {
    td {
      border-bottom: 1px solid var(--kt-outline-dark);
    }
  }

  tr.kst-messages-row {

    td,
    th {
      border-bottom: 1px solid var(--kt-outline-dark);
    }

    td:first-child {
      border-right: 1px solid var(--kt-outline-dark);
    }
  }

  tr[data-msg-type="cast_on"] .kst-header-cell {
    padding-block: 2px;
  }

  td+th {
    line-height: 1;
    border-bottom-color: var(--kt-outline);
    border-left: 1px solid var(--kt-outline-dark);
  }

  td {
    line-height: 1;

    &.kst-count {
      background-color: var(--kt-shade-lightest);
      border-left: 1px solid var(--kt-outline-dark);
      border-right: 1px solid var(--kt-outline);
    }

    &.kst-stitch {
      border-right: 1px solid var(--kt-outline-dark);
    }

    &.kst-row {
      background-color: var(--kt-shade-lightest);
      border-right: 1px solid var(--kt-outline-dark);
      text-align: right;
    }

    &.kst-row:has(.kst-row-info-icon) {
      padding-right: 5px;
    }

    &.kst-start-stitch {
      background-color: var(--kt-shade-lightest);
    }

    &.kst-cast-on-message {
      background-color: var(--kt-shade-lightest);
    }

    /* &.kst-start-stitches {
      border-inline: 1px solid var(--kt-outline);
    } */

    &.kst-row-message {
      font-size: var(--kt-small);
      line-height: 1;
      background-color: var(--kt-shade-lighter);
      /* border-inline: 1px solid var(--kt-outline); */
      text-align: center;

      &.kst-count {
        border-inline: 1px solid var(--kt-outline);
      }

      /* &.kst-row-message-change_to_rounds {
        border-bottom-width: 0;
      } */
      &.kst-row-message-stitch-patterns {
        background-color: color-mix(in lab, var(--kt-tertiary) 20%, white);
      }
    }

    &.kst-row-banner {
      background-color: var(--kt-shade-lightest);
    }

    &.kst-cell-empty {
      background: linear-gradient(to top left,
          #fff calc(50% - 1px),
          var(--kt-outline),
          #fff calc(50% + 1px));
    }
  }
}

.kst-instruction-trigger+.kst-instruction-trigger {
  margin-left: 5px;
}

.kst-row-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.kst-row-info-text {
  flex-grow: 1;
}

.kst-row-info-color-button {
  padding: 0;
  background-color: transparent;
  min-width: 18px;
  vertical-align: text-bottom;
}

.kst-row-info-color {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 3px 0px 3px 8px;
  pointer-events: none;
}

.kst-row-info-icon {
  flex-shrink: 1;
  min-width: 18px;
  padding-left: 4px;
}

th .kst-row-info-icon,
.kst-row-banner .kst-row-info-icon {
  padding-left: 4px;
}

.kst-row-info-label {
  width: 25px;
  text-align: left;
  white-space: nowrap;
  flex-grow: 1;
}

.kst-row-info-number {
  width: 26px;
  text-align: right;
  padding-right: 10px;
  font-weight: bolder;
}

.kst-header-repeat th {
  border-top: 1px solid var(--kt-outline-dark);
}

th.kst-header-cell-changed {
  background-color: var(--kt-outline-darker);

  &:after {
    content: "⟁";
    color: var(--kt-secondary);
  }
}

.kst-patterns-container {
  display: flex;
  /* flex-wrap: wrap; */
  gap: 1.5em;
}

.kst-pattern-summary img.kst-pattern-thumb {
  max-width: 100%;
  height: auto;
  border-radius: var(--kt-radius-small);
  margin-bottom: 1em;
}

.kst-not-found,
.kst-loading {
  margin: 1em 0;
  padding: 2em;
  text-align: center;
  background-color: var(--kt-background);
  border: 1px solid var(--kt-outline-dark);
  border-radius: var(--kt-radius-small);
}

.kst-shaping-tables-wrapper {
  position: relative;

  &>.flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.kst-unit-selector {
  align-items: center;

  select {
    background-color: white;
  }
}

.kst-table {

  /* .kst-cell-group {
    border-inline: 1px solid var(--kt-outline);
  } */
  th,
  td {
    vertical-align: middle;
  }

  .kst-cell-group-start {
    border-left: 1px solid var(--kt-outline-dark);
  }

  .kst-cell-group-end {
    border-right: 1px solid var(--kt-outline-dark);
  }

  th.kst-checkbox-header,
  td.kst-checkbox {
    width: 20px;
    text-align: center;
    border-left: 1px solid var(--kt-outline);
    cursor: pointer;
  }

  th[class*="hint--"] {
    display: table-cell;
  }

  .kst-message-header,
  .kst-message-item {
    border-left: 1px solid var(--kt-outline);
    width: 22px;
    padding: 0 2px;
    vertical-align: middle;
  }

  .kst-message-header img {
    filter: contrast(0.25);
  }

  .kst-message-item img {
    filter: grayscale(100%);
  }

  tfoot {
    td {
      border-top: 1px solid var(--kt-outline-dark);
      font-weight: bold;
    }
  }

  tfoot:not(.kst-show) {
    display: none;
    /* Only show when printing */
  }
}

/* Display row count first */
.kst-table.kst-display-row-first {
  .kst-cell-group-start {
    border-right: 1px solid var(--kt-outline-dark);
    border-left: unset;
  }

  .kst-cell-group-end {
    border-left: 1px solid var(--kt-outline-dark);
    border-right: 1px solid var(--kt-outline);
  }

  .kst-row-message-starting_stitch {
    border-right: 1px solid var(--kt-outline-dark);

    .kst-neck-diagram-icon:not(:first-child) {
      margin-left: 5px;
    }
  }

  & td {
    &.kst-count {
      background-color: var(--kt-shade-lightest);
      border-right: 1px solid var(--kt-outline-dark);
      border-left: 1px solid var(--kt-outline);
    }

    &.kst-stitch {
      border-right: 1px solid var(--kt-outline);
    }
  }

  .kst-row-banner:has(+ .kst-row-message) {
    border-right: 1px solid var(--kt-outline-dark);
  }

  .kst-row-banner:has(+ .kst-row-banner) {
    border-color: transparent);
  }

  .kst-row-banner.kst-row-message-starting_stitch {
    border-right: 1px solid var(--kt-outline-dark);
  }

  th.kst-header-cell {
    border-right: 1px solid var(--kt-outline-dark);
  }

  .kst-checkbox-header {
    border-left: 1px solid var(--kt-outline-dark);
  }

  .kst-row+.kst-cell-group-start {
    border-right: 1px solid var(--kt-outline);
  }
}

.kst-start-hint {
  text-align: right;
  font-size: var(--kt-small);
  margin-bottom: 2px;

  &::before {
    content: "← ";
  }
}


/* Content from row instructions and knitting instructions */
p.p1 {
  margin-bottom: .5em;
}

.kst-instructions,
.kst-bust-dart-note {
  line-height: 1.2;
}

.kst-continuation-instructions {
  margin-top: 20px;
  font-weight: bolder;
  text-align: center;
}

.kst-bust-adjustment-form {
  img {
    max-height: 140px;
  }

  img+img,
  img+div>img {
    margin-top: 10px;
  }
}

/* Bust dart instruction styling */
.kst-bust-dart-instruction {
  .kst-bust-dart-content {
    background-color: var(--kt-shade-lightest);
    border: 1px solid var(--kt-outline);
    border-radius: var(--kt-radius-small);
    padding: 15px;
    font-size: var(--kt-medium);
    line-height: 1.4;
    text-align: left;
  }
}

/* below the shaping table */
.kst-bust-dart-instructions,
.kst-knitting-directions {
  margin-block: 30px;

  h3 {
    margin-block: 1em .5em;
  }

  h4 {
    font-size: 1em;
    margin-bottom: .25em;
  }

  p {
    margin-bottom: .5em;
  }
}

/* Bust dart form styling */
.kst-bust-dart-section {
  background-color: var(--kt-shade-lightest);
  border: 1px solid var(--kt-outline);
  border-radius: var(--kt-radius-small);
  padding: 15px;
  margin-top: 15px;
  margin-bottom: 30px;
}

.kst-bust-dart-results {
  .kst-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;

    .label {
      font-weight: bold;
      margin-right: 10px;
    }

    .info {
      font-family: monospace;
    }
  }
}

.kst-error-message {
  background-color: #ffebee;
  border: 1px solid #f44336;
  color: #c62828;
  padding: 10px;
  border-radius: var(--kt-radius-small);
  margin-top: 10px;
}

.kst-stitch-pattern-section {
  margin-block: 40px;

  .kst-close-btn {
    display: none;
  }

  .kst-stitch-pattern-section-header {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;

    .kst-drag-handle {
      display: none;
    }
  }

  .kst-stitch-pattern-boundary:not(.kst-stitch-pattern-last-boundary) {
    border-bottom: 2px solid var(--kt-outline-dark);
  }

  td.kst-center-gap {
    border-inline: 1px solid var(--kt-outline-dark);
  }

  td.kst-stitch-type:has(+ .kst-center-gap) {
    border-right: 1px solid var(--kt-outline-dark);
  }

  [class*="kst-stitch-pattern-message-"] {
    display: none;
  }

  /* stitch pattern that is in overlay */
  &.kst-tracked-show {
    background-color: white;
    border: 1px solid var(--kt-outline-darker);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1;

    h4 {
      margin: 0;
    }

    .kst-stitch-pattern-section-header {
      cursor: pointer;

      .kst-drag-handle {
        display: inline-block;
      }

      h4 {
        font-size: 1em;
      }
    }

    .kst-close-btn {
      display: inline-block;
      background: transparent;
      color: var(--kt-outline-dark);
      padding: 10px;
      padding: 0 10px;
      font-size: 40px;
      margin-top: -10px;
      transform: translateX(5px);

      &:hover {
        color: revert;
      }
    }

    table {
      margin-inline: auto;
    }

    /* Collapse the already processed rows -- unless .kst-expanded-rows is added */
    &.kst-stitch-pattern-progress-done table,
    .kst-stitch-pattern-message-done,
    .kst-stitch-pattern-table thead,
    tr:has(~ .kst-active-row) {
      cursor: pointer;
    }

    &:not(.kst-expanded-rows) {
      .kst-stitch-pattern-description {
        display: none;
      }

      &.kst-stitch-pattern-progress-done tbody tr,
      tr:has(~ .kst-active-row) {
        height: 3px;
        overflow: hidden;
        font-size: 0px;

        td {
          padding: 0;
        }

        img {
          height: 0;
          max-height: 0;
        }
      }
    }

    [class*="kst-stitch-pattern-message-"] {
      display: block;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      border-radius: 4px;
      padding: 10px;
      z-index: 1;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
      background-color: var(--kt-background);
      line-height: 1.2;
      text-align: center;
    }

    .kst-stitch-pattern-message-done {
      color: var(--kt-background);
      background: var(--kt-primary);
    }
  }

  .kst-active-row td {
    background-color: color-mix(in lab, var(--kt-secondary) 20%, white);
  }

  h4 {
    margin-bottom: 10px;
  }
}

.kst-stitch-pattern-table {
  width: auto;

  tbody td {
    border-left: 1px solid var(--kt-outline);
    line-height: 0;
    box-sizing: border-box;
    vertical-align: middle;
  }

  .kst-stitch-type {
    padding: 0;
    /* width: 30px;
    max-width: 30px; */
    line-height: 0;

    img {
      height: 30px;
      max-height: 30px;
    }
  }

  tfoot td:first-child {
    border-left: 1px solid var(--kt-outline-dark);
  }

  .kst-row {
    border-left: 1px solid var(--kt-outline);
  }

  .kst-stitch-pattern-end {
    border-bottom: solid 1px var(--kt-outline-dark);
  }

  td+td+td.kst-stitch-pattern-start {
    border-left: solid 2px var(--kt-outline-dark);
  }
}

.kst-start-count-table {
  margin-bottom: 10px;
  /* border-bottom: solid 1px var(--kt-outline); */
}

/* disable selecting text when dragging */
.disable-select {
  user-select: none;
}

/* hint.css improvements */
[class*="hint--"]:after {
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 400;
  text-transform: none;
}

.kst-diagram-overlay .mt-overlay-message {
  width: clamp(200px, 80vw, 700px);
}

/* SVG Diagram */
.kst-diagram-sts {
  font-weight: bolder;
}

.kst-gauge-adjusted-info .kst-smaller-text {
  display: block;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {

  .kst-table th,
  .kst-table td {
    padding: 8px;
  }

  .kst-table {
    font-size: 0.9em;
  }

  .kst-main-title {
    font-size: 1.3em;
  }

  .kst-section-title {
    font-size: 1.1em;
  }
}


/* Driver Tour */
.driver-popover.kst-theme {
  background-color: var(--kst-tour-primary);
  color: #000;

  .driver-popover-title {
    font-size: 20px;
  }

  .driver-popover-title,
  .driver-popover-description,
  .driver-popover-progress-text {
    color: white;

    strong {
      font-weight: bold;
    }
  }

  .kst-tour-icon {
    width: 60px;
    height: auto;
    display: block;
    margin: 0 auto 8px;
  }

  .kst-tour-inline-icon {
    width: 1em;
    height: 1em;
    vertical-align: middle;
  }

  button {
    background-color: transparent;
    color: white;
    border: 1px solid white;
    text-shadow: none;
    font-size: 14px;
    padding: 5px 8px;
    border-radius: 6px;

    &:hover {
      background-color: var(--kt-on-secondary);
      color: white;
    }
  }

  .driver-popover-close-btn {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 38px;
    color: white;

    font-weight: 400;

    &:hover {
      color: var(--kt-on-secondary);
      background-color: transparent;
    }
  }

  .driver-popover-arrow-side-left.driver-popover-arrow {
    border-left-color: var(--kst-tour-primary);
  }

  .driver-popover-arrow-side-right.driver-popover-arrow {
    border-right-color: var(--kst-tour-primary);
  }

  .driver-popover-arrow-side-top.driver-popover-arrow {
    border-top-color: var(--kst-tour-primary);
  }

  .driver-popover-arrow-side-bottom.driver-popover-arrow {
    border-bottom-color: var(--kst-tour-primary);
  }
}

/* Tour column highlights */
.kst-tour-button {
  font-size: var(--kt-small);
  color: var(--kt-primary);
  background-color: transparent;
  cursor: pointer;
}

.kst-data-table.kst-tour-hl-instructions td.kst-stitch,
.kst-data-table.kst-tour-hl-instructions th.kst-cell-group-end,
.kst-data-table.kst-tour-hl-counts td.kst-count,
.kst-data-table.kst-tour-hl-counts th.kst-cell-group-start,
.kst-data-table.kst-tour-hl-neckline-count td:nth-child(3):not(.kst-row-banner),
.kst-data-table.kst-tour-hl-neckline-count th:nth-child(3),
.kst-data-table.kst-tour-hl-progress td.kst-checkbox,
.kst-data-table.kst-tour-hl-progress td.kst-message-item,
.kst-data-table.kst-tour-hl-progress th.kst-checkbox-header,
.kst-data-table.kst-tour-hl-progress th.kst-message-header,
.kst-data-table.kst-tour-hl-row-instructions th:has(.kst-instruction-trigger button),
.kst-data-table.kst-tour-hl-row-instructions td:has(.kst-instruction-trigger button) {
  background: linear-gradient(to right,
      color-mix(in lab, var(--kst-tour-primary) 45%, white) 0%,
      color-mix(in lab, var(--kst-tour-primary) 20%, white) 40%,
      color-mix(in lab, var(--kst-tour-primary) 20%, white) 20%,
      color-mix(in lab, var(--kst-tour-primary) 20%, white) 60%,
      color-mix(in lab, var(--kst-tour-primary) 45%, white) 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  animation: kst-shimmer 1.8s 0.5s ease-in-out 1 forwards;

}

@keyframes kst-shimmer {
  to {
    background-position: -100% 0;
  }
}

.kst-set-marker {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 1.3em;
  height: 1.3em;
  margin-left: 0.3em;
  border-radius: 4px;
  background-color: var(--kt-marker-color);
  color: white;
  font-size: 0.75em;
  font-weight: bold;
  line-height: 1;
  vertical-align: 1px;
}

.kst-pr-display-color {
  box-shadow: 0 0 0 transparent;
  border-radius: 2px;
  border: 1px solid #949494;
  background-color: #fff;
}

.kst-cleared {
  background: linear-gradient(to top left, #fff calc(50% - 1px), #8c8f94, #fff calc(50% + 1px));
}

.kst-pr-clear-color {
  color: var(--kt-secondary);
  background-color: transparent;
  border: none;
  font-size: 14px;
  padding: 8px 6px 4px;
  margin-left: 10px;

  &:disabled {
    pointer-events: none;
    color: var(--kt-outline-dark);
  }
}

/* Tour animated icon and label */
#tour-container {
  position: relative;
  display: flex;
  align-items: center;
}

#tour-label {
  position: absolute;
  bottom: calc(100%);
  /* Position above the button */
  left: 25%;
  transform: translateX(-50%) translateY(10px);
  background: var(--kt-alternate-2);
  color: white;
  font-size: .9em;
  font-weight: bold;
  padding: 2px 8px 0;
  border-radius: 5px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  transform-origin: center center;
}

/* Tooltip arrow */
#tour-label::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: var(--kt-alternate-2) transparent transparent transparent;
}

/* Hover interaction: Show label when button is hovered */
#start-tour-btn:hover+#tour-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Automatic slide-up animation for the initial "visible" class trigger */
#tour-label.visible {
  opacity: 1;
  animation:
    slide-up 0.4s ease-out forwards,
    rotate-shake 0.6s ease-in-out 0.5s 2;
}

#start-tour-btn {
  position: relative;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21;
}

/* Lighthouse Beam Animation */
.lighthouse-ray {
  transform-origin: center center;
  animation: lighthouse-flash 2s infinite ease-in-out;
}

.lighthouse-ray-delayed {
  animation-delay: 1s;
}

.lighthouse-ray.stopped {
  animation: none;
  opacity: 0.3;
}

@keyframes lighthouse-flash {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes slide-up {
  from {
    transform: translateX(-50%) translateY(10px);
  }

  to {
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes rotate-shake {

  /* You MUST include translateX and translateY here */
  0% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }

  25% {
    transform: translateX(-50%) translateY(0) rotate(6deg);
  }

  50% {
    transform: translateX(-50%) translateY(0) rotate(-6deg);
  }

  75% {
    transform: translateX(-50%) translateY(0) rotate(3deg);
  }

  100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
}

/* row instructions */
.mt-overlay-trigger,
.mt-overlay-trigger-attached {
  padding: 1px;
  font-size: 0px;
  background: none;
  color: currentColor;
}


@media screen {
  .kst-print-only {
    display: none;
  }
}

/* ACCESSIBILITY */
.sr-only {
  display: inline;
  position: absolute;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
}

/* PRINTING */
@media print {
  body.page {
    background-color: white;

    #masthead,
    #colophon,
    .hero-section,
    .hero-section+.entry-content>div.wp-block-columns,
    .hero-section+.entry-content .wp-block-spacer {
      display: none;
    }

    .entry-content>.wp-block-columns {
      padding-top: 1em;
    }

    .kst-sizes-container {
      font-size: 24px;

      .kst-section-content {
        font-size: 1rem;
      }
    }

    .kst-size-select {
      display: none;
    }

    .kst-print-only {
      display: inline;
    }

    .kst-print-only-block.kst-print-only {
      display: block
    }

    .kst-row-info-color-label {
      display: block;
      position: static;
      clip: initial;
      clip-path: none;
      width: auto;
      height: auto;
      font-size: 14px;
      white-space: nowrap;
      color: black;
      margin: 0 -4px 0 12px;
    }

    tr.kst-print-only {
      display: table-row;

      td {
        padding-top: 15px;

        a {
          display: none;
        }

        .mt-overlay-content {
          column-count: 2;
          column-gap: 20px;
        }
      }
    }

    .kst-instructions-row {
      break-inside: avoid;
      break-before: auto;
    }

    .kst-screen-only {
      display: none;
    }

    article {
      color: black;

      .site-header,
      .site-navigation.main-navigation,
      .site-navigation.main-small-navigation,
      .kst-custom-dropdown,
      .kst-size-selector,
      .edit-link,
      .comments-area,
      .kst-print-button,
      .site-info {
        display: none;
      }

      .shaping-tables {
        margin-top: 20px;
      }

      .entry-inner {
        margin-bottom: 0;
        margin-inline: 0;
        padding: 0;
        max-width: 100%;
        background-color: white;
      }

      .hentry {
        margin-bottom: 0;
      }

      .kst-size-section {
        break-after: page;

        &:last-child {
          break-after: auto;
        }
      }

      #kst-pattern-title {
        display: block;
      }

      .kst-table tfoot {
        display: table-footer-group;
      }

      .kst-table-label {
        font-size: 0.65em;
        display: block;
        margin-top: -8px;
      }

      h2.kst-section-title {
        font-size: 20px;
        font-weight: bold;
        margin: 0;

        span {
          margin: 0;
        }
      }

      .kst-message-item .screen-reader-text {
        display: inline-block;
        position: relative !important;
        clip: unset;
        height: auto;
        overflow: visible;
        width: auto;
        clip-path: unset;
        text-decoration: none;
      }

      .kst-table {
        th {
          position: static;
        }

        thead {
          display: table-row-group;
          /* Treats the header like a normal body row */
        }

        tr:last-child td {
          font-weight: normal;
          font-size: 14px;
        }
      }

      .kst-set-marker {
        border: 1px solid var(--kt-on-background);
        color: var(--kt-on-background);
      }
    }

    main+footer {
      display: none;
    }
  }
}

.mt-overlay-hidden-content {
  display: none;

  .mt-overlay & {
    display: block;
  }
}


/* .kst-adjustment-phase1 {
  background-color: aquamarine;
}

.kst-adjustment-phase2 {
  background: linear-gradient(90deg, aquamarine 0%, greenyellow 100%);
}

.kst-adjustment-removal {
  background-color: lightsalmon;
}

.debug-promote {
  background: linear-gradient(90deg, aquamarine 0%, red 100%);
}

.debug-split {
  background-color: orchid;
}

.debug-rewritten {
  background-color: yellow;
} */