.phase14-shell,
.demo-body {
    --p14-bg: #f6f8fb;
    --p14-panel: #ffffff;
    --p14-text: #0f172a;
    --p14-muted: #64748b;
    --p14-line: rgba(100, 116, 139, .22);
    --p14-teal: #0f766e;
    --p14-amber: #b45309;
    --p14-red: #dc2626;
    --p14-green: #15803d;
}

.p14-kpi-grid,
.demo-context-grid,
.demo-story-grid,
.demo-playlist,
.p14-rec-grid {
    display: grid;
    gap: 14px;
}

.p14-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.p14-kpi,
.p14-rec,
.p14-advice,
.demo-section,
.demo-playlist-card,
.demo-step,
.demo-hero-card,
.demo-context-grid section {
    background: var(--p14-panel);
    border: 1px solid var(--p14-line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .06);
}

.p14-kpi {
    padding: 16px;
}

.p14-kpi span,
.demo-context-grid span,
.demo-eyebrow,
.demo-progress span,
.demo-playlist-card span,
.demo-step__head span {
    color: var(--p14-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.p14-kpi strong {
    color: var(--p14-text);
    display: block;
    font-size: 1.8rem;
    line-height: 1.1;
}

.p14-kpi.is-danger strong { color: var(--p14-red); }
.p14-kpi.is-warning strong { color: var(--p14-amber); }
.p14-kpi.is-success strong { color: var(--p14-green); }
.p14-kpi.is-primary strong { color: var(--p14-teal); }

.p14-rec,
.p14-advice {
    padding: 16px;
    margin-bottom: 12px;
}

.p14-rec__head,
.p14-actions,
.demo-card-actions,
.demo-step__actions,
.demo-command-header,
.demo-section header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.p14-rec__head strong {
    flex: 1 1 220px;
}

.p14-rec p,
.p14-advice p,
.demo-step p,
.demo-playlist-card p,
.demo-hero p {
    color: var(--p14-muted);
    margin: 8px 0 12px;
}

.p14-evidence,
.demo-field-guide,
.demo-role-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p14-evidence span,
.demo-field-guide span,
.demo-role-cloud span,
.demo-session-pill {
    background: #f8fafc;
    border: 1px solid var(--p14-line);
    border-radius: 8px;
    color: var(--p14-text);
    padding: 8px 10px;
}

.p14-evidence small,
.demo-field-guide small,
.demo-session-pill small {
    color: var(--p14-muted);
    display: block;
    font-size: .72rem;
}

.p14-rec-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.p14-playbook {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
}

.p14-playbook span {
    color: var(--p14-muted);
    display: block;
}

.demo-body {
    background: var(--p14-bg);
    color: var(--p14-text);
    min-height: 100vh;
}

.demo-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

.demo-hero {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
    min-height: 62vh;
    align-items: center;
}

.demo-hero h1,
.demo-command-header h1 {
    color: var(--p14-text);
    font-size: clamp(2rem, 5vw, 4.4rem);
    letter-spacing: 0;
    line-height: .98;
    margin: 10px 0;
}

.demo-start-form,
.demo-contact-form {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-top: 22px;
}

.demo-hero-card {
    padding: 18px;
}

.demo-section {
    margin-top: 18px;
    padding: 18px;
}

.demo-section header {
    margin-bottom: 14px;
}

.demo-section header strong {
    font-size: 1.15rem;
}

.demo-section header span {
    color: var(--p14-muted);
}

.demo-playlist {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.demo-playlist-card {
    padding: 16px;
}

.demo-hub {
    display: grid;
    gap: 18px;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    padding: 18px;
}

.demo-rail {
    align-self: start;
    background: var(--p14-panel);
    border: 1px solid var(--p14-line);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    padding: 16px;
    position: sticky;
    top: 18px;
}

.demo-back {
    color: var(--p14-teal);
    font-weight: 800;
}

.demo-main {
    min-width: 0;
}

.demo-command-header {
    background: linear-gradient(135deg, #ffffff 0%, #eefdfb 100%);
    border: 1px solid var(--p14-line);
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 20px;
}

.demo-command-header h1 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.demo-context-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 14px;
}

.demo-context-grid section {
    padding: 14px;
}

.demo-context-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.demo-story-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.demo-step {
    border-left: 4px solid #cbd5e1;
    padding: 16px;
}

.demo-step.is-active { border-left-color: var(--p14-teal); }
.demo-step.is-completed { border-left-color: var(--p14-green); }
.demo-step.is-skipped { border-left-color: var(--p14-amber); }

.demo-step__head b {
    color: var(--p14-muted);
    font-size: .8rem;
}

.demo-step strong {
    display: block;
    font-size: 1.05rem;
    margin-top: 8px;
}

.demo-step__actions {
    justify-content: flex-start;
    margin: 12px 0;
}

.demo-outcome {
    color: var(--p14-teal);
    display: block;
    font-weight: 700;
}

.demo-progress {
    display: grid;
    gap: 8px;
}

.demo-progress div {
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.demo-progress i {
    background: var(--p14-teal);
    display: block;
    height: 100%;
}

.demo-role-switcher {
    display: grid;
    gap: 6px;
}

.demo-role-switcher strong {
    margin-bottom: 4px;
}

.demo-role-switcher button {
    background: #f8fafc;
    border: 1px solid var(--p14-line);
    border-radius: 8px;
    color: var(--p14-text);
    font-weight: 700;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.demo-role-switcher button.is-active {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

/* ShipOS guided product experience */
.demo-body--landing {
    background:
        radial-gradient(circle at 6% 2%, rgba(15, 118, 110, .12), transparent 28rem),
        radial-gradient(circle at 96% 16%, rgba(14, 165, 233, .09), transparent 24rem),
        #f6f8fb;
}

.demo-topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 8px 0 22px;
}

.demo-topbar > div,
.demo-brand,
.demo-hero__actions,
.demo-proof-row,
.demo-journey-head,
.demo-chapter-card__top,
.demo-command-header__actions,
.demo-chapter-block > header > div,
.demo-tour-menu__full,
.demo-tour-menu__chapters button {
    align-items: center;
    display: flex;
}

.demo-brand {
    gap: 10px;
    color: #0f172a;
    text-decoration: none;
}

.demo-brand span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: #0f766e;
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.demo-brand strong { font-size: 1.05rem; }
.demo-topbar > div { gap: 18px; }
.demo-topbar > div a { color: #475569; font-size: .82rem; font-weight: 750; text-decoration: none; }
.demo-topbar .demo-topbar__login { padding: 9px 14px; border: 1px solid rgba(15, 118, 110, .2); border-radius: 10px; color: #0f766e; }

.demo-hero--product {
    min-height: 72vh;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
}

.demo-hero--product h1 {
    max-width: 850px;
    font-size: clamp(3rem, 6vw, 5.8rem);
    letter-spacing: -.065em;
}

.demo-hero--product > div > p {
    max-width: 760px;
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    line-height: 1.72;
}

.demo-hero__actions {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.demo-hero__actions form { margin: 0; }

.demo-primary-cta,
.demo-secondary-cta {
    align-items: center;
    display: inline-flex;
    min-height: 54px;
    justify-content: center;
    border-radius: 13px;
    padding: 0 18px;
    font-size: .83rem;
    font-weight: 850;
    text-decoration: none;
}

.demo-primary-cta {
    gap: 12px;
    border: 0;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .17);
}

.demo-primary-cta span { color: #99f6e4; font-size: .68rem; }
.demo-secondary-cta { border: 1px solid rgba(15, 118, 110, .25); color: #0f766e; }

.demo-proof-row {
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 30px;
    color: #64748b;
    font-size: .73rem;
    font-weight: 650;
}

.demo-proof-row span { padding-right: 16px; border-right: 1px solid rgba(100, 116, 139, .22); }
.demo-proof-row span:last-child { border-right: 0; }
.demo-proof-row b { display: block; color: #0f172a; font-size: 1.1rem; }

.demo-hero-card--journey {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 22px;
    background: linear-gradient(155deg, #0f172a, #132e36);
    color: #fff;
    box-shadow: 0 32px 80px rgba(15, 23, 42, .24);
}

.demo-hero-card--journey::after {
    position: absolute;
    width: 230px;
    height: 230px;
    right: -90px;
    top: -100px;
    border-radius: 50%;
    background: rgba(45, 212, 191, .11);
    content: "";
}

.demo-journey-head { justify-content: space-between; position: relative; z-index: 1; }
.demo-journey-head span { color: #99f6e4; font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.demo-journey-head b { font-size: .75rem; }
.demo-journey { display: grid; gap: 4px; margin: 24px 0 0; padding: 0; list-style: none; position: relative; z-index: 1; }
.demo-journey li { align-items: flex-start; display: grid; gap: 12px; grid-template-columns: 34px minmax(0, 1fr); padding: 11px 0; border-top: 1px solid rgba(255,255,255,.1); }
.demo-journey i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: rgba(45,212,191,.12); color: #5eead4; font-size: 18px; }
.demo-journey b,.demo-journey small { display: block; }
.demo-journey b { color: #f8fafc; font-size: .79rem; }
.demo-journey small { margin-top: 3px; color: #94a3b8; font-size: .68rem; line-height: 1.4; }

.demo-chapter-section { padding: 30px; border-radius: 22px; }
.demo-section-heading { align-items: end !important; }
.demo-section-heading > div { max-width: 590px; }
.demo-section-heading strong { display: block; margin-top: 5px; color: #0f172a; font-size: clamp(1.5rem, 3vw, 2.4rem) !important; line-height: 1.1; }
.demo-section-heading > p { max-width: 500px; margin: 0; color: #64748b; font-size: .84rem; line-height: 1.6; }
.demo-chapter-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo-chapter-card { display: flex; min-height: 340px; flex-direction: column; padding: 20px; border: 1px solid rgba(100, 116, 139, .18); border-radius: 17px; background: linear-gradient(180deg, #fff, #fbfdff); }
.demo-chapter-card:hover { border-color: rgba(15, 118, 110, .35); box-shadow: 0 20px 50px rgba(15,23,42,.08); transform: translateY(-2px); }
.demo-chapter-card__top { justify-content: space-between; margin-bottom: 18px; }
.demo-chapter-card__top i { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #ecfdf5; color: #0f766e; }
.demo-chapter-card__top span { color: #64748b; font-size: .68rem; font-weight: 750; }
.demo-chapter-card > strong { color: #0f172a; font-size: 1.05rem; }
.demo-chapter-card > p { min-height: 48px; margin: 8px 0 14px; color: #64748b; font-size: .78rem; line-height: 1.55; }
.demo-chapter-card ul { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.demo-chapter-card li { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid rgba(100,116,139,.12); color: #334155; font-size: .72rem; font-weight: 700; }
.demo-chapter-card li span { flex: 0 0 auto; color: #0f766e; font-size: .62rem; }
.demo-chapter-card form { margin-top: auto; }
.demo-chapter-card form button { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; border: 0; border-radius: 11px; padding: 0 13px; background: #f1f5f9; color: #0f172a; font-size: .75rem; font-weight: 850; }
.demo-chapter-card form button:hover { background: #0f766e; color: #fff; }

.demo-personalize { display: grid; gap: 24px; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); padding: 28px; border-radius: 22px; background: linear-gradient(135deg, #ecfdf5, #f8fafc); }
.demo-personalize strong { display: block; margin-top: 5px; color: #0f172a; font-size: 1.45rem; }
.demo-personalize p { margin: 8px 0 0; color: #64748b; font-size: .78rem; }

.demo-rail__title span,.demo-rail__title strong { display: block; }
.demo-rail__title span { color: #0f766e; font-size: .65rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.demo-rail__title strong { margin-top: 3px; color: #0f172a; font-size: .87rem; }
.demo-tour-menu { display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(15,118,110,.18); border-radius: 13px; background: #f8fffd; }
.demo-tour-menu__head { display: flex; justify-content: space-between; }
.demo-tour-menu__head strong { color: #0f172a; font-size: .75rem; }
.demo-tour-menu__head small { color: #64748b; font-size: .63rem; }
.demo-tour-menu button { width: 100%; border: 0; text-align: left; }
.demo-tour-menu__full,.demo-tour-menu__chapters button { gap: 9px; border-radius: 10px !important; padding: 9px !important; }
.demo-tour-menu__full { background: #0f172a !important; color: #fff !important; }
.demo-tour-menu__full i { color: #5eead4; }
.demo-tour-menu__full span,.demo-tour-menu__full small,.demo-tour-menu__chapters span,.demo-tour-menu__chapters small { display: block; }
.demo-tour-menu__full span,.demo-tour-menu__chapters span { font-size: .7rem; font-weight: 800; }
.demo-tour-menu__full small { color: #94a3b8; font-size: .58rem; font-weight: 600; }
.demo-tour-menu__chapters { display: grid; gap: 4px; }
.demo-tour-menu__chapters button { background: transparent; color: #334155; }
.demo-tour-menu__chapters button:hover { background: #ecfdf5; color: #0f766e; }
.demo-tour-menu__chapters i { font-size: 16px; }
.demo-tour-menu__chapters small { color: #94a3b8; font-size: .56rem; font-weight: 600; }

.demo-command-header__actions { flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.demo-command-header__actions button,.demo-command-header__actions a { display: inline-flex; min-height: 38px; align-items: center; border-radius: 10px; padding: 0 13px; font-size: .72rem; font-weight: 800; text-decoration: none; }
.demo-command-header__actions button { border: 0; background: #0f172a; color: #fff; }
.demo-command-header__actions a { border: 1px solid rgba(15,118,110,.25); color: #0f766e; }
.demo-session-pill span { display: block; margin-top: 5px; color: #64748b; font-size: .62rem; }

.demo-chapter-block { margin: 16px 0; padding: 18px; border: 1px solid rgba(100,116,139,.18); border-radius: 17px; background: rgba(255,255,255,.72); }
.demo-chapter-block > header { display: grid; gap: 14px; grid-template-columns: minmax(220px, .8fr) minmax(260px, 1.2fr) auto; align-items: center; margin-bottom: 14px; }
.demo-chapter-block > header > div { gap: 10px; }
.demo-chapter-block > header i { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #ecfdf5; color: #0f766e; }
.demo-chapter-block > header small,.demo-chapter-block > header strong { display: block; }
.demo-chapter-block > header small { color: #64748b; font-size: .62rem; }
.demo-chapter-block > header strong { color: #0f172a; font-size: .92rem; }
.demo-chapter-block > header p { margin: 0; color: #64748b; font-size: .75rem; line-height: 1.5; }
.demo-chapter-block > header button { min-height: 36px; border: 1px solid rgba(15,118,110,.25); border-radius: 10px; padding: 0 11px; background: #fff; color: #0f766e; font-size: .67rem; font-weight: 850; }

.demo-step { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.demo-step.is-tour-focus { position: relative; z-index: 1002; border-color: #2dd4bf; box-shadow: 0 0 0 5px rgba(45,212,191,.2), 0 25px 70px rgba(15,23,42,.22); transform: translateY(-3px); }

.demo-tour-layer[hidden] { display: none !important; }
.demo-tour-layer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.demo-tour-layer__scrim { position: absolute; inset: 0; border: 0; background: rgba(2,6,23,.52); backdrop-filter: blur(2px); pointer-events: auto; }
.demo-tour-guide { position: absolute; z-index: 1003; width: min(430px, calc(100vw - 32px)); max-height: calc(100vh - 32px); right: 16px; top: 16px; overflow: auto; padding: 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 19px; background: #0f172a; color: #fff; box-shadow: 0 30px 100px rgba(2,6,23,.45); pointer-events: auto; }
.demo-tour-guide__top,.demo-tour-guide__meta,.demo-tour-guide__actions { align-items: center; display: flex; }
.demo-tour-guide__top { justify-content: space-between; }
.demo-tour-guide__top > span { color: #5eead4; font-size: .65rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.demo-tour-guide__top > button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font-size: 1.2rem; }
.demo-tour-guide__progress { height: 5px; overflow: hidden; margin: 16px 0; border-radius: 999px; background: rgba(148,163,184,.18); }
.demo-tour-guide__progress i { display: block; height: 100%; border-radius: inherit; background: #2dd4bf; transition: width .22s ease; }
.demo-tour-guide__meta { justify-content: space-between; }
.demo-tour-guide__meta span { color: #94a3b8; font-size: .68rem; }
.demo-tour-guide__meta b { padding: 5px 8px; border-radius: 999px; background: rgba(45,212,191,.12); color: #99f6e4; font-size: .63rem; }
.demo-tour-guide h2 { margin: 14px 0 8px; color: #fff; font-size: 1.5rem; letter-spacing: -.025em; }
.demo-tour-guide > p { color: #cbd5e1; font-size: .82rem; line-height: 1.65; }
.demo-tour-guide__fields { display: grid; gap: 7px; margin: 14px 0; }
.demo-tour-guide__fields div { padding: 10px; border: 1px solid rgba(148,163,184,.14); border-radius: 10px; background: rgba(255,255,255,.035); }
.demo-tour-guide__fields small,.demo-tour-guide__fields span { display: block; }
.demo-tour-guide__fields small { color: #5eead4; font-size: .6rem; font-weight: 850; text-transform: uppercase; }
.demo-tour-guide__fields span { margin-top: 3px; color: #cbd5e1; font-size: .72rem; }
.demo-tour-guide__outcome { padding: 12px; border-radius: 11px; background: rgba(45,212,191,.09); }
.demo-tour-guide__outcome small,.demo-tour-guide__outcome strong { display: block; }
.demo-tour-guide__outcome small { color: #5eead4; font-size: .6rem; font-weight: 850; text-transform: uppercase; }
.demo-tour-guide__outcome strong { margin-top: 4px; color: #ecfeff; font-size: .76rem; line-height: 1.5; }
.demo-tour-guide__actions { flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.demo-tour-guide__actions button { min-height: 36px; border: 1px solid rgba(148,163,184,.2); border-radius: 9px; padding: 0 10px; background: rgba(255,255,255,.05); color: #e2e8f0; font-size: .67rem; font-weight: 800; }
.demo-tour-guide__actions button.is-primary { margin-left: auto; border-color: #2dd4bf; background: #2dd4bf; color: #042f2e; }
.demo-tour-guide__actions button:disabled { opacity: .45; }
.demo-tour-guide__hint { display: block; margin-top: 12px; color: #64748b; font-size: .61rem; text-align: center; }

@media (max-width: 1100px) {
    .demo-chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .demo-hero--product { grid-template-columns: 1fr; padding: 55px 0; }
    .demo-hero-card--journey { max-width: 680px; }
}

@media (max-width: 820px) {
    .demo-hub { grid-template-columns: 1fr; }
    .demo-rail { position: static; }
    .demo-chapter-block > header { grid-template-columns: 1fr; }
    .demo-personalize { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .demo-shell { padding: 18px; }
    .demo-topbar > div > a:first-child { display: none; }
    .demo-hero--product h1 { font-size: clamp(2.6rem, 13vw, 4rem); }
    .demo-proof-row { display: grid; grid-template-columns: 1fr 1fr; }
    .demo-proof-row span { border-right: 0; }
    .demo-chapter-grid { grid-template-columns: 1fr; }
    .demo-chapter-section { padding: 18px; }
    .demo-section-heading { align-items: flex-start !important; }
    .demo-tour-guide { top: auto; bottom: 10px; right: 10px; width: calc(100vw - 20px); max-height: 78vh; }
}

.demo-autofill-result {
    background: #f0fdfa;
    border: 1px dashed rgba(15, 118, 110, .35);
    border-radius: 8px;
    color: var(--p14-text);
    display: none;
    margin-top: 10px;
    padding: 10px;
}

.demo-autofill-result.is-visible {
    display: block;
}

.demo-timeline {
    display: grid;
    gap: 8px;
}

.demo-timeline div {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--p14-line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    padding: 10px;
}

.demo-timeline span,
.demo-timeline small {
    color: var(--p14-muted);
}

@media (max-width: 900px) {
    .demo-hero,
    .demo-hub {
        grid-template-columns: 1fr;
    }

    .demo-rail {
        position: static;
    }
}
