/* Cadence Forms 1.0 component geometry. These tokens are shared by every opted-in app. */
body[data-cadence-ui="1.0"] {
  --cad-toolbar-height:52px;
  --cad-control-height:32px;
  --cad-row-height:38px;
  --cad-header-height:34px;
  --cad-icon-size:15px;
  --cad-icon-gap:6px;
  --cad-ink:#262626;
  --cad-plum:#2b2134;
  --cad-row-alt:#f7f7f7;
}
html body[data-cadence-ui="1.0"] #shell-context-nav[data-cadence-component="toolbar"] {
  height:var(--cad-toolbar-height) !important; min-height:var(--cad-toolbar-height) !important;
  gap:12px !important;
}
html body[data-cadence-ui="1.0"] #shell-context-nav [data-cadence-component="filters"] {
  display:flex; align-items:center; flex-wrap:nowrap; gap:4px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > tbody > tr:not(.rwm-exp-row):not(.cad-section) > :is(td,th):not([rowspan]) {
  box-sizing:border-box !important; height:var(--cad-row-height) !important;
  padding-top:0 !important; padding-bottom:0 !important; line-height:18px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > tbody > tr > td :is(.link-btn,.rwm-why-btn) {
  min-height:0 !important; height:auto !important; line-height:18px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > tbody > tr > td :is(input,select,button.cad-rg-btn) {
  max-height:28px; box-sizing:border-box;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-rown {
  font-variant-numeric:tabular-nums;
}
html body[data-cadence-ui="1.0"] #view [data-cadence-component="footer"] {
  font-size:12.5px; font-variant-numeric:tabular-nums;
}
html body[data-cadence-ui="1.0"] #shell-context-nav .cad-bar .pv > .cad-sel,
html body[data-cadence-ui="1.0"] #shell-context-nav .cad-bar .pv > .cad-sel > .cad-rg-btn {
  width:auto !important; min-width:0 !important; max-width:180px !important; flex:none !important;
}
html body[data-cadence-ui="1.0"] #view .cad-foot .im-readyline {
  display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin:0; padding:0;
  border:0; background:transparent; font-size:12.5px;
}

/* Cell editors read as cells until engaged, with an explicit keyboard focus state. */
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel { width:auto !important; min-width:0 !important; max-width:100% !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel > .cad-rg-btn {
  min-width:0 !important; min-height:26px !important; height:26px !important; padding:0 4px !important;
  border:1px solid transparent !important; background:transparent !important; box-shadow:none !important;
  font:inherit !important; gap:4px !important; border-radius:3px !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel .cad-sel-caret { opacity:0; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel:is(:hover,:focus-within) .cad-sel-caret { opacity:1; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel > .cad-rg-btn:hover { background:#eee !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] .cad-sel > .cad-rg-btn:focus-visible { outline:2px solid #76528e !important; outline-offset:0; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid :is(.rwm-adj-input,.rwm-adj-note) {
  width:100% !important; max-width:100% !important; height:28px !important; padding:0 4px !important;
  border:1px solid transparent !important; border-radius:3px !important; background:transparent !important; box-shadow:none !important;
  color:var(--cad-ink) !important; font:inherit !important;
}
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid input:focus { outline:2px solid #76528e !important; outline-offset:0; background:white !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid input[type=number] { appearance:textfield; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid input::-webkit-inner-spin-button { appearance:none; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid tbody :is(th,td) { font-size:13px !important; color:var(--cad-ink) !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid tbody .rwm-adj-account { font-weight:400 !important; background:#fafafa !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid tbody .rwm-adj-item-col { background:#fafafa !important; color:var(--cad-ink) !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid :is(.rwm-adj-consensus-row,.rwm-adj-total-row) > :is(th,td) {
  background:#f3f0f5 !important; color:var(--cad-ink) !important; border-top:1px solid #d8cfdf !important; border-bottom:1px solid #d8cfdf !important; font-weight:600 !important;
}
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid td.rwm-adj-closed { background:transparent !important; color:#777 !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid td.dirty { background:#f3edf8 !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid .cad-cell-select { width:100% !important; }
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid .cad-cell-select > .cad-rg-btn { width:100% !important; justify-content:space-between; }
html body[data-cadence-ui="1.0"] #view .cad-foot .cad-pagination { margin-left:auto; display:flex; align-items:center; gap:10px; }

html body[data-cadence-ui="1.0"] #view table[data-cadence-render="direct"] td[data-column="item"] strong { font-weight:600 !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"].rwm-adj-grid :is(input.rwm-adj-input,input.rwm-adj-note) { border:1px solid transparent !important; background:transparent !important; }

/* A label inside summary is interactive HTML and swallows the native details toggle. */
html body[data-cadence-ui="1.0"] #shell-context-nav details.facet-dd > summary > label { pointer-events:none; }

/* Values use one cell treatment across forms; action buttons keep their own affordance. */
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td :is(input[type="number"],input[type="text"],input:not([type]),select) {
  border:1px solid transparent !important; border-radius:3px !important;
  background:transparent !important; box-shadow:none !important; font:inherit !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td :is(input[type="number"],input[type="text"],input:not([type]),select):hover { background:#eee !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td :is(input[type="number"],input[type="text"],input:not([type]),select):focus {
  outline:2px solid #76528e !important; outline-offset:0; background:white !important;
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td input[type="number"] { appearance:textfield; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td input::-webkit-inner-spin-button { appearance:none; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] td span.src {
  background:transparent !important; border:0 !important; padding:0 !important; font:inherit !important;
}

/* Compact reason cells reserve space for the label without widening period columns. */
html body[data-cadence-ui="1.0"] #view .rwm-adj-grid td:has(> .cad-cell-select) { padding-left:4px !important; padding-right:4px !important; }
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"].rwm-adj-grid .cad-cell-select > .cad-rg-btn { padding:0 2px !important; gap:2px !important; font-weight:400 !important; }

/* Preserve the approved fitted desktop grid; below its readable width use the
   native table's intrinsic numeric widths and the existing shared scroll rails.
   A container query also covers zoom, side panels and an already mounted grid. */
html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid { container-type:inline-size; }
@container (max-width:1349px) {
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default {
    table-layout:auto !important; width:max-content !important; min-width:100% !important;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-fit-default td input.rwm-edit { field-sizing:content; width:auto !important; min-width:52px; max-width:none; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-fit-default col { width:auto !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td) {
    min-width:72px !important; text-overflow:clip;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="rown"] { min-width:38px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="select"] { min-width:32px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="item"] { min-width:150px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="desc"] {
    width:220px !important; min-width:220px !important; max-width:220px !important; text-overflow:ellipsis;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td):is([data-column="vendor"],[data-column="constraint"]) {
    width:180px !important; max-width:180px !important; text-overflow:ellipsis;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="dest"] {
    width:240px !important; max-width:240px !important; text-overflow:ellipsis;
  }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="recQty"] { min-width:90px !important; }
  html body[data-cadence-ui="1.0"] #view .rwm-workbench-grid table.rwm-tbl.rwm-fit-default :is(th,td)[data-column="why"] { min-width:50px !important; }
}


/* Secondary business sections follow the same typography as grid chrome. */
html body[data-cadence-ui="1.0"] #view .cad-section-title {
  margin:16px 0 8px; font-size:13px; font-weight:600; color:var(--cad-ink);
}
html body[data-cadence-ui="1.0"] #view table[data-cadence-render="direct"] :is(.lr-flag,.lr-urg,.tpm-status,.ctp-stat,.cbmf-conf) {
  background:transparent !important; border:0 !important; padding:0 !important; font:inherit !important;
}

/* Reports retain chart/card composition while nested grids can scroll independently. */
html body[data-cadence-ui="1.0"] #view .cad-report-table { margin-top:12px; }
html body[data-cadence-ui="1.0"] #view .cad-report-section { margin-top:16px; }
html body[data-cadence-ui="1.0"] #view .cad-report-section > h3 { font-size:13px; margin:0 0 8px; }

html body[data-cadence-ui="1.0"] #view .cad-report-columns > * { min-width:0; }

/* The expanded search wrapper supplies the icon; the input must not draw it again. */
html body[data-cadence-ui="1.0"] #shell-context-nav .cad-filters.cad-bar.cad-bar .scope-select.cad-search.open input {
  background-image:none !important; padding:0 4px !important;
}

/* Canvas drawing dimensions update asynchronously after a viewport change. Keep
   the visible chart inside its current card during that resize as well. */
html body[data-cadence-ui="1.0"] #view .da-canvas-wrap { min-width:0; }
html body[data-cadence-ui="1.0"] #view .da-canvas-wrap > canvas {
  display:block; width:100% !important; height:100% !important; max-width:100%;
}

/* Period transitions remain visible without assigning colors to time fences. */
html body[data-cadence-ui="1.0"] #view table[data-cadence-component="grid"] > thead > tr > th[data-period-boundary="planning"] {
  border-left:2px dotted #938c81 !important;
}
