/* Deliverable Review */
/* Workspace embed — metrics & deliverables inside workspace.html iframe */
body.yel-workspace-embed { margin: 0; }
body.yel-workspace-embed > header.topbar { display: none !important; }
body.yel-workspace-embed .dlv-company-bar { display: none !important; }
/* NOTE: .dlv-page IS .ws-page-content — same element (see deliverables.html), not
   a child of it like board-prep's .bp-scroll. So the shell's overflow:hidden lands
   directly on this rule's element, and anything here that sets `overflow` wins.
   The embed skin (below) already unlocks the inner panes to `visible`, so this
   element is the page's only candidate scroller.
   Without it: the skin stacks the console into one paper document that grows past
   the frame the moment a function is picked or a review lands, the frame is a
   fixed height the parent .center-scroll cannot grow, and the overflow past the
   fold was unreachable — no scroller anywhere on the page. */
body.yel-workspace-embed .dlv-page {
  min-height: 100vh;
  overflow-y: auto;
}

.dlv-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dlv-company-bar {
  margin: 0;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-0);
  display: flex;
  justify-content: flex-end;
  flex: none;
}

/* Persistent page title, above the console rather than inside a column: the
   standalone page spans it across all three, the embed stacks it first. Scoped
   to this page — metrics.html shares this stylesheet but keeps its title in
   .dlv-main, so nothing here may touch a shared .dlv-* selector. */
.dlv-titlebar {
  flex: none;
  padding: 18px 22px 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
}
.dlv-page-title {
  margin: 0 0 6px;
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--ink-0);
}
.dlv-page-lede {
  margin: 0;
  max-width: 62ch;
  font-size: var(--fs-base);
  line-height: 1.45;
  color: var(--ink-3);
}

.dlv-shell {
  display: grid;
  grid-template-columns: 300px 1fr 360px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dlv-rail {
  background: var(--bg-0);
  border-right: 1px solid var(--border-1);
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dlv-main {
  padding: 18px 22px;
  overflow-y: auto;
  background: var(--bg-1);
}

.dlv-out {
  background: var(--bg-0);
  border-left: 1px solid var(--border-1);
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dlv-kicker {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 600;
}

.dlv-fn-list { flex: 1; min-height: 0; overflow-anchor: none; }
.dlv-rail-msg {
  font-size: 12px; color: var(--ink-3); line-height: 1.45; padding: 8px 4px;
}
.dlv-rail-err { color: #f87171; display: block; margin-bottom: 8px; }
.dlv-retry {
  margin-top: 6px; padding: 6px 10px; font-size: 11px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px; color: var(--ink-1);
}

.dlv-cluster { margin-bottom: 8px; }
.dlv-cluster-name {
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 4px; padding-left: 2px;
}

.dlv-fn-btn {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 10px; margin-bottom: 3px;
  background: var(--bg-2); border: 1px solid transparent; border-radius: 7px;
  color: var(--ink-1); font-size: 12px; cursor: pointer; text-align: left;
}
.dlv-fn-btn:hover { border-color: var(--border-2); }
.dlv-fn-btn.on { border-color: rgba(125,211,252,.4); background: rgba(125,211,252,.08); }
.dlv-fn-label,
.dlv-fn-btn > span:first-child { flex: 1; min-width: 0; line-height: 1.35; }
.dlv-fn-btn .num { flex: none; font-size: 10px; color: var(--ink-4); font-family: ui-monospace, monospace; margin-top: 1px; }

.dlv-alt-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.dlv-alt-tab {
  padding: 6px 10px; font-size: 11px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px;
  color: var(--ink-3); cursor: pointer;
}
.dlv-alt-tab.on { border-color: var(--accent-green); color: var(--accent-green); background: rgba(52,211,153,.08); }

.dlv-deliv-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.dlv-deliv-btn {
  text-align: left; padding: 8px 10px; font-size: 11px; line-height: 1.35;
  background: var(--bg-2); border: 1px solid transparent; border-radius: 6px;
  color: var(--ink-2); cursor: pointer;
}
.dlv-deliv-btn:hover { border-color: var(--border-2); }
.dlv-deliv-btn.on { border-color: var(--accent-cyan); background: rgba(125,211,252,.06); color: var(--ink-1); }
.dlv-deliv-btn .bp { font-size: 9px; color: var(--accent-cyan); margin-top: 3px; display: block; }

.dlv-meta-card {
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: 9px; font-size: 11px; color: var(--ink-3); line-height: 1.45;
}
.dlv-meta-card strong { color: var(--ink-1); }
.dlv-trace { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-1); font-style: italic; }

.dlv-upload {
  border: 2px dashed var(--border-3); border-radius: 10px; padding: 28px 20px;
  text-align: center; background: var(--bg-2); cursor: pointer; transition: border-color .15s;
}
.dlv-upload:hover, .dlv-upload.drag { border-color: var(--accent-cyan); background: rgba(125,211,252,.04); }
.dlv-upload.has-file { border-style: solid; border-color: rgba(52,211,153,.35); }
.dlv-upload-title { font-size: 13px; font-weight: 600; color: var(--ink-1); margin-bottom: 4px; }
.dlv-upload-hint { font-size: 11px; color: var(--ink-4); }
.dlv-file-name { margin-top: 10px; font-size: 12px; color: var(--accent-cyan); word-break: break-all; }

/* Sample link. Mirrors board-prep's .bp-sample-link treatment — that placement
   reads clearly, and this is the same "no file? here's one" affordance. --ink-*
   is remapped to paper by embed-summary.css in the workspace embed, so this
   follows the surface instead of pinning a colour. */
.dlv-sample-link {
  display: inline-block; margin-top: 12px;
  color: var(--accent-cyan); font-size: 12.5px;
  letter-spacing: .04em; text-transform: uppercase; text-decoration: underline;
}
.dlv-sample-link:hover { color: var(--ink-0); }

.dlv-company-select {
  width: 100%; padding: 8px 10px; font-size: 12px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 7px; color: var(--ink-1);
}

.dlv-run-btn {
  width: 100%; padding: 12px 16px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #ffb86b);
  color: #1a0d05; border: none; border-radius: 8px; cursor: pointer;
}
.dlv-run-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--bg-3); color: var(--ink-3); }

.dlv-phase {
  font-size: 11px; color: var(--accent-cyan); padding: 6px 0;
  border-bottom: 1px solid var(--border-1); margin-bottom: 8px;
}

.dlv-panel {
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 9px;
  overflow: hidden;
}
.dlv-panel-head {
  padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--ink-1);
  border-bottom: 1px solid var(--border-2); display: flex; align-items: center; gap: 8px;
}
.dlv-panel-head .st {
  font-size: 9px; font-weight: 500; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-3); color: var(--ink-3); font-family: ui-monospace, monospace;
}
.dlv-panel-head .st.live { color: var(--accent-cyan); }
.dlv-panel-head .st.done { color: var(--accent-green); }
.dlv-panel-body {
  padding: 12px; font-size: 12px; line-height: 1.55; color: var(--ink-2);
  white-space: pre-wrap; max-height: 360px; overflow-y: auto;
}
.dlv-panel-body.empty { color: var(--ink-4); font-style: italic; }

.dlv-spec-match {
  padding: 10px 12px; background: rgba(125,211,252,.06);
  border: 1px solid rgba(125,211,252,.2); border-radius: 8px;
  font-size: 11px; color: var(--ink-2); line-height: 1.4;
}

@media (max-width: 1100px) {
  .dlv-shell { grid-template-columns: 260px 1fr; }
  .dlv-out { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--border-1); }

  /* Below this width there is no room for a fixed-height 3-pane console — an
     iPad lands here in both orientations. The console pinned every pane to the
     viewport height behind its own scroller, so the page as a whole did not
     scroll and a tall pane's content was unreachable. Scroll the page as one
     document instead: unlock the panes and let .dlv-page (which IS
     .ws-page-content — see the note at the top) own the single scroller.
     .dlv-out's 50vh cap goes with it — that cap only made sense against a
     locked page; here it would strand the end of a long review. */
  .dlv-page { overflow-y: auto; }
  .dlv-shell { flex: 0 0 auto; overflow: visible; }
  .dlv-rail, .dlv-main, .dlv-out { overflow: visible; max-height: none; }
}

/* ── Embedded summary skin (paper) — only when shown as a Workspace section.
   Tokens are remapped to paper in embed-summary.css; these rules turn the
   3-column review console into a single paper document: title masthead on top,
   then function chips, the configure/upload toolbar, output as paper cards below. ── */

/* function library → wrapping chip row (display:contents lets the clustered
   buttons flow into one flex row; cluster labels and the counts drop out) */
body.yel-workspace-embed .dlv-rail .dlv-kicker { margin-bottom: 10px; }
body.yel-workspace-embed .dlv-fn-list { display: flex; flex-wrap: wrap; gap: 7px; }
body.yel-workspace-embed .dlv-cluster { display: contents; }
body.yel-workspace-embed .dlv-cluster-name { display: none; }
body.yel-workspace-embed .dlv-fn-btn {
  width: auto;
  margin: 0;
  background: #fff;
  border: 1px solid #d9dad2;
  border-radius: 20px;
  padding: 6px 13px;
  color: var(--ink-1);
}
body.yel-workspace-embed .dlv-fn-btn .num { display: none; }
body.yel-workspace-embed .dlv-fn-btn:hover { border-color: var(--accent); }
body.yel-workspace-embed .dlv-fn-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* title block → paper masthead, first in the stack.
   #fn-title / #empty-state h1 are metrics.html's title slots — this stylesheet is
   shared, so they stay. */
body.yel-workspace-embed .dlv-titlebar {
  /* width:100% is load-bearing — .dlv-page is a column flex container, so the
     auto side margins cancel align-items:stretch and the block would otherwise
     shrink to the lede's 62ch and sit out of line with the rail below. */
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 32px 0;
  background: transparent;
  border: none;
}
body.yel-workspace-embed .dlv-page-title,
body.yel-workspace-embed #fn-title,
body.yel-workspace-embed #empty-state h1 {
  font-family: var(--paper-serif) !important;
  font-size: 40px !important;
  font-weight: 600;
  letter-spacing: -.02em;
}

/* configure / upload column */
body.yel-workspace-embed .dlv-spec-match {
  background: #e8f0ee; border-color: #cfe0dc; color: var(--ink-1);
}
body.yel-workspace-embed .dlv-run-btn {
  background: var(--accent); color: #fff;
}
body.yel-workspace-embed .dlv-run-btn:disabled { background: #e7e7e1; color: #a9aaa1; }

/* output → paper cards */
body.yel-workspace-embed .dlv-out { display: flex; flex-direction: column; gap: 14px; }
body.yel-workspace-embed .dlv-panel {
  background: #fff;
  border: 1px solid #d9dad2;
  box-shadow: 0 1px 2px rgba(26, 28, 26, .04);
}
