/*
 * China Kanta — the back arrow.
 *
 * One control, drawn once. It is the same tile the icon system already uses (the soft
 * --ck-tile-bg surface, the currentColor glyph, the scale-and-fill press) at 44px, which is
 * the smallest box a thumb can be asked to aim at, and it takes the brand red on the press so
 * the door looks like every other door in the app.
 *
 * Loads AFTER ck-icons-v1.css. That matters in one specific place: the messenger sheet's own
 * `.ck-msg-back svg` rule sizes its glyph at 20px, and the thread bar now holds this component,
 * so the 24px the brief asks for is restated here at 0,2,0 and the later file wins.
 */
.ck-back {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background-color: var(--ck-tile-bg, #f7f7f8);
    color: #17171a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 200ms var(--ck-icon-ease, cubic-bezier(0.22, 0.61, 0.36, 1)),
        background-color 200ms var(--ck-icon-ease, cubic-bezier(0.22, 0.61, 0.36, 1)),
        color 200ms var(--ck-icon-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

/*
 * The brand's own glyph size, restated rather than inherited: the header rows each sized their
 * icons by hand before the ramp existed, and a 24px arrow inside a 44px tile is the ratio the
 * brief asks for.
 */
.ck-back .ck-ico {
    width: 24px;
    height: 24px;
}

.ck-back--labelled {
    width: auto;
    padding: 0 15px 0 11px;
}

.ck-back:active {
    transform: scale(0.92);
    background-color: var(--ck-brand, #e31e24);
    color: #fff;
}

/* A mouse gets a hint before it clicks; a thumb gets the press and nothing else. */
@media (hover: hover) and (pointer: fine) {
    .ck-back:hover {
        background-color: var(--ck-tile-press, #efeff2);
        color: var(--ck-brand, #e31e24);
    }
}

/*
 * The header is white in the light theme and #17171a in the dark one, so the tile answers the
 * dark chrome the same way the quick-action tiles do: its own surface, the brighter red the dark
 * layer settled on, and no white glyph on a black button.
 */
html[data-theme="dark"] .ck-back {
    background-color: #1f1f23;
    color: #ff5b5f;
}

html[data-theme="dark"] .ck-back:active {
    background-color: var(--ck-brand, #e31e24);
    color: #fff;
}

/*
 * The phone brand row is `justify-content: space-between` and held exactly two children: the
 * wordmark on the left, the doors on the right. Three children and space-between starts the
 * wordmark in the middle of the screen, which moves the one element shoppers read first. The
 * auto margin keeps the arrow and the wordmark a group on the left and the doors on the right,
 * so the wordmark sits precisely where it did before the arrow arrived.
 */
.ck-mnav-brand .ck-mnav-logo {
    margin-right: auto;
}

@media (prefers-reduced-motion: reduce) {
    .ck-back {
        transition-duration: 1ms;
    }
}
