/* ===== App replica - mirrors the live workspace =====
   Laid out at natural app width (1060px), then scaled to fit its
   column by the scaler script - like a screenshot, but crisp. */
.app-scale { position: relative; overflow: hidden; border-radius: 14px; box-shadow: var(--shadow-pop); }
/* Sits in .app-scale, not .bark-app - .bark-app carries the scale
   transform, so a button inside it would be scaled down with it and
   become unhittable at small card widths. */
/* Look and size live in page.css, on .slot-btn and .zoom-btn together, so the
   film buttons and this one cannot drift apart. What stays here is the one
   thing that is only true of the replica: it has no zoom worth opening on a
   phone. The old note about a solid --ink background still applies and moved
   with the rule: white on the replica's own near-white chrome measured 1.21:1
   against the border, below WCAG 1.4.11's 3:1 for a control. */

/* Below 768px the modal's own horizontal padding outweighs what it gains
   over the card - at 375px the replica renders smaller open (273px) than
   it does inline in the card (309px), and no viewport this narrow reaches
   a legible scale of a 1060px layout regardless. Hiding the button avoids
   a "zoom" that shrinks the image. */
@media (max-width: 767px) {
    .zoom-btn { display: none; }
}
.bark-app {
    border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden; background: #fff;
    text-align: left;
    width: 1060px; transform-origin: top left;
}
.ba-top { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #eceff2; }
.ba-title { font-size: 0.92rem; font-weight: 600; color: #1c2b36; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-share { font-size: 0.72rem; font-weight: 600; color: #33454f; background: #f1f3f5; border-radius: 8px; padding: 6px 12px; }
.ba-saved { font-size: 0.72rem; color: #16a34a; font-weight: 500; white-space: nowrap; }
.ba-body { display: flex; height: 560px; }
.ba-rail { width: 52px; border-right: 1px solid #eceff2; display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 6px; flex-shrink: 0; }
.ba-rail > img { width: 24px; height: auto; filter: brightness(0); opacity: 0.85; margin-bottom: 10px; }
.ba-ric { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #8a98a3; }
.ba-ric.on { background: #16304a; color: #fff; }
.ba-avatar { margin-top: auto; width: 26px; height: 26px; border-radius: 50%; background: #16304a; color: #fff; font-size: 0.58rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ba-main { flex: 1; min-width: 0; background: #f4f5f7; padding: 14px 22px 0; }
.ba-pill { margin: 0 auto 14px; width: max-content; background: #fff; border: 1px solid #e6eaee; border-radius: 10px; padding: 3px; display: flex; gap: 2px; box-shadow: 0 1px 2px rgba(11,28,38,0.05); }
.ba-pill span { font-size: 0.72rem; font-weight: 600; color: #5a6b76; padding: 5px 14px; border-radius: 7px; }
.ba-pill span.on { background: #f1f3f5; color: #16304a; }
.ba-report { background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 1px 3px rgba(11,28,38,0.06); padding: 22px 30px; height: calc(100% - 51px); overflow: hidden; }
.ba-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.ba-btn { font-size: 0.68rem; font-weight: 600; color: #33454f; border: 1px solid #e6eaee; border-radius: 8px; padding: 5px 12px; }
.ba-rtitle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef1f4; padding-bottom: 12px; margin-bottom: 6px; }
.ba-rtitle { font-size: 1.12rem; font-weight: 700; color: #16304a; letter-spacing: -0.015em; }
.ba-validated { font-size: 0.68rem; font-weight: 600; color: #15803d; background: #e8f7ee; border-radius: 7px; padding: 3px 10px; white-space: nowrap; }
.ba-h { font-size: 0.84rem; font-weight: 700; color: #16304a; margin: 14px 0 7px; }
.ba-p { font-size: 0.76rem; line-height: 1.75; color: #3d4f5a; margin-bottom: 9px; }
.ba-chip { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; background: #f1f3f5; border: 1px solid #e6eaee; border-radius: 6px; padding: 1px 7px; color: #33454f; white-space: nowrap; }
.ba-chat { width: 330px; border-left: 1px solid #eceff2; display: flex; flex-direction: column; background: #fff; flex-shrink: 0; }
.ba-chead { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; color: #5a6b76; padding: 12px 16px 8px; }
.ba-cbody { flex: 1; overflow: hidden; padding: 0 16px; font-size: 0.68rem; color: #33454f; }
.ba-clabel { font-weight: 700; color: #16304a; margin-bottom: 6px; }
.ba-table { width: 100%; border: 1px solid #eceff2; border-radius: 6px; margin-bottom: 10px; font-size: 0.6rem; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.ba-table th { text-align: left; background: #f7f8f9; padding: 5px 8px; font-weight: 600; color: #5a6b76; border-bottom: 1px solid #eceff2; }
.ba-table td { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid #f1f3f5; line-height: 1.5; }
.ba-table tr:last-child td { border-bottom: none; }
.ba-code { font-family: 'JetBrains Mono', monospace; font-size: 0.55rem; background: #f1f3f5; border-radius: 4px; padding: 0 4px; }
.ba-tool { display: flex; align-items: center; gap: 7px; font-size: 0.64rem; color: #5a6b76; margin: 8px 0; }
.ba-tool::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #1c2b36; flex-shrink: 0; }
.ba-uname { text-align: right; font-size: 0.58rem; color: #9aa8b1; margin: 4px 0 3px; }
.ba-user {
    margin-left: auto; width: max-content; max-width: 92%;
    background: #1c2b36; color: #fff; border-radius: 12px;
    padding: 7px 12px; font-size: 0.68rem; line-height: 1.5; margin-bottom: 10px;
}
.ba-tcall { display: flex; align-items: center; gap: 7px; font-size: 0.64rem; font-weight: 600; color: #5a6b76; margin: 9px 0 3px; }
.ba-tcall::before { content: '›'; color: #9aa8b1; font-weight: 700; }
.ba-ol { margin: 4px 0 0 14px; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.ba-va {
    border: 1px solid #bde3c8; background: #f0faf3; border-radius: 9px;
    padding: 9px 11px; margin-top: 10px; font-size: 0.66rem; line-height: 1.55; color: #33454f;
}
.ba-va-h { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.07em; color: #15803d; margin-bottom: 4px; }
.ba-static .ba-st, .ba-static .ba-p, .ba-static .ba-user, .ba-static .ba-tcall,
.ba-static .ba-agentline, .ba-static .ba-va { opacity: 1; transform: none; }
/* Inventory replica - frame height matches the Research replica */
.iv-app { height: 611px; }
.iv-split { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.iv-split b { font-size: 0.66rem; color: #2563eb; font-weight: 600; white-space: nowrap; }
.iv-split span em, .iv-label > em { text-transform: none; letter-spacing: 0; font-weight: 400; }
.iv-top { display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid #eceff2; background: #fff; }
.iv-top > img { width: 22px; height: auto; filter: brightness(0); opacity: 0.85; }
.iv-tab { font-size: 0.78rem; font-weight: 600; color: #33454f; }
.iv-tab.on { background: #eef1f4; border-radius: 8px; padding: 5px 12px; color: #16304a; }
.iv-tab.dim { color: #9aa8b1; }
.iv-search { margin-left: auto; font-size: 0.72rem; color: #9aa8b1; border: 1px solid #e6eaee; border-radius: 9px; padding: 6px 14px; min-width: 180px; }
.iv-bank { font-size: 0.74rem; font-weight: 600; color: #16304a; border: 1px solid #e6eaee; border-radius: 9px; padding: 6px 12px; }
.iv-main { background: #f4f5f7; padding: 20px 26px 8px; }
.iv-title { font-family: Georgia, 'Times New Roman', serif; font-size: 1.6rem; color: #16304a; margin-bottom: 4px; }
.iv-desc { font-size: 0.74rem; color: #5a6b76; line-height: 1.55; margin-bottom: 12px; max-width: 60ch; }
.iv-notice { background: #fff; border: 1px solid #e8e6e1; border-radius: 10px; padding: 10px 14px; font-size: 0.72rem; color: #5a6b76; line-height: 1.55; margin-bottom: 12px; }
.iv-notice strong { color: #16304a; }
.iv-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5a6b76; margin-bottom: 6px; }
.iv-label em { font-style: normal; color: #9aa8b1; margin-left: 4px; }
.iv-row {
    background: #fff; border: 1px solid #e8e6e1; border-radius: 10px;
    padding: 9px 14px; margin-bottom: 6px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.iv-row strong { display: block; font-size: 0.78rem; color: #16304a; }
.iv-row div span { font-size: 0.64rem; color: #7e95a1; }
.iv-row > em { font-style: normal; font-size: 0.66rem; color: #7e95a1; white-space: nowrap; }
.iv-row > em b { color: #16304a; }
.ba-st { opacity: 0; transform: translateY(5px); transition: opacity 0.45s ease, transform 0.45s ease; }
.ba-st.on { opacity: 1; transform: none; }
.ba-validated { opacity: 0; transition: opacity 0.5s ease; }
.ba-validated.on { opacity: 1; }
.ba-agentline { display: flex; gap: 8px; margin: 8px 0; line-height: 1.55; }
.ba-agentline img { width: 13px; height: 13px; filter: brightness(0); opacity: 0.7; flex-shrink: 0; margin-top: 2px; }
.ba-ul { list-style: none; margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.ba-ul li { padding-left: 13px; position: relative; line-height: 1.5; }
.ba-ul li::before { content: '•'; position: absolute; left: 2px; }
.ba-inputwrap { padding: 12px 14px; }
.ba-input { border: 1px solid #e6eaee; border-radius: 12px; padding: 10px 12px 8px; }
.ba-input-ph { font-size: 0.76rem; color: #9aa8b1; margin-bottom: 10px; }
.ba-input-row { display: flex; align-items: center; gap: 8px; font-size: 0.64rem; color: #5a6b76; }
.ba-ctx { color: #16a34a; font-weight: 600; }
.ba-send { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; background: #e6eaee; display: flex; align-items: center; justify-content: center; color: #8a98a3; }
@media (max-width: 900px) {
    .ba-chat, .ba-rail { display: none; }
    .ba-body { height: 460px; }
}

/* ===== Welcome-flow mocks (Research & Build media slots) =====
   Recreates the app's Welcome panels: real mini-UI per step,
   revealed one step at a time in a loop. */
.wflow {
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-soft); padding: 18px 18px 14px;
    overflow: hidden;
}
.wflow-stage { position: relative; min-height: 315px; }
.wflow-panel {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: center;
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}
.wflow-panel.on { opacity: 1; transform: none; }
.wflow-ph { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wflow-num {
    width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
    background: var(--accent); color: white;
    font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
}
.wflow-pt { font-size: 0.84rem; font-weight: 600; letter-spacing: -0.01em; }
.wcard {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-card);
}
.wq { font-size: 0.8rem; color: var(--ink); line-height: 1.45; padding-bottom: 10px; }
.wrow {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--border-soft); padding-top: 9px; gap: 8px;
}
.wrow-meta { display: flex; align-items: center; gap: 8px; font-size: 0.62rem; color: var(--text-3); }
.wrow-meta strong { color: var(--text-2); font-weight: 600; }
.wbar { width: 34px; height: 3px; border-radius: 3px; background: var(--border); }
.wsend {
    width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
    background: var(--accent); display: flex; align-items: center; justify-content: center;
}
.weyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56rem; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-2); margin-bottom: 6px;
}
.wtext { font-size: 0.72rem; color: var(--ink); line-height: 1.5; margin-bottom: 8px; }
.wbullets { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.wbullets li { font-size: 0.7rem; color: var(--text-2); padding-left: 12px; position: relative; line-height: 1.4; }
.wbullets li::before { content: '•'; position: absolute; left: 0; color: var(--text-3); }
.wfoot { font-size: 0.64rem; color: var(--text-3); font-style: italic; }
.wprop { border-left: 3px solid var(--accent); }
.wprop .weyebrow { color: var(--accent-dark); }
.wlabel {
    font-size: 0.58rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-2); margin: 8px 0 3px;
}
.wlabel:first-of-type { margin-top: 0; }
.wtag {
    font-family: 'JetBrains Mono', monospace; font-size: 0.5rem;
    text-transform: uppercase; letter-spacing: 0.06em;
    background: var(--bg-soft); color: var(--text-3);
    border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: middle;
}
.wrows { display: flex; flex-direction: column; gap: 2px; }
.wrows div { display: flex; gap: 8px; font-size: 0.66rem; color: var(--text-2); line-height: 1.45; }
.wrows span:first-child {
    font-family: 'JetBrains Mono', monospace; color: var(--text-3);
    min-width: 26px; flex-shrink: 0; font-size: 0.6rem; padding-top: 1px;
}
.wpills { display: flex; gap: 6px; margin-top: 10px; }
.wpill {
    font-size: 0.64rem; font-weight: 600; padding: 4px 12px; border-radius: 6px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.wpill-primary { background: var(--accent); border-color: var(--accent); color: white; }
.wtiles { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.wtile {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; min-height: 96px; padding: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; box-shadow: var(--shadow-card);
}
.wtile svg { color: var(--text-2); }
.wtile span { font-size: 0.62rem; font-weight: 600; color: var(--text-2); text-align: center; }
.wcheck {
    position: absolute; right: -8px; bottom: -8px;
    width: 26px; height: 26px; border-radius: 50%;
    background: #16a34a; color: white;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-soft);
}
.wchecks { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.wchecks li {
    font-size: 0.7rem; color: var(--text-2);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.wchecks li::after { content: '✓'; color: #16a34a; font-weight: 700; font-size: 0.7rem; }
.wworking { font-size: 0.66rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.wworking::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.wplan { display: flex; flex-direction: column; gap: 6px; }
.wnode {
    background: var(--surface); border: 1px solid var(--border);
    border-left: 3px solid var(--accent); border-radius: 8px;
    padding: 7px 10px; box-shadow: var(--shadow-card);
}
.wnode-k {
    font-family: 'JetBrains Mono', monospace; font-size: 0.52rem; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-dark);
}
.wnode-t { font-size: 0.72rem; font-weight: 600; color: var(--ink); }
.wnode-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wflow-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.wflow-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--border); transition: background 0.3s ease;
}
.wflow-dots span.on { background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
    .wflow-panel { transition: none; }
}
