/* An integrations money page's own parts (rule 504): the hero card "Typed once" (kit/SyncHero.astro), the Type-it-once
   map and its sync sheet (kit/SyncMap.astro), and the day a sync stops (kit/SyncBreak.astro). The card head and the
   step panel take their look from kit-build.css and kit-build-parts.css (kbb__ and kbc__ classes), which
   SectionRenderer links with this file only on a page that draws one of these. The three ways have one colour each:
   monday.com's own integration green, a connector violet, code blue. */

.ksh,
.ksm,
.ksb {
  --way-native: #00a35c;
  --way-connector: #8a3ffc;
  --way-code: #2f6fde;
  --way-bad: #df2f4a;
}
[data-way='native'] { --way: var(--way-native); }
[data-way='connector'] { --way: var(--way-connector); }
[data-way='code'] { --way: var(--way-code); }
.ksh [hidden],
.ksm [hidden],
.ksb [hidden] {
  display: none !important;
}

/* ---------- hero: typed once ---------- */

.hero__sync {
  align-self: center;
}
.ksh__card {
  display: grid;
  gap: var(--s-4);
}
.ksh .kbb__head {
  margin-bottom: 0;
}
.ksh__stops {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* the road between the stops */
.ksh__stops::before {
  content: '';
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px);
}
.ksh[data-phase='once'] .ksh__stops::before {
  background: linear-gradient(90deg, var(--way-native), var(--accent));
}
.ksh__stop {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: 10px 8px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
  transition: box-shadow 360ms var(--ease), transform 360ms var(--ease), border-color 360ms var(--ease);
}
.ksh__stop[data-st='hand'] {
  border-color: color-mix(in srgb, var(--way-bad) 45%, var(--line));
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--way-bad) 80%, transparent);
  transform: translateY(-2px);
}
.ksh__stop[data-st='typed'],
.ksh__stop[data-st='synced'] {
  border-color: color-mix(in srgb, var(--way-native) 45%, var(--line));
}
.ksh__logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.ksh__logo .tool-tile {
  border: 0;
}
.ksh__tool {
  color: var(--faint);
  font-size: var(--fs-mono-xs);
}
.ksh__what {
  color: var(--ink);
  font-weight: 550;
  font-size: var(--fs-small);
  line-height: 1.25;
}
.ksh__detail {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.3;
}
.ksh__badge {
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  color: var(--muted);
  font-size: var(--fs-mono-xs);
  transition: background 300ms var(--ease), color 300ms var(--ease);
}
.ksh__badge[data-st='hand'] {
  background: color-mix(in srgb, var(--way-bad) 14%, var(--paper));
  color: color-mix(in srgb, var(--way-bad) 70%, var(--ink));
}
.ksh__badge[data-st='typed'] {
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
  color: var(--accent-deep);
}
.ksh__badge[data-st='synced'] {
  background: color-mix(in srgb, var(--way-native) 16%, var(--paper));
  color: color-mix(in srgb, var(--way-native) 65%, var(--ink));
}
.ksh__badge[data-st='arrives'] {
  background: var(--paper-2);
  color: var(--ink-2);
}
/* the record that travels, once connected */
.ksh__rec {
  position: absolute;
  z-index: 2;
  bottom: -10px;
  left: calc(16.66% - 11px);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--way-native);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--way-native) 22%, transparent);
  opacity: 0;
  transition: left 700ms var(--ease), opacity 250ms var(--ease);
  pointer-events: none;
}
.ksh__rec.is-moving {
  opacity: 1;
}
.ksh__rec[data-at='1'] {
  left: calc(50% - 11px);
}
.ksh__rec[data-at='2'] {
  left: calc(83.33% - 11px);
}
.ksh__count {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ksh__cell {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  opacity: 0.92; /* was 0.55: the 'not connected yet' look was under 4.5:1 for its text (T6, 20 Nov 2026) */
  border-style: dashed;
  transition: opacity 300ms var(--ease), border-color 300ms var(--ease);
}
.ksh__cell.is-on {
  opacity: 1;
}
.ksh__cell[data-ksh-cell='today'].is-on {
  border-color: color-mix(in srgb, var(--way-bad) 50%, var(--line));
}
.ksh__cell[data-ksh-cell='once'].is-on {
  border-color: color-mix(in srgb, var(--way-native) 50%, var(--line));
}
.ksh__n {
  min-width: 1.2ch;
  font-size: 2rem;
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.ksh__cell[data-ksh-cell='today'] .ksh__n {
  color: color-mix(in srgb, var(--way-bad) 75%, var(--ink));
}
.ksh__cell[data-ksh-cell='once'] .ksh__n {
  color: color-mix(in srgb, var(--way-native) 70%, var(--ink));
}
.ksh__cl {
  display: grid;
  gap: 1px;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1.3;
}
.ksh__cl > :last-child {
  /* the two cells (today, connected) always hold two lines, so they are one height whichever words the pick shows */
  min-height: calc(2 * 1.3em);
}
.ksh__pick {
  margin-top: 0;
}
.ksh__mini {
  display: inline-flex;
}
.ksh__mini .tool-tile {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
}
.ksh__mini .tool-tile + .tool-tile {
  margin-left: -4px;
}

/* ---------- the Type-it-once map ---------- */

.ksm .kbc__grid {
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
}
.ksm__side {
  padding: var(--s-5);
}
.ksm__card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}
.ksm__head {
  margin-bottom: 0;
}
.ksm__count {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent-deep);
  white-space: nowrap;
}
.ksm[data-example='yes'] .ksm__count {
  background: var(--paper-2);
  color: var(--muted);
  border: 1px dashed var(--line-2);
}
.ksm__map {
  position: relative;
  aspect-ratio: 520 / 300;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 47%, var(--accent-tint) 0, transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--line) 55%, transparent) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--line) 55%, transparent) 23px 24px),
    var(--paper-2);
  overflow: hidden;
}
.ksm[data-example='yes'] .ksm__map::after {
  content: 'Example';
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border: 1px dashed var(--line-2);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-mono-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ksm__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ksm__track {
  fill: none;
  stroke: transparent;
}
.ksm__line {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 2;
  stroke-dasharray: 3 5;
  transition: stroke 300ms var(--ease), stroke-width 300ms var(--ease), opacity 300ms var(--ease);
  opacity: 0.6;
}
.ksm__wire.is-on .ksm__line {
  opacity: 1;
}
.ksm__wire.is-live .ksm__line {
  stroke: var(--way);
  stroke-width: 3;
  stroke-dasharray: none;
}
.ksm.is-js.is-in .ksm__wire.is-live .ksm__line {
  animation: ksm-draw 900ms var(--ease) both;
  stroke-dasharray: 100;
}
@keyframes ksm-draw {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
.ksm__dot {
  stroke: var(--paper);
  stroke-width: 2;
}
.ksm__dot--native { fill: var(--way-native); }
.ksm__dot--connector { fill: var(--way-connector); }
.ksm__dot--code { fill: var(--way-code); }
.ksm__node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 31%;
  max-width: 168px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  transform: translate(-50%, -50%);
  opacity: 0.92; /* was 0.6: text under 4.5:1; the dashed border is the example cue (T6, 20 Nov 2026) */
  border-style: dashed;
  transition: opacity 300ms var(--ease), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.ksm__node.is-on {
  opacity: 1;
}
.ksm__node[data-way='native'],
.ksm__node[data-way='connector'],
.ksm__node[data-way='code'] {
  border-color: color-mix(in srgb, var(--way) 55%, var(--line));
  box-shadow: 0 8px 20px -14px color-mix(in srgb, var(--way) 90%, transparent);
}
.ksm__node--hub {
  grid-template-columns: auto auto;
  justify-content: center;
  width: auto;
  padding: 10px 14px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow-card);
  opacity: 1;
}
.ksm__node--hub .ksm__nname {
  font-weight: 600;
}
.ksm__nlogo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
}
.ksm__nlogo .tool-tile,
.ksm__node--hub .tool-tile {
  width: 26px;
  height: 26px;
  border: 0;
}
.ksm__ntext {
  display: grid;
  min-width: 0;
}
.ksm__nname {
  overflow: hidden;
  color: var(--ink);
  font-size: var(--fs-xs);
  font-weight: 550;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ksm__node:not(.is-on):not(.ksm__node--hub) .ksm__nname {
  display: none;
}
.ksm__nlane {
  color: var(--faint);
  font-size: var(--fs-mono-xs);
}
.ksm [data-way='native'] .ksm__npill,
.ksm__node[data-way='native'] .ksm__npill {
  background: #007a45; /* white on the brand green was 3.3:1; on this one 5.6:1 (T6, 20 Nov 2026) */
}
.ksm__npill {
  position: absolute;
  right: -1px;
  bottom: -9px;
  padding: 0 6px;
  background: var(--way, var(--line-2));
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}
.ksm__npill:empty {
  display: none;
}
.ksm__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.ksm__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ksm__swatch {
  width: 18px;
  height: 3px;
  background: var(--way);
}
.ksm__rows {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ksm__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--way, var(--line-2));
  background: var(--paper);
  animation: ksm-in 320ms var(--ease) both;
}
.ksm[data-example='yes'] .ksm__row {
  opacity: 0.92; /* was 0.72 (T6, 20 Nov 2026: text under 4.5:1) */
}
@keyframes ksm-in {
  from { opacity: 0; transform: translateY(4px); }
}
.ksm__row--empty {
  grid-template-columns: 1fr;
  border-left-style: dashed;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.ksm__rhead {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 550;
  line-height: 1.25;
}
.ksm__ic {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--accent-deep);
}
.ksm__route {
  grid-column: 1 / -1;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.ksm__tile {
  display: inline-flex;
}
.ksm__tile:empty {
  display: none;
}
.ksm__tile .tool-tile {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
}
.ksm__rname {
  color: var(--ink-2);
}
.ksm__owner {
  margin-left: 4px;
  color: var(--faint);
  font-size: var(--fs-mono-xs);
}
.ksm__pill {
  align-self: start;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--way) 14%, var(--paper));
  color: color-mix(in srgb, var(--way) 80%, var(--ink));
  font-size: var(--fs-mono-xs);
  white-space: nowrap;
}
.ksm__meter {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.ksm__mh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--accent-deep);
}
.ksm__mbar {
  position: relative;
  height: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ksm__mwant {
  position: absolute;
  inset: 0 auto 0 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--way-bad) 30%, transparent) 0 4px, transparent 4px 8px);
  transition: width 600ms var(--ease);
}
.ksm__mfill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  background: var(--way-native);
  transition: width 600ms var(--ease);
}
.ksm__meter:not(.is-over) .ksm__mwant {
  display: none;
}
.ksm__mtext {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

/* the steps: systems by row, with logos */
/* the step panel is top-aligned: "Why we ask" sits right under the options, not pushed to the bottom */
.ksm.is-js .kbc__why {
  margin-top: var(--s-5);
  border-top: 0;
}
.ksm.is-js .kbc__step.is-on,
.ksm .kbc__steps {
  flex: 0 0 auto;
}
.ksm__lanes {
  display: grid;
  gap: 10px;
}
.ksm__lane {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.ksm__lane:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.ksm__lname {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  color: var(--ink-2);
}
.ksm__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ksm__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-small);
  cursor: pointer;
  transition: border-color 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
}
.ksm__chip .tool-tile {
  width: 22px;
  height: 22px;
  border: 0;
}
.ksm__chip--other {
  padding-left: 10px;
  border-style: dashed;
  color: var(--muted);
}
.ksm__chip:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.ksm__chip[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--ink);
  font-weight: 550;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ksm__chip:focus-visible,
.ksb__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ksm__multi {
  position: relative;
  padding-right: 40px;
}
.ksm__optsub {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--fs-mono-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ksm__box {
  position: absolute;
  right: 12px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line-2);
  color: transparent;
  transform: translateY(-50%);
}
.ksm__multi[aria-pressed='true'] .ksm__box {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.ksm__next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.ksm__hint {
  color: var(--faint);
}
.ksm__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ksm__go[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* the result: the three ways with their counts */
.ksm__ways {
  display: grid;
  gap: 6px;
  margin: var(--s-3) 0;
  padding: 0;
  list-style: none;
}
.ksm__ways li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--way);
  background: var(--paper);
  transition: opacity 300ms var(--ease);
}
.ksm__ways li.is-zero {
  opacity: 0.5;
}
.ksm__wn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: color-mix(in srgb, var(--way) 14%, var(--paper));
  color: color-mix(in srgb, var(--way) 85%, var(--ink));
  font-size: 1.1rem;
  font-weight: 600;
}
.ksm__wtext {
  display: grid;
  gap: 2px;
}
.ksm__wlabel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 550;
  font-size: var(--fs-small);
}
.ksm__wlabel svg {
  color: var(--way);
}
.ksm__wlabel .tool-tile {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
}
.ksm__wline {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

/* the sync sheet */
.ksm__slines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ksm__sline {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--way);
  background: var(--paper);
}
.ksm__slh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 550;
}
.ksm__slh .ksm__pill {
  margin-left: auto;
}
.ksm__sdl {
  display: grid;
  gap: 4px;
  margin: 0;
}
.ksm__sdl div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
}
.ksm__sdl dt {
  color: var(--faint);
  font-size: var(--fs-mono-xs);
}
.ksm__sdl dd {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.ksm__snote {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.ksm [data-ksm-ssys] li {
  flex-wrap: wrap;
}


@media (prefers-reduced-motion: reduce) {
  .ksh__stop,
  .ksh__rec,
  .ksh__badge,
  .ksh__cell,
  .ksm__row,
  .ksm__line,
  .ksm__node,
  .ksm__chip,
  .ksm__mfill,
  .ksm__mwant {
    animation: none !important;
    transition: none !important;
  }
}
