/* Blog post phone demo (inc/post-demos.php, assets/js/phone-demo.js).
   The stage holds a fixed 360 x 620 canvas that the script scales and centres.
   Chapter buttons match the course page demos (course-demo.css). */

.pd {
    margin: 2rem 0;
    --pd-navy: #0f1722;
    --pd-lime: #baf861;
    --pd-wa: #008069;
    --pd-out: #d9fdd3;
    --pd-paper: #efeae2;
}

.pd *,
.pd *::before,
.pd *::after {
    box-sizing: border-box;
}

/* ---------- chapters ---------- */

/* .pd prefix: beats the blog's .initd-blog-content ol/li rules */
.pd .pd-chapters {
    display: flex;
    gap: .4rem;
    margin: 0 0 .75rem;
    padding: 0 0 .25rem;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.pd-chapters::-webkit-scrollbar {
    display: none;
}

.pd .pd-chapters li {
    flex: none;
    margin: 0;
    padding: 0;
}

.pd .pd-chapters li::before,
.pd .pd-chapters li::marker {
    content: none;
}

.pd-chapter {
    position: relative;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    padding: .4rem .7rem;
    overflow: hidden;
    border: 1px solid #dbe2ea;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.pd-chapter:hover {
    border-color: #94a3b8;
}

.pd-chapter:focus-visible {
    outline: 2px solid #2f6f5e;
    outline-offset: 2px;
}

.pd-chapter-num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #64748b;
}

.pd-chapter.is-on {
    border-color: var(--pd-navy);
    background: var(--pd-navy);
    color: #fff;
}

.pd-chapter.is-on .pd-chapter-num {
    color: var(--pd-lime);
}

.pd-chapter::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: calc(var(--pd-p, 0) * 100%);
    background: var(--pd-lime);
    transition: width .4s linear;
}

.pd-chapter:not(.is-on)::after {
    display: none;
}

/* ---------- stage ---------- */

.pd-stage {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: radial-gradient(120% 90% at 85% 0%, #1d2d44 0%, #0f1722 60%);
}

.pd:not(.is-ready) .pd-stage {
    display: none;
}

.pd-canvas {
    position: absolute;
    top: 12px;
    left: 0;
    width: 360px;
    height: 620px;
    transform-origin: 0 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.35;
    color: #111b21;
}

.pd-phone {
    position: absolute;
    inset: 0 20px;
    overflow: hidden;
    border: 6px solid #1f2933;
    border-radius: 34px;
    background: #fff;
    box-shadow: 0 22px 50px rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
}

.pd-status {
    flex: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30px;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 600;
}

.pd-icons {
    display: flex;
    gap: 3px;
}

.pd-icons i {
    width: 12px;
    height: 7px;
    border-radius: 2px;
    background: #111b21;
}

.pd-screen {
    position: relative;
    flex: 1;
    min-height: 0;
}

.pd-screen > div {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    animation: pd-fade .3s ease-out;
}

/* ---------- Tools tab (Singapore app, 26 Nov 2026) ---------- */

.pd-appbar {
    flex: none;
    padding: 6px 16px 10px;
    border-bottom: 1px solid #e9edef;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
}

.pd-tools {
    background: #f2f2f2;
}

.pd-list {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0 12px;
}

.pd-sec {
    margin: 12px 4px 8px;
    font-size: 18px;
    font-weight: 700;
}

.pd-one {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 3px solid #111b21;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.pd-card-for {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
}

.pd-card-for b {
    display: block;
    font-size: 15px;
}

.pd-card-for p {
    margin: 4px 0 10px;
    color: #54656f;
    font-size: 13px;
}

.pd-try {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    background: #111b21;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 0 0 2px var(--pd-lime), 0 0 14px rgba(186, 248, 97, .55);
    transition: filter .15s;
}

.pd-try.is-pressed {
    filter: brightness(1.6);
}

.pd-group {
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
}

.pd-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid #f0f2f5;
}

.pd-row-ic {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: #e9edef;
}

.pd-row-lab {
    flex: 1;
    min-width: 0;
}

.pd-row-lab b {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.pd-row-lab small {
    display: block;
    overflow: hidden;
    color: #667781;
    font-size: 11.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pd-row-go {
    color: #8696a0;
    font-size: 18px;
}

.pd-tabs {
    flex: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 50px;
    border-top: 1px solid #e9edef;
    background: #fff;
    font-size: 10.5px;
    font-weight: 500;
}

.pd-tabs span.is-on {
    padding: 5px 10px;
    border-radius: 999px;
    background: #ececec;
    font-weight: 700;
}

/* ---------- Meta One offer ---------- */

.pd-m1 {
    padding: 8px 16px 14px;
    background: linear-gradient(180deg, #dbe8ff 0, #fff 90px);
}

.pd-m1-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #54656f;
}

.pd-m1-tabs .pd-x {
    margin-right: 6px;
    font-size: 20px;
    color: #111b21;
}

.pd-m1-tabs span.is-on {
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff;
    color: #111b21;
    font-weight: 600;
}

.pd-m1-h {
    margin: 18px 0 6px;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.pd-m1-h em {
    color: #2563eb;
    font-style: normal;
}

.pd-m1-sub,
.pd-m1-price {
    color: #54656f;
    font-size: 12.5px;
    text-align: center;
}

.pd-m1-price {
    margin: 4px 0 14px;
    color: #111b21;
    font-weight: 600;
}

.pd-m1-ben {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 10px;
}

.pd-m1-ben b {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.pd-m1-ben span {
    display: block;
    color: #54656f;
    font-size: 12.5px;
}

.pd-m1-ben.is-hot {
    box-shadow: 0 0 0 2px var(--pd-lime), 0 0 14px rgba(186, 248, 97, .55);
}

.pd-m1-foot {
    margin-top: auto;
    color: #667781;
    font-size: 11px;
    text-align: center;
}

.pd-m1-btn {
    margin-top: 8px;
    padding: 11px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

/* ---------- chat ---------- */

.pd-chathead {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 10px;
    border-bottom: 1px solid #e9edef;
}

.pd-back {
    font-size: 26px;
    line-height: 1;
}

.pd-av {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5c26b;
    color: #fff;
    font-weight: 700;
}

.pd-who {
    display: flex;
    flex-direction: column;
}

.pd-who small {
    color: #667781;
    font-size: 12px;
}

.pd-msgs {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px 10px 4px;
    background: var(--pd-paper);
}

.pd-msg {
    position: relative;
    width: fit-content;
    max-width: 82%;
    margin: 0 0 8px;
    padding: 6px 9px 18px;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s, transform .3s;
}

.pd-msg.is-in {
    opacity: 1;
    transform: none;
}

.pd-msg.is-out {
    margin-left: auto;
    background: var(--pd-out);
}

.pd-msg.is-sys {
    max-width: 90%;
    margin: 0 auto 10px;
    padding: 6px 10px;
    background: #fff5c4;
    color: #54656f;
    font-size: 12px;
    text-align: center;
}

.pd-time {
    position: absolute;
    right: 8px;
    bottom: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #667781;
    font-size: 10.5px;
}

.pd-spark {
    width: 10px;
    height: 10px;
}

.pd-ticks {
    width: 15px;
    height: 10px;
    color: #53bdeb;
}

.pd-card {
    display: flex;
    flex-direction: column;
    margin: 8px -4px 4px;
    padding: 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .6);
}

.pd-card-img {
    height: 92px;
    margin-bottom: 6px;
    border-radius: 6px;
    background:
        repeating-conic-gradient(#f4e04d 0 25%, #fffbea 0 50%) 0 0 / 22px 22px;
}

.pd-card small {
    color: #667781;
}

.pd-card-go {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    color: var(--pd-wa);
    font-weight: 600;
    text-align: center;
}

.pd-composer {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: var(--pd-paper);
}

.pd-input {
    flex: 1;
    overflow: hidden;
    padding: 9px 14px;
    border-radius: 999px;
    background: #fff;
    white-space: nowrap;
}

.pd-ph {
    color: #8696a0;
}

.pd-composer.is-typing .pd-ph {
    color: #111b21;
}

.pd-chip {
    display: none;
    padding: 5px 10px;
    border: 1px solid #c4cdd2;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
}

.pd-composer.is-waiting .pd-chip {
    display: block;
}

.pd-composer.is-waiting .pd-input {
    border: 1.5px solid #25d366;
}

/* ---------- our notes and the finger ---------- */

.pd-note {
    position: absolute;
    left: 34px;
    right: 34px;
    top: 44px;
    z-index: 5;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--pd-lime);
    color: var(--pd-navy);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}

.pd-note.is-low {
    top: auto;
    bottom: 130px;
}

.pd-note.is-in {
    opacity: 1;
    transform: none;
}

.pd-touch {
    position: absolute;
    left: -16px;
    top: -16px;
    z-index: 6;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: rgba(15, 23, 34, .35);
    opacity: 0;
    transform: translate(180px, 560px);
    transition: transform .55s cubic-bezier(.4, 0, .2, 1), opacity .25s;
    pointer-events: none;
}

.pd-touch.is-on {
    opacity: 1;
}

.pd-touch.is-go {
    animation: pd-tap .45s ease-out;
}

/* ---------- caption ---------- */

.pd-caption {
    margin-top: .7rem;
    color: #64748b;
    font-size: .82rem;
    line-height: 1.45;
}

/* ---------- motion ---------- */

@keyframes pd-fade {
    from {
        opacity: 0;
    }
}

@keyframes pd-tap {
    50% {
        box-shadow: 0 0 0 10px rgba(186, 248, 97, .55);
    }
}
