/* "How a Report Gets Built" (GRW-20): clickable steps and the four panels beside them.
   The fx-* panels are Radiant's own drawings of a notebook, a lakehouse and a semantic model.
   They keep their own light palette, so nothing here reads the page theme tokens. */

#built .built { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px; }

/* ---------- steps as a vertical tab list ---------- */
#built .steps { list-style: none; margin: 0; padding: 0; }
#built .steps li { display: block; padding: 0; transition: background-color .18s ease-out, border-color .18s ease-out, box-shadow .18s ease-out; }
#built .step-btn {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 6px; width: 100%; padding: 16px 18px;
  margin: 0; border: 0; border-radius: 11px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#built .step-btn > div { display: block; min-width: 0; }
#built .steps li:not(.is-on):hover { background: rgba(255, 255, 255, .5); border-color: rgba(23, 44, 45, .16); }
#built .step-btn:focus-visible { outline: 2px solid var(--rds-forest); outline-offset: 2px; }
#built .steps li.is-on .step-btn { cursor: default; }

/* ---------- frame ---------- */
#built .frame-bar { padding-right: 16px; }
#built .built-kind { flex: none; font-size: .74rem; font-weight: 600; color: #5A6866; letter-spacing: .01em; white-space: nowrap; }
#built .built-stage { position: relative; background: #fff; }
#built .built-panel[hidden] { display: none; }
#built .built-panel.is-in { animation: built-in .22s ease-out; }
@keyframes built-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- shared panel look ---------- */
.fx {
  --fx-ink: #242424; --fx-ink-2: #424242; --fx-ink-3: #616161; --fx-ink-4: #707070;
  --fx-bg: #ffffff; --fx-bg-2: #fafafa; --fx-bg-3: #f5f5f5; --fx-sel: #ebebeb;
  --fx-line: #d1d1d1; --fx-line-2: #e0e0e0; --fx-line-3: #f0f0f0;
  --fx-green: #117865; --fx-green-soft: #e3f3ef; --fx-blue: #0f6cbd;
  color-scheme: light;
  display: flex; flex-direction: column; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--fx-bg); color: var(--fx-ink);
  font: 400 12px/16px 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
  letter-spacing: 0; text-align: left;
}
.fx *, .fx *::before, .fx *::after { box-sizing: border-box; }
.fx p, .fx ul, .fx ol, .fx pre, .fx h4 { margin: 0; padding: 0; }
.fx ul { list-style: none; }
.fx p { color: inherit; font-size: inherit; }
.fx button { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
.fx button:focus-visible { outline: 2px solid var(--fx-blue); outline-offset: -2px; }
.fx svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.fx-ribbon {
  flex: none; display: flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px;
  background: var(--fx-bg); border-bottom: 1px solid var(--fx-line-2); color: var(--fx-ink-2); white-space: nowrap; overflow: hidden;
}
.fx-ribbon-item { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 4px; }
.fx-ribbon-sep { flex: none; width: 1px; height: 18px; margin: 0 4px; background: var(--fx-line-2); }
.fx-ribbon-end { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--fx-ink-3); }
.fx-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border: 1px solid var(--fx-line); border-radius: 4px; background: var(--fx-bg); color: var(--fx-ink-2); }
.fx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fx-green); }
.fx-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--fx-green); border-radius: 4px;
  background: var(--fx-green); color: #fff !important; font-weight: 600 !important; cursor: pointer;
}
.fx-btn:hover { background: #0e6455; }
.fx-btn svg { fill: currentColor; stroke: none; }
.fx-pane-title { font-size: 14px !important; line-height: 20px; font-weight: 600; color: var(--fx-ink); }
.fx-check { color: var(--fx-green); }

/* ---------- 01 notebook ---------- */
.fx-nb-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 14px 6px; background: var(--fx-bg); display: grid; gap: 12px; align-content: start; }
.fx-cell { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px; }
.fx-cell-gutter { display: grid; justify-items: center; align-content: space-between; padding: 2px 0 0; }
.fx-run {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--fx-blue) !important; cursor: pointer;
}
.fx-run:hover { background: var(--fx-bg-3); }
.fx-run svg { stroke-width: 1.5; }
.fx-count { font-family: Consolas, 'Courier New', Courier, monospace; font-size: 11px; color: var(--fx-ink-3); padding-bottom: 3px; }
.fx-cell-main { min-width: 0; }
.fx-code {
  border: 1px solid var(--fx-line-2); border-radius: 4px; background: var(--fx-bg-2); padding: 8px 10px 8px 0 !important; overflow-x: auto;
  font: 400 12px/19px Consolas, 'Courier New', Courier, monospace; color: var(--fx-ink); white-space: pre; tab-size: 4;
}
.fx-cell.is-running .fx-code { border-color: var(--fx-green); }
.fx-code .ln { display: inline-block; width: 34px; padding-right: 12px; text-align: right; color: #8a8a8a; user-select: none; }
.fx-code .c { color: #2e7d32; }
.fx-code .s { color: #a31515; }
.fx-code .k { color: #0f4fd6; }
.fx-bar { height: 2px; margin-top: 4px; border-radius: 1px; background: var(--fx-line-3); overflow: hidden; visibility: hidden; }
.fx-cell.is-running .fx-bar { visibility: visible; }
.fx-bar::before { content: ''; display: block; width: 40%; height: 100%; background: var(--fx-green); }
.fx-cell.is-running .fx-bar::before { animation: fx-slide 1s ease-in-out infinite; }
@keyframes fx-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.fx-status { display: flex; align-items: center; gap: 6px; min-height: 22px; padding-top: 3px !important; color: var(--fx-ink-3); }
.fx-spin { width: 12px; height: 12px; border: 2px solid var(--fx-line); border-top-color: var(--fx-green); border-radius: 50%; animation: fx-spin .8s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.fx-out { margin-top: 6px; overflow-x: auto; }
.fx-out[hidden] { display: none; }
.fx-out.is-in { animation: built-in .25s ease-out; }

/* ---------- grids (notebook output, lakehouse preview) ---------- */
.fx-grid { border-collapse: collapse; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; line-height: 16px; background: var(--fx-bg); }
.fx-grid th, .fx-grid td { padding: 5px 12px; border-bottom: 1px solid var(--fx-line-2); text-align: left; white-space: nowrap; color: var(--fx-ink); font-weight: 400; }
.fx-grid th { position: sticky; top: 0; z-index: 1; background: var(--fx-bg-2); font-weight: 600; border-right: 1px solid var(--fx-line-2); border-top: 1px solid var(--fx-line-2); }
.fx-grid.is-num th:first-child, .fx-grid.is-num td:first-child { width: 34px; padding: 5px 8px; text-align: center; color: var(--fx-ink-3); border-right: 1px solid var(--fx-line-2); }
.fx-grid tbody tr:hover td { background: var(--fx-bg-3); }
.fx-type { display: inline-block; margin-right: 8px; font-size: 9px; font-weight: 700; letter-spacing: .02em; color: var(--fx-ink-3); vertical-align: 1px; }
.fx-out .fx-grid { min-width: 0; border: 1px solid var(--fx-line-2); }
.fx-out .fx-grid th { position: static; border-top: 0; }

/* ---------- 02 lakehouse ---------- */
.fx-lh-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(180px, 32%) minmax(0, 1fr); background: var(--fx-bg-3); }
.fx-explorer { position: relative; min-height: 0; overflow: auto; padding: 10px 6px 10px 6px; background: var(--fx-bg); border-right: 1px solid var(--fx-line-2); }
.fx-explorer .fx-pane-title { padding: 0 8px 6px; }
.fx-node {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 22px; padding: 0 8px 0 calc(6px + var(--d, 0) * 14px);
  border: 0; border-radius: 4px; background: none; color: var(--fx-ink) !important; text-align: left; white-space: nowrap; cursor: pointer;
}
.fx-node span { overflow: hidden; text-overflow: ellipsis; }
.fx-node:hover { background: var(--fx-bg-3); }
.fx-node[aria-current="true"] { background: var(--fx-sel); font-weight: 600 !important; }
.fx-node[aria-current="true"] .fx-ico { color: var(--fx-green); }
.fx-node.is-static { cursor: default; }
.fx-node.is-static:hover { background: none; }
.fx-chev { width: 10px; height: 10px; color: var(--fx-ink-3); transition: transform .15s ease-out; }
.fx-node[aria-expanded="true"] > .fx-chev { transform: rotate(90deg); }
.fx-chev-gap { flex: none; width: 10px; }
.fx-ico { width: 14px; height: 14px; color: var(--fx-ink-3); }
.fx-tree ul[hidden] { display: none; }
.fx-lh-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--fx-bg); }
.fx-lh-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 8px; }
.fx-lh-name { font-size: 14px !important; line-height: 20px; font-weight: 600; color: var(--fx-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-lh-gridwrap { flex: 1; min-height: 0; overflow: auto; margin: 0 14px; border-left: 1px solid var(--fx-line-2); border-right: 1px solid var(--fx-line-2); }
.fx-lh-gridwrap.is-in { animation: built-in .22s ease-out; }
.fx-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; padding: 0 14px; margin-top: 8px; border-top: 1px solid var(--fx-line-2); color: var(--fx-ink-2); }
.fx-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 03 semantic model ---------- */
.fx-md-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 27%); }
.fx-canvas { position: relative; min-height: 0; overflow: hidden; background: var(--fx-bg-3); }
.fx-links { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-links path { stroke: #9a9a9a; stroke-width: 1.2; fill: none; transition: stroke .15s ease-out; }
.fx-links text { fill: var(--fx-ink-2); stroke: none; font: 600 11px/1 'Segoe UI', -apple-system, Roboto, sans-serif; text-anchor: middle; paint-order: stroke; stroke: var(--fx-bg-3); stroke-width: 3px; }
.fx-links .is-hot path { stroke: var(--fx-green); stroke-width: 2; }
.fx-links .is-hot text { fill: var(--fx-green); }
.fx-card {
  position: absolute; width: 23.5%; min-width: 96px; padding: 0; border: 1px solid var(--fx-line); border-radius: 4px; background: var(--fx-bg);
  box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .14); text-align: left; cursor: pointer; overflow: hidden;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.fx-card:hover { border-color: #9a9a9a; }
.fx-card[aria-pressed="true"] { border-color: var(--fx-green); box-shadow: 0 0 0 1px var(--fx-green), 0 2px 6px rgba(0, 0, 0, .14); }
.fx-card-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--fx-line-2); background: var(--fx-bg-2); font-weight: 600; color: var(--fx-ink); }
.fx-card[aria-pressed="true"] .fx-card-head { background: var(--fx-green-soft); }
.fx-card-cols { display: block; padding: 4px 8px 6px; }
.fx-card-cols span { display: block; font-size: 11px; line-height: 17px; color: var(--fx-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-card-cols .is-key { color: var(--fx-green); font-weight: 600; }
.fx-card[data-t="Customer"] { left: 4%; top: 7%; }
.fx-card[data-t="Product"] { left: 4%; bottom: 13%; }
.fx-card[data-t="Store"] { right: 4%; top: 7%; }
.fx-card[data-t="Date"] { right: 4%; bottom: 13%; }
.fx-card[data-t="Sales"] { left: 50%; top: 46%; transform: translate(-50%, -50%); width: 25%; }
.fx-layout { position: absolute; left: 0; bottom: 0; padding: 4px 12px; background: var(--fx-bg); border-top: 2px solid var(--fx-green); border-right: 1px solid var(--fx-line-2); font-weight: 600; color: var(--fx-ink); }
.fx-props { min-height: 0; overflow: auto; padding: 10px 12px; background: var(--fx-bg); border-left: 1px solid var(--fx-line-2); }
.fx-props-name { display: flex; align-items: center; gap: 6px; margin-top: 8px !important; font-weight: 600; color: var(--fx-ink); }
.fx-props-label { margin-top: 10px !important; font-size: 11px !important; color: var(--fx-ink-3); }
.fx-props li { display: flex; align-items: center; gap: 6px; min-height: 22px; color: var(--fx-ink); white-space: nowrap; }
.fx-props li svg { width: 12px; height: 12px; color: var(--fx-ink-3); }
.fx-props .fx-rel { display: block; min-height: 0; padding: 2px 0; white-space: normal; color: var(--fx-ink-2); }
.fx-props-list.is-in { animation: built-in .22s ease-out; }

/* ---------- widths ---------- */
@media (max-width: 980px) {
  #built .built { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #built .step-btn { padding: 14px 14px; }
  .fx { aspect-ratio: auto; height: 480px; }
  .fx-ribbon { padding: 0 8px; }
  .fx-ribbon .fx-hide-s { display: none; }
  .fx-nb-body { padding-right: 10px; }
  .fx-cell { grid-template-columns: 34px minmax(0, 1fr); }
  .fx-lh-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 190px minmax(0, 1fr); }
  .fx-explorer { border-right: 0; border-bottom: 1px solid var(--fx-line-2); }
  .fx-node { height: 30px; }
  .fx-lh-head { padding: 8px 10px 6px; }
  .fx-lh-gridwrap { margin: 0 10px; }
  .fx-foot { padding: 0 10px; }
  .fx-md-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 270px minmax(0, 1fr); }
  .fx-props { border-left: 0; border-top: 1px solid var(--fx-line-2); }
  .fx-card { width: 27%; min-width: 0; }
  .fx-card[data-t="Sales"] { width: 29%; }
  .fx-card[data-t="Customer"], .fx-card[data-t="Product"] { left: 6px; }
  .fx-card[data-t="Store"], .fx-card[data-t="Date"] { right: 6px; }
  .fx-card-head { padding: 4px 6px; gap: 4px; font-size: 11px; }
  .fx-card-head svg { display: none; }
  .fx-card-cols { padding: 3px 6px 4px; }
  .fx-card-cols span { font-size: 10px; line-height: 15px; }
  .fx-card:not([data-t="Sales"]) .fx-card-cols span:nth-child(n+3) { display: none; }
}


/* no scroll bars inside the step panels; what does not fit is cut at the edge, like a window */
#built .fx-nb-body, #built .fx-out, #built .fx-cell pre, #built .fx-explorer, #built .fx-lh-gridwrap, #built .fx-props { scrollbar-width: none; }
#built .fx-nb-body::-webkit-scrollbar, #built .fx-out::-webkit-scrollbar, #built .fx-cell pre::-webkit-scrollbar, #built .fx-explorer::-webkit-scrollbar, #built .fx-lh-gridwrap::-webkit-scrollbar, #built .fx-props::-webkit-scrollbar { display: none; }
#built .fx *, #built .fx { scrollbar-width: none; }
#built .fx *::-webkit-scrollbar { display: none; }
/* phones: every step's panel is the same height, so the page does not jump as the steps play */
@media (max-width: 760px) {
  #built .result-view { aspect-ratio: auto; height: 480px; }
}

/* ---------- the build as a carousel ---------- */
#built .built { display: block; }
#built .built.car { --slide-w: 64%; }
html.rise #built .built.car { --slide-w: min(64%, max(440px, calc((100vh - 385px) * 1.6))); }
#built .bslide { padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .42); border: 1px solid rgba(255, 255, 255, .64); -webkit-backdrop-filter: blur(8px) saturate(1.15); backdrop-filter: blur(8px) saturate(1.15); }
#built .bslide.is-on { background: rgba(255, 255, 255, .6); border-color: var(--rds-pop); }
#built .bslide:not(.car-slide) { margin-bottom: 18px; }
#built .bhead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 4px 6px 12px; }
#built .bhead .num { font-size: .8rem; }
#built .bhead h3 { font-size: 1.15rem; line-height: 1.25; color: var(--rds-ink); }
#built .bhead p { grid-column: 2 / -1; font-size: .92rem; line-height: 1.45; color: var(--rds-text-2); text-wrap: pretty; }
#built .blayer { font-family: var(--rds-mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--v4-accent-ink); padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--v4-accent-ink) 40%, transparent); border-radius: 999px; white-space: nowrap; }
#built .bslide .frame { box-shadow: none; }
#built .built-panel { background: #fff; }
/* the AI slide: three drawings side by side over a soft wash */
#built .b-ai {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background:
    radial-gradient(120% 90% at 8% 4%, rgba(64, 78, 110, .42) 0, transparent 58%),
    radial-gradient(90% 80% at 96% 22%, rgba(170, 178, 204, .6) 0, transparent 60%),
    radial-gradient(110% 80% at 70% 104%, color-mix(in srgb, var(--rds-teal) 36%, transparent) 0, transparent 62%),
    radial-gradient(70% 60% at 16% 88%, rgba(178, 46, 91, .16) 0, transparent 64%),
    #E2E1E6;
}
#built .b-ai-in {
  position: absolute; left: 0; top: 50%; width: 960px; padding: 0 135px;
  display: grid; grid-template-columns: 330px 330px; gap: 22px 30px; align-items: center;
  transform: translateY(-50%) scale(var(--s, .6)); transform-origin: 0 50%;
}
#built .b-ai .cx { max-width: none; }
#built .b-ai .cx:first-child { grid-row: 1 / span 2; }
@media (max-width: 760px) {
  #built .built.car, html.rise #built .built.car { --slide-w: 86%; }
  #built .bhead { grid-template-columns: auto minmax(0, 1fr); }
  #built .blayer { grid-column: 2; justify-self: start; margin-top: 2px; }
  #built .bhead p { grid-column: 1 / -1; margin-top: 4px; }
  #built .b-ai { aspect-ratio: auto; height: 480px; }
  #built .b-ai-in { width: 390px; grid-template-columns: 330px; gap: 16px; }
  #built .b-ai .cx:nth-child(3) { display: none; }
  #built .b-ai .cx:first-child { grid-row: auto; }
}

/* the notebook, lakehouse and model screens: drawn at 760 by 475 and scaled to fit the frame */
@media (min-width: 761px) {
  #built .built-panel:has(> .fx) { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
  #built .built-panel > .fx { position: absolute; left: 0; top: 0; width: 760px; height: 475px; aspect-ratio: auto; transform: scale(var(--s, 1)); transform-origin: 0 0; }
}
