/* The workbench owns these variables, including when it is embedded in the main site. */
.jn-workbench {
  --jn-ink: #1d2738;
  --jn-subtle: #536278;
  --jn-line: #dfe5ed;
  --jn-bg: #f4f6f9;
  --jn-blue: #165dff;
  --jn-space: clamp(14px, 1.6vw, 24px);
  color: var(--jn-ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html .jn-workbench .main-shell { min-width: 0; background: var(--jn-bg); }
html .jn-workbench .main-content { width: 100%; min-width: 0; max-width: 1580px; margin-inline: auto; padding: 16px var(--jn-space) 28px; }
html .jn-workbench .page-heading { align-items: center; gap: 12px; margin: 14px 0; }
html .jn-workbench .page-heading h1 { font-size: 21px; line-height: 1.45; letter-spacing: 0; }
.jn-workbench .page-heading .breadcrumb, .jn-workbench .page-heading p { display: none; }
.jn-workbench .page-heading .page-heading-tag { white-space: normal; }
html .jn-workbench .surface, html .jn-workbench .main-magnetic-account-summary,
html .jn-workbench .main-magnetic-single-actions, html .jn-workbench .main-magnetic-codex-help,
html .jn-workbench .main-magnetic-result-help {
  min-width: 0; margin-bottom: 12px; border: 1px solid var(--jn-line); border-radius: 8px; background: #fff; box-shadow: none;
}
.jn-workbench .surface .section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 14px var(--jn-space); }
.jn-workbench .surface .section-title h2 { font-size: 16px; line-height: 24px; font-weight: 650; }
.jn-workbench .surface h3, .jn-workbench .jn-editor-heading label { color: var(--jn-ink); font-size: 14px; font-weight: 650; line-height: 22px; }
.jn-workbench .muted, .jn-workbench .jn-draft-note, .jn-workbench .config-info { color: var(--jn-subtle); font-size: 13px; line-height: 1.6; }
.jn-workbench .toolbar { min-width: 0; flex-wrap: wrap; gap: 8px; }
.jn-workbench .ant-btn { border-radius: 5px; }
.jn-workbench :is(button, input, textarea, summary, .upload-button):focus-visible { outline: 2px solid var(--jn-blue); outline-offset: 2px; }
.jn-workbench .ant-table-wrapper, .jn-workbench .ant-table-container { min-width: 0; max-width: 100%; }
.jn-workbench .ant-table-content, .jn-workbench .ant-table-body { overflow-x: auto; }
.jn-workbench .ant-table-thead > tr > th { background: #f5f7fa; color: #38455a; }
.jn-workbench .main-content > .ant-alert, .jn-workbench .page-alert { margin-bottom: 12px; }
html .jn-workbench .main-magnetic-build-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px var(--jn-space); }
.jn-workbench .jn-company-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.jn-company-scope > span { color: var(--jn-subtle); }
html .jn-workbench .plan-table { padding: 0; }
html .jn-workbench .plan-table > .section-title { margin: 0; padding: 16px var(--jn-space); border-bottom: 1px solid var(--jn-line); }
html .jn-workbench .plan-table > .section-title h2 { font-size: 18px; }
html .jn-workbench .plan-table > .section-title p { margin: 3px 0 0; }
html .jn-workbench .plan-table > .jn-plan-mode { align-items: center; margin: 12px var(--jn-space); padding: 0; }
.jn-plan-mode > label { color: var(--jn-ink); font-size: 13px; font-weight: 600; }
html .jn-workbench .plan-table > .jn-spend-note { margin: 10px var(--jn-space) 4px; padding: 9px 12px; background: #fff8e9; border: 1px solid #eedbb1; border-radius: 6px; }
.jn-workbench .jn-spend-note .ant-alert-icon { margin-top: 2px; margin-inline-end: 9px; font-size: 16px; }
.jn-workbench .jn-spend-note .ant-alert-message { margin: 0; font-size: 13px; line-height: 1.55; color: #775016; font-weight: 600; }
.jn-workbench .jn-spend-note .ant-alert-description { font-size: 12px; line-height: 1.5; color: #755b30; }
html .jn-workbench .plan-table > .jn-draft-note { margin: 5px var(--jn-space) 10px; }
.jn-workbench .jn-table-editor { margin: 14px var(--jn-space); padding: 14px; background: #f7f9fd; border: 1px solid #d7e1ee; border-radius: 7px; }
.jn-editor-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.jn-workbench .jn-table-editor .toolbar, .jn-workbench .jn-resource-grid .toolbar, .jn-workbench .jn-plan-recovery .toolbar { margin: 0; padding: 0; }
html .jn-workbench .jn-table-editor textarea { display: block; width: 100%; min-height: 86px; line-height: 1.65; padding: 10px 12px; border: 1px solid #cad5e3; border-radius: 5px; font-size: 13px; }
html .jn-workbench .jn-table-editor textarea:focus { border-color: var(--jn-blue); }
html .jn-workbench .jn-table-editor .jn-validate { margin-top: 10px; }
.jn-workbench .jn-validate .ant-btn-primary:not(:disabled) { background: var(--jn-blue); }
html .jn-workbench .plan-table > .business-plan-import { margin: 12px var(--jn-space); border-radius: 6px; }
.jn-workbench .jn-plan-resources, .jn-workbench .jn-plan-recovery { padding: 14px var(--jn-space); border-top: 1px solid var(--jn-line); }
.jn-resource-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,340px),1fr)); gap: 16px; }
.jn-workbench .jn-resource-grid > * { min-width: 0; margin: 0; padding: 12px 14px; border: 1px solid var(--jn-line); border-radius: 6px; background: #fff; }
html .jn-workbench .jn-resource-grid .section-title { margin: 0; padding: 0; border: 0; }
.jn-workbench .jn-resource-grid h3, .jn-workbench .jn-plan-recovery h3 { margin: 0; }
.jn-workbench .jn-resource-grid .muted { margin: 3px 0; }
.jn-workbench .jn-resource-grid .toolbar { margin-top: 8px; justify-content: flex-start; }
.jn-workbench .jn-video .plan-local-materials { margin: 0; padding: 0; border: 0; background: transparent; }
.jn-workbench .jn-inline-help { margin: 7px 0 0; font-size: 12px; }
.jn-workbench .jn-inline-help > summary { cursor: pointer; color: var(--jn-blue); }
.jn-workbench .jn-inline-help .config-info { padding: 6px 0 0; margin: 0; }
.jn-workbench .jn-plan-recovery .toolbar { display: grid; grid-template-columns: minmax(100px,1fr) auto minmax(100px,1fr) auto; margin-top: 8px; }
.jn-workbench .jn-plan-recovery .config-info { padding: 0; margin: 6px 0 0; border: 0; background: transparent; }
html .jn-workbench .main-magnetic-account-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; padding: 12px var(--jn-space); }
html .jn-workbench .main-magnetic-account-summary > span, html.embedded-workspace .jn-workbench .main-magnetic-account-summary > span:last-child { display: inline-flex; align-items: baseline; gap: 7px; width: auto; margin: 0; font-size: 13px; color: var(--jn-subtle); }
.jn-workbench .main-magnetic-account-summary strong { font-size: 18px; color: var(--jn-ink); font-variant-numeric: tabular-nums; }
.jn-workbench .material-library > .section-title { align-items: center; justify-content: space-between; }
html .jn-workbench .jn-material-filters { margin: 0; padding: 10px var(--jn-space); border-bottom: 1px solid var(--jn-line); background: #f7f9fc; justify-content: flex-start; }
.jn-workbench .material-library .upload-button { position: relative; }
.jn-workbench .material-library .upload-button input { display: block; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.jn-workbench .material-library .upload-button:focus-within { outline: 2px solid var(--jn-blue); outline-offset: 2px; }
.jn-workbench .material-library .upload-button { border-radius: 5px; }
.jn-workbench .material-library .upload-button:not(.disabled) { background: var(--jn-blue); color: #fff; }
html .jn-workbench[data-jn-page="materials"] .workflow-hint { background: #f0f5ff; border: 1px solid #d6e4ff; border-radius: 6px; }
html .jn-workbench .batch-lookup .lookup-controls { display: flex; min-width: 0; flex-wrap: wrap; gap: 8px; }
html .jn-workbench .batch-lookup .lookup-controls > .ant-input { flex: 1 1 190px; min-width: 0; }
@media (max-width: 700px) {
  html .jn-workbench .main-content { padding: 8px; }
  html .jn-workbench .main-shell { width: 100%; }
  html .jn-workbench .topbar, html .jn-workbench .page-heading { height: auto; flex-wrap: wrap; }
  html .jn-workbench .contextbar { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 9px; padding: 8px 12px; }
  html .jn-workbench .contextbar > .ant-select { width: 100% !important; min-width: 0; }
  html .jn-workbench .contextbar .context-label { grid-column: 1/-1; }
  html .jn-workbench .toolbar, html .jn-workbench .section-title { max-width: 100%; justify-content: flex-start; }
  html .jn-workbench .toolbar > .ant-select, html .jn-workbench .toolbar > .ant-input, html .jn-workbench .toolbar > .ant-input-affix-wrapper { min-width: 0 !important; max-width: 100% !important; }
  html .jn-workbench .jn-plan-mode > .muted { flex-basis: 100%; }
  html .jn-workbench .jn-table-editor { padding: 10px; }
  html .jn-workbench .jn-validate > .muted { flex-basis: 100%; }
  .jn-workbench .jn-plan-recovery .toolbar { grid-template-columns: minmax(0,1fr) auto; }
  .jn-workbench .material-library .section-title > .toolbar { width: 100%; }
  .jn-workbench .material-library .toolbar > .ant-input-affix-wrapper { flex: 1 1 145px; }
  .jn-workbench .main-content .ant-alert, .jn-workbench .employee { overflow-wrap: anywhere; }
}

/* Local to the table builder. Preserve the shared workbench on other routes. */
.jn-workbench[data-jn-page="create"] .page-heading[hidden] { display: none; }
.jn-workbench .jn-build-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 3px 0 14px; }
.jn-workbench .jn-build-title h1 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.5; color: var(--jn-ink); }
.jn-workbench .jn-build-title .toolbar { margin: 0; padding: 0; }
.jn-workbench .jn-context-scope { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; color: var(--jn-ink); }
.jn-workbench .jn-context-scope > span { display: inline-flex; align-items: center; gap: 7px; }
.jn-context-help { position: relative; }
.jn-workbench :is(.jn-context-help, .jn-fill-help, .jn-inline-help) summary { cursor: pointer; color: #195cc7; font-size: 13px; line-height: 1.6; }
.jn-workbench .jn-context-help > div { position: absolute; z-index: 20; top: calc(100% + 7px); inset-inline-start: 0; width: min(300px, 70vw); padding: 9px 12px; color: #344458; background: white; border: 1px solid var(--jn-line); border-radius: 6px; box-shadow: 0 4px 16px #24395a19; }
.jn-workbench .jn-context-help p, .jn-workbench .jn-fill-help p { margin: 0; line-height: 1.65; }
html .jn-workbench .plan-table > .jn-spend-note { padding: 8px 12px; margin-block: 10px 16px; }
.jn-workbench .jn-spend-note .ant-alert-message { display: flex; gap: 2px 12px; align-items: baseline; flex-wrap: wrap; color: #754506; }
.jn-workbench .jn-spend-note .ant-alert-message span { color: #554a39; font-weight: 400; }
.jn-workbench .jn-table-editor { padding: 14px; margin-block: 14px; }
.jn-workbench .jn-fill-help { font-size: 13px; flex: 1 1 auto; }
.jn-workbench .jn-fill-help[open] { flex-basis: 100%; }
.jn-workbench .jn-fill-help p { color: var(--jn-subtle); }
.jn-workbench .jn-resource-grid .jn-inline-help { margin-top: 9px; }
html .jn-workbench .jn-resource-grid .section-title { padding: 0; }
html .jn-workbench .jn-video .plan-local-materials { padding: 0; margin: 0; border: 0; background: none; }
html .jn-workbench .jn-resource-grid .toolbar { margin: 8px 0 0; padding: 0; align-items: center; }
.jn-workbench .jn-resource-grid .product-lookup .toolbar > input { flex: 1 1 105px; }
@media (max-width: 1000px) {
  .jn-workbench .jn-context-help > div { position: static; width: auto; box-shadow: none; }
  .jn-workbench .jn-context-scope:has(details[open]) { flex-basis: 100%; }
}
@media (max-width: 700px) {
  .jn-workbench .jn-context-scope { grid-column: 1/-1; }
  .jn-workbench .jn-build-title { margin-block: 3px 10px; }
  .jn-workbench .jn-build-title h1 { font-size: 20px; }
  .jn-workbench .jn-resource-grid { grid-template-columns: minmax(0,1fr); }
  .jn-workbench .jn-fill-help { flex-basis: 100%; }
  .jn-workbench .jn-context-help[open] { width: 100%; }
}
html .jn-workbench .jn-resource-grid .section-title.compact { min-height: 0; }
html .jn-workbench .jn-plan-recovery .toolbar > input { width: 100%; }
@media (max-width: 700px) {
  html .jn-workbench .jn-build-title { flex-direction: row; justify-content: space-between; }
  html .jn-workbench .jn-build-title .toolbar { width: auto; flex-direction: row; flex-basis: auto; }
  html .jn-workbench .plan-table > .section-title { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 700px) {
  html .jn-workbench .jn-resource-grid .section-title.compact { flex-direction: row; justify-content: flex-start; }
}
