/*
 * Klaviyo Flow Toolkit: the Klaviyo skin over the Shopify Flow toolkit's flow-toolkit.css, plus the pieces only these pages have
 * (Klaviyo tile, variables panel and table, email copy block, copy buttons).
 * Pencil marketing-site.pen, hub JiqNX, template page fL5mb. Everything is scoped under .kft, which always sits on an .sft root.
 */

.kft {
    --kft-lime: #deff00;
    --kft-lime-dark: #1f2600;
    --kft-klaviyo-ink: #1d1e20;
    /* The Flow pages' cyan accent becomes Klaviyo lime: badges, routes, ticks, focus rings. */
    --sft-cyan: var(--kft-lime);
    --sft-flow-dark: var(--kft-lime-dark);
}

.kft-eyebrow--lime { color: var(--kft-lime); }

.kft-accent {
    color: var(--kft-lime);
    padding-right: 0.04em;
}

.kft .sft-glow {
    background: radial-gradient(closest-side, rgba(222, 255, 0, 0.32), rgba(222, 255, 0, 0));
}

.kft .sft-count-badge {
    background: var(--kft-lime);
    color: var(--kft-lime-dark);
}

.kft .sft-icon-caption__dot {
    background: var(--kft-lime);
}

.kft .sft-tested-badge {
    color: var(--sft-yellow);
}

.kft-link {
    color: var(--kft-lime);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Klaviyo tile ---------- */

.kft-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--kft-klaviyo-ink);
    overflow: hidden;
}

.kft-flag {
    display: block;
    width: 52%;
    height: auto;
}

.kft-tile.sft-squircle--hero {
    box-shadow:
        0 40px 70px rgba(0, 0, 0, 0.65),
        0 8px 16px rgba(0, 0, 0, 0.4),
        inset 0 -6px 10px rgba(0, 0, 0, 0.12);
}

.kft-tile.sft-squircle--cta {
    box-shadow: 0 30px 50px rgba(19, 0, 65, 0.3), inset 0 -4px 8px rgba(0, 0, 0, 0.1);
}

/* ---------- Kind badges ---------- */

.kft-badge--library {
    background: var(--kft-lime);
    color: var(--kft-lime-dark);
}

.kft-badge--recipe {
    background: #fff;
    color: var(--sft-ink);
}

.kft-card--recipe {
    border-color: rgba(255, 255, 255, 0.14);
}

/* ---------- Hub: journey, library ---------- */

.kft .sft-journey__track::before {
    height: 2px;
    top: 24px;
    background: rgba(255, 255, 255, 0.25);
}

.kft .sft-journey__stop {
    --sft-stop-colour: var(--kft-lime);
}

.kft .sft-journey__dot {
    position: relative;
    border: 0;
    background: var(--sft-bg);
    box-shadow: 0 0 0 10px var(--sft-bg), 0 0 26px 8px rgba(222, 255, 0, 0.35);
}

.kft .sft-journey__dot::after {
    content: "";
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    background: var(--kft-lime);
}

.kft .sft-library__key .sft-needs__dot {
    border-color: var(--kft-lime);
}

.kft-start-tab {
    padding: 4px 14px;
    border-radius: 8px 8px 0 0;
    background: rgba(222, 255, 0, 0.18);
    color: var(--kft-lime);
    font-size: 13px;
    line-height: 1.4;
}

.kft-vars-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.kft-vars-panel__eyebrow {
    font-family: var(--sft-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
}

.kft-vars-panel__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kft-vars-panel__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.kft-vars-panel__item code {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #fff;
    overflow-wrap: anywhere;
}

.kft-vars-panel__note {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------- Copy buttons ---------- */

.kft .kft-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.kft .kft-copy:hover {
    background: rgba(255, 255, 255, 0.16);
}

.kft .kft-copy.is-copied {
    background: var(--kft-lime);
    color: var(--kft-lime-dark);
}

.kft-copy .sft-icon {
    width: 14px;
    height: 14px;
}

.kft .kft-copy--icon {
    padding: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}

.kft-copy--icon span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.kft .kft-copy--small {
    padding: 5px 9px;
    font-size: 12px;
}

/* ---------- Template: Klaviyo flow builder window ---------- */

.kft-flow-window__mark {
    display: flex;
    width: 18px;
    color: var(--kft-klaviyo-ink);
}

.kft-flow-window__mark .kft-flag {
    width: 100%;
}

.kft-flow-window .sft-flow-start__tab {
    background: #d5f3e5;
}

.kft .sft-step--lime {
    --sft-tone: var(--kft-lime);
}

/* ---------- Template: requirements ---------- */

.kft-requirement--klaviyo {
    border-color: rgba(222, 255, 0, 0.35);
    background: rgba(222, 255, 0, 0.05);
}

.kft-requirement--klaviyo .sft-requirement__icon {
    border-color: transparent;
    background: #fff;
    color: var(--kft-klaviyo-ink);
}

.kft-requirement--klaviyo .kft-flag {
    width: 26px;
}

.kft-requirement--mute {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
}

.kft-requirement--mute .sft-requirement__icon {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Template: variables and copy ---------- */

.kft-copy-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kft-copy-section__layout {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 796px);
    justify-content: space-between;
    gap: 64px;
}

.kft-copy-section__lead {
    margin-top: 24px;
    font-size: 17px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

.kft-copy-section__panels {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.kft-vars-table {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: var(--sft-panel);
    overflow: hidden;
}

.kft-vars-table__head {
    padding: 12px 20px;
    background: #fff;
    color: var(--sft-ink);
    font-family: var(--sft-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
}

.kft-vars-table__row {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kft-vars-table__row:first-child {
    border-top: 0;
}

.kft-vars-table__row dt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.kft-vars-table__row dt span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.kft-vars-table__row dd {
    min-width: 0;
}

.kft-vars-table__row code,
.kft-email code {
    font-size: 13.5px;
    line-height: 1.5;
    color: #fff;
    overflow-wrap: anywhere;
}

.kft-email {
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #120533;
}

.kft-email__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.kft-email__label {
    font-family: var(--sft-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
}

.kft-email__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

.kft-email__field {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.kft-email__field dt {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.kft-email__field--subject code {
    font-family: var(--sft-body);
    font-size: 17px;
    font-weight: 700;
}

.kft-email__blank {
    font-size: 13px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.45);
}

.kft .kft-email__body {
    margin: 18px 0 0;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: none;
    color: #fff;
    font-family: var(--sft-mono);
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.kft-notes .kft-link,
.kft-notes .sft-code {
    color: var(--kft-lime);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .kft-copy-section__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

@media (max-width: 720px) {
    .kft-vars-table__row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
        padding: 14px 16px;
    }

    .kft-vars-table__row dt {
        grid-column: 1 / -1;
    }

    .kft-email {
        padding: 18px 16px;
    }

    .kft-email__head {
        align-items: flex-start;
    }

    .kft-email__field {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 2px 12px;
    }

    .kft-email__field dt {
        grid-column: 1 / -1;
    }

    .kft-email__field--subject code {
        font-size: 15px;
    }

    .kft .sft-journey__dot::after {
        inset: 9px;
    }
}

/* ---------- Overrides placed last so they win over the base rules above ---------- */

/* Job nodes: white header, lime number, as in the hub design. */
.kft .sft-job-node__header {
    background: #fff;
}

.kft .sft-job-node__number {
    color: var(--kft-lime);
}

/* Recipe route: white, not the Flow toolkit's download yellow. */
.kft .sft-route--download {
    --sft-route: #fff;
    --sft-route-dark: var(--sft-ink);
    border-color: rgba(255, 255, 255, 0.16);
}

.kft .sft-route--download .sft-badge--download {
    background: #fff;
    color: var(--sft-ink);
}

.kft .sft-route--flow .sft-badge--flow {
    background: var(--kft-lime);
    color: var(--kft-lime-dark);
}

.kft-vars-panel__item code {
    font-size: 11.5px;
}

/* The theme sets white-space on bare code elements; the email body keeps its line breaks. */
.kft .kft-email__body code {
    display: block;
    white-space: pre-wrap;
}

/* Long Liquid snippets fill each line instead of breaking at the space after "{{". */
.kft-vars-panel__item code,
.kft-vars-table__row code {
    word-break: break-all;
}
