/* 2026-11-15: COOKING MODE (js/cook-mode.js). Full screen, phone first: big type, the Back / Next buttons under the
   thumbs, the running timers as pills at the top. To change: step text size (.cm-text font-size), the button height
   (.cm-btn min-height), the pill colours (.cm-pill / .cm-pill.is-done). */
html.aks-cm-open, html.aks-cm-open body { overflow: hidden; }

.cm { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #fffdf8; color: #172f49;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.cm[hidden] { display: none; }

.cm-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #eee6d6; background: #fff; }
.cm-x { flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid #e3e8ec; border-radius: 50%; background: #fff; color: #172f49; font-size: 1rem; cursor: pointer; }
.cm-head-t { min-width: 0; display: flex; flex-direction: column; }
.cm-head-t b { font-family: "Fraunces", Georgia, serif; font-size: 1.05rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-head-t small { display: flex; flex-wrap: wrap; gap: 0 10px; color: #64717d; font-size: .8rem; }
.cm-head-t small [data-cm-awake] { color: #1d7044; }
.cm-head-t small [data-cm-awake]::before { content: "\2022"; margin-right: 10px; color: #b8c2cc; }

.cm-bar { height: 4px; background: #f1ebdf; }
.cm-bar i { display: block; height: 100%; width: 0; background: #f2a21b; transition: width .25s ease; }

.cm-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(22px + var(--cm-dock-h, 0px)) 20px 28px; outline: none; }
.cm-body > * { max-width: 760px; margin-left: auto; margin-right: auto; }

.cm-h { margin: 0 0 4px; font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; font-weight: 600; color: #102f56; }
.cm-sub { margin: 0 0 16px; color: #64717d; font-size: .95rem; }
.cm-last { margin-top: 24px; text-align: center; color: #1d7044; font-weight: 600; }

/* Get ready: the ingredients, tap to tick */
.cm-ing { list-style: none; margin: 0 auto; padding: 0; }
.cm-ing li[data-cm-tick] { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid #eee6d6; font-size: 1.15rem; line-height: 1.4; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cm-ing li[data-cm-tick] small { display: block; color: #7a8794; font-size: .85rem; }
.cm-ing .cm-ing-group { padding: 18px 0 6px; color: #b58a3a; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cm-box { flex: 0 0 26px; height: 26px; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #c9d2da; border-radius: 7px; color: transparent; font-size: .8rem; }
.cm-ing li.is-done { color: #8a96a2; }
.cm-ing li.is-done > span:last-child { text-decoration: line-through; }
.cm-ing li.is-done .cm-box { border-color: #1d7044; background: #1d7044; color: #fff; }

/* One step */
.cm-step { display: flex; gap: 16px; align-items: flex-start; }
.cm-n { flex: 0 0 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #102f56; color: #fff; font-size: 1.2rem; font-weight: 700; }
.cm-text { font-size: 1.45rem; line-height: 1.55; color: #172f49; min-width: 0; }
.cm-text p { margin: 0 0 12px; }
.cm-text p:last-child { margin-bottom: 0; }
.cm-text ul, .cm-text ol { margin: 6px 0; padding-left: 24px; }
.cm-text .aks-scaled { text-decoration: underline dotted #b58a3a; text-underline-offset: 4px; font-weight: 600; }

.cm-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-left: 60px; }
.cm-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 48px; padding: 8px 16px; border: 1.5px solid #f2a21b; border-radius: 14px; background: #fff7e6; color: #7a4b00; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.cm-chip-t { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cm-chip small { font-size: .72rem; font-weight: 500; color: #8a6a2f; }
.cm-chip:active { transform: scale(.98); }

/* Back / Next under the thumbs */
.cm-nav { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #eee6d6; background: #fff; }
.cm-btn { flex: 1 1 0; min-height: 56px; border-radius: 16px; font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.cm-btn--back { flex: 0 0 34%; border: 1px solid #d7dee6; background: #fff; color: #172f49; }
.cm-btn--back:disabled { opacity: .4; cursor: default; }
.cm-btn--next { border: 0; background: #102f56; color: #fff; }

/* Running timers: pills at the top while cooking, above the page's bottom bar after closing */
.cm-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 2001;
    display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
.cm-dock[hidden] { display: none; }
html.aks-cm-open .cm-dock { top: calc(70px + env(safe-area-inset-top)); bottom: auto; }
.cm-pill { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px; background: #102f56; color: #fff;
    box-shadow: 0 6px 18px rgba(16, 47, 86, .25); font-size: .92rem; cursor: pointer; }
.cm-pill-l { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.cm-pill b { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.cm-pill-x { flex: 0 0 30px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.cm-pill.is-done { background: #f2a21b; color: #3b2600; padding-right: 16px; animation: cm-ring 1s ease-in-out infinite; }
@keyframes cm-ring { 50% { transform: scale(1.03); } }

/* The button that opens it */
.aks-cm-start { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
    background: #102f56; color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.aks-cm-start:hover { background: #0b2443; }
.aks-cm-start--wide { width: 100%; min-height: 52px; font-size: 1.05rem; margin: 12px 0 0; }
.aks-cm-start--sm { min-height: 34px; padding: 0 14px; font-size: .85rem; }

@media (max-width: 420px) {
    .cm-text { font-size: 1.28rem; }
    .cm-step { gap: 12px; }
    .cm-n { flex-basis: 38px; height: 38px; font-size: 1.05rem; }
    .cm-chips { padding-left: 50px; }
}
@media (min-width: 900px) {
    .cm-body { padding: calc(40px + var(--cm-dock-h, 0px)) 32px 40px; }
    .cm-text { font-size: 1.6rem; }
    .cm-nav { justify-content: center; }
    .cm-btn { flex: 0 1 260px; }
    .cm-btn--back { flex: 0 1 180px; }
}
@media (prefers-reduced-motion: reduce) { .cm-pill.is-done { animation: none; } .cm-bar i { transition: none; } }
@media print { .cm, .cm-dock { display: none !important; } }

/* Recipes/Details: the button sits at the right end of the Instructions heading */
.recipe-ingredients-subtitle .rd-cm-start { margin-left: auto; align-self: center; font-size: .82rem; letter-spacing: 0; text-transform: none; }
/* Recipes/View (public page): at the right end of the Steps heading */
.sp-steps-head { display: flex; align-items: center; gap: 10px; }
.sp-steps-head .aks-cm-start { margin-left: auto; font-family: inherit; font-size: .82rem; letter-spacing: 0; text-transform: none; }
