/* SMP-INDUSTRY-VISUAL-ALIGNMENT-001
   SMP-NUMBERED-MODULE-BODY-ALIGN-001
   SMP-INDUSTRY-CONTENT-INSET-001
   One content grid for the four industry workspaces.
   2px is the space between adjacent module borders. It is not the
   space between text and a border.
   Section 01 has one border. Its content container keeps a symmetric
   12px inset, so labels and inputs are not flush with that border.
   The number stays in the heading. The body uses the same content
   width and does not follow the title text.
*/

:is(#restaurant-root, #retail-root, #service-root, #rental-root) {
  --industry-module-pad: 2px;
  --industry-content-pad: 12px;
  --industry-number-col: 2.5rem;
  --industry-col-gap: 10px;
  --industry-content-inset: calc(var(--industry-number-col) + var(--industry-col-gap));
  --industry-line: color-mix(in srgb, var(--accent, #0f5b44) 22%, var(--line, #d7e0da));
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) :is(#product-margin-form, #operating-records, #operating-results) {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin-form.input-panel.section01-flow {
  border: 1px solid var(--industry-line);
  border-radius: 12px;
  padding: 12px var(--industry-content-pad) 16px;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) :is(.restaurant-calculator-host, .detailed-calculator-group) #product-margin .section01-heading {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

@media (max-width: 900px) {
  /* The older phone rule uses auto-fit 148px tracks. Once fields sit in the title
     column, two tracks no longer fit and the dish name stops spanning the row. */
  :is(#restaurant-root, #service-root) #product-margin .s01-product-fields {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  :is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-product-fields.s01-product-fields--no-status {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-product-fields > .product-name-field {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-width: 0;
    width: auto;
  }
}

@media (max-width: 700px) {
  :is(#retail-root) #product-margin.s01-purchase-lot-register .s01-product-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  :is(#retail-root) #product-margin.s01-purchase-lot-register .s01-product-fields > .field {
    grid-column: 1;
  }
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-recipe-costing {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .section01-flow > :not(.section01-heading) {
  margin-left: 0;
  max-width: 100%;
  min-width: 0;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin :is(.s01-guided-step, .s01-pricing-section, .s01-final-save, .s01-added-section, .s01-material-section, .s01-cost-result, .s01-cost-confirmation) {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-guided-step.is-current,
:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-guided-step.is-locked,
:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-pricing-section,
:is(#restaurant-root, #retail-root, #service-root, #rental-root) #product-margin .s01-final-save {
  background: color-mix(in srgb, var(--accent, #0f5b44) 6%, transparent);
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) :is(#operating-records, #operating-results) {
  border: 1px solid var(--industry-line);
  border-radius: 12px;
  overflow: clip;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) :is(#operating-records, #operating-results) > summary.business-section-heading {
  padding-left: var(--industry-module-pad);
  padding-right: var(--industry-module-pad);
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #operating-records > .s02-root,
:is(#restaurant-root, #retail-root, #service-root, #rental-root) #operating-results > .s03-root {
  border: 0;
  box-shadow: none;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 8px var(--industry-module-pad) 16px;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #operating-records .s02v2-wrap,
:is(#restaurant-root, #retail-root, #service-root, #rental-root) #operating-results .s03v2-module {
  padding-left: 0;
  padding-right: 0;
}

:is(#restaurant-root, #retail-root, #service-root) :is(.restaurant-calculator-host, .detailed-calculator-group) #product-margin .section01-heading > .section-title-line > h2 {
  overflow: visible;
  text-overflow: clip;
  text-wrap: wrap;
  white-space: normal;
}

:is(#restaurant-root, #retail-root, #service-root) :is(.restaurant-calculator-host, .detailed-calculator-group) #product-margin .section01-heading > p {
  -webkit-box-orient: unset;
  -webkit-line-clamp: unset;
  display: block;
  height: auto;
  max-height: none;
  overflow: visible;
  text-overflow: clip;
  text-wrap: wrap;
  white-space: normal;
}

:is(#restaurant-root, #retail-root, #service-root, #rental-root) #operating-results .s03v2-inventory {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}
