/* Converged Conversation Stack — landing page (index.php). Markup: lib/_conversation_stack.php.
   Behaviour: js/conversation_stack.js. Without JS the row is simply a static graphic.
   Palette: #E46C47 orange, #5DCAA5 teal, #F0997B peach, #B4B2A9 grey on #1E2235. */

.cs {
    --cs-orange: #E46C47;
    --cs-teal: #5DCAA5;
    --cs-peach: #F0997B;
    --cs-grey: #B4B2A9;
    --cs-ink: #F5F3EF;
    --cs-card: #252d48;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 8px;
    box-sizing: border-box;
    background: #1E2235;
    color: var(--cs-ink);
    font-family: 'Poppins', sans-serif;
    text-align: left;           /* the landing page wraps sections in centred containers */
}
.cs *, .cs *::before, .cs *::after { box-sizing: border-box; }

.cs-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cs-pill {
    padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.4;
    background: rgba(228,108,71,0.08); border: 1px solid rgba(228,108,71,0.22); color: rgba(228,108,71,0.95);
}
.cs-hint { margin: 0; min-height: 22px; font-size: 14px; line-height: 1.5; color: rgba(245,243,239,0.6); max-width: 620px; }

/* overflow-y hidden: the 14px slide-up of the medallions would otherwise flash a vertical scrollbar;
   the bottom padding gives the slide-up room so the labels are not clipped while they settle. */
.cs-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 20px; margin-top: 18px; }
.cs-track { min-width: 700px; padding: 0 6px; display: flex; flex-direction: column; gap: 10px; }   /* side padding: the pulse ring and active scale overshoot the end columns */

/* group labels: 9 columns, same grid as the nodes */
.cs-groups {
    display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0 8px;
    font-size: 10px; letter-spacing: 1.5px; font-weight: 500; color: rgba(228,108,71,0.6); text-align: center;
}
.cs-group { border-bottom: 1px solid rgba(228,108,71,0.2); padding-bottom: 4px; }
.cs-group-1 { grid-column: 1 / 2; }
.cs-group-2 { grid-column: 2 / 5; }
.cs-group-5 { grid-column: 5 / 8; }
.cs-group-8 { grid-column: 8 / 9; }      /* MEETINGS: Recording only; AI voice (9) is outside any group */

.cs-rail { position: relative; }
.cs-line { position: absolute; left: 5.5556%; right: 5.5556%; top: 43px; height: 2px; background: rgba(228,108,71,0.18); }
.cs-line-done { right: auto; width: 0; background: var(--cs-orange); transition: width .5s ease; }

.cs-nodes { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 0 8px; }
.cs-node {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 10px;
    border-radius: 14px; text-align: center; background: transparent; outline: none;
    transition: opacity .5s ease, transform .5s ease, background .25s;
}
.cs-tone-teal   { --c: var(--cs-teal);   --cg: rgba(93,202,165,0.22); }
.cs-tone-peach  { --c: var(--cs-peach);  --cg: rgba(240,153,123,0.22); }
.cs-tone-grey   { --c: var(--cs-grey);   --cg: rgba(180,178,169,0.22); }
.cs-tone-orange { --c: var(--cs-orange); --cg: rgba(228,108,71,0.22); }

.cs-medal { position: relative; width: 56px; height: 56px; margin-top: 8px; }
.cs-disc {
    position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--cs-card); border: 2px solid var(--c); transition: transform .25s, box-shadow .25s, background .25s;
}
.cs-disc svg { stroke: var(--c); }
.cs-node-last .cs-disc { background: var(--cs-orange); }
.cs-node-last .cs-disc svg { stroke: #fff; }
.cs-pulse { display: none; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); }

.cs-label { font-size: 12px; font-weight: 500; color: var(--cs-ink); }
.cs-node-last .cs-label { color: var(--cs-orange); }
.cs-sub { font-size: 10px; color: rgba(245,243,239,0.45); }
.cs-out { font-size: 10px; color: rgba(245,243,239,0.35); }
.cs-node-last .cs-out { color: var(--cs-teal); }

.cs-btn {
    font-family: inherit; cursor: pointer; border-radius: 999px; font-size: 13px; font-weight: 500; line-height: 1.2;
    padding: 10px 22px; border: 1px solid transparent; transition: background .2s, border-color .2s, color .2s;
}
.cs-btn-primary { background: var(--cs-orange); color: #fff; }
.cs-btn-primary:hover { background: #ee7d5a; }
.cs-btn-ghost { background: transparent; border-color: rgba(245,243,239,0.25); color: rgba(245,243,239,0.8); padding: 9px 20px; }
.cs-btn-ghost:hover { border-color: var(--cs-ink); }
.cs-btn-outline { display: inline-flex; align-items: center; background: transparent; border-color: var(--cs-orange); color: var(--cs-orange); padding: 9px 20px; text-decoration: none; text-align: center; }
.cs-btn-outline:hover { background: rgba(228,108,71,0.12); color: var(--cs-orange); }
.cs-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 0; }
.cs-controls[hidden], .cs-btn[hidden], .cs-panels[hidden] { display: none; }

/* ---- JavaScript on: interactive states ------------------------------------------------ */
.cs-js .cs-node { cursor: pointer; opacity: 0; transform: translateY(14px); }
.cs-js .cs-node.cs-in { opacity: 1; transform: none; }
.cs-js .cs-node:hover, .cs-js .cs-node:focus-visible { background: rgba(255,255,255,0.05); }
.cs-js .cs-node.cs-on { background: rgba(255,255,255,0.07); }
.cs-js .cs-node.cs-on .cs-disc { transform: scale(1.12); box-shadow: 0 0 0 5px var(--cg); }
.cs-js .cs-node.cs-seen .cs-disc { background: var(--c); }
.cs-js .cs-node.cs-seen .cs-disc svg { stroke: #fff; }
.cs-js .cs-node.cs-seen .cs-out, .cs-js .cs-node.cs-on .cs-out { color: var(--cs-teal); }
.cs-js .cs-node.cs-pulsing .cs-pulse { display: block; animation: cs-pulse 2.2s ease-out infinite; animation-delay: var(--cs-delay, 0s); }
@keyframes cs-pulse { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
@keyframes cs-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Detail card + running record ------------------------------------------------------ */
.cs-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; margin-top: 24px; }
.cs-card { background: var(--cs-card); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 20px; min-height: 360px; }
.cs-card-empty { margin: auto; text-align: center; color: rgba(245,243,239,0.5); font-size: 14px; line-height: 1.6; max-width: 300px; }
.cs-detail { display: flex; flex-direction: column; gap: 20px; animation: cs-rise .4s ease; }
.cs-title { display: flex; align-items: center; gap: 12px; }
.cs-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.cs-title-label { font-size: 20px; font-weight: 600; }
.cs-title-step { font-size: 12px; color: rgba(245,243,239,0.5); }
.cs-block { display: flex; flex-direction: column; gap: 6px; }
.cs-kicker { font-size: 11px; letter-spacing: 1.5px; color: rgba(245,243,239,0.45); }
.cs-kicker-orange { color: var(--cs-orange); }
.cs-kicker-teal { color: var(--cs-teal); }
.cs-text { font-size: 14px; line-height: 1.6; color: rgba(245,243,239,0.8); }
.cs-text-strong { color: var(--cs-ink); }
.cs-signal { align-self: flex-start; margin-top: 4px; padding: 4px 12px; border-radius: 999px; font-size: 12px; background: rgba(93,202,165,0.12); color: var(--cs-teal); }
.cs-turns { gap: 8px; }
.cs-turn { display: grid; grid-template-columns: 78px 1fr; gap: 12px; font-size: 13px; line-height: 1.5; }
.cs-who { font-weight: 500; color: var(--cs-peach); }
.cs-who-customer { color: var(--cs-ink); }
.cs-next { align-self: flex-start; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--cs-orange); background: none; border: 0; padding: 0; cursor: pointer; }
.cs-next:hover { color: var(--cs-peach); }

.cs-record { background: rgba(255,255,255,0.03); border: 1px solid rgba(245,243,239,0.1); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.cs-record-head { display: flex; justify-content: space-between; align-items: baseline; }
.cs-progress { font-size: 12px; color: var(--cs-teal); }
.cs-row { display: grid; grid-template-columns: 8px 1fr; gap: 14px; opacity: .35; transition: opacity .5s ease; }
.cs-row.cs-row-seen { opacity: 1; }
.cs-row-bar { width: 8px; border-radius: 4px; background: rgba(245,243,239,0.12); }
.cs-row-seen .cs-row-bar { background: var(--c); }
.cs-row-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cs-row-label { font-size: 11px; font-weight: 500; color: rgba(245,243,239,0.5); }
.cs-row-seen .cs-row-label { color: var(--c); }
.cs-row-text { font-size: 13px; line-height: 1.5; color: rgba(245,243,239,0.85); }
.cs-done { margin-top: 6px; padding: 14px 16px; border-radius: 10px; background: rgba(93,202,165,0.1); color: var(--cs-teal); font-size: 14px; line-height: 1.5; animation: cs-rise .4s ease; }
.cs-done[hidden] { display: none; }

/* narrow screens: the empty "Select a step" card shrinks to its text until a node is selected */
@media (max-width: 599px) {
    .cs-card.cs-card-idle { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cs-js .cs-node, .cs-line-done, .cs-disc, .cs-row { transition: none; }
    .cs-js .cs-node.cs-pulsing .cs-pulse, .cs-detail, .cs-done { animation: none; }
}
