/* Forms and notices, one system (owner, 2026-11-23: "many different form
   styles … the notice is also just a plain white card … engineered and
   precise"). Loaded last, after the page stylesheets.

   Forms sit on the page, not in a card. A form at least 640px wide sets each
   field on a ruled row with its label on the left (container query), groups
   are headed like sections, and the buttons line up with the fields; a
   narrow form (a sidebar, a dialog) keeps its labels above. */
.s-main form:not(.s-inline-form,.s-search,.s-adm-inline,.s-rename,.s-list-foot,.s-inbox-order,.s-def-copy,.button_to,.a-form){container-type:inline-size}
.s-main form.s-card,.s-main form .s-card:not(aside),.s-main .s-card:has(>form:only-child){background:none;border:0;border-radius:0;padding:0;box-shadow:none}
.s-main form.s-card{margin-top:0}

/* Groups (owner, 2026-11-23: "put the group title all the way on the left and
   then have the form on a two-thirds column on the right, all of it under one
   divider line that spans across both columns"). In a form at least 640px
   wide, each group is one ruled band: its title and hint in the left third,
   its fields stacked in the right two-thirds, related short fields side by
   side. Fields outside a group and the buttons use the same right column. */
@container (min-width:640px){
  .s-fieldset:has(>.s-legend){position:relative;min-height:120px;margin:0;padding:24px 0 32px calc((100% - 40px) / 3 + 40px);border:0;border-top:1px solid var(--s-ink)}
  .s-fieldset:has(>.s-legend)+.s-fieldset:has(>.s-legend){margin-top:0}
  .s-fieldset>.s-legend{position:absolute;left:0;top:24px;width:calc((100% - 40px) / 3);margin:0;padding:0;border:0;font:600 17px/1.3 var(--s-sans)}
  .s-fieldset>.s-legend-hint{position:absolute;left:0;top:52px;width:calc((100% - 40px) / 3);margin:0;font-size:13px}
  .s-fieldset:has(>.s-legend) .s-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:0 16px}
  .s-fieldset:has(>.s-legend) :is(.s-grid2,.s-pair,.s-inbox-pair){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
  .s-fieldset:has(>.s-legend) .s-grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px}
  form:has(.s-legend)>:is(.s-field,.s-fields,.s-grid2,.s-pair,.s-check,.s-checks,.s-flash,.s-note){margin-left:calc((100% - 40px) / 3 + 40px)}
  form:has(.s-legend)>:is(.s-form-actions,.s-actions:last-child){margin-top:0;padding:20px 0 0 calc((100% - 40px) / 3 + 40px);border-top:1px solid var(--s-line)}
  form:has(.s-legend)>:is(.s-btn,input[type=submit],button[type=submit]){margin-left:calc((100% - 40px) / 3 + 40px)}
}
.s-field{display:grid;gap:6px;margin:0 0 18px}
.s-field .s-input,.s-field .s-select,.s-field .s-textarea{max-width:none}
.s-main .s-form,.s-main .s-adm-form{max-width:1040px}
.s-main form:has(.s-legend){max-width:none}
form:not(:has(.s-legend,.s-section))>:is(.s-field,.s-fields,.s-grid2,.s-pair){max-width:560px}
form:not(:has(.s-legend,.s-section))>:is(.s-form-actions,.s-actions:last-child){padding-top:20px;border-top:1px solid var(--s-line);max-width:560px}
/* Notices: a tinted panel with a bar on the left, never a white card.
   Information (the default), attention, success and a problem. */
.s-main :is(.s-flash,.s-note),.s-flash,.s-note{display:block;margin:0 0 32px;padding:14px 18px 14px 16px;border:0;border-left:3px solid var(--s-ink-3);border-radius:0 var(--s-radius-sm) var(--s-radius-sm) 0;
  background:color-mix(in srgb,var(--s-sky) 45%,var(--s-ground));color:var(--s-ink);font-size:14px;line-height:1.5}
.s-note{border-left-color:var(--s-attention);background:var(--s-attention-soft);color:#4a3300}
.s-flash--notice{border-left-color:var(--s-ok);background:var(--s-ok-soft);color:#1f4a33}
.s-flash--alert{border-left-color:var(--s-critical);background:var(--s-critical-soft);color:#7d1a14}
.s-flash p,.s-note p{margin:0}
.s-flash p+p{margin-top:4px}
.s-flash>.s-h2,.s-flash>div>.s-h2{font-size:15px;margin:0 0 2px}
.s-danger-zone{padding-left:16px!important;border-left:3px solid var(--s-critical)!important}
/* A notice is as wide as the content it is about. */
.s-main>:is(.s-flash,.s-note),.s-main>.s-narrow>:is(.s-flash,.s-note){max-width:880px}
/* An explanation under a heading, not a notice. */
.s-lead-note{margin:14px 0 0;color:var(--s-ink-2);font-size:14px}
/* Details beside a form share its label column. */
.s-narrow .s-dl{grid-template-columns:252px minmax(0,1fr)}
.s-narrow .s-dl dt{padding-right:32px}
@media (max-width:640px){.s-narrow .s-dl{grid-template-columns:1fr}}
/* One label style for forms and details: medium, in the second ink. */
.s-field>.s-label,.s-field>label:first-child{font-weight:500;color:var(--s-ink-2);font-size:14px}
.s-dl dt{color:var(--s-ink-2);font-weight:500;font-size:14px}
/* A form inside a section is as wide as the section. */
.s-section>form.s-form,.s-section>form{max-width:none}
/* A summary beside a form (the order) is the page's focus: a white card
   with a shadow, well apart from the form (owner, 2026-11-23). */
.s-inbox-order{grid-template-columns:minmax(0,1fr) 380px;gap:72px}
.s-inbox-summary{top:112px;padding:28px;background:#fff;border:1px solid var(--s-line);border-radius:var(--s-radius);box-shadow:0 18px 40px -22px rgba(12,15,17,.28)}
@media (max-width:900px){.s-inbox-order{grid-template-columns:1fr;gap:32px}}
/* Save and Cancel stay in view (owner, 2026-11-23): the form's action row
   sticks to the bottom of the window on a band in the page colour. */
.s-main form>:is(.s-form-actions,.s-actions:last-child){position:sticky;bottom:0;z-index:5;margin-bottom:0;padding-bottom:20px;background:var(--s-ground);box-shadow:0 -12px 16px -12px rgba(12,15,17,.08)}
/* A band outside a form (owner, 2026-11-23): a titled row like a form
   group, for settings that save on their own and for facts beside them. */
.s-settings-bands{margin-top:40px;border-bottom:1px solid var(--s-line)}
.s-band{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);column-gap:40px;padding:24px 0;border-top:1px solid var(--s-line)}
.s-settings-bands>.s-band:first-child{border-top-color:var(--s-ink)}
.s-band-title{margin:0;font:600 15px/1.4 var(--s-sans)}
.s-band-hint{margin:6px 0 0;color:var(--s-ink-3);font-size:13px;line-height:1.5}
.s-band-text{margin:0;font-size:14px;line-height:1.5}
.s-band-body{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}
ul.s-band-body{display:block;border:0}
@media (max-width:760px){.s-band{grid-template-columns:1fr;row-gap:12px}}
/* Sections that hold a form, and sections inside a form, are bands too
   (owner, 2026-11-23: every form in the one structure): the heading and its
   hint in the left third, the form or its controls in the right two-thirds,
   under one rule. */
@media (min-width:1000px){
  .s-main :is(.s-section:has(>form:not(.s-inline-form,.s-search,.button_to)),form .s-section:has(>.s-section-head)){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);column-gap:40px;align-items:start;padding-top:24px;border-top:1px solid var(--s-ink)}
  .s-main :is(.s-section:has(>form:not(.s-inline-form,.s-search,.button_to)),form .s-section:has(>.s-section-head))>.s-section-head{grid-column:1;grid-row:1 / span 20;display:block;margin:0;padding:0;border:0}
  .s-main :is(.s-section:has(>form:not(.s-inline-form,.s-search,.button_to)),form .s-section:has(>.s-section-head))>.s-section-head>*:not(.s-btn){display:block}
  .s-main :is(.s-section:has(>form:not(.s-inline-form,.s-search,.button_to)),form .s-section:has(>.s-section-head))>.s-section-head .s-hint{margin-top:6px}
  .s-main :is(.s-section:has(>form:not(.s-inline-form,.s-search,.button_to)),form .s-section:has(>.s-section-head))>.s-section-head .s-btn{margin:12px 0 0 -10px}
  .s-main :is(.s-section:has(>form:not(.s-inline-form,.s-search,.button_to)),form .s-section:has(>.s-section-head))>:not(.s-section-head){grid-column:2;margin-top:0}
  .s-main .s-section:has(>form:not(.s-inline-form,.s-search,.button_to))>form{max-width:none}
}
@media (min-width:1000px){
  .s-main :is(.s-section,.s-fieldset,.s-band-body)>.s-segment{justify-self:start;width:max-content;max-width:100%}
  .s-main form:has(.s-section>.s-section-head)>:is(.s-save-bar,.s-form-actions,.s-actions:last-child){padding-left:calc((100% - 40px) / 3 + 40px)}
}
/* A page of bands uses the full width; every section on it is a band. */
.s-main .s-narrow:has(>.s-section>form,>form,>.s-section>.s-section-head+*){max-width:none}
@media (min-width:1000px){
  .s-main .s-narrow>.s-section:has(>.s-section-head){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);column-gap:40px;align-items:start;padding-top:24px;border-top:1px solid var(--s-ink)}
  .s-main .s-narrow>.s-section:has(>.s-section-head)>.s-section-head{grid-column:1;grid-row:1 / span 20;display:block;margin:0;padding:0;border:0}
  .s-main .s-narrow>.s-section:has(>.s-section-head)>.s-section-head>*:not(.s-btn){display:block}
  .s-main .s-narrow>.s-section:has(>.s-section-head)>.s-section-head .s-hint{margin-top:6px}
  .s-main .s-narrow>.s-section:has(>.s-section-head)>:not(.s-section-head){grid-column:2;margin-top:0}
}
/* Step-by-step flows and repeated items (owner recovery, reminders) are
   bands too: the step's or item's heading on the left, its content right. */
@media (min-width:1000px){
  .s-main :is(.s-step,.s-item){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);column-gap:40px;align-items:start;max-width:none;margin-top:32px;padding:24px 0 0;background:none;border:0;border-radius:0;border-top:1px solid var(--s-ink);box-shadow:none}
  .s-main .s-step>h2,.s-main .s-item>.s-item-head{grid-column:1;grid-row:1 / span 30;margin:0}
  .s-main .s-item>.s-item-head{display:block}
  .s-main .s-item>.s-item-head .s-btn{margin-top:12px}
  .s-main :is(.s-step,.s-item)>:not(h2,.s-item-head){grid-column:2}
  .s-main .s-step>p:first-of-type,.s-main .s-step>h2+*{margin-top:0}
}
.s-main .s-save-bar{position:sticky;bottom:0;z-index:5;padding-top:16px;padding-bottom:20px;background:var(--s-ground);border-top:1px solid var(--s-line);box-shadow:0 -12px 16px -12px rgba(12,15,17,.08)}
/* One kind of group per page (owner, 2026-11-23: "two different types of
   groups on top of each other"): in Workshop every section with a heading is
   a band, except in the vehicle overview's two columns and in admin. */
@media (min-width:1000px){
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);column-gap:40px;align-items:start;padding-top:24px;border-top:1px solid var(--s-ink)}
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you)>.s-section-head{grid-column:1;grid-row:1 / span 30;display:block;margin:0;padding:0;border:0}
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you)>.s-section-head>*:not(.s-btn){display:block}
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you)>.s-section-head .s-hint{margin-top:6px}
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you)>.s-section-head .s-btn{margin:12px 0 0 -10px}
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you)>:not(.s-section-head){grid-column:2;margin-top:0}
  .s-body:not(:has(.s-admin)) .s-main .s-section:has(>.s-section-head):not(.s-split .s-section,#needs-you)>:is(.s-list,.s-dl,.s-table,.s-history,.s-scroll){border-top:0}
}
/* Under tabs the tab line is the divider: the first band has no rule of
   its own (owner, 2026-11-23: no double border). */
:is(.s-tabs,.s-inbox-tabs)+:is(.s-section,.s-band),
:is(.s-tabs,.s-inbox-tabs)+*>:is(.s-section,.s-band):first-child{border-top:0!important;margin-top:16px}
:is(.s-tabs,.s-inbox-tabs)+.s-settings-bands{margin-top:16px;border-top:0}
/* The order summary is a forest card with lime for the action (owner, 2026-11-23). */
.s-main .s-inbox-summary{background:var(--s-forest);border-color:var(--s-forest);color:#eef1e9;box-shadow:0 22px 44px -24px rgba(12,15,17,.45)}
.s-inbox-summary .s-h2,.s-inbox-summary .s-inbox-summary-line,.s-inbox-summary .s-inbox-total,.s-inbox-summary .s-inbox-total dt{color:#fff}
.s-inbox-summary .s-inbox-figures{border-top-color:rgba(255,255,255,.16)}
.s-inbox-summary .s-inbox-figures dt,.s-inbox-summary .s-hint{color:rgba(238,241,233,.68)}
.s-inbox-summary .s-btn--primary{background:var(--s-lime);color:var(--s-ink)}
.s-inbox-summary .s-btn--primary:hover{background:color-mix(in srgb,var(--s-lime),#fff 18%)}
.s-inbox-summary :is(.s-btn--quiet,.s-btn--secondary){color:#eef1e9;background:transparent;border-color:rgba(255,255,255,.28)}
.s-inbox-summary .s-btn--quiet:hover{background:rgba(255,255,255,.08)}
.s-inbox-summary .s-input{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.24);color:#fff}
.s-inbox-summary a{color:#fff}
