/* ============================================================
   THE REGISTER — one window, two screens.

   First a person and Claude work out a process together, in the
   same window the hero uses. Then the window switches to the
   register that process now lives in — Askpilot's Workflows
   screen — and the new row arrives. That is the whole claim in
   one motion: you describe how your company does something, and
   it becomes part of the company's record.

   The chat is step markup built and animated by js/ai-setup.js.
   Everything here is the shell, the screen swap, and the table.
   ============================================================ */

.reg {
    padding: 96px 0 104px;
    background: var(--cream);
    border-top: 1px solid var(--line);
}
.reg .sec-eyebrow { color: var(--brand-magenta); }

/* the macOS shell is .step-win; it only needs a width and a place */
.reg-win { max-width: 1040px; margin: 56px auto 0; }

/* fixed height so the page never moves as the screen changes */
.reg-stage { position: relative; height: 560px; }

/* The screen changes; it does not dissolve. Two opaque screens fading
   through each other ghost, so the swap is instant and only the arriving
   contents ease in over the new screen's own white. */
.reg-view {
    position: absolute; inset: 0; z-index: 1;
    background: #fff;
    visibility: hidden;
    display: flex; flex-direction: column;
}
.reg-win[data-scene="chat"]  .reg-view--chat,
.reg-win[data-scene="table"] .reg-view--table { visibility: visible; z-index: 2; }
.reg-win[data-scene="chat"]  .reg-view--chat  > *,
.reg-win[data-scene="table"] .reg-view--table > * { animation: reg-view-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes reg-view-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* the chat fills the screen; .step-win already strips its own frame */
.reg-view--chat .ai-window { flex: 1; min-height: 0; height: auto; }

/* --- the register screen ---
   Askpilot's Workflows list, on the same shell as the Sources screen in
   the Integrations tab: the sidebar, the search, the New button and the
   table are the .sc-* block in css/how-it-works.css. Only the columns
   are this screen's own. The window shell carries the frame. */
.reg-view--table .sc-app { flex: 1; min-height: 0; height: auto; border-radius: 0; }
.reg-app .sc-view { padding: 24px 28px 0; }
.reg-app .sc-thead, .reg-app .sc-row {
    grid-template-columns: minmax(0, 1fr) 250px 140px;
    margin: 0 -12px; padding-left: 16px; padding-right: 16px;
}
.reg-app .sc-row { transition: background 1.1s ease; }
.reg-app .sc-row.is-hot { background: #F3F5FF; transition: background 0.18s ease; }
.reg-app .sc-row-name { min-width: 0; color: var(--sc-ink); }
.reg-app .sc-row-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-dept {
    flex: none; padding: 1.5px 6px; border-radius: 999px;
    background: #F1F1F4; color: #6B7280;
    font-style: normal; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.reg-trig { display: flex; align-items: center; gap: 8px; min-width: 0; color: #4B5563; }
.reg-trig img { flex: none; width: 15px; height: 15px; border-radius: 3px; object-fit: contain; }
.reg-trig b { font-weight: 600; color: var(--sc-ink); white-space: nowrap; }
.reg-trig em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-trig em::before { content: "\00b7"; margin: 0 5px 0 1px; color: #C9CBD2; }
.reg-own {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    white-space: nowrap; color: #4B5563;
}
.reg-av {
    flex: none; width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center;
    background: #EEF0FF; color: #4C4CE0;
    font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: 0.02em;
}

/* --- the row that the conversation produced ---
   Hidden only once the driver is running, so with no script the register
   stands complete. It arrives at the top, lit for a beat, and the rows
   below it make room rather than jump. */
.reg-win.is-live .reg-row--new { display: none; }
.reg-win.is-live .reg-row--new.is-in {
    display: grid;
    animation: reg-arrive 0.62s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes reg-arrive {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
}
/* the seed is for readers, not viewers */
.reg-seed { display: none; }

/* the shell goes to a column at 980 (the sidebar becomes a strip); the
   main pane then fills what is left of the fixed stage */
@media (max-width: 980px) {
    .reg-app .sc-main { flex: 1; height: auto; min-height: 0; }
    .reg-app .sc-view { padding: 18px 16px 0; }
    .reg-app .sc-thead, .reg-app .sc-row {
        grid-template-columns: minmax(0, 1fr) 250px;
        margin: 0 -8px; padding-left: 10px; padding-right: 10px;
    }
    .reg-app .sc-thead span:last-child, .reg-own { display: none; }
}
@media (max-width: 640px) {
    .reg { padding: 64px 0 72px; }
    .reg-win { margin-top: 40px; }
    .reg-stage { height: 520px; }
    .reg-dept { display: none; }
    /* the icon already says which tool; the event is what matters */
    .reg-app .sc-thead, .reg-app .sc-row { grid-template-columns: minmax(0, 1fr) 140px; }
    .reg-trig b, .reg-trig em::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .reg-win[data-scene] .reg-view > * { animation: none; }
    .reg-win.is-live .reg-row--new { display: grid; animation: none; }
}
