/* Public datasets directory. Tokens come from ds.css; evidence mode: mono labels, hairlines, small corners.
   The canvas (.pcanvas) and data table (.jt, .dc-*) are ports of Factory's own components. */
.ds .dir-intro { padding-bottom: 0; }
.ds .dir-intro h1 { max-width: 24ch; overflow-wrap: anywhere; }
.ds .dir-intro .intro-summary { max-width: 62ch; margin-top: 1.1rem; }
.ds .dir-intro .intro-actions { margin-top: 1.5rem; }
.ds .dir-head-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ds .dir-head-top .ds-eyebrow a { color: inherit; }
.ds .dir-head-top .ds-eyebrow a:hover { color: var(--ds-primary); }
.ds .dir-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-canvas); color: var(--ds-body); }
.ds .dir-icon .icon, .ds .dir-icon svg { width: 20px; height: 20px; }
.ds .dir-icon img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; }
.ds .dir-icon-lg { width: 52px; height: 52px; }
.ds .dir-icon-lg img { width: 28px; height: 28px; }
.ds .dir-version { vertical-align: middle; }
.ds .dir-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; max-width: 40rem; background: var(--ds-canvas); }
.ds .dir-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 12px; max-width: 54rem; }
.ds .dir-strip-box { padding: 12px 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-canvas); }
.ds .dir-strip-box .ds-eyebrow { margin-bottom: 8px; font-size: 11px; }
.ds .dir-dests { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; }
.ds .dir-dests li, .ds .dir-dests a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; border: 1px solid var(--ds-border); border-radius: 999px; background: var(--ds-surface-alt); color: var(--ds-body); font-size: 13px; line-height: 1.2; }
.ds .dir-dests li:has(> a) { padding: 0; border: 0; background: none; }
.ds .dir-dests a:hover { border-color: var(--ds-border-strong); background: var(--ds-primary-tint); color: var(--ds-ink); }
.ds .dir-dests img, .ds .dir-dests .icon { width: 18px; height: 18px; border-radius: 3px; object-fit: contain; color: var(--ds-body); }
.ds .dir-timer { min-width: 15rem; }
.ds .dir-timer-body { display: flex; align-items: center; gap: 10px; }
.ds .dir-timer-body .icon { width: 22px; height: 22px; flex: none; color: var(--ds-primary); }
.ds .dir-timer-body b { display: block; font-weight: 700; color: var(--ds-ink); font-size: 15px; }
.ds .dir-timer-body small { display: block; margin-top: 2px; font-family: var(--ds-mono); font-size: 11.5px; color: var(--ds-muted); }
.ds .dir-facts dd { margin: 4px 0 0; font-size: 15px; color: var(--ds-ink); white-space: normal; overflow-wrap: anywhere; }

/* search */
.ds .dir-search { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px auto 0; max-width: 46rem; }
.ds .dir-search-field { position: relative; flex: 1 1 18rem; display: flex; align-items: center; }
.ds .dir-search-field .icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--ds-muted); pointer-events: none; }
.ds .dir-search input, .ds .dir-search select { width: 100%; min-height: 44px; padding: 10px 14px 10px 42px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-canvas); color: var(--ds-ink); font: inherit; font-size: 16px; }
.ds .dir-search select { padding-left: 14px; min-width: 11rem; }
.ds .dir-search input:focus, .ds .dir-search select:focus { outline: 2px solid var(--ds-primary); outline-offset: 1px; border-color: var(--ds-border-strong); }
.ds .dir-search-submit { flex: none; }
.ds .dir-list-section { padding-top: clamp(40px, 6vw, 64px); }
.ds .dir-list-section .ds-wrap[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.ds .dir-list .rl-main h2 { font-size: 22px; }
.ds .dir-list .rl-main p { overflow-wrap: anywhere; }
.ds .dir-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; font-family: var(--ds-mono); font-size: 12px; color: var(--ds-muted); }
.ds .dir-pager-start { color: var(--ds-primary); }
.ds .dir-pager .ds-btn { margin-left: auto; }
.ds .dir-pager .ds-btn .icon { width: 16px; height: 16px; }

/* notices: empty, unavailable, changed, error */
.ds .dir-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 20px 22px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-surface); color: var(--ds-body); }
.ds .dir-notice > .icon { width: 22px; height: 22px; flex: none; color: var(--ds-muted); }
.ds .dir-notice b { display: block; font-weight: 700; color: var(--ds-ink); }
.ds .dir-notice p { margin-top: 4px; font-size: 14px; max-width: 52ch; }
.ds .dir-notice .ds-btn { margin-left: auto; }
.ds .dir-notice-error, .ds .dir-notice-changed { border-color: #F3C9BF; background: var(--ds-alert-soft); }
.ds .dir-notice-error > .icon, .ds .dir-notice-changed > .icon { color: var(--ds-alert); }
.ds .dir-notice-loading > .icon { animation: dir-spin 1.2s linear infinite; }
@keyframes dir-spin { to { transform: rotate(360deg); } }

/* sections */
.ds .dir-section { padding-block: clamp(48px, 7vw, 80px) 0; }
.ds .dir-section-head { max-width: 52rem; margin-bottom: clamp(20px, 3vw, 32px); }
.ds .dir-section-head h2 { margin-top: 8px; font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.1; letter-spacing: -.03em; }
.ds .dir-section-head p { margin-top: 12px; color: var(--ds-body); font-size: 16px; max-width: 46rem; }
.ds .dir-section-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; max-width: none; }
.ds .dir-export { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: none; }
.ds .dir-pipeline-cta { align-self: center; }
.ds .dir-section-head-row > div:first-child { min-width: 0; flex: 1 1 32rem; }
.ds .dir-export-btn { min-height: 50px; padding: 14px 22px; font-size: 16px; }
.ds .dir-export-btn .icon { width: 18px; height: 18px; }
.ds .dir-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--ds-body); }
.ds .dir-note .icon { width: 16px; height: 16px; color: var(--ds-alert); }

/* ---------- pipeline canvas (Factory canvas.css on landing tokens) ---------- */
.ds .pcanvas {
  --paper: var(--ds-surface-alt); --ink: var(--ds-ink); --muted: var(--ds-muted); --rule: var(--ds-border); --card: var(--ds-canvas);
  --teal: #0e7c86; --teal-bg: #d9f2f4; --orange: #c2570a; --orange-bg: #fdebd9; --purple: var(--ds-primary); --purple-bg: var(--ds-primary-soft);
  --green: var(--ds-success); --green-bg: #EDF9EE; --red: var(--ds-alert); --slate: var(--ds-body); --slate-bg: var(--ds-surface-alt); --amber: #B7791F; --amber-bg: #FBF3E3;
  --edge: #6b6b73;
  position: relative; height: clamp(300px, 38vw, 440px); overflow: hidden; color: var(--ink);
  border: 1px solid var(--ds-border); border-radius: var(--ds-r-lg); background-color: var(--paper);
  background-image: radial-gradient(circle, #DEDBE6 1px, transparent 1.2px); background-size: 20px 20px;
  font-family: inherit; touch-action: none;
}
.ds .pcanvas:focus { outline: none; }
.ds .pcanvas:focus-visible { box-shadow: inset 0 0 0 2px var(--ds-primary); }
.ds .pcanvas svg.pcanvas-svg { width: 100%; height: 100%; display: block; cursor: grab; }
.ds .pcanvas svg.pcanvas-svg.drag { cursor: grabbing; }
.ds .pcanvas text { fill: var(--ink); }
.ds .pcanvas .hud { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; }
.ds .pcanvas .hud button { display: inline-grid; place-items: center; font: inherit; font-size: 14px; min-width: 32px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 6px; cursor: pointer; line-height: 1.2; }
.ds .pcanvas .hud button:hover { background: var(--ds-surface-alt); }
.ds .pcanvas .hud button:focus-visible { outline: 2px solid var(--ds-primary); outline-offset: 3px; }
.ds .pcanvas .band { fill: var(--card); stroke: var(--rule); rx: 6; pointer-events: none; }
.ds .pcanvas .band-title { font-size: 11px; font-weight: 400; fill: var(--purple); letter-spacing: .04em; text-transform: uppercase; }
.ds .pcanvas .node { cursor: pointer; }
.ds .pcanvas .node rect.card { fill: var(--card); stroke-width: 1; }
.ds .pcanvas .node.k-input rect.card { stroke: var(--teal); fill: var(--teal-bg); }
.ds .pcanvas .node.k-step rect.card { stroke: var(--slate); fill: var(--slate-bg); }
.ds .pcanvas .node.k-map_step rect.card { stroke: var(--orange); fill: var(--orange-bg); }
.ds .pcanvas .node.k-route rect.card { stroke: var(--amber); fill: var(--amber-bg); }
.ds .pcanvas .node.k-sink rect.card { stroke: var(--green); fill: var(--green-bg); }
.ds .pcanvas .node:hover rect.card, .ds .pcanvas .node:focus-visible rect.card { stroke-width: 2.5; }
.ds .pcanvas .node:focus-visible { outline: none; }
.ds .pcanvas .node .action-icon { fill: none; }
.ds .pcanvas .node-title { color: var(--ink); font-size: 13px; line-height: 18px; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-family: 'KH Teka', sans-serif; }
.ds .pcanvas .start-label rect { fill: var(--ds-surface-alt); stroke: var(--rule); }
.ds .pcanvas .start-label text { fill: var(--muted); font-size: 10px; font-weight: 500; }
.ds .pcanvas .edge path { fill: none; stroke: var(--edge); stroke-width: 1.5; }
.ds .pcanvas .edge.boundary path { stroke-width: 2; }
.ds .pcanvas .edge.k-reads path { stroke-dasharray: 4 4; }
.ds .pcanvas .edge .direction-arrow { stroke: var(--edge); stroke-width: 1.5; stroke-dasharray: none; pointer-events: none; }
.ds .pcanvas .edge .elabel { font-size: 10.5px; fill: var(--muted); }
.ds .pcanvas .edge rect.lbg { fill: var(--paper); rx: 3; opacity: .92; }
.ds .pcanvas .band-title, .ds .pcanvas .edge .elabel { font-family: var(--ds-mono); font-weight: 400; }
.ds .pcanvas .tip { position: absolute; z-index: 5; width: 360px; max-width: calc(100% - 16px); max-height: calc(100% - 16px); overflow: auto; white-space: normal; padding: 16px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); color: var(--muted); font-size: 12px; line-height: 1.55; box-shadow: 0 8px 24px -16px rgba(23,21,31,.25); }
.ds .pcanvas .tip-heading { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.ds .pcanvas .tip-heading > svg { flex-shrink: 0; color: var(--muted); }
.ds .pcanvas .tip-heading strong { flex: 1; font-size: 14px; font-weight: 500; }
.ds .pcanvas .tip-kind { border: 1px solid var(--rule); border-radius: 3px; padding: 3px 7px; font-family: var(--ds-mono); font-size: 10px; }
.ds .pcanvas .tip p { margin: 8px 0 0; }
.ds .pcanvas .tip-group { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 12px; }
.ds .pcanvas .tip-label { font-size: 11px; margin-bottom: 8px; color: var(--muted); }
.ds .pcanvas .tip-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ds .pcanvas .tip-rules { margin: 0; padding-left: 16px; color: var(--ds-body); }
.ds .pcanvas .tip-rules li + li { margin-top: 8px; }
.ds .pcanvas .tip-chip svg { flex-shrink: 0; }
.ds .pcanvas .tip-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: 9999px; padding: 4px 8px; color: var(--ds-body); background: var(--ds-surface-alt); font-size: 11px; }
.ds .dir-graph-list { display: none; }
@media (max-width: 720px) {
  .ds .pcanvas { display: none; }
  .ds .dir-graph-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; counter-reset: dir-step; }
  .ds .dir-graph-list li { position: relative; padding: 12px 14px 12px 44px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-canvas); font-size: 14px; }
  .ds .dir-graph-list li::before { counter-increment: dir-step; content: counter(dir-step); position: absolute; left: 14px; top: 12px; font-family: var(--ds-mono); font-size: 12px; color: var(--ds-primary); }
  .ds .dir-graph-list b { display: block; font-weight: 700; }
  .ds .dir-graph-list small { color: var(--ds-muted); font-family: var(--ds-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  .ds .dir-graph-list span { display: block; margin-top: 4px; color: var(--ds-body); font-size: 13px; }
}

/* ---------- outputs: worksheet strip and selection ---------- */
.ds .dir-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.ds .dir-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-md); background: var(--ds-canvas); color: var(--ds-ink); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.ds .dir-tab .icon { width: 16px; height: 16px; color: var(--ds-muted); }
.ds .dir-tab small, .ds .dir-chip small { font-family: var(--ds-mono); font-size: 11px; color: var(--ds-muted); }
.ds .dir-tab:hover { border-color: var(--ds-border-strong); background: var(--ds-primary-tint); }
.ds .dir-tab[aria-selected="true"] { border-color: var(--ds-primary); background: var(--ds-primary-soft); color: var(--ds-primary); }
.ds .dir-tab[aria-selected="true"] .icon { color: var(--ds-primary); }
.ds .dir-chips { display: flex; gap: 2px; overflow-x: auto; margin: 0; padding: 0 4px; border: 1px solid var(--ds-border); border-bottom: 0; border-radius: var(--ds-r-sm) var(--ds-r-sm) 0 0; background: var(--ds-surface-alt); }
.ds .dir-chip { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ds-body); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ds .dir-chip:hover { color: var(--ds-ink); background: rgba(23,21,31,.04); }
.ds .dir-chip[aria-selected="true"] { border-bottom-color: var(--ds-primary); background: var(--ds-canvas); color: var(--ds-primary); }
.ds .dir-chips + .dir-table-region { border-top-left-radius: 0; border-top-right-radius: 0; }
.ds .dir-output-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ds .dir-output-head:empty { display: none; }
.ds .dir-output-desc { color: var(--ds-body); font-size: 15px; max-width: 60rem; }
.ds .dir-publication { font-family: var(--ds-mono); font-size: 12px; color: var(--ds-muted); }
.ds .dir-output-head .dir-note { margin-top: 0; }
.ds .dir-table-region { border: 1px solid var(--ds-border-strong); border-radius: var(--ds-r-sm); background: var(--ds-canvas); box-shadow: 0 0 0 4px var(--ds-primary-tint); overflow: hidden; }
.ds .dir-table-region > .dir-notice { border: 0; border-radius: 0; }
.ds .dir-table-region[aria-busy="true"] { opacity: .6; }

/* ---------- data table (Factory JsonTable) ---------- */
.ds .jt { display: flex; flex-direction: column; font-size: 14px; }
.ds .jt-scroll { position: relative; overflow: auto; max-height: min(70vh, 640px); background: var(--ds-canvas); }
.ds .jt-updating { position: sticky; top: 0; z-index: 10; display: flex; justify-content: flex-end; height: 0; overflow: visible; pointer-events: none; }
.ds .jt-updating > span { display: inline-flex; align-items: center; gap: 6px; height: 28px; margin: 8px; padding: 0 8px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-canvas); font-size: 12px; color: var(--ds-muted); box-shadow: 0 1px 2px rgba(23,21,31,.06); }
.ds .jt-spin { animation: dir-spin 1s linear infinite; }
.ds .jt-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; min-width: 100%; }
.ds .jt-table th, .ds .jt-table td { border-bottom: 1px solid var(--ds-border); border-right: 1px solid #F1F0F5; }
.ds .jt-table thead th { position: sticky; top: 0; z-index: 5; padding: 6px 10px; background: var(--ds-surface-alt); border-bottom-color: #DAD8E2; text-align: left; font-family: var(--ds-mono); font-weight: 400; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ds-muted); white-space: nowrap; overflow: hidden; }
.ds .jt-th .jt-sort { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.ds .jt-th .jt-sort span { overflow: hidden; text-overflow: ellipsis; }
.ds .jt-th:hover { color: var(--ds-ink); background: #EFEDF4; }
.ds .jt-th.is-sorted { color: var(--ds-ink); }
.ds .jt-th.is-sorted svg:last-child { color: var(--ds-primary); }
.ds .dc-type-icon { flex: none; color: var(--ds-muted); }
.ds .jt-gutter { position: sticky; left: 0; z-index: 3; width: 44px; padding: 6px 0; text-align: center; background: var(--ds-surface); border-right-color: #DAD8E2 !important; }
.ds .jt-gutter span { font-family: var(--ds-mono); font-size: 11px; color: var(--ds-muted); font-variant-numeric: tabular-nums; }
.ds .jt-corner { z-index: 6; background: var(--ds-surface-alt); color: var(--ds-muted); font-size: 10px; }
.ds .jt-row { cursor: pointer; }
.ds .jt-row:hover td, .ds .jt-row:focus-visible td { background: var(--ds-primary-tint); }
.ds .jt-row:focus-visible { outline: none; }
.ds .jt-row:focus-visible .jt-gutter { box-shadow: inset 2px 0 0 var(--ds-primary); }
.ds .jt-cell { padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ds-body); vertical-align: middle; font-size: 13.5px; }
.ds .jt-mono, .ds .dc-mono { font-family: var(--ds-mono); font-size: 12px; }
.ds .jt-chevron { position: sticky; right: 0; z-index: 2; padding: 6px 12px 6px 6px; text-align: right; background: var(--ds-canvas); color: var(--ds-muted); font-size: 10.5px; white-space: nowrap; border-left: 1px solid #F1F0F5; }
.ds .jt-chevron span { display: inline-flex; align-items: center; gap: 3px; }
.ds .jt-chevron-h { position: sticky; right: 0; z-index: 7; background: var(--ds-surface-alt); }
.ds .jt-row:hover .jt-chevron { color: var(--ds-primary); background: var(--ds-primary-tint); }
.ds .jt-row-oversized td { padding: 8px 10px; color: var(--ds-body); font-size: 13px; }
.ds .jt-row-oversized svg { vertical-align: -2px; margin-right: 6px; color: var(--ds-alert); }
.ds .jt-empty { padding: 44px 16px !important; text-align: center; color: var(--ds-muted); font-size: 14px; }
.ds .jt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 12px; border-top: 1px solid var(--ds-border); background: var(--ds-surface-alt); font-size: 11.5px; color: var(--ds-muted); }
.ds .jt-summary { white-space: nowrap; font-family: var(--ds-mono); }
.ds .jt-capped { font-style: normal; color: var(--ds-primary); }
.ds .jt-search { position: relative; display: inline-flex; align-items: center; }
.ds .jt-search svg { position: absolute; left: 8px; color: var(--ds-muted); pointer-events: none; }
.ds .jt-search input { width: 12rem; padding: 5px 8px 5px 24px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-xs); background: var(--ds-canvas); font: inherit; font-size: 12px; color: var(--ds-ink); }
.ds .jt-search input:focus, .ds .jt-size:focus { outline: 2px solid var(--ds-primary); outline-offset: 1px; }
.ds .jt-size { padding: 5px 6px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-xs); background: var(--ds-canvas); font: inherit; font-size: 12px; color: var(--ds-ink); }
.ds .jt-pager { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ds .jt-pager button { display: inline-grid; place-items: center; padding: 2px; border: 0; border-radius: 3px; background: none; color: var(--ds-muted); cursor: pointer; }
.ds .jt-pager button:hover:not(:disabled) { color: var(--ds-ink); }
.ds .jt-pager button:disabled { opacity: .3; cursor: not-allowed; }
.ds .jt-link { padding: 0; border: 0; background: none; color: var(--ds-muted); font: inherit; cursor: pointer; }
.ds .jt-link:hover { color: var(--ds-ink); }
.ds .jt-error { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid #F3C9BF; background: var(--ds-alert-soft); font-size: 13px; color: var(--ds-body); }
.ds .jt-error svg { color: var(--ds-alert); }

/* cells */
.ds .dc-empty { color: #C9C6D3; }
.ds .dc-muted { color: var(--ds-muted); }
.ds .dc-num { font-variant-numeric: tabular-nums; }
.ds .dc-money { font-weight: 700; color: var(--ds-ink); }
.ds .dc-bool { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; }
.ds .dc-bool.is-true { color: var(--ds-success); }
.ds .dc-bool.is-false { color: #C4320A; }
.ds .dc-count { display: inline-flex; align-items: center; padding: 1px 6px; border: 1px solid var(--ds-border-strong); border-radius: 3px; background: var(--ds-primary-soft); color: var(--ds-primary); font-family: var(--ds-mono); font-size: 10px; flex: none; }
.ds .dc-inline { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.ds .dc-teaser { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ds-muted); }
.ds .dc-tip { cursor: help; outline: none; }
.ds .dc-block { display: block; max-width: 100%; }
.ds .dc-tip:focus-visible { box-shadow: 0 0 0 2px var(--ds-primary); border-radius: 2px; }
.ds .dc-clamp { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds .dc-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; padding: 2px 6px; border: 1px solid var(--ds-border); border-radius: 6px; background: var(--ds-canvas); color: var(--ds-ink); font-size: 12px; line-height: 1.3; vertical-align: middle; overflow: hidden; text-decoration: none; }
.ds .dc-pill img { flex: none; border-radius: 2px; }
.ds .dc-pill-md { padding: 4px 8px; font-size: 14px; gap: 6px; }
.ds .dc-host { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ds .dc-path { color: var(--ds-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
a.dc-pill:hover { background: var(--ds-surface-alt); border-color: #CFCBDA; }
.ds .dc-image { display: inline-block; height: 28px; max-width: 64px; vertical-align: middle; border: 1px solid var(--ds-border); border-radius: 4px; overflow: hidden; background: var(--ds-surface-alt); }
.ds .dc-image img { height: 100%; width: auto; max-width: 100%; object-fit: cover; display: block; }
.ds .dc-image-md { height: 96px; max-width: 160px; }
.dc-tipcard { position: absolute; z-index: 60; padding: 10px 12px; border: 1px solid #E8E7EE; border-radius: 6px; background: #1C172B; color: #ECE8F6; font-size: 12px; line-height: 1.5; box-shadow: 0 12px 32px -16px rgba(23,21,31,.5); max-height: 60vh; overflow: auto; }
.dc-tipcard .dc-json, .dc-json { margin: 0; font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 11px; line-height: 1.55; white-space: pre; color: #ECE8F6; }
.dc-tipcard .dc-longtext { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 60ch; }
.dc-tipcard .j-key { color: #7dd3fc; } .dc-tipcard .j-str { color: #6ee7b7; } .dc-tipcard .j-num { color: #fcd34d; } .dc-tipcard .j-null { color: #d8b4fe; } .dc-tipcard .j-punc { color: #A59FB8; } .dc-tipcard .j-more { color: #A59FB8; font-style: italic; }

/* row detail dialog (Factory RowDetailModal, read-only) */
.jt-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto; padding: 0; border: 1px solid #E8E7EE; border-radius: 10px; background: #fff; color: #17151F; box-shadow: 0 24px 64px -24px rgba(23,21,31,.4); }
.jt-dialog::backdrop { background: rgba(23,21,31,.45); backdrop-filter: blur(2px); }
.jt-dialog-body { padding: 20px 24px 24px; font-family: 'KH Teka', sans-serif; font-size: 15px; }
.jt-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.jt-detail-head .ds-eyebrow { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #6E6A7B; }
.jt-detail-nav { display: inline-flex; gap: 4px; }
.jt-detail-nav button { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid #E8E7EE; border-radius: 6px; background: #fff; color: #4D4959; cursor: pointer; }
.jt-detail-nav button:hover:not(:disabled) { background: #F7F7F9; color: #17151F; }
.jt-detail-nav button:disabled { opacity: .35; cursor: not-allowed; }
.jt-detail-list { margin: 0; border-top: 1px solid #E8E7EE; }
.jt-detail-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #F1F0F5; font-size: 14px; }
.jt-detail-row dt { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 12px; color: #6E6A7B; overflow-wrap: anywhere; padding-top: 2px; }
.jt-detail-row dd { margin: 0; min-width: 0; color: #4D4959; }
.jt-row-oversized-note { display: flex; align-items: center; gap: 8px; padding: 16px 0; color: #4D4959; }
.jt-row-oversized-note svg { color: #FF3B30; }
.dc-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-kv { border-left: 2px solid #F1F0F5; padding-left: 12px; }
.dc-kv-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F7F7F9; font-size: 13px; }
.dc-kv-row:last-child { border-bottom: 0; }
.dc-kv-key { flex: none; width: 7rem; color: #6E6A7B; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-kv-val { min-width: 0; flex: 1; }
.dc-list { margin: 0; padding-left: 0; border-left: 2px solid #F1F0F5; list-style: none; counter-reset: dc-item; }
.dc-list li { display: flex; gap: 8px; padding: 4px 0 4px 12px; font-size: 13px; counter-increment: dc-item; }
.dc-list li::before { content: counter(dc-item) '.'; width: 1.5rem; flex: none; color: #6E6A7B; font-variant-numeric: tabular-nums; }
.dc-list-inline { font-size: 13px; }
.dc-sep { color: #6E6A7B; }
.dc-notes { margin: 0; padding-left: 20px; }
.dc-notes li + li { margin-top: 4px; }
.dc-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-subtable { border: 1px solid #E8E7EE; border-radius: 4px; overflow: hidden; }
.dc-subtable table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dc-subtable th { padding: 4px 8px; background: #F7F7F9; border-bottom: 1px solid #E8E7EE; text-align: left; font-family: 'Fragment Mono', ui-monospace, monospace; font-weight: 400; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: #6E6A7B; white-space: nowrap; }
.dc-subtable td { padding: 4px 8px; border-bottom: 1px solid #F1F0F5; vertical-align: top; max-width: 280px; overflow-wrap: anywhere; }
.dc-json-block { max-height: 18rem; overflow: auto; padding: 8px; border: 1px solid #E8E7EE; border-radius: 4px; background: #F7F7F9; color: #17151F; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }

/* signup gate and report line */
.ds .jt-gate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px; border-top: 1px solid var(--ds-border-strong); background: var(--ds-primary-tint); color: var(--ds-body); font-size: 14px; }
.ds .jt-gate b { color: var(--ds-ink); }
.ds .jt-gate p { margin-top: 2px; }
.ds .jt-gate .ds-btn { min-height: 40px; }
.ds .jt-gate .ds-btn svg { width: 14px; height: 14px; }
.ds .dir-report { margin-top: 18px; font-size: 13px; color: var(--ds-muted); }
.ds .dir-report a { color: var(--ds-primary); }
.ds .dir-facts a { color: var(--ds-primary); }
.ds .dc-date { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* export modal */
.dir-modal { width: min(520px, calc(100vw - 32px)); }
.dir-modal-body h3 { margin-top: 6px; font-weight: 400; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; color: #17151F; }
.dir-modal-text { margin-top: 10px; color: #4D4959; font-size: 15px; line-height: 1.5; }
.dir-modal-form { display: flex; gap: 8px; margin-top: 18px; }
.dir-modal-form input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid #E8E7EE; border-radius: 10px; font: inherit; font-size: 16px; color: #17151F; }
.dir-modal-form input:focus { outline: 2px solid #653DE9; outline-offset: 1px; border-color: #DDD5F7; }
.dir-modal-form .ds-btn { flex: none; min-height: 48px; }
.dir-modal-small { margin-top: 14px; font-size: 13px; color: #6E6A7B; }
.dir-modal-small a { color: #653DE9; }
.dir-modal-progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border: 1px solid #E8E7EE; border-radius: 6px; background: #F7F7F9; font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 13px; color: #17151F; }
.dir-spinner { width: 22px; height: 22px; flex: none; color: #653DE9; animation: dir-spin 1s linear infinite; }
.dir-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dir-modal-actions .ds-btn { min-height: 48px; }
.dir-modal-download .icon { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .dir-spinner { animation: none; } }

/* history and build conversation */
.ds .dir-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ds .dir-history-col h3 { margin-bottom: 12px; font-weight: 400; font-size: 20px; letter-spacing: -.015em; }
.ds .dir-hist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ds-border); }
.ds .dir-hist-item { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--ds-border); }
.ds .dir-hist-when { display: flex; flex-direction: column; gap: 2px; font-family: var(--ds-mono); font-size: 12px; color: var(--ds-muted); }
.ds .dir-hist-when b { font-weight: 400; color: var(--ds-primary); }
.ds .dir-hist-text { font-size: 15px; line-height: 1.5; color: var(--ds-body); overflow-wrap: anywhere; }
.ds .dir-hist-text p + p { margin-top: 8px; }
.ds .dir-hist-more { margin-top: 14px; }
.ds .dir-truncated { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-xs); font-family: var(--ds-mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ds-muted); }
.ds .dir-outcome { display: inline-block; padding: 3px 8px; border-radius: var(--ds-r-xs); font-family: var(--ds-mono); font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; }
.ds .dir-outcome-good { background: var(--ds-success-soft); color: var(--ds-success); }
.ds .dir-outcome-warn { background: #FBF3E3; color: #B7791F; }
.ds .dir-outcome-bad { background: var(--ds-alert-soft); color: #C4320A; }
.ds .dir-outcome-neutral { background: var(--ds-surface-alt); color: var(--ds-body); }
.ds .dir-notice-good { border-color: #CDE7D4; background: var(--ds-success-soft); }
.ds .dir-notice-good > .icon { color: var(--ds-success); }
.ds .dir-chat { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; max-width: 56rem; }
.ds .dir-msg { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 12px; padding: 14px 16px; border: 1px solid var(--ds-border); border-radius: var(--ds-r-sm); background: var(--ds-canvas); }
.ds .dir-msg-jason { background: var(--ds-primary-tint); border-color: var(--ds-border-strong); }
.ds .dir-msg-who { font-family: var(--ds-mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ds-muted); padding-top: 3px; }
.ds .dir-msg-jason .dir-msg-who { color: var(--ds-primary); }
.ds .dir-msg-text { font-size: 15px; line-height: 1.55; color: var(--ds-body); overflow-wrap: anywhere; }
.ds .dir-msg-text p + p { margin-top: 8px; }
@media (max-width: 720px) { .ds .dir-history-grid { grid-template-columns: 1fr; } .ds .dir-hist-item { grid-template-columns: 1fr; gap: 4px; } .ds .dir-msg { grid-template-columns: 1fr; gap: 4px; } }

/* embeds */
.ds .dir-embed, .dir-embed { margin-block: 24px; }
.ds .dir-embed-frame { overflow: hidden; }
.ds .dir-embed-frame .dir-table-region { border: 0; box-shadow: none; border-radius: 0; }
.ds .dir-embed-frame .dir-icon { width: 28px; height: 28px; }
.ds .dir-embed-frame .dir-icon img { width: 18px; height: 18px; }
.ds .dir-embed-table { font-family: var(--ds-mono); font-size: 12px; color: var(--ds-muted); }
.ds .dir-embed-frame .ds-pipeline-foot a { color: var(--ds-primary); display: inline-flex; align-items: center; gap: 4px; }
.ds .dir-embed-frame .ds-pipeline-foot .icon { width: 14px; height: 14px; }
.ds .dir-embed-frame .jt-scroll { max-height: 24rem; }

@media (max-width: 720px) {
  .ds .dir-facts { grid-template-columns: 1fr 1fr; }
  .ds .dir-facts div:nth-child(n+3) { border-top: 1px solid var(--ds-border); border-left: 0; }
  .ds .dir-strip { grid-template-columns: 1fr; }
  .ds .dir-search select { min-width: 0; }
  .ds .jt-scroll { max-height: 28rem; }
  .ds .jt-chevron, .ds .jt-chevron-h { display: none; }
  .ds .jt-search input { width: 9rem; }
  .jt-detail-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .ds .dir-notice-loading > .icon, .ds .jt-spin { animation: none; } }
