/* Titanor V1 — fundação visual canônica.
   O shell é universal; os corpos migram por arquétipo sem criar outro padrão. */

:root {
  --titanor-card-gap-one-two: 20px;
  --titanor-card-gap-three: 16px;
  --titanor-card-gap-four-plus: 12px;
  --titanor-card-gap-mobile: 12px;
  --titanor-card-padding-min: 16px;
}

body .b3-materials-page { display: grid; gap: var(--ui-space-section); min-width: 0; }
body .b3-materials-page > .page-heading { margin-bottom: 0; }
body .b3-material-summary + .panel { margin-top: var(--ui-space-section); }
body .b3-materials-page > .b3-material-summary + .panel { margin-top: 0; }

/* Checklists e inspeções permanecem um bloco transversal simples: modelos e
   execuções são linhas, não cartões aninhados dentro do painel canônico. */
.operational-form-template-list,
.operational-forms-panel,
.operational-evidence-section,
.operational-run-history { min-width: 0; }
[data-v1-canonical-page="operational-form-run"] .canonical-page-heading p a {
  text-decoration: underline;
  text-underline-offset: .18em;
}
[data-v1-canonical-page="task-detail"] > .canonical-card + .canonical-card,
[data-v1-canonical-page="operational-form-run"] > .operational-run-history {
  margin-top: var(--titanor-card-gap-three);
}
[data-v1-canonical-page="operational-form-run"] > .canonical-form {
  display: grid;
  gap: var(--titanor-card-gap-three);
}
.service-order-operational-detail > .operational-forms-panel {
  margin-block: var(--titanor-card-gap-three);
}
.operational-form-fields,
.operational-run-fields,
.operational-form-start-list,
.operational-form-run-list,
.operational-evidence-list { display: grid; min-width: 0; }
.operational-form-field-row,
.operational-evidence-field {
  min-width: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.operational-form-field-row:last-child,
.operational-evidence-field:last-child { border-bottom: 0; }
.operational-form-field-heading,
.operational-form-start-list > form,
.operational-form-run-list > a,
.operational-evidence-list > a {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.operational-form-field-heading { margin-bottom: 14px; }
.operational-form-field-heading .canonical-actions { flex-wrap: wrap; }
.operational-form-start-list > form,
.operational-form-run-list > a,
.operational-evidence-list > a {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.operational-form-start-list > form:last-child,
.operational-form-run-list > a:last-child,
.operational-evidence-list > a:last-child { border-bottom: 0; }
.operational-form-start-list span,
.operational-form-run-list a > span,
.operational-evidence-list a > span,
.operational-evidence-field > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.operational-form-start-list small,
.operational-form-run-list small,
.operational-evidence-list small,
.operational-evidence-field small { color: var(--muted); }
.operational-run-field {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-weight: var(--ui-weight-emphasis);
}
.operational-run-field:last-child { border-bottom: 0; }
.operational-run-field > span { display: grid; gap: 3px; }
.operational-run-field :is(input:not([type="checkbox"]), select, textarea) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.operational-evidence-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-top: 12px;
}
.operational-evidence-form label { display: grid; min-width: 0; gap: 6px; }
.operational-evidence-form input[type="file"] { max-width: 100%; }

@media (max-width: 760px) {
  .operational-form-field-heading,
  .operational-form-start-list > form,
  .operational-form-run-list > a,
  .operational-evidence-list > a,
  .operational-evidence-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .operational-form-field-heading .canonical-actions,
  .operational-form-start-list .button,
  .operational-evidence-form .button { width: 100%; }
  .operational-form-field-heading .canonical-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .operational-form-field-heading .canonical-actions .button {
    min-width: 0;
    padding-inline: 8px;
  }
}

.migration-row-data {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}
.migration-row-data > div {
  display: grid;
  grid-template-columns: minmax(105px, .45fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.migration-row-data dt {
  color: var(--muted);
  font-size: .78rem;
  overflow-wrap: anywhere;
}
.migration-row-data dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .migration-row-data > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .migration-source-heading > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 6px;
  }
  .migration-source-heading :is(.eyebrow, h2, p) {
    width: 100%;
    min-width: 0;
    margin-inline: 0;
  }
}

/* Pacote A — acabamento focal de Vitrine, Recorrências e OS manual.
   O ritmo usa apenas os tokens canônicos e não altera comportamento. */
.booking-canonical .booking-grid {
  gap: var(--ui-space-section) var(--ui-space-column);
}
.booking-canonical .booking-grid > :is(.canonical-section, .canonical-disclosure) {
  min-width: 0;
  margin: 0;
  padding: var(--ui-space-field);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}
.booking-canonical .booking-grid > .booking-availability {
  border-top: 1px solid var(--line);
}
.booking-canonical .storefront-list-disclosure > summary {
  padding: 0;
}
.booking-canonical .storefront-list-disclosure[open] > summary {
  padding-bottom: var(--ui-space-field);
}
.booking-canonical .storefront-list-disclosure .canonical-disclosure-body {
  padding-top: var(--ui-space-field);
}

.recurrence-board,
.recurrence-plan-list {
  min-width: 0;
}
.recurrence-plan-list {
  gap: var(--ui-space-field);
  margin-top: 0;
}
.recurrence-plan {
  min-width: 0;
  display: grid;
  gap: var(--ui-space-field);
  padding: var(--ui-space-field);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}
.recurrence-plan .recurrence-plan-summary {
  padding: 0;
  border: 0;
}
.recurrence-plan .recurrence-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-control);
  padding-top: var(--ui-space-field);
  border-top: 1px solid var(--line);
}
.recurrence-plan .recurrence-plan-actions form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-control);
  margin: 0;
}
.recurrence-action-label {
  color: var(--muted);
  font-size: var(--ui-type-helper);
}

body.app-authenticated .service-order-manual-form > .sales-form-section {
  padding-block: var(--ui-space-section);
}
body.app-authenticated .service-order-manual-form > .sales-form-section:first-of-type {
  padding-top: 0;
}
body.app-authenticated .service-order-manual-form .service-material-fields {
  margin-top: var(--ui-space-field);
  padding-top: var(--ui-space-field);
  border-top: 1px solid var(--line);
}
body.app-authenticated .service-order-manual-form .quote-items {
  gap: var(--ui-space-field);
}
body.app-authenticated .service-order-manual-form .canonical-os-item-row {
  gap: var(--ui-space-column);
  padding: var(--ui-space-field);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
body.app-authenticated .service-order-manual-form .sales-price input[readonly] {
  color: var(--ink);
  background: var(--card);
  border-style: dashed;
}
.service-price-policy-note {
  color: var(--muted);
  font-size: var(--ui-type-helper);
  font-weight: var(--ui-weight-body);
}
body.app-authenticated .service-order-manual-form > .form-actions {
  margin-top: var(--ui-space-section);
  padding-top: var(--ui-space-field);
  border-top: 1px solid var(--line);
}
.service-order-operational-detail > :is(.panel, details.panel) + :is(.panel, details.panel) {
  margin-top: var(--ui-space-field);
}

@media (max-width: 700px) {
  .booking-canonical .booking-grid {
    gap: var(--ui-space-section);
  }
  .recurrence-plan .recurrence-plan-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .recurrence-plan .recurrence-plan-actions,
  .recurrence-plan .recurrence-plan-actions form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .recurrence-plan .recurrence-plan-actions :is(a, button) {
    width: 100%;
  }
}

body.app-authenticated.app-has-company {
  --v1-sidebar: #061425;
  --v1-sidebar-strong: #04101e;
  --v1-sidebar-text: #b9cbe2;
  --v1-sidebar-muted: #83a0c2;
  --v1-sidebar-line: #26425f;
  --v1-blue: #2378ed;
  --v1-blue-soft: color-mix(in srgb, var(--v1-blue) 12%, transparent);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.45;
}

body.app-authenticated.app-has-company .app-shell {
  height: 100dvh;
  min-height: 0;
  grid-template-columns: 245px minmax(0, 1fr);
  background: var(--paper);
}

body.app-authenticated.app-has-company .app-sidebar {
  position: relative;
  z-index: 40;
  height: 100dvh;
  min-height: 0;
  padding: 0 13px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--v1-sidebar-text);
  background: linear-gradient(180deg, var(--v1-sidebar), var(--v1-sidebar-strong));
  border-right: 1px solid rgba(131, 160, 194, .16);
}

body.app-authenticated.app-has-company .sidebar-head {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 68px;
  padding: 0 12px;
  margin: 0;
  background: var(--v1-sidebar);
}

body.app-authenticated.app-has-company .app-brand {
  min-width: 0;
  padding: 6px 0;
  border-radius: 7px;
}

body.app-authenticated.app-has-company .app-brand:hover,
body.app-authenticated.app-has-company .app-brand:focus-visible {
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}

body.app-authenticated.app-has-company .app-brand .brand-word,
body.app-authenticated.app-has-company .mobile-brand .brand-word {
  color: #fff;
  font-size: 1.08rem;
  letter-spacing: .11em;
}

body.app-authenticated.app-has-company .app-brand .brand-word span,
body.app-authenticated.app-has-company .mobile-brand .brand-word span {
  color: #5db2ff;
}

body.app-authenticated.app-has-company .sidebar-close { display: none; }

.sidebar-company {
  display: grid;
  gap: 3px;
  padding: 12px 12px 18px;
  margin: 0 0 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--v1-sidebar-line);
}

.sidebar-company-marquee {
  display: flex;
  width: max-content;
  min-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: 1.48rem;
  font-weight: 760;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-company-marquee span {
  flex: 0 0 auto;
  padding-right: 44px;
  animation: v1-company-marquee 15s linear infinite;
}

.sidebar-company-marquee:hover span { animation-play-state: paused; }

@keyframes v1-company-marquee {
  to { transform: translateX(-100%); }
}

.sidebar-company small {
  color: var(--v1-sidebar-text);
  font-size: .78rem;
  font-weight: var(--ui-weight-emphasis);
}

body.app-authenticated.app-has-company .app-nav {
  gap: 4px;
  padding: 0;
}

body.app-authenticated.app-has-company .sidebar-mobile-account { display: none; }

body.app-authenticated.app-has-company .app-nav-link {
  min-height: 44px;
  grid-template-columns: 1fr;
  padding: 10px 12px;
  color: var(--v1-sidebar-text);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .96rem;
  font-weight: 520;
}

body.app-authenticated.app-has-company .app-nav-link svg { display: none; }

body.app-authenticated.app-has-company .app-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  box-shadow: none;
}

body.app-authenticated.app-has-company .app-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .11);
  border-color: transparent;
  box-shadow: inset 3px 0 0 #58a8ff;
}

body.app-authenticated.app-has-company .app-nav-group {
  min-width: 0;
  border-block: 1px solid transparent;
}

body.app-authenticated.app-has-company .app-nav-group > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  color: var(--v1-sidebar-muted);
  border-radius: 9px;
  cursor: pointer;
  list-style: none;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.app-authenticated.app-has-company .app-nav-group > summary::-webkit-details-marker { display: none; }
body.app-authenticated.app-has-company .app-nav-group > summary:hover,
body.app-authenticated.app-has-company .app-nav-group > summary:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .05);
}
body.app-authenticated.app-has-company .app-nav-group > summary svg {
  display: block;
  width: 15px;
  height: 15px;
  transition: transform .16s ease;
}
body.app-authenticated.app-has-company .app-nav-group[open] > summary svg { transform: rotate(180deg); }
body.app-authenticated.app-has-company .app-nav-group > div {
  display: grid;
  gap: 2px;
  padding: 2px 0 5px 9px;
  border-left: 1px solid var(--v1-sidebar-line);
  margin-left: 12px;
}
body.app-authenticated.app-has-company .app-nav-group > div .app-nav-link {
  min-height: 40px;
  padding-block: 8px;
  font-size: .9rem;
}

body.app-authenticated.app-has-company .app-workspace {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
}

body.app-authenticated.app-has-company .app-topbar {
  position: relative;
  z-index: 28;
  flex: 0 0 54px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 5px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.mobile-brand { display: none; }

body.app-authenticated.app-has-company .topbar-navigation {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.app-authenticated.app-has-company .history-controls { display: flex; align-items: center; gap: 4px; }
body.app-authenticated.app-has-company .history-button { background: transparent; }
body.app-authenticated.app-has-company .history-button svg { width: 20px; height: 20px; }
body.app-authenticated.app-has-company .history-button:disabled {
  opacity: .34;
  cursor: default;
  background: transparent;
}
body.app-authenticated.app-has-company .app-topbar-actions { flex: 0 0 auto; gap: 8px; }
body.app-authenticated.app-has-company .command-trigger {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-width: var(--control-target);
  justify-content: flex-start;
  color: var(--muted);
  background: var(--surface-soft);
}

.topbar-help,
.web-push-summary,
.topbar-logout button {
  min-height: var(--control-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.topbar-help,
.web-push-summary {
  position: relative;
  width: var(--control-target);
  min-width: var(--control-target);
  padding: 0;
}

.topbar-help svg,
.web-push-summary svg { width: 19px; height: 19px; }

.topbar-help:hover,
.web-push-summary:hover,
.topbar-logout button:hover {
  color: var(--ink);
  background: var(--surface-soft);
  box-shadow: none;
}

.web-push-menu { position: relative; }
.web-push-menu summary { list-style: none; }
.web-push-menu summary::-webkit-details-marker { display: none; }
.web-push-indicator {
  display: none;
}
.topbar-alert-count {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  padding-inline: 4px;
  color: #fff;
  background: var(--danger, #d83a45);
  border: 2px solid var(--card);
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.web-push-menu[data-state="active"] .web-push-indicator { background: #27c47d; }
.web-push-menu[data-state="denied"] .web-push-indicator,
.web-push-menu[data-state="error"] .web-push-indicator { background: #f05d5e; }
.web-push-menu[open] .web-push-summary { background: var(--surface-soft); }
.web-push-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 9px);
  right: 0;
  width: min(320px, calc(100vw - 20px));
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(0, 7, 18, .3);
}
.web-push-popover p,
.web-push-popover small { margin: 0; color: var(--muted); line-height: 1.45; }
.web-push-popover .web-push-note { font-size: .75rem; }
.web-push-popover .button { width: 100%; justify-content: center; }

.topbar-logout { margin: 0; }

body.app-authenticated.app-has-company .account-summary {
  min-height: 44px;
  padding: 4px 7px 4px 4px;
  border: 1px solid transparent;
  border-radius: 9px;
}

body.app-authenticated.app-has-company .account-summary:hover,
body.app-authenticated.app-has-company .account-menu[open] .account-summary {
  background: var(--surface-soft);
  border-color: var(--line);
}

body.app-authenticated.app-has-company .account-avatar {
  width: 36px;
  height: 36px;
  color: #c9dfff;
  background: #123152;
}

body.app-authenticated.app-has-company .account-identity { max-width: 230px; }
body.app-authenticated.app-has-company .account-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.app-authenticated.app-has-company .account-popover {
  top: calc(100% + 7px);
  width: min(310px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 18, 40, .2);
}

body.app-authenticated.app-has-company .app-workspace > .page {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(20px, 2.4vw, 32px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body.app-authenticated.app-has-company .app-workspace > .messages {
  flex: 0 0 auto;
  width: calc(100% - 64px);
  margin: 14px 32px 0;
}

body.app-authenticated.app-has-company .app-workspace .section-nav {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  padding-inline: 24px;
  background: var(--card);
  backdrop-filter: none;
}

body.app-authenticated.app-has-company .app-workspace .inventory-section-nav {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 56px;
  min-height: 56px;
  flex-wrap: nowrap;
  gap: 4px;
  padding-block: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 12px;
  scrollbar-width: thin;
  background: transparent;
  border-bottom: 1px solid var(--line);
}
body.app-authenticated.app-has-company .inventory-section-nav > .section-nav-context {
  display: none;
}
body.app-authenticated.app-has-company .inventory-section-nav > a {
  min-width: 0;
  min-height: 44px;
  height: 44px;
  flex: 0 0 auto;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
  padding: 8px 10px;
  border-radius: 6px;
  scroll-margin-inline: 12px;
}
body.app-authenticated.app-has-company .inventory-section-nav > a > span {
  padding: 0;
  color: inherit;
  font: inherit;
}
body.app-authenticated.app-has-company .inventory-section-nav > a > svg {
  flex: 0 0 16px;
}
body.app-authenticated.app-has-company .inventory-section-nav > a.active {
  background: var(--surface-soft);
  box-shadow: inset 0 -3px 0 var(--brand);
}
body.app-authenticated.app-has-company .inventory-section-nav > a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
body.app-authenticated.app-has-company .inventory-section-nav::-webkit-scrollbar {
  display: block;
  height: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-company-marquee span { animation: none; }
  .sidebar-company-marquee span + span { display: none; }
}

@media (max-width: 980px) {
  body.app-authenticated.app-has-company .app-shell { display: block; }

  body.app-authenticated.app-has-company .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    visibility: hidden;
    transform: translateX(-105%);
    transition: transform .2s ease, visibility 0s linear .2s;
    box-shadow: 22px 0 60px rgba(0, 7, 18, .38);
  }

  body.app-authenticated.app-has-company .app-shell.nav-open .app-sidebar {
    visibility: visible;
    transform: translateX(0);
    transition-delay: 0s;
  }

  body.app-authenticated.app-has-company .sidebar-close { display: grid; }

  body.app-authenticated.app-has-company .app-topbar {
    justify-content: flex-start;
    padding-inline: 14px;
  }

  body.app-authenticated.app-has-company .topbar-navigation { flex: 0 0 auto; }
  body.app-authenticated.app-has-company .command-trigger {
    flex: 1 1 auto;
    width: auto;
    min-width: var(--control-target);
    padding-inline: 12px;
  }

  .mobile-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  body.app-authenticated.app-has-company .mobile-brand .nav-toggle { display: grid; }
  body.app-authenticated.app-has-company .mobile-brand .brand { display: inline-flex; }
  body.app-authenticated.app-has-company .mobile-brand .brand-word { color: var(--ink); font-size: .92rem; }
  body.app-authenticated.app-has-company .topbar-logout { display: none; }

  body.app-authenticated.app-has-company .app-workspace > .page {
    width: 100%;
    margin: 0;
    padding: 24px;
  }
}

/* No tablet, preservar o botão da marca que abre a navegação recolhida. */
@media (max-width: 820px) {
  body.app-authenticated.app-has-company .mobile-brand .brand:not(.mobile-verticals-trigger) { display: none; }
  body.app-authenticated.app-has-company .mobile-brand {
    flex: 0 0 auto;
  }
  body.app-authenticated.app-has-company .app-topbar { gap: 8px; }
  body.app-authenticated.app-has-company .account-summary .account-identity,
  body.app-authenticated.app-has-company .account-summary > svg { display: none; }
}

@media (max-width: 600px) {
  body.app-authenticated.app-has-company .app-nav-link.nav-key-quick_checkout { display: none; }

  body.app-authenticated.app-has-company .app-topbar {
    min-height: 58px;
    gap: 8px;
    padding: 7px 12px;
  }

  body.app-authenticated.app-has-company .mobile-brand { gap: 6px; }
  body.app-authenticated.app-has-company .mobile-brand .nav-toggle { width: var(--control-target); min-width: var(--control-target); }
  body.app-authenticated.app-has-company .mobile-brand .brand-word { font-size: .8rem; letter-spacing: .07em; }
  body.app-authenticated.app-has-company .topbar-help,
  body.app-authenticated.app-has-company .web-push-summary { min-height: var(--control-target); padding-inline: 10px; }
  body.app-authenticated.app-has-company .web-push-popover { position: fixed; top: 58px; right: 8px; }
  body.app-authenticated.app-has-company .account-summary { padding: 2px; }
  body.app-authenticated.app-has-company .account-summary .account-identity,
  body.app-authenticated.app-has-company .account-summary > svg { display: none; }
  body.app-authenticated.app-has-company .account-avatar { width: 36px; height: 36px; }
  body.app-authenticated.app-has-company .account-popover { position: fixed; top: 58px; right: 8px; }

  body.app-authenticated.app-has-company .app-workspace > .page {
    margin: 0;
    padding: 22px 16px 28px;
  }

  body.app-authenticated.app-has-company .app-workspace > .messages {
    width: calc(100% - 32px);
    margin-inline: 16px;
  }

  body.app-authenticated.app-has-company .app-workspace .section-nav {
    top: auto;
    padding-inline: 12px;
  }
  body.app-authenticated.app-has-company .app-workspace .inventory-section-nav {
    height: 52px;
    min-height: 52px;
    padding-block: 1px;
  }
}

@media (max-width: 420px) {
  body.app-authenticated.app-has-company .mobile-brand .brand { display: none; }
  body.app-authenticated.app-has-company .mobile-brand {
    flex: 0 0 var(--control-target);
  }
  body.app-authenticated.app-has-company .app-topbar { gap: 5px; padding-inline: 8px; }
  body.app-authenticated.app-has-company .app-topbar-actions,
  body.app-authenticated.app-has-company .topbar-navigation { gap: 4px; }
  body.app-authenticated.app-has-company .command-trigger {
    flex: 1 1 44px;
    padding: 0;
  }
  body.app-authenticated.app-has-company .command-trigger > :is(span, kbd) { display: none; }
}

@media (max-width: 340px) {
  body.app-authenticated.app-has-company .app-topbar .account-menu { display: none; }
  body.app-authenticated.app-has-company .sidebar-mobile-account {
    display: grid;
    gap: 4px;
    padding: 14px 4px 0;
    margin-top: 14px;
    border-top: 1px solid var(--v1-sidebar-line);
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account-head {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 5px 8px 9px;
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account-head > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account-head strong,
  body.app-authenticated.app-has-company .sidebar-mobile-account-head small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account-head strong { color: #fff; }
  body.app-authenticated.app-has-company .sidebar-mobile-account-head small {
    color: var(--v1-sidebar-text);
    font-size: .72rem;
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account :is(a, button) {
    width: 100%;
    min-height: var(--control-target);
    display: flex;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--v1-sidebar-text);
    background: transparent;
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account :is(a, button):hover,
  body.app-authenticated.app-has-company .sidebar-mobile-account :is(a, button):focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .06);
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account form { margin: 0; }
}

/* Demais destinos locais mantêm seu layout; Estoque usa a faixa horizontal acima.
   A navegação principal não participa. */
@media (max-width: 600px) {
  body.app-authenticated.app-has-company .app-workspace :is(
    .section-nav:not(.inventory-section-nav),
    .subnav,
    .canonical-local-nav
  ) {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    overflow: visible;
  }
  body.app-authenticated.app-has-company .app-workspace :is(
    .section-nav:not(.inventory-section-nav),
    .subnav,
    .canonical-local-nav
  ) > :is(a, details) {
    flex: 0 1 auto;
    max-width: 100%;
  }
  body.app-authenticated.app-has-company .app-workspace :is(
    .section-nav:not(.inventory-section-nav),
    .subnav,
    .canonical-local-nav
  ) a {
    min-height: var(--control-target);
    white-space: normal;
  }
}

/* Famílias de formulário e controles de escolha compartilham o alvo tátil V1. */
.canonical-form :is(.checkbox-row, .radio-row),
.configuration-family :is(.checkbox-row, .radio-row),
.document-option-grid label,
.payment-options label {
  min-height: var(--control-target);
  align-items: center;
}
.canonical-form :is(input[type="checkbox"], input[type="radio"]),
.configuration-family :is(input[type="checkbox"], input[type="radio"]) {
  flex: 0 0 20px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--brand);
}

/* Ritmo compartilhado: seções equivalentes respiram sem criar novos cards. */
.canonical-page > :is(.canonical-section, .panel, .canonical-disclosure) + :is(.canonical-section, .panel, .canonical-disclosure) {
  margin-top: 16px;
}
[data-v1-canonical-page="fiscal-review"] > :is(.canonical-card, .form-card) + :is(.canonical-card, .form-card) {
  margin-top: 16px;
}
@media (max-width: 700px) {
  body.app-authenticated [data-v1-canonical-page="fiscal-review"] .fiscal-review-warning {
    display: grid;
    gap: 8px;
    align-items: start;
  }
}
.canonical-disclosure > summary {
  min-height: var(--control-target);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}
.canonical-disclosure > summary small { color: var(--muted); font-weight: 500; }
.canonical-disclosure > summary > span:first-child { min-width: 0; display: grid; gap: 2px; }
.canonical-disclosure > summary::-webkit-details-marker { display: none; }
.canonical-disclosure > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 650;
}
.canonical-disclosure[open] > summary::after { content: "−"; }
@media (max-width: 700px) {
  .canonical-disclosure > summary:has(> span:nth-child(2)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }
  .canonical-disclosure > summary > span:nth-child(2) { grid-column: 1; }
  .canonical-disclosure > summary:has(> span:nth-child(2))::after { grid-column: 2; grid-row: 1 / span 2; }
}
.canonical-disclosure-body {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
}

/* Cabeçalhos mantêm duas ações de alta relevância e recolhem utilidades. */
.heading-utilities { position: relative; }
.heading-utilities > summary { list-style: none; cursor: pointer; }
.heading-utilities > summary::-webkit-details-marker { display: none; }
.heading-utilities > div {
  position: absolute;
  z-index: 32;
  top: calc(100% + 7px);
  right: 0;
  width: min(260px, calc(100vw - 32px));
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.heading-utilities > div :is(a, button) {
  width: 100%;
  min-height: var(--control-target);
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}
.heading-utilities > div :is(a, button):hover,
.heading-utilities > div :is(a, button):focus-visible { background: var(--surface-soft); }
.heading-utilities > div form { margin: 0; }

/* Formulários de configuração usam seções contínuas, não cartões aninhados. */
.configuration-family { min-width: 0; }
.storefront-settings-form { gap: 0; }
.configuration-section {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.configuration-section:first-of-type { margin-top: 4px; }
.configuration-section > div:first-child :is(h3, p) { margin: 0; }
.configuration-section > div:first-child h3 { font-size: var(--ui-type-section); }
.configuration-section > div:first-child p {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--ui-type-helper);
}
.configuration-switch {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}
.configuration-switch > span { min-width: 0; display: grid; gap: 3px; }
.configuration-switch small { color: var(--muted); font-weight: 450; }
.configuration-switch input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  height: 26px;
  min-height: 26px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.configuration-switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .24);
  transition: transform .16s ease;
}
.configuration-switch input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: var(--brand);
}
.configuration-switch input[type="checkbox"]:checked::before { transform: translateX(20px); }
.configuration-switch input[type="checkbox"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 3px;
}
.storefront-cover-field { align-content: start; }
.storefront-cover-preview {
  width: min(460px, 100%);
  display: grid;
  gap: 6px;
}
.storefront-cover-preview img {
  width: 100%;
  max-height: 190px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.storefront-cover-field input[type="file"] {
  max-width: 100%;
  padding: 9px;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.configuration-submit { padding-top: 18px; border-top: 1px solid var(--line); }

.canonical-empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px dashed var(--line-strong, var(--line));
  background: var(--surface-soft);
}
.canonical-empty-state :is(h2, p) { margin: 0; }
.canonical-empty-state p { color: var(--muted); }

form[aria-busy="true"] { cursor: progress; }
form[aria-busy="true"] :is(button[type="submit"], input[type="submit"]):disabled {
  opacity: .72;
  cursor: progress;
}

.billing-settings { max-width: 1040px; }
.billing-status-summary { display: grid; gap: 18px; }
.billing-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}
.billing-facts > div { min-width: 0; padding: 15px; background: var(--card); }
.billing-facts dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.billing-facts dd { margin: 5px 0 0; overflow-wrap: anywhere; font-weight: 720; }
.billing-settings .callout { display: grid; gap: 3px; margin: 0; }
.billing-change-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.billing-change-form label { display: grid; gap: 6px; }
.billing-actions { align-items: flex-start; }
.inline-confirm { position: relative; }
.inline-confirm > summary { list-style: none; cursor: pointer; }
.inline-confirm > summary::-webkit-details-marker { display: none; }
.inline-confirm > form {
  width: min(360px, calc(100vw - 48px));
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
@media (max-width: 700px) {
  .billing-facts { grid-template-columns: 1fr; }
  .billing-facts > div { display: flex; justify-content: space-between; gap: 16px; }
  .billing-facts dd { margin: 0; text-align: right; }
  .billing-change-form { grid-template-columns: 1fr; }
  .billing-actions, .billing-actions > * { width: 100%; }
  .billing-actions :is(.button, button) { width: 100%; justify-content: center; text-align: center; }
  .heading-utilities { width: 100%; }
  .heading-utilities > summary { width: 100%; justify-content: center; }
  .heading-utilities > div { position: static; width: 100%; margin-top: 8px; }
}

@media (max-width: 600px) {
  .document-settings-actions {
    position: static;
    bottom: auto;
    box-shadow: none;
  }
}

/* Corpos canônicos — linguagem aprovada no protótipo. */
.canonical-page {
  width: min(100%, 1440px);
  min-height: 100%;
  margin: 0 auto;
  color: var(--ink);
}

body.app-authenticated.app-has-company:has([data-v1-canonical-page]) .app-workspace > .section-nav { display: flex; }

.section-nav-more { position: relative; margin-left: auto; }
.section-nav-more > summary {
  min-height: var(--control-target);
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 9px;
  list-style: none;
}
.section-nav-more > summary::-webkit-details-marker { display: none; }
.section-nav-more[open] > summary { background: var(--surface-soft); }
.section-nav-more > div {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  display: grid;
  padding: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 18, 40, .16);
}
.section-nav-more > div a { min-height: var(--control-target); display: flex; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.section-nav-more > div a:hover { background: var(--surface-soft); }

.canonical-record-summary { display: grid; gap: 18px; min-width: 0; }
.canonical-record-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.canonical-record-heading h2 { margin: 2px 0; font-size: clamp(1.35rem, 2.8vw, 1.75rem); line-height: 1.2; }
.canonical-record-heading .muted { margin: 0; }
.canonical-record-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; border-top: 1px solid var(--line); }
.canonical-record-facts > div { min-width: 0; display: grid; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.canonical-record-facts > .full { grid-column: 1 / -1; }
.canonical-record-facts :is(dt, dd) { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.canonical-record-facts dt { color: var(--muted); font-size: .76rem; font-weight: var(--ui-weight-emphasis); }
.canonical-record-facts dd { color: var(--ink); }
.canonical-record-external-link { display: block; width: fit-content; margin-top: 5px; font-size: .78rem; font-weight: 650; }
.canonical-record-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.canonical-record-metrics > div { min-width: 0; display: grid; gap: 2px; padding: 12px; border-right: 1px solid var(--line); }
.canonical-record-metrics > div:last-child { border-right: 0; }
.canonical-record-metrics strong { font-size: clamp(1rem, 2.5vw, 1.28rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.canonical-record-metrics span { color: var(--muted); font-size: .74rem; }
.canonical-record-related > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.canonical-record-related :is(h3, ul, p) { margin: 0; }
.canonical-record-related h3,
.canonical-record-note h3 { font-size: .88rem; }
.canonical-record-related > div > span { color: var(--muted); font-size: .76rem; }
.canonical-record-related ul { display: grid; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.canonical-record-related li { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.canonical-record-related li :is(strong, span) { min-width: 0; overflow-wrap: anywhere; }
.canonical-record-related li span { color: var(--muted); font-size: .76rem; text-align: right; }
.canonical-record-note { display: grid; gap: 6px; }
.canonical-record-note p { margin: 0; overflow-wrap: anywhere; }
.search-bar.customer-search-bar { padding: 0; background: transparent; border: 0; box-shadow: none; }
.customer-assets-inline .section-heading { align-items: start; }
.customer-assets-inline-forms { display: grid; border-top: 1px solid var(--line); }
.customer-asset-inline-row { min-width: 0; display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.customer-asset-inline-grid { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.customer-asset-inline-grid > label { min-width: 0; }
.customer-asset-inline-grid > .asset-name { grid-column: span 2; }
.customer-asset-inline-grid > .full { grid-column: 1 / -1; }
.customer-asset-inline-actions { display: flex; justify-content: flex-end; }
.customer-asset-inline-actions .button { min-height: var(--control-target); }
.customer-asset-add { justify-self: start; margin-top: 12px; }
.customer-related-inline-forms { display: grid; border-top: 1px solid var(--line); }
.customer-related-inline-row { min-width: 0; display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.customer-related-inline-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.customer-contact-inline-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.customer-related-inline-grid > label { min-width: 0; }
.customer-related-inline-grid > .full { grid-column: 1 / -1; }
.customer-related-inline-actions { display: flex; justify-content: flex-end; }
.customer-related-add { justify-self: start; margin-top: 12px; }
.quick-action-complete { min-height: 55vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink); }
.quick-action-complete p { margin: 4px 0 0; color: var(--muted); }
.status-dot.success { width: 12px; height: 12px; border-radius: 50%; background: var(--success, #238b57); box-shadow: 0 0 0 6px color-mix(in srgb, var(--success, #238b57) 14%, transparent); }
.smart-field-shell { position: relative; display: block; width: 100%; min-width: 0; }
.smart-field-shell > input { width: 100%; }
.smart-field-shell > input.has-smart-suggestion { padding-right: min(48%, 240px); }
.smart-field-hint { position: absolute; z-index: 2; right: 10px; top: 50%; max-width: 44%; translate: 0 -50%; overflow: hidden; color: var(--muted); font-size: .76rem; font-weight: 600; line-height: 1; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.customer-autocomplete-shell { position: relative; display: block; width: 100%; min-width: 0; }
.customer-autocomplete-list { position: absolute; z-index: 90; top: calc(100% + 5px); left: 0; right: 0; max-height: min(320px, 42dvh); padding: 5px; overflow-y: auto; overscroll-behavior: contain; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 46px rgba(0, 17, 36, .22); }
.customer-autocomplete-list[hidden] { display: none; }
.customer-autocomplete-list button { width: 100%; min-width: 0; min-height: 44px; display: grid; gap: 2px; padding: 8px 10px; color: var(--ink); background: transparent; border: 0; border-radius: 7px; font: inherit; text-align: left; }
.customer-autocomplete-list button:hover,
.customer-autocomplete-list button.active { background: var(--surface-soft); }
.customer-autocomplete-list button :is(strong, span) { min-width: 0; overflow-wrap: anywhere; }
.customer-autocomplete-list button strong { font-size: .86rem; }
.customer-autocomplete-list button span { color: var(--muted); font-size: .74rem; }

/* CRUD canônico: tabelas continuam tabelas e reduzem colunas por prioridade. */
body.app-authenticated .table-details-trigger {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 4px;
  overflow: hidden;
  font-size: .76rem;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1360px) {
  .table-priority-responsive.table-wrap.table-ergonomic {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--card);
    box-shadow: var(--shadow-sm);
  }
  .table-priority-responsive :is(.titanor-table, .titanor-table tbody) {
    width: 100%;
    min-width: 0 !important;
  }
  .table-priority-responsive .titanor-table { display: table; table-layout: fixed !important; }
  .table-priority-responsive .titanor-table thead { display: table-header-group; }
  .table-priority-responsive .titanor-table tbody { display: table-row-group; }
  .table-priority-responsive .titanor-table tr {
    display: table-row;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .table-priority-responsive.table-wrap .titanor-table :is(th, td) {
    position: static;
    display: table-cell;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .table-priority-responsive .titanor-table td::before { display: none; }
  .table-priority-responsive .titanor-table :is(th, td).table-priority-5 { display: none !important; }
  .table-priority-responsive .titanor-table :is(th, td).table-col-details {
    width: 126px;
    padding: 10px 12px;
    text-align: right;
  }
  .table-priority-responsive .titanor-table td.table-col-details .table-details-trigger {
    width: auto;
    min-height: var(--control-target);
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  .table-priority-responsive .titanor-table :is(th, td).table-priority-4 { display: none !important; }
}

@media (max-width: 700px) {
  .table-priority-responsive .titanor-table :is(th, td).table-priority-2,
  .table-priority-responsive .titanor-table :is(th, td).table-priority-3,
  .table-priority-responsive .titanor-table :is(th, td).table-priority-4 { display: none !important; }
  .table-priority-responsive .titanor-table :is(th, td) { padding: 9px 10px; }
  .table-priority-responsive .titanor-table :is(th, td).table-col-details { width: 112px; padding: 9px 10px; }
  .table-priority-responsive .titanor-table td.table-col-details .table-details-trigger {
    width: 100%;
    max-width: 100%;
    min-height: var(--control-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 4px;
    overflow: hidden;
    font-size: .72rem;
    text-align: center;
  }
}

/* CRUD Final: uma hierarquia de ação, sem compressão ou texto sobreposto. */
body.app-authenticated :is(.canonical-actions, .form-actions, .heading-actions, .card-actions) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}
body.app-authenticated :is(.canonical-actions, .form-actions, .heading-actions, .card-actions) > :is(a, button, .button) {
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-target);
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.app-authenticated .button.quiet {
  color: var(--text);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
body.app-authenticated .button.quiet:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}
body.app-authenticated :is(.button.button-danger, button.button-danger) {
  color: var(--on-action);
  background: var(--action-danger);
  border-color: var(--action-danger);
}

/* Planilhas operacionais: cabeçalho e linhas preservam o mesmo alinhamento. */
body.app-authenticated .canonical-line-sheet { display: grid; gap: 0; min-width: 0; }
body.app-authenticated :is(.canonical-line-head, .canonical-line-row) {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, .24fr) minmax(80px, .18fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
body.app-authenticated .canonical-line-head {
  color: var(--muted);
  font-size: .75rem;
  font-weight: var(--ui-weight-emphasis);
  letter-spacing: .035em;
  text-transform: uppercase;
}
body.app-authenticated .canonical-line-row > * { min-width: 0; overflow-wrap: anywhere; }
body.app-authenticated .delivery-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: var(--titanor-card-gap-one-two);
  align-items: start;
}
body.app-authenticated .delivery-progress-form { margin-top: var(--titanor-card-gap-one-two); }
body.app-authenticated .delivery-handoff-card { margin-bottom: var(--titanor-card-gap-one-two); }
body.app-authenticated .delivery-handoff-card form { margin-top: 12px; }
body.app-authenticated .delivery-stage-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 16px);
  margin: 0 0 var(--titanor-card-gap-one-two);
  padding: 0;
  list-style: none;
}
body.app-authenticated .delivery-stage-track li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: clamp(.72rem, .55rem + .35vw, .9rem);
}
body.app-authenticated .delivery-stage-track li span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
body.app-authenticated .delivery-stage-track li strong { overflow-wrap: anywhere; }
body.app-authenticated .delivery-stage-track li.current,
body.app-authenticated .delivery-stage-track li.done { color: var(--ink); }
body.app-authenticated .delivery-stage-track li.current span,
body.app-authenticated .delivery-stage-track li.done span { border-color: var(--accent); background: var(--accent); color: #fff; }
body.app-authenticated .delivery-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--titanor-card-gap-mobile);
  margin-bottom: var(--titanor-card-gap-mobile);
}
body.app-authenticated .delivery-filter > label { display: grid; gap: 6px; min-width: 0; }
body.app-authenticated .delivery-filter > label > span { white-space: nowrap; }
body.app-authenticated .delivery-filter > label > select { width: 100%; min-width: 0; }
body.app-authenticated .delivery-filter > button { width: auto; white-space: nowrap; }
body.app-authenticated .delivery-mobile-list,
body.app-authenticated .delivery-route-list {
  display: grid;
  gap: var(--titanor-card-gap-three);
  padding: 0;
  margin: 0;
  list-style: none;
}
body.app-authenticated .delivery-mobile-card,
body.app-authenticated .delivery-route-stop {
  min-width: 0;
  padding: var(--titanor-card-padding-min);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
body.app-authenticated .delivery-mobile-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
body.app-authenticated .delivery-mobile-card-heading h2,
body.app-authenticated .delivery-route-main h2 { margin: 3px 0 0; font-size: 1rem; overflow-wrap: anywhere; }
body.app-authenticated .delivery-compact-items { display: grid; gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
body.app-authenticated .delivery-compact-items li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
body.app-authenticated .delivery-primary-action { width: 100%; margin-top: 14px; }
body.app-authenticated .delivery-route-filter { align-items: end; }
body.app-authenticated .delivery-route-plan-heading {
  display: grid;
  grid-template-columns: minmax(220px, .35fr) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}
body.app-authenticated .delivery-route-plan-heading label { display: grid; gap: 6px; font-weight: var(--ui-weight-emphasis); }
body.app-authenticated .delivery-route-stop {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}
body.app-authenticated .delivery-route-stop.is-current { border-color: var(--accent); }
body.app-authenticated .delivery-route-sequence { display: grid; place-items: center; }
body.app-authenticated .delivery-route-sequence strong,
body.app-authenticated .delivery-route-sequence input {
  width: 48px;
  min-height: 48px;
  padding: 6px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
}
body.app-authenticated .delivery-route-sequence strong { display: grid; place-items: center; }
body.app-authenticated .delivery-route-main { min-width: 0; }
body.app-authenticated .delivery-route-main p { margin: 6px 0; overflow-wrap: anywhere; }
body.app-authenticated .delivery-route-main small { color: var(--muted); }
body.app-authenticated .delivery-route-save { margin-top: 16px; }
body.app-authenticated .delivery-items-card { grid-column: 1 / -1; }
body.app-authenticated .delivery-item-sheet { display: grid; min-width: 0; }
body.app-authenticated :is(.delivery-item-head, .delivery-item-row) {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(86px, .22fr) minmax(110px, .28fr) minmax(110px, .28fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
body.app-authenticated .delivery-item-head { color: var(--muted); font-size: .75rem; font-weight: var(--ui-weight-emphasis); text-transform: uppercase; }
body.app-authenticated .delivery-item-row > * { min-width: 0; overflow-wrap: anywhere; }
body.app-authenticated .delivery-payment-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
body.app-authenticated .delivery-payment-report { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
body.app-authenticated .delivery-payment-report > span:first-child { display: grid; gap: 2px; }
body.app-authenticated .delivery-payment-form { margin-top: 14px; }
body.app-authenticated .delivery-completion-card { margin-top: var(--titanor-card-gap-one-two); }
body.app-authenticated .delivery-sticky-action { position: sticky; z-index: 8; bottom: 12px; margin-top: 16px; }
body.app-authenticated .delivery-sticky-action button { width: 100%; min-height: 52px; box-shadow: var(--shadow); }

/* OS: itens e modelos usam a densidade da planilha aprovada em vendas. */
body.app-authenticated .service-order-item-row {
  grid-template-columns: minmax(120px, .8fr) minmax(220px, 1.45fr) minmax(76px, .42fr) minmax(90px, .5fr) minmax(110px, .62fr) minmax(100px, .5fr) auto;
  align-items: end;
  gap: 10px;
}
body.app-authenticated .service-order-item-row .sales-description { grid-column: 1 / -1; }
body.app-authenticated .service-order-item-row .service-item-main { display: grid; gap: 6px; }
body.app-authenticated .service-order-item-row .stock-checkbox { align-self: center; }
body.app-authenticated .service-order-item-row .stock-checkbox { grid-column: 1 / -1; }
body.app-authenticated .service-order-item-row .delete-field { align-self: center; }
body.app-authenticated :is(.service-order-item-row, .template-item-row) .delete-field {
  position: relative;
  min-height: var(--control-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
body.app-authenticated :is(.service-order-item-row, .template-item-row) .delete-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
body.app-authenticated .service-line-total { display: grid; gap: 5px; align-self: center; }
body.app-authenticated .service-line-total small { color: var(--muted); font-size: .75rem; font-weight: var(--ui-weight-emphasis); }
body.app-authenticated .template-item-row {
  grid-template-columns: minmax(110px, .65fr) minmax(180px, 1.15fr) minmax(220px, 1.45fr) minmax(74px, .4fr) minmax(80px, .46fr) minmax(110px, .62fr) minmax(100px, .55fr) auto;
  min-width: 0;
}
body.app-authenticated .template-item-row label { min-width: 0; }
body.app-authenticated .template-item-row :is(input:not([type="checkbox"]), select) { min-width: 0; width: 100%; }
body.app-authenticated .template-item-row .checkbox-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  align-self: center;
}

@media (max-width: 1100px) {
  body.app-authenticated .delivery-detail-grid { grid-template-columns: 1fr; }
  body.app-authenticated .delivery-stage-track { grid-template-columns: 1fr; }
  body.app-authenticated .service-order-item-row,
  body.app-authenticated .template-item-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.app-authenticated .service-order-item-row .sales-description { grid-column: span 2; }
}

@media (max-width: 700px) {
  body.app-authenticated :is(.canonical-actions, .form-actions, .heading-actions, .card-actions) {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  body.app-authenticated :is(.canonical-actions, .form-actions, .heading-actions, .card-actions) > :is(a, button, .button) { width: 100%; }
  body.app-authenticated .canonical-line-head { display: none; }
  body.app-authenticated .canonical-line-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }
  body.app-authenticated .canonical-line-row > :first-child { grid-column: 1 / -1; }
  body.app-authenticated .service-order-item-row,
  body.app-authenticated .template-item-row { grid-template-columns: 1fr; }
  body.app-authenticated .service-order-item-row > *,
  body.app-authenticated .template-item-row > * { grid-column: 1 / -1; width: 100%; }
  body.app-authenticated .service-line-total { min-height: var(--control-target); }
  body.app-authenticated .delivery-mobile-page { padding-bottom: 72px; }
  body.app-authenticated .delivery-mobile-page .canonical-page-heading { align-items: stretch; }
  body.app-authenticated .delivery-mobile-page .canonical-page-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  body.app-authenticated .delivery-mobile-page .canonical-page-actions > * { width: 100%; }
  body.app-authenticated .delivery-stage-track { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; }
  body.app-authenticated .delivery-stage-track li { grid-template-columns: 24px minmax(0, 1fr); justify-items: start; gap: 5px; font-size: .68rem; text-align: left; }
  body.app-authenticated .delivery-stage-track li span { width: 24px; height: 24px; }
  body.app-authenticated .delivery-stage-track li strong { font-size: .62rem; overflow-wrap: normal; word-break: normal; }
  body.app-authenticated .delivery-route-plan-heading { grid-template-columns: 1fr; }
  body.app-authenticated .delivery-route-stop { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  body.app-authenticated .delivery-route-stop > .button { grid-column: 1 / -1; width: 100%; }
  body.app-authenticated .delivery-route-sequence strong,
  body.app-authenticated .delivery-route-sequence input { width: var(--control-target); min-height: var(--control-target); }
  body.app-authenticated .delivery-compact-items li { align-items: flex-start; }
  body.app-authenticated .delivery-item-head { display: none; }
  body.app-authenticated .delivery-item-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0; }
  body.app-authenticated .delivery-item-row > :first-child { grid-column: 1 / -1; }
  body.app-authenticated .delivery-item-row [data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .68rem; font-weight: var(--ui-weight-emphasis); text-transform: uppercase; }
  body.app-authenticated .delivery-payment-summary { grid-template-columns: 1fr; }
  body.app-authenticated .delivery-payment-report { align-items: flex-start; }
}

body.app-embedded { height: auto; min-height: 100dvh; overflow: auto; }
body.app-embedded .app-shell { height: auto; min-height: 100dvh; display: block; }
body.app-embedded .app-sidebar,
body.app-embedded .app-nav-scrim,
body.app-embedded .app-topbar,
body.app-embedded .section-nav,
body.app-embedded .messages { display: none !important; }
body.app-embedded .app-workspace { height: auto; min-height: 100dvh; overflow: visible; }
body.app-embedded .app-workspace > .page { height: auto; min-height: 100dvh; padding: 20px; overflow: visible; }
body.app-embedded .page-heading h1,
body.app-embedded .canonical-page-heading h1 { font-size: 1.7rem; }

@media (max-width: 700px) {
  .topbar-help span,
  .web-push-summary > span { display: none; }
  .canonical-record-facts,
  .customer-asset-inline-grid,
  .customer-related-inline-grid { grid-template-columns: 1fr; }
  .canonical-record-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canonical-record-metrics > div:nth-child(2) { border-right: 0; }
  .canonical-record-metrics > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .customer-asset-inline-grid > .asset-name { grid-column: auto; }
  .canonical-record-related li { align-items: start; flex-direction: column; gap: 2px; }
  .canonical-record-related li span { text-align: left; }
}

.canonical-page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: start;
  gap: 36px;
  padding-bottom: 24px;
}

.canonical-page-heading h1 {
  margin: 3px 0 6px;
  font-size: clamp(2rem, 3.1vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.canonical-page-heading > div > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.canonical-reminder {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0 0;
}

.canonical-reminder > span:last-child {
  display: grid;
  gap: 4px;
}

.canonical-reminder small,
.canonical-reminder strong { display: block; }

.canonical-reminder small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: var(--ui-weight-emphasis);
  letter-spacing: .09em;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  background: var(--v1-blue);
  border-radius: 50%;
}

.status-dot-attention { background: #c78216; }

.canonical-local-nav {
  position: sticky;
  z-index: 8;
  top: -28px;
  display: flex;
  gap: 28px;
  padding: 0 0 12px;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.canonical-local-nav a {
  flex: 0 0 auto;
  padding: 8px 0;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.canonical-local-nav a:first-child,
.canonical-local-nav a:hover { color: var(--ink); }

.canonical-local-nav a:first-child { box-shadow: 0 2px 0 var(--v1-blue); }

.canonical-section {
  padding: 28px 0;
  scroll-margin-top: 50px;
  border-bottom: 1px solid var(--line);
}

.canonical-section:last-child { border-bottom: 0; }

.canonical-section > p {
  max-width: 840px;
  margin: -8px 0 20px;
  color: var(--muted);
}

.canonical-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.canonical-section-heading h2 {
  margin: 3px 0 0;
  font-size: 1.34rem;
  line-height: 1.2;
}

.canonical-section-heading > a {
  color: var(--v1-blue);
  font-weight: 700;
  text-decoration: none;
}

.canonical-section-heading > span,
.section-count { color: var(--muted); font-size: .85rem; }

.banking-recommendation { padding-top: 24px; }

.recommendation-lines,
.route-summary,
.import-history,
.request-history {
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.recommendation-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 30px;
}

.recommendation-lines li {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.recommendation-lines span,
.recommendation-lines li > span { color: var(--muted); }

.canonical-empty-line {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 0 20px;
}

.canonical-empty-line p { margin: 0; }

.canonical-table { width: 100%; }

.canonical-table-head,
.canonical-table-row {
  display: grid;
  grid-template-columns: 1.5fr .75fr 1.2fr 1fr auto;
  align-items: center;
  gap: 20px;
}

.canonical-table-head {
  padding: 0 0 9px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: var(--ui-weight-emphasis);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.canonical-table-row {
  min-height: 58px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.canonical-table-row > span:first-child {
  display: grid;
  gap: 2px;
}

.canonical-table-row small { color: var(--muted); }

.text-action {
  padding: 0;
  color: var(--v1-blue);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
}

.availability-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 750;
  white-space: nowrap;
}

.availability-badge.preparing { color: #9a6108; background: color-mix(in srgb, #e9a52f 14%, transparent); }
html[data-theme="dark"] .availability-badge.preparing { color: var(--state-warning-text); }
.availability-badge.requested { color: var(--muted); }

.banking-setup-grid,
.banking-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
}

.banking-setup-grid {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.banking-work-grid { border-bottom: 1px solid var(--line); }
.banking-work-grid .canonical-section { border-bottom: 0; }
.banking-work-grid .canonical-section + .canonical-section { padding-left: 34px; border-left: 1px solid var(--line); }

.canonical-form-block {
  display: grid;
  align-content: start;
  gap: 16px;
}

.canonical-form-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.canonical-form-block > header > span {
  color: var(--muted);
  font-size: .78rem;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-form-grid > label {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: var(--ui-weight-emphasis);
}

.compact-form-grid > label:first-child,
.canonical-form-block .compact-form-grid:not(.two-columns) > label {
  grid-column: 1 / -1;
}

.compact-form-grid input,
.compact-form-grid select,
.compact-form-grid textarea,
.canonical-form-block input,
.canonical-form-block select {
  width: 100%;
  min-height: var(--control-target);
  padding: 9px 11px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.compact-form-grid input:focus,
.compact-form-grid select:focus,
.compact-form-grid textarea:focus,
.canonical-form-block input:focus,
.canonical-form-block select:focus {
  border-color: var(--v1-blue);
  outline: 2px solid color-mix(in srgb, var(--v1-blue) 18%, transparent);
}

.compact-form-grid textarea { min-height: 84px; resize: vertical; }
.compact-form-grid label > small { color: var(--muted); font-weight: 450; }
.compact-form-grid .errorlist { margin: 0; color: var(--danger); font-weight: 600; }
.compact-form-grid .span-all { grid-column: 1 / -1; }
.compact-form-grid > .button,
.canonical-form-block > .button { width: fit-content; justify-self: end; }

.route-summary { margin: 0; }
.route-summary li,
.import-history li,
.request-history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.route-summary span,
.import-history span,
.request-history span,
.request-history small { color: var(--muted); }

.import-form { grid-template-columns: 1fr; }
.import-form > label { grid-column: auto; }

.compact-activity .canonical-table-row { grid-template-columns: 1.5fr .7fr .8fr .7fr .8fr; }
.compact-activity .canonical-table-row > span:last-child { text-align: right; }

.integration-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
}

.integration-catalog > div {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.integration-catalog > div > span { min-width: 0; display: grid; gap: 3px; }
.integration-catalog small { color: var(--muted); }
@media (max-width: 700px) {
  .integration-catalog > div { align-items: start; flex-direction: column; gap: 8px; }
  .integration-catalog .availability-badge { max-width: 100%; white-space: normal; }
}

.integration-request {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.integration-request summary {
  width: fit-content;
  color: var(--v1-blue);
  cursor: pointer;
  font-weight: 750;
}

.integration-request > p { color: var(--muted); }
.request-form { max-width: 920px; margin-top: 18px; }

@media (max-width: 1050px) {
  .canonical-page-heading { grid-template-columns: 1fr; gap: 18px; }
  .canonical-reminder { padding-top: 0; }
  .banking-setup-grid,
  .banking-work-grid { grid-template-columns: 1fr; gap: 0; }
  .banking-work-grid .canonical-section + .canonical-section { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .canonical-table-head { display: none; }
  .canonical-table-row { grid-template-columns: 1.2fr 1fr 1fr; }
  .canonical-table-row > span:nth-child(3),
  .canonical-table-row > span:nth-child(4) { color: var(--muted); font-size: .86rem; }
  .compact-activity .canonical-table-row { grid-template-columns: 1.4fr .7fr .8fr .7fr .8fr; }
}

@media (max-width: 700px) {
  .canonical-page-heading { padding-bottom: 18px; }
  .canonical-page-heading h1 { font-size: 2rem; }
  .canonical-local-nav { top: -22px; gap: 20px; }
  .canonical-section { padding: 23px 0; }
  .canonical-section-heading { align-items: start; }
  .recommendation-lines,
  .integration-catalog,
  .compact-form-grid { grid-template-columns: 1fr; }
  .compact-form-grid > label,
  .compact-form-grid .span-all { grid-column: auto; }
  .canonical-table-row,
  .compact-activity .canonical-table-row {
    grid-template-columns: 1fr auto;
    gap: 7px 14px;
    align-items: start;
  }
  .canonical-table-row > span:nth-child(n+3) { grid-column: 1 / -1; }
  .compact-activity .canonical-table-row > span:nth-child(2) { text-align: right; }
  .compact-activity .canonical-table-row > span:last-child { grid-column: 2; grid-row: 3; }
  .integration-catalog { display: block; }
  .canonical-form-block > header { align-items: start; }
  .canonical-form-block > .button,
  .compact-form-grid > .button { width: 100%; }
}

.canonical-onboarding {
  width: min(100%, 1040px);
  max-width: none;
  display: block;
  padding: 0;
  margin: 0 auto;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.canonical-onboarding [hidden] { display: none !important; }

.canonical-onboarding .onboarding-intro {
  padding: 0 0 22px;
  text-align: left;
  border: 0;
}

.canonical-onboarding .onboarding-intro h1 {
  max-width: 760px;
  margin: 3px 0 7px;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.canonical-onboarding .onboarding-intro p:last-child {
  max-width: 760px;
  margin: 0;
  font-size: 1.02rem;
}

.onboarding-stage-nav {
  display: flex;
  gap: 28px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.onboarding-stage-nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 650;
}

.onboarding-stage-nav button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 50%;
  font-size: .75rem;
}

.onboarding-stage-nav button.active {
  color: var(--ink);
  box-shadow: 0 2px 0 var(--v1-blue);
}

.onboarding-stage-nav button.active span { color: #fff; background: var(--v1-blue); }

.onboarding-stage-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0 8px;
}

.onboarding-stage-progress span {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
}

.onboarding-stage-progress span.active { background: var(--v1-blue); }

.canonical-onboarding .onboarding-discovery-form {
  display: block;
  padding: 0;
}

.canonical-onboarding [data-onboarding-stage] { scroll-margin-top: 24px; }

.canonical-onboarding .onboarding-step,
.canonical-onboarding .onboarding-recommendation,
.canonical-onboarding .onboarding-learning {
  padding: 24px 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.canonical-onboarding .onboarding-step-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.canonical-onboarding .onboarding-step-heading > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--v1-blue);
  background: var(--v1-blue-soft);
  border-radius: 8px;
  font-weight: 760;
}

.canonical-onboarding .onboarding-step-heading h2,
.canonical-onboarding .onboarding-learning h2 {
  margin: 0 0 4px;
  font-size: 1.32rem;
}

.canonical-onboarding .onboarding-step-heading p,
.canonical-onboarding .onboarding-learning p { margin: 0; color: var(--muted); }

.canonical-onboarding .discovery-choice-grid,
.canonical-onboarding .discovery-check-grid,
.canonical-onboarding .future-feature-grid,
.canonical-onboarding .recommended-module-grid {
  gap: 10px;
}

.canonical-onboarding .discovery-choice,
.canonical-onboarding .discovery-check,
.canonical-onboarding .future-feature,
.canonical-onboarding .recommended-module {
  min-height: 58px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: none;
}

.canonical-onboarding .discovery-choice:has(input:checked),
.canonical-onboarding .discovery-check:has(input:checked),
.canonical-onboarding .future-feature:has(input:checked) {
  background: var(--v1-blue-soft);
  border-color: color-mix(in srgb, var(--v1-blue) 62%, var(--line));
}

.canonical-onboarding .onboarding-submit {
  margin: 0;
  padding: 24px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.onboarding-stage-actions {
  position: sticky;
  z-index: 6;
  bottom: -32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.onboarding-stage-actions [data-onboarding-next] { margin-left: auto; }

@media (max-width: 700px) {
  .onboarding-stage-nav { gap: 17px; overflow-x: auto; }
  .onboarding-stage-nav button { flex: 0 0 auto; font-size: .83rem; }
  .canonical-onboarding .onboarding-intro h1 { font-size: 2rem; }
  .canonical-onboarding .discovery-choice-grid,
  .canonical-onboarding .discovery-check-grid,
  .canonical-onboarding .future-feature-grid,
  .canonical-onboarding .recommended-module-grid { grid-template-columns: 1fr; }
  .onboarding-stage-actions { bottom: -28px; }
}

/* Home de decisão — implementação ligada ao motor real.
   O layout anterior está arquivado e estas regras seguem o protótipo aprovado. */
.canonical-home {
  width: min(100%, 1440px);
  min-height: 100%;
  margin: 0 auto;
  color: var(--ink);
}

.canonical-home-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  align-items: end;
  gap: 36px;
  padding: 0 0 24px;
}

.canonical-home-heading h1 {
  margin: 4px 0 6px;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.canonical-home-heading > div > p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.canonical-home-reminder {
  min-height: 76px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-content: center;
  gap: 10px;
  padding: 10px 4px;
  opacity: .82;
}

.canonical-home-reminder > span {
  color: var(--v1-blue);
  font-size: .8rem;
  line-height: 1.45;
}

.canonical-home-reminder.attention > span { color: #c78216; }
.canonical-home-reminder.urgent > span { color: var(--danger); }

.canonical-home-reminder > div { display: grid; gap: 4px; }
.canonical-home-reminder small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: var(--ui-weight-emphasis);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.canonical-home-reminder strong { line-height: 1.3; }
.canonical-home-reminder div > span { color: var(--muted); font-size: .82rem; }

.canonical-home-section {
  padding: 25px 0;
  border-top: 1px solid var(--line);
}

.canonical-home-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.canonical-home-section-heading h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.canonical-home-section-heading > a {
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--v1-blue);
  font-weight: 720;
  text-decoration: none;
}

.canonical-home-section-heading > span {
  color: var(--muted);
  font-size: .8rem;
}

.canonical-attention-list,
.canonical-timeline {
  padding: 0;
  margin: 0;
  list-style: none;
}

.canonical-attention-list li {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.canonical-attention-list li:first-child { border-top: 0; }
.canonical-attention-list li > div { display: grid; gap: 2px; }
.canonical-attention-list strong { font-weight: 720; }
.canonical-attention-list span { color: var(--muted); }
.canonical-attention-list small { color: #bd7211; }
.canonical-attention-list .button { white-space: nowrap; }

.canonical-money-summary { margin: 0; }
.canonical-money-summary > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.canonical-money-summary dt { font-weight: 700; }
.canonical-money-summary dd { margin: 4px 0 0; color: var(--muted); }
.canonical-money-summary dd strong { color: var(--ink); font-size: 1.25rem; }
.canonical-money-summary dd span { display: block; }
.canonical-fact-link { display: inline-flex; align-items: center; min-height: 44px; }
.canonical-home-section > p > a, .canonical-home-analysis > p > a,
.canonical-page-heading > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }
.finance-section-nav { display: flex; flex-wrap: nowrap; align-items: center; gap: 20px; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border-bottom: 1px solid var(--line); margin-block: 8px 16px; }
.finance-section-nav > a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 48px; white-space: nowrap; }
.finance-section-nav > a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.finance-filter-details > summary, .finance-row-actions > summary { cursor: pointer; min-height: 44px; padding-block: 10px; }
.finance-filter-details { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.finance-row-actions form { margin-top: 12px; }
/* Financial nature and category remain available at intermediate widths. */
@media (min-width: 761px) and (max-width: 1000px) {
  .finance-core-entries .cash-table th:nth-child(2),
  .finance-core-entries .cash-table td:nth-child(2),
  .finance-core-entries .cash-table th:nth-child(4),
  .finance-core-entries .cash-table td:nth-child(4) { display: table-cell; }
  .finance-core-entries .cash-table table { min-width: 820px; table-layout: auto; }
}
.canonical-home-analysis > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 700; }

.canonical-timeline li {
  min-height: 56px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.canonical-timeline time,
.canonical-timeline span { color: var(--muted); }
.canonical-timeline li > div { display: grid; gap: 2px; }
.canonical-timeline li > a { color: var(--v1-blue); font-weight: 700; text-decoration: none; }

.canonical-home-empty {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.canonical-home-empty > span { color: var(--v1-blue); }
.canonical-home-empty p { margin: 0; }
.canonical-home-empty p > span { font-size: .9rem; }

.canonical-money-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--titanor-card-gap-four-plus);
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.canonical-money-grid > a {
  min-width: 0;
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.canonical-money-grid > a:hover { background: var(--surface-soft); }
.canonical-money-grid small,
.canonical-money-grid span { color: var(--muted); }
.canonical-money-grid strong { font-size: clamp(1.24rem, 2.2vw, 1.75rem); }

.canonical-trend-tag {
  display: inline-flex;
  padding: 5px 9px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-radius: 999px;
  font-weight: 700;
}
.canonical-trend-tag.down {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.canonical-home-trend {
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(260px, .85fr);
  align-items: end;
  gap: 36px;
}

.canonical-bars {
  height: 150px;
  min-height: 150px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding-top: 16px;
  border-bottom: 1px solid var(--line);
}

.canonical-bars span {
  width: 100%;
  height: max(6px, var(--bar-value));
  background: color-mix(in srgb, var(--v1-blue) 78%, var(--card));
  border-radius: 5px 5px 0 0;
}

.canonical-home-trend > div:last-child { align-self: center; }
.canonical-home-trend:not(:has(.canonical-bars)) { grid-template-columns: 1fr; }
.canonical-home-trend strong { font-size: 1.05rem; }
.canonical-home-trend p { margin: 9px 0 18px; color: var(--muted); }
.canonical-home-trend a { color: var(--v1-blue); font-weight: 720; text-decoration: none; }

@media (max-width: 900px) {
  .canonical-home-heading { grid-template-columns: 1fr; gap: 12px; }
  .canonical-home-reminder { min-height: auto; }
  .canonical-money-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canonical-home-trend { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 600px) {
  .canonical-home-heading { padding-bottom: 18px; }
  .canonical-home-heading h1 { font-size: 2rem; }
  .canonical-home-section { padding: 22px 0; }
  .canonical-attention-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .canonical-attention-list li > .canonical-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .canonical-attention-list .button { min-width: 108px; padding-inline: 11px; }
  .canonical-timeline li { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .canonical-timeline li > a { grid-column: 2; }
  .canonical-money-grid { grid-template-columns: 1fr; }
  .canonical-money-grid > a { min-height: 92px; }
  .canonical-home-trend { display: block; }
  .canonical-bars { min-height: 120px; margin-bottom: 22px; }
}

/* Arquétipos funcionais — os módulos reais usam a mesma gramática do protótipo. */
.canonical-page {
  width: min(100%, 1440px);
  min-height: 100%;
  margin: 0 auto;
  color: var(--ink);
}

.canonical-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 0 0 24px;
}

.canonical-page-heading > div:first-child { min-width: 0; }
.canonical-page-heading h1 {
  margin: 4px 0 6px;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -.035em;
}
.canonical-page-heading .eyebrow { margin: 0; }
.canonical-page-heading .muted {
  max-width: 760px;
  margin: 0;
  font-size: 1rem;
}
.canonical-page-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.canonical-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.canonical-metric-grid > a,
.canonical-metric-grid > article {
  min-width: 0;
  min-height: 102px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  color: var(--ink);
  background: var(--card);
  text-decoration: none;
}
.canonical-metric-grid > a:hover { background: var(--surface-soft); }
.canonical-metric-grid small,
.canonical-metric-grid span { color: var(--muted); }
.canonical-metric-grid strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  line-height: 1.08;
}
.canonical-metric-grid .is-attention strong { color: #bd7211; }
.canonical-metric-grid .is-danger strong { color: var(--danger); }

.canonical-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.canonical-toolbar label { margin: 0; }
.canonical-toolbar label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: var(--ui-weight-emphasis);
}

[data-v1-canonical-page="finance"] .canonical-toolbar {
  margin-bottom: var(--titanor-card-gap-four-plus);
}

.canonical-work-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.canonical-work-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, .8fr) minmax(180px, .8fr) auto;
  align-items: center;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.canonical-work-row > span,
.canonical-work-row > div { min-width: 0; }
.canonical-work-row > span { color: var(--ink); }
.canonical-work-row > span:first-child,
.canonical-work-row > div:first-child { display: grid; gap: 3px; }
.canonical-work-row strong { font-weight: 720; }
.canonical-work-row small,
.canonical-work-row .muted { color: var(--muted); }
.canonical-work-row .context-title { font-weight: 500; }
.canonical-work-row .button { white-space: nowrap; }
.customer-source-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.customer-source-row > .canonical-row-actions { grid-column: 1 / -1; }
.customer-source-row .canonical-row-actions,
.customer-source-row .canonical-row-actions form { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.customer-source-row .button { max-width: 100%; white-space: normal; }
.customer-source-row .canonical-row-actions input { min-width: 0; max-width: 100%; }
.canonical-work-row.is-attention { box-shadow: inset 3px 0 0 #d49a32; padding-left: 13px; }
.canonical-work-row.is-danger { box-shadow: inset 3px 0 0 var(--danger); padding-left: 13px; }
.canonical-work-row-credit {
  grid-template-columns: minmax(180px, 1.25fr) repeat(4, minmax(96px, .62fr)) auto;
  gap: 12px;
}

@media (max-width: 1050px) {
  .canonical-work-row-credit {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: start;
  }
  .canonical-work-row-credit > :first-child { grid-column: 1 / 3; }
  .canonical-work-row-credit > :last-child {
    grid-column: 3;
    grid-row: 1 / span 3;
    align-self: center;
  }
}

.canonical-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.canonical-section:first-of-type { border-top: 0; }
.canonical-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.canonical-section-heading h2 { margin: 0; font-size: 1.25rem; }
.canonical-section-heading a { color: var(--v1-blue); font-weight: 720; text-decoration: none; }
.canonical-empty {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--muted);
}
.canonical-empty strong { color: var(--ink); }

.canonical-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.canonical-filter-bar .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.canonical-filter-bar .button > span {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.canonical-compact-list { display: grid; }
.canonical-compact-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 9px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.canonical-compact-row > span { display: grid; gap: 2px; }
.canonical-compact-row small { color: var(--muted); }

.collaboration-panel .activity-list > div,
[data-v1-canonical-page="task-detail"] .activity-list > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.collaboration-panel .activity-list > div > span,
[data-v1-canonical-page="task-detail"] .activity-list > div > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.collaboration-panel .activity-list small,
[data-v1-canonical-page="task-detail"] .activity-list small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Meu dia: cada grupo operacional é um card canônico; os fatos internos
   permanecem linhas para evitar cartões aninhados e ruído visual. */
.operational-day-responsibility-summary,
.responsibility-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.operational-day-responsibility-summary {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: none;
}
.responsibility-summary {
  padding: 11px 0;
  border-block: 1px solid var(--line);
}
.operational-day-responsibility-summary > span,
.responsibility-summary > span { color: var(--muted); }
.operational-day-responsibility-summary strong,
.responsibility-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.operational-day-responsibility-summary b,
.responsibility-summary .is-danger { color: var(--danger); }
.responsibility-summary { justify-content: flex-start; margin-bottom: 14px; }
.responsibility-summary > span + span { padding-left: 18px; border-left: 1px solid var(--line); }
.responsibility-table-wrap td { vertical-align: top; }
.operational-day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.operational-day-group {
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: none;
}
.operational-day-group-heading { margin-bottom: 4px; }
.operational-day-group-heading .eyebrow,
.operational-day-close-heading .eyebrow { margin: 0 0 3px; }
.operational-day-count {
  min-width: 28px;
  padding: 3px 8px;
  color: var(--ink) !important;
  background: var(--surface-soft);
  border-radius: 999px;
  text-align: center;
  font-weight: 760;
}
.operational-day-item { min-height: 68px; }
.operational-day-item > span { min-width: 0; }
.operational-day-item > b {
  color: var(--v1-blue);
  font-size: .78rem;
  white-space: nowrap;
}
.operational-day-item.is-danger { box-shadow: inset 3px 0 0 var(--danger); padding-left: 12px; }
.operational-day-empty {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.operational-day-empty strong { color: var(--ink); }
.canonical-section.operational-day-close {
  margin-top: 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: none;
}
.operational-day-close-heading { align-items: flex-start; }
.operational-day-close-heading .muted { max-width: 760px; margin: 5px 0 0; }
.operational-day-close .compact-fields {
  grid-template-columns: minmax(220px, .65fr) minmax(360px, 1.35fr);
  max-width: none;
}

.canonical-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 32px;
}

/* Orçamentos: os controles ficam diretamente sobre a página, sem tarja
   estrutural atrás da busca e dos filtros. */
.quote-filter {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.canonical-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.canonical-page .cash-awareness {
  margin: 0;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.canonical-page .cash-awareness-open,
.canonical-page .cash-awareness-closed { background: transparent; }

/* Caixa operacional: os formulários reais seguem a mesma composição limpa. */
.canonical-cash-operation .canonical-section > p {
  max-width: 760px;
  margin: 0 0 16px;
  color: var(--muted);
}
.canonical-cash-start { max-width: 820px; }
.canonical-cash-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}
.canonical-cash-form label { display: grid; gap: 5px; margin: 0; }
.canonical-cash-form label > span { color: var(--muted); font-size: .78rem; font-weight: var(--ui-weight-emphasis); }
.canonical-cash-form input,
.canonical-cash-form select,
.canonical-cash-form textarea {
  width: 100%;
  min-height: var(--control-target);
  padding: 9px 11px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.canonical-cash-form textarea { min-height: 64px; resize: vertical; }
.canonical-cash-form .button { justify-self: start; }
.canonical-cash-actions .canonical-section { border-top: 1px solid var(--line); }
.canonical-inline-cancel { display: flex; gap: 6px; }
.canonical-inline-cancel input {
  width: 110px;
  min-height: var(--control-target);
  padding: 7px 9px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* PDV real: o mesmo fluxo aprovado, conectado aos formulários do Django. */
.canonical-pdv-page { min-height: 100%; }
.canonical-pdv-mobile-block { display: none; }
.canonical-pdv-page .canonical-page-heading { align-items: end; padding: 0 0 10px; margin: 0; }
.canonical-pdv-page .canonical-page-heading > div { min-width: 0; }
.canonical-pdv-page .canonical-page-heading h1 { font-size: 1.8rem; }
.canonical-pdv-page .canonical-page-heading .muted { margin-top: 2px; }
.quick-checkout-form[data-v1-canonical-page="pdv"] {
  height: calc(100dvh - 180px);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .82fr);
  grid-template-areas:
    "items customer"
    "items payment"
    "footer footer";
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.app-authenticated.app-has-company .app-workspace > .page:has(.canonical-pdv-page) {
  overflow: auto !important;
  padding-bottom: 6px;
}
.discovery-choice.is-plan-locked {
  cursor: not-allowed;
  opacity: .68;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}
.settings-page-heading { align-items: end; }
.settings-search {
  width: min(390px, 100%);
  display: grid;
  gap: 5px;
}
.settings-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.settings-search small { color: var(--muted); font-size: .75rem; }
.settings-search-empty { padding: 16px 0; color: var(--muted); }
.settings-action-list > a[hidden],
.settings-section[hidden] { display: none !important; }

.settings-workspace { max-width: 1040px; }
.settings-workspace .settings-search[hidden] { display: none !important; }
.settings-group-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.settings-group-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--card);
  text-decoration: none;
}
.settings-group-nav a[aria-current] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.settings-group-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.settings-workspace [data-settings-group][hidden] { display: none !important; }
.settings-workspace [data-settings-group] { margin-bottom: 24px; scroll-margin-top: 100px; }
.settings-workspace .settings-section > header h3 { margin: 0; font-size: 1.05rem; }
.settings-workspace .settings-section > header p { margin: 10px 0 0; }
.settings-workspace .settings-action-list small { overflow-wrap: anywhere; }
.settings-technical { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.settings-technical summary { min-height: 44px; cursor: pointer; }
.settings-technical a { display: inline-block; padding: 12px 0; }

.navigation-settings-panel {
  display: block;
  max-width: 1040px;
  overflow: hidden;
}

.navigation-settings-panel > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.navigation-settings-panel > form {
  padding: 1rem;
}

.navigation-preference-list {
  display: grid;
  gap: .65rem;
}

.navigation-preference-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 6.8rem 6.8rem 10rem;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.navigation-preference-row > div {
  display: grid;
  gap: .25rem;
}

.navigation-preference-row label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
}

.navigation-preference-row input[type="number"] {
  width: 4.5rem;
}

@media (max-width: 760px) {
  .navigation-settings-panel > header {
    display: grid;
    align-items: start;
    padding: 1rem;
  }

  .navigation-settings-panel > form {
    padding: .75rem;
  }

  .navigation-preference-row {
    grid-template-columns: minmax(0, 1fr) 6.4rem;
    gap: .75rem;
  }

  .navigation-preference-row > div {
    grid-column: 1 / -1;
  }

  .navigation-preference-row label:last-child {
    grid-column: 1 / -1;
  }
}

/* Agenda canônica: calendário operacional, mural e agendamento público no mesmo contexto. */
.agenda-month-toolbar {
  display: grid;
  grid-template-columns: var(--control-target) minmax(0, 1fr) var(--control-target);
  align-items: center;
  width: min(360px, 100%);
  margin: 0 0 12px;
}
.agenda-month-toolbar strong { text-align: center; text-transform: capitalize; }
.agenda-month-toolbar a {
  min-height: var(--control-target);
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  text-decoration: none;
}
.agenda-workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .34fr); gap: 20px; }
.agenda-workspace .company-calendar { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.agenda-workspace .calendar-weekdays { padding: 8px 0; background: var(--surface); }
.agenda-workspace .calendar-day { min-height: 92px; padding: 7px; background: var(--card); }
.agenda-workspace .calendar-day.today { box-shadow: inset 0 0 0 2px var(--v1-blue); }
.agenda-workspace .calendar-event { padding: 4px 5px; font-size: .7rem; line-height: 1.2; border-radius: 5px; }
.agenda-workspace .calendar-event.event-event {
  color: #173556;
  background: #e7f1ff;
  border: 1px solid #c3d9f2;
}
html[data-theme="dark"] .agenda-workspace .calendar-event.event-event {
  color: #edf4ff;
  background: #172942;
  border-color: #31537b;
}
.agenda-mural { min-height: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.agenda-mural > header { display: flex; justify-content: space-between; gap: 12px; }
.agenda-mural h2 { margin: 3px 0 0; font-size: 1.12rem; }
.agenda-mural-list { display: grid; margin-top: 12px; }
.agenda-mural-list article { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.agenda-mural-list article:first-child { border-top: 0; }
.agenda-mural-list strong, .agenda-mural-list small { display: block; }
.agenda-mural-list small { margin-top: 3px; color: var(--muted); }
.agenda-mural-list p { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.agenda-filter { display: flex; align-items: end; gap: 12px; padding: 12px 0; }
.agenda-filter label { min-width: 180px; }
.agenda-filter select { width: 100%; }
.agenda-workspace .calendar-event { display: grid; align-content: center; gap: 2px; }
.agenda-workspace .calendar-event small { margin: 0; color: inherit; opacity: .75; }
.agenda-workspace .calendar-event.status-canceled { opacity: .78; text-decoration: line-through; }
.agenda-workspace .calendar-event.status-completed { opacity: .78; }
.agenda-event-page { max-width: 920px; }
.agenda-event-page .canonical-page-actions form { margin: 0; }
.agenda-event-form { max-width: 720px; }
.canonical-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.canonical-detail-list div { min-width: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.canonical-detail-list dt { color: var(--muted); font-size: .78rem; font-weight: var(--ui-weight-emphasis); }
.canonical-detail-list dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.agenda-event-note { margin-top: 20px; }
.agenda-event-note h3 { margin-bottom: 6px; font-size: .92rem; }
.agenda-event-history ol { display: grid; gap: 12px; margin: 12px 0 0; padding-left: 20px; }
.agenda-event-history li span { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; }

.booking-link-bar {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.booking-link-bar h2, .booking-link-bar p { margin: 0; }
.booking-link-bar h2 { margin-top: 2px; font-size: 1.05rem; }
.booking-link-bar p { color: var(--muted); font-size: .82rem; }
.booking-link-bar code { min-width: 0; white-space: normal; overflow-wrap: anywhere; color: var(--ink); }
.booking-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0; }
.booking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.booking-grid .canonical-section { padding-block: 18px; }
.booking-grid .booking-availability { grid-column: 1 / -1; }
.booking-request { grid-template-columns: minmax(0, 1fr) auto auto; }
.booking-request form { display: flex; gap: 6px; }
.booking-members { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.booking-window-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.booking-window-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.booking-window-list :is(strong, small) { display: block; }
.booking-window-list small { color: var(--muted); margin-top: 2px; }
.canonical-disclosure { border-top: 1px solid var(--line); }
.canonical-disclosure > summary { padding: 14px 0; cursor: pointer; font-weight: 750; }
.canonical-settings-form { display: grid; gap: 14px; padding: 0 0 20px; }
.booking-readiness { padding-block: 18px; }
.booking-check-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.booking-check-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.booking-check-list li.is-complete { color: var(--ink); }
.booking-check-list li span { flex: 0 0 auto; font-weight: 800; }
.booking-service-admin-list { display: grid; }
.booking-service-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--ui-space-control);
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.booking-service-admin-row:first-child { border-top: 0; }
.booking-service-admin-copy { display: grid; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.booking-service-admin-copy small { color: var(--muted); overflow-wrap: break-word; word-break: normal; }
.booking-service-admin-copy .status-pill { justify-self: start; margin-top: 3px; }
.booking-service-admin-row .canonical-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  min-width: 0;
  gap: var(--ui-space-control);
}
.booking-service-admin-row form { min-width: 0; max-width: 100%; margin: 0; }
.booking-service-admin-row .canonical-row-actions :is(button, a) {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.attendance-form { display: grid; gap: 16px; }
.attendance-form-field { display: grid; min-width: 0; gap: 6px; }
.attendance-form-field > label { margin: 0; font-weight: var(--ui-weight-emphasis); }
.attendance-form-field > :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  min-width: 0;
}
.attendance-form-field .field-help { display: block; color: var(--muted); }
.attendance-choice {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: var(--ui-space-control);
  min-height: var(--control-target);
  cursor: pointer;
}
.attendance-choice > input { flex: 0 0 auto; }
.attendance-choice > span { min-width: 0; overflow-wrap: break-word; }
.attendance-choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.attendance-choice-fieldset > legend {
  margin-bottom: 6px;
  padding: 0;
  font-weight: var(--ui-weight-emphasis);
}
.attendance-choice-list,
.attendance-choice-list > div {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 8px 16px;
}
.attendance-choice-list > div > div { min-width: 0; }
.attendance-choice-list label {
  min-width: 0;
  min-height: var(--control-target);
  display: flex;
  align-items: center;
  gap: var(--ui-space-control);
  padding: 8px 0;
  cursor: pointer;
  overflow-wrap: break-word;
}
.attendance-choice-list input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
}

@media (max-width: 980px) {
  .agenda-workspace, .booking-grid { grid-template-columns: 1fr; }
  .agenda-mural { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .agenda-filter { align-items: stretch; flex-direction: column; }
  .agenda-filter label { min-width: 0; }
  .agenda-filter .button { width: 100%; }
  .booking-link-bar { grid-template-columns: 1fr auto auto; }
  .booking-link-bar > div { grid-column: 1 / -1; }
  .booking-grid .booking-availability { grid-column: 1; }
  .booking-check-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .booking-link-bar { grid-template-columns: 1fr 1fr; }
  .booking-link-bar code { grid-column: 1 / -1; }
  .booking-metrics, .booking-window-list { grid-template-columns: 1fr; }
  .agenda-workspace .calendar-day { min-height: 64px; padding: 4px; }
  .agenda-workspace .calendar-event { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
  .canonical-detail-list { grid-template-columns: 1fr; }
  .booking-check-list { grid-template-columns: 1fr; }
  .booking-service-admin-row .canonical-row-actions .button { width: 100%; }
}
.quick-checkout-form .quick-checkout-client { grid-area: customer; }
.quick-checkout-form .solo-sale-items-section { grid-area: items; min-height: 0; }
.quick-checkout-form .quick-checkout-payment { grid-area: payment; min-height: 0; }
.quick-checkout-form .solo-sale-consequence { display: none; }
.quick-checkout-form .solo-sale-actions { grid-area: footer; }
.quick-checkout-form .sales-form-section {
  min-width: 0;
  padding: 12px 14px;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.quick-checkout-form .solo-sale-items-section {
  display: flex;
  flex-direction: column;
}
.quick-checkout-form .solo-sale-section-heading .step-number { display: none; }
.quick-checkout-form .solo-sale-section-heading h2 { font-size: .86rem; text-transform: uppercase; letter-spacing: .08em; }
.quick-checkout-form .solo-sale-section-help { margin: 2px 0 8px; font-size: .78rem; }
.quick-checkout-form .solo-sale-items {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  overflow: auto;
  scrollbar-gutter: stable;
}
.quick-checkout-form .solo-sale-item {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) minmax(260px, 1fr);
  align-items: end;
  gap: 10px 14px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.quick-checkout-form .solo-sale-item > :not([hidden]) { grid-column: auto; }
.quick-checkout-form .solo-sale-item-primary { grid-template-columns: minmax(0, 1fr) auto; }
.quick-checkout-form .solo-sale-item-primary input { min-height: var(--control-target) !important; }
.quick-checkout-form .solo-sale-item-values {
  grid-template-columns: minmax(66px, .45fr) minmax(108px, .8fr);
  gap: 8px;
}
.quick-checkout-form .solo-sale-item-values input { min-height: var(--control-target); }
.quick-checkout-form .solo-sale-item-values .solo-sale-discount-field,
.quick-checkout-form .solo-sale-item-values .solo-sale-line-total,
.quick-checkout-form .solo-sale-item-details { display: none; }
.quick-checkout-form .sales-items-footer { display: none; }
.quick-checkout-form .sales-items-footer .add-quote-item { min-height: var(--control-target); padding: 7px 10px; }
.quick-checkout-form .quick-checkout-client .solo-sale-section-help,
.quick-checkout-form .quick-checkout-client label > span,
.quick-checkout-form .quick-checkout-client label > small { display: none; }
.quick-checkout-form .quick-checkout-client .solo-sale-main-field { width: 100%; }
.quick-checkout-form .quick-checkout-client .solo-sale-main-field input { min-height: var(--control-target) !important; }
.quick-checkout-form .quick-checkout-payment > .solo-sale-section-help { display: none; }
.quick-checkout-form .canonical-pdv-summary {
  display: grid;
  gap: 9px;
  padding: 10px 0 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.quick-checkout-form .solo-sale-calculation { margin: 0; }
.quick-checkout-form .solo-sale-final-total dd { font-size: clamp(1.55rem, 2.6vw, 2rem); }
.quick-checkout-form .quick-checkout-payment { overflow: visible; }
.quick-checkout-form .quick-checkout-payment [hidden] { display: none !important; }
.quick-checkout-form .quick-checkout-payment .solo-sale-order-discount {
  grid-template-columns: minmax(90px, 1fr) minmax(128px, 156px);
}
.quick-checkout-form .quick-checkout-payment .solo-sale-order-discount > small {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: .7rem;
}
.quick-checkout-form .quick-checkout-payment .solo-sale-discount-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  overflow: hidden;
}
.quick-checkout-form .quick-checkout-payment .solo-sale-discount-control input { border: 0; }
.quick-checkout-form .quick-checkout-payment .solo-sale-discount-control strong { text-align: center; }
.quick-checkout-form .quick-checkout-payment .solo-sale-final-total dd {
  max-width: 64%;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  white-space: nowrap;
}
.quick-checkout-form .quick-checkout-payment .solo-sale-fulfillment-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.quick-checkout-form .quick-checkout-payment .solo-sale-fulfillment-grid > label { min-width: 0; }
.quick-checkout-form .quick-checkout-payment .solo-sale-fulfillment-grid small { display: none; }
.quick-checkout-form .quick-checkout-payment [data-credit-fields]:not([hidden]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.quick-checkout-form .quick-checkout-payment [data-credit-fields] label:last-child { grid-column: 1 / -1; }
.quick-checkout-form .quick-checkout-payment [data-credit-fields] small { display: none; }
.canonical-payment-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.canonical-payment-shortcuts button {
  min-height: 48px;
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 7px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
}
.canonical-payment-shortcuts button strong { font-size: .78rem; }
.canonical-payment-shortcuts button span { font-size: .78rem; }
.canonical-payment-shortcuts button.active,
.canonical-payment-shortcuts button:hover { border-color: var(--v1-blue); background: var(--v1-blue-soft); }
.quick-checkout-form .solo-sale-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.canonical-pdv-keybar {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.canonical-pdv-keybar :is(button, a) {
  min-height: var(--control-target);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: .74rem;
  text-decoration: none;
}
.canonical-pdv-keybar :is(button, a):hover { border-color: var(--v1-blue); background: var(--v1-blue-soft); }
.canonical-pdv-keybar strong { font-size: .72rem; }
.quick-checkout-form #quick-checkout-submit { min-height: var(--control-target); white-space: nowrap; }
.quick-checkout-form .remove-sale-item {
  min-height: var(--control-target);
  padding-inline: 9px;
}
.quick-checkout-form .sales-price input[readonly] {
  color: var(--muted);
  background: var(--surface);
  cursor: not-allowed;
}
.quick-checkout-form .sales-price small { display: none; }
.canonical-pdv-payment-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.3;
}
.quick-checkout-form .canonical-pdv-keybar :is(button, a) { min-width: 92px; justify-content: center; }

@media (max-height: 820px) and (min-width: 981px) {
  .canonical-pdv-page .canonical-page-heading .muted { display: none; }
  .quick-checkout-form[data-v1-canonical-page="pdv"] { height: calc(100dvh - 144px); gap: 8px 12px; }
  .quick-checkout-form .sales-form-section { padding: 9px 12px; }
  .quick-checkout-form .solo-sale-section-help { display: none; }
  .quick-checkout-form .canonical-pdv-summary { gap: 6px; padding-top: 7px; margin-top: 6px; }
  .canonical-payment-shortcuts button { min-height: var(--control-target); }
}

/* Meu ritmo preserva os registros reais, sem voltar ao painel de cartões legado. */
.canonical-journey .rhythm-privacy {
  padding: 10px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.canonical-journey .panel {
  padding: 22px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.canonical-journey .rhythm-checkin-simple { border-top: 0; }
.canonical-journey .rhythm-layout { gap: 32px; }

@media (max-width: 1050px) {
  .capacity-demand-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .capacity-demand-row > :nth-child(2),
  .capacity-demand-row > :nth-child(3) { grid-column: 1; }
  .capacity-demand-row > :last-child { grid-column: 2; grid-row: 1 / span 3; }
}

@media (max-width: 980px) {
  .canonical-page-heading { align-items: start; flex-direction: column; gap: 14px; }
  .canonical-page-actions { justify-content: flex-start; }
  .canonical-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canonical-two-column { grid-template-columns: 1fr; }
  .operational-day-close .compact-fields { grid-template-columns: 1fr; }
  .canonical-work-row.warranty-work-row { grid-template-columns: minmax(0, 1fr); }
  .canonical-work-row.warranty-work-row > :nth-child(n),
  .canonical-work-row.warranty-work-row > :last-child {
    grid-column: 1;
    grid-row: auto;
  }
  .warranty-work-row .canonical-actions { justify-content: stretch; }
  .push-delivery-history-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .push-delivery-history-row > :nth-child(2),
  .push-delivery-history-row > :nth-child(3) { grid-column: 1; }
  .push-delivery-history-row > :last-child { grid-column: 2; grid-row: 1 / span 3; }
}

@media (max-width: 700px) {
  .canonical-page-heading h1 { font-size: 2rem; }
  .canonical-page-actions { width: 100%; }
  .canonical-page-actions .button { flex: 1 1 auto; }
  .canonical-metric-grid { grid-template-columns: 1fr 1fr; }
  .canonical-metric-grid > a,
  .canonical-metric-grid > article { min-height: 88px; padding: 12px; }
  .canonical-toolbar { grid-template-columns: 1fr; }
  .operational-day-grid { grid-template-columns: 1fr; }
  .operational-day-responsibility-summary { align-items: flex-start; flex-direction: column; gap: 8px; }
  .operational-day-item { align-items: start; }
  .operational-day-item > b { padding-top: 2px; }
  .canonical-work-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .canonical-work-row > :nth-child(2),
  .canonical-work-row > :nth-child(3) { grid-column: 1; }
  .canonical-work-row > :last-child { grid-column: 2; grid-row: 1 / span 3; }
  .customer-source-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .customer-source-row > :first-child,
  .customer-source-row > :nth-child(2),
  .customer-source-row > :last-child {
    grid-column: 1;
    grid-row: auto;
  }
  .customer-source-row .canonical-row-actions,
  .customer-source-row .canonical-row-actions form {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .canonical-work-row-credit {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .canonical-work-row-credit > :first-child,
  .canonical-work-row-credit > :nth-child(n),
  .canonical-work-row-credit > :last-child {
    grid-column: 1;
    grid-row: auto;
  }
  .canonical-work-row-credit > :last-child { width: 100%; margin-top: 4px; }
  .quick-checkout-form .solo-sale-actions { grid-template-columns: 1fr; }
  .canonical-pdv-page .quick-checkout-form { display: none; }
  .canonical-cash-form { grid-template-columns: 1fr; }
  .canonical-inline-cancel { align-items: end; flex-direction: column; }
  .canonical-pdv-mobile-block {
    min-height: 55dvh;
    display: grid;
    place-content: center;
    justify-items: start;
    gap: 9px;
  }
  .canonical-pdv-mobile-block strong { font-size: 1.25rem; }
  .canonical-pdv-mobile-block span { color: var(--muted); }
}

@media (max-width: 520px) {
  nav.canonical-filter-bar:has(.button > span) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav.canonical-filter-bar:has(.button > span) .button { min-width: 0; white-space: normal; }
  nav.canonical-filter-bar .button > span { flex-shrink: 0; }
  .canonical-filter-bar .button {
    width: 100%;
    justify-content: space-between;
  }
  .collaboration-panel .activity-list > div,
  [data-v1-canonical-page="task-detail"] .activity-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* Item 2 — acabamento visual universal da interface autenticada.
   A coluna vertical mantém a identidade azul-marinho em todos os temas. */
body.app-authenticated {
  --v1-space-1: 4px;
  --v1-space-2: 8px;
  --v1-space-3: 12px;
  --v1-space-4: 16px;
  --v1-space-5: 24px;
  --v1-space-6: 32px;
  --v1-content-measure: 72ch;
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] body.app-authenticated {
  --paper: #000000;
  --card: #0c0d10;
  --surface-soft: #14161a;
  --surface-hover: #1b1e23;
  --ink: #f0f1f3;
  --muted: #a7adb7;
  --line: #292c31;
}

html[data-theme="dark"] body.app-authenticated.app-has-company {
  --v1-sidebar: #061425;
  --v1-sidebar-strong: #04101e;
  --v1-sidebar-text: #b9cbe2;
  --v1-sidebar-muted: #83a0c2;
  --v1-sidebar-line: #26425f;
}

html[data-theme="dark"] body.app-authenticated .app-workspace,
html[data-theme="dark"] body.app-authenticated .app-workspace > .page {
  background: #000000;
}

body.app-authenticated :is(a, button, summary) { text-decoration: none; }
body.app-authenticated details > summary {
  min-height: var(--control-target, 44px);
  display: flex;
  align-items: center;
  cursor: pointer;
}
body.app-authenticated :is(.subnav, .canonical-local-nav, .pagination) a {
  min-height: var(--control-target, 44px);
  display: inline-flex;
  align-items: center;
}
body.app-authenticated :is(h1, h2, h3, legend, .section-title, .canonical-section-heading strong) {
  color: var(--ink);
  font-weight: var(--ui-weight-title);
  letter-spacing: -.018em;
  text-wrap: balance;
}
body.app-authenticated strong {
  font-weight: var(--ui-weight-title);
}
body.app-authenticated b {
  font-weight: var(--ui-weight-emphasis);
}
body.app-public :is(strong, b) {
  font-weight: var(--ui-weight-title);
}
body.app-authenticated :is(p, small, .muted, .helptext, .field-help) {
  font-weight: 400;
}
body.app-authenticated .panel > .muted { overflow-wrap: anywhere; }
body.app-authenticated :is(.page-heading, .canonical-page-heading) > div > p:not(.eyebrow) {
  max-width: var(--v1-content-measure);
  line-height: 1.55;
}

body.app-authenticated :is(.button, button.primary, button.secondary, button.ghost) {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.15;
}
body.app-authenticated :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea, .form-control):not([type="checkbox"]):not([type="radio"]) {
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 9px;
  line-height: 1.35;
}
body.app-authenticated textarea { min-height: 88px; resize: vertical; }
body.app-authenticated :is(label, .field-label) {
  font-weight: var(--ui-weight-emphasis);
  line-height: 1.3;
}

body.app-authenticated :is(.panel, .form-card, .movement-card, .table-wrap, .canonical-card, .canonical-metric-grid > *) {
  border-radius: 13px;
}
html[data-theme="dark"] body.app-authenticated :is(.panel, .form-card, .movement-card, .table-wrap, .canonical-card, .canonical-metric-grid > *) {
  box-shadow: none;
}

body.app-authenticated :is(table, .titanor-table) th {
  padding: 8px 10px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: var(--ui-weight-emphasis);
  letter-spacing: .035em;
  line-height: 1.25;
  text-transform: uppercase;
}
body.app-authenticated .calendar-weekdays span {
  font-weight: var(--ui-weight-emphasis);
}
body.app-authenticated :is(table, .titanor-table) td {
  padding: 9px 10px;
  line-height: 1.35;
}
body.app-authenticated :is(.message, .canonical-empty, .canonical-empty-line, .empty-state, .quick-action-complete) {
  border-radius: 11px;
}
body.app-authenticated .message {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 13px;
  line-height: 1.4;
}
body.app-authenticated .message.error {
  color: var(--state-danger-text);
  background: var(--state-danger-surface);
}
body.app-authenticated :is(.canonical-empty, .canonical-empty-line, .empty-state) {
  color: var(--muted);
  text-align: left;
}
body.app-authenticated :is(.field-error, .errorlist) {
  color: var(--state-danger-text);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.4;
}

body.app-authenticated .theme-choice-dark .theme-preview { background: #000000; }
body.app-authenticated .theme-choice-dark .theme-preview-sidebar { background: #061425; }
body.app-authenticated .theme-choice-dark .theme-preview-accent { background: #2378ed; }
body.app-authenticated .theme-choice-dark .theme-preview-surface { background: #14161a; }

/* Aparência: somente os dois temas, sem painel decorativo ou segunda versão móvel. */
body.app-authenticated .appearance-page-heading,
body.app-authenticated .appearance-form { max-width: 760px; }
body.app-authenticated .appearance-form { display: grid; gap: 20px; }
body.app-authenticated .appearance-theme-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
body.app-authenticated .appearance-form .theme-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.app-authenticated .appearance-form .theme-choice {
  min-width: 0;
  min-height: 178px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: 72px auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: none;
}
body.app-authenticated .appearance-form .theme-choice > input {
  grid-row: 1 / -1;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
}
body.app-authenticated .appearance-form .theme-preview {
  grid-column: 2;
  width: 100%;
  height: 72px;
  padding: 7px;
}
body.app-authenticated .appearance-form .theme-choice-copy {
  grid-column: 2;
  display: grid;
  gap: 4px;
  min-width: 0;
}
body.app-authenticated .appearance-form .theme-choice-copy strong { font-size: .94rem; }
body.app-authenticated .appearance-form .theme-choice-copy small { color: var(--muted); font-size: .82rem; line-height: 1.45; }
body.app-authenticated .appearance-form .theme-choice:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 18%, transparent);
}
body.app-authenticated .appearance-actions { justify-content: flex-start; }

/* Buscas e filtros ficam sobre o fundo da página, sem tarja decorativa. */
body.app-authenticated :is(.filter-bar, .search-bar, .product-filters) {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 700px) {
  body.app-authenticated .appearance-form .theme-choice-grid { grid-template-columns: 1fr; }
  body.app-authenticated .appearance-form .theme-choice { min-height: 0; }
  body.app-authenticated .appearance-actions { display: grid; grid-template-columns: 1fr; }
  body.app-authenticated .appearance-actions > :is(a, button) { width: 100%; }
}

/* CRUD canônico: cards ficam diretamente sobre o fundo da página. A camada
   compartilhada calcula a quantidade real por linha e define o gap. */
body :is(
  .canonical-card-grid,
  [data-titanor-card-grid],
  .canonical-kpi-grid,
  .canonical-metric-grid,
  .canonical-money-grid,
  .metric-grid,
  .owner-metrics,
  .summary-grid,
  .summary-card-grid,
  .compact-metrics,
  .canonical-record-metrics,
  .decision-metrics,
  .balanced-summary,
  .commercial-detail-grid,
  .document-option-grid,
  .employee-grid,
  .attachment-grid,
  .commercial-home-grid,
  .sale-mode-grid,
  .stock-dashboard-grid,
  .operation-grid,
  .service-template-grid,
  .location-card-grid,
  .recommended-module-grid,
  .future-feature-grid,
  .theme-choice-grid,
  .discovery-choice-grid,
  .quick-review-grid,
  .settings-grid,
  .module-grid,
  .module-overview-grid,
  .owner-grid,
  .commission-overview,
  .storage-summary,
  .stats-grid,
  .rhythm-kpis,
  .owner-kpi-grid,
  .operational-day-grid,
  .quiet-grid,
  .knowledge-module-grid,
  .knowledge-discipline-grid,
  .knowledge-security-grid,
  .dev-company-grid,
  .dev-technical-grid,
  .dev-workbench-grid,
  .discovery-insights-grid,
  .discovery-check-grid,
  .signup-human-grid,
  .audience-grid,
  .institutional-grid,
  .values-grid,
  .landing-v5-audience-grid,
  .landing-v5-security-grid
) {
  gap: var(--titanor-card-grid-gap, var(--titanor-card-gap-three)) !important;
  padding: 0 !important;
  overflow: visible;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* A barra de filtros e a lista de OS são regiões distintas; o divisor da lista
   mantém o mesmo respiro canônico usado entre campos, sem redesenhar a tela. */
[data-v1-canonical-page="orders"] > .canonical-section {
  margin-top: var(--ui-space-field);
}

/* Indicadores canônicos — a mesma leitura em Financeiro, Meu ritmo, Estoque,
   Vendas, Orçamentos e Meu negócio. Os módulos preservam seus dados e links;
   somente a gramática visual é compartilhada. */
body .canonical-kpi-grid {
  --titanor-card-grid-gap: var(--titanor-card-gap-one-two);
  display: grid;
  align-items: stretch;
  margin-bottom: 22px;
}
body .canonical-kpi-grid-three {
  --titanor-card-grid-gap: var(--titanor-card-gap-three);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body .canonical-kpi-grid-four {
  --titanor-card-grid-gap: var(--titanor-card-gap-four-plus);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body.app-authenticated .canonical-kpi-grid > * {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: var(--titanor-card-padding-min);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
  text-decoration: none;
}
body.app-authenticated .canonical-kpi-grid > a:hover {
  background: var(--surface-soft);
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
}
body.app-authenticated .canonical-kpi-grid > a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}
body.app-authenticated .canonical-kpi-grid > * > :is(small, span) {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
body.app-authenticated .canonical-kpi-grid > * > small:first-child {
  font-weight: 500;
}
body.app-authenticated .canonical-kpi-grid > * > strong {
  min-width: 0;
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  body .canonical-kpi-grid-three,
  body .canonical-kpi-grid-four {
    --titanor-card-grid-gap: var(--titanor-card-gap-one-two);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body .canonical-kpi-grid-three,
  body .canonical-kpi-grid-four {
    --titanor-card-grid-gap: var(--titanor-card-gap-mobile);
    grid-template-columns: minmax(0, 1fr);
  }
  body.app-authenticated .canonical-kpi-grid > * { min-height: 96px; }
}

/* As tabelas de Equipe podem conter identificadores e descrições longas.
   O contêiner absorve essa largura intrínseca, mantendo a página no viewport. */
body.app-authenticated :is(.account-table, .permission-panel, .permission-table) {
  min-width: 0;
  max-width: 100%;
}
body.app-authenticated :is(.account-table, .permission-table) {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Aprovações: opções longas devem encolher dentro das três colunas existentes. */
body.app-authenticated .commercial-policy-targets > *,
body.app-authenticated .commercial-policy-targets .field-group,
body.app-authenticated .commercial-policy-targets select {
  min-width: 0;
  max-width: 100%;
}
body.app-authenticated .commercial-policy-targets select { width: 100%; }

@media (max-width: 700px) {
  body :is(.canonical-card-grid, [data-titanor-card-grid], .canonical-kpi-grid) {
    --titanor-card-grid-gap: var(--titanor-card-gap-mobile);
  }
}

@media (max-width: 700px) {
  body.app-authenticated {
    min-width: 0;
    font-size: 15px;
  }
  body.app-authenticated :is(.page-heading h1, .canonical-page-heading h1) {
    font-size: clamp(1.75rem, 9vw, 2.25rem);
  }
  body.app-authenticated :is(.panel, .form-card, .movement-card) { padding: 16px; }

  /* Fiscal mantém avisos e listas dentro da largura útil do celular. */
  body.app-authenticated [data-v1-canonical-page="fiscal"] .message,
  body.app-authenticated [data-v1-canonical-page="fiscal"] .simple-list > div {
    flex-wrap: wrap;
  }

  /* Superfícies de cadastro e acompanhamento que recebem conteúdo variável
     precisam encolher até a largura útil real, inclusive com a barra de rolagem. */
  body.app-authenticated .mobile-safe-surface,
  body.app-authenticated .mobile-safe-surface > *,
  body.app-authenticated .mobile-safe-surface :is(
    .page-heading,
    .canonical-page-heading,
    .canonical-page-actions,
    .heading-actions,
    .section-heading,
    .canonical-section-heading,
    .panel,
    .form-card,
    .movement-card,
    form,
    fieldset,
    .form-grid,
    .canonical-form,
    .simple-list,
    .table-wrap
  ),
  body.app-authenticated .mobile-safe-surface :is(.page-heading, .canonical-page-heading) > * {
    min-width: 0;
    max-width: 100%;
  }
  body.app-authenticated .mobile-safe-surface :is(.page-heading, .canonical-page-heading) > * {
    width: 100%;
  }
  body.app-authenticated .mobile-safe-surface :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
  ) {
    width: 100%;
    min-width: 0;
    max-width: min(100%, var(--ui-control-max, 100%));
  }
  body.app-authenticated .mobile-safe-surface :is(
    h1,
    h2,
    h3,
    legend,
    p,
    small,
    strong,
    span,
    dt,
    dd
  ) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  body.app-authenticated .mobile-safe-surface :is(.simple-list > div, .detail-list > div) {
    min-width: 0;
    flex-wrap: wrap;
  }
  body.app-authenticated .mobile-safe-surface .canonical-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  body.app-authenticated .mobile-safe-surface .canonical-page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }
  body.app-authenticated .mobile-safe-surface .canonical-page-actions > :is(a, button, form) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  body.app-authenticated .mobile-safe-surface .canonical-page-actions > form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

/* Contrato móvel final: o cabeçalho preserva apenas Central de Verticais e
   Perfil; o conteúdo reflui sem comprimir texto, números, campos ou ações. */
.mobile-profile-primary,
.mobile-profile-alert-count { display: none; }

@media (max-width: 700px) {
  body.app-authenticated.app-has-company .app-topbar {
    min-height: 56px;
    flex-basis: 56px;
    justify-content: space-between;
    gap: 12px;
    padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  }

  body.app-authenticated.app-has-company .mobile-brand {
    flex: 0 1 auto;
    display: flex;
    min-width: 0;
  }
  body.app-authenticated.app-has-company .mobile-brand .mobile-verticals-trigger {
    min-width: 0;
    min-height: var(--control-target);
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font: inherit;
    cursor: pointer;
  }
  body.app-authenticated.app-has-company .mobile-brand .mobile-verticals-trigger:hover,
  body.app-authenticated.app-has-company .mobile-brand .mobile-verticals-trigger:focus-visible,
  body.app-authenticated.app-has-company .mobile-brand .mobile-verticals-trigger[aria-expanded="true"] {
    color: var(--ink);
    background: var(--surface-soft);
  }
  body.app-authenticated.app-has-company .mobile-brand .mobile-verticals-trigger .brand-word {
    display: inline;
    color: inherit;
    font-size: .9rem;
    letter-spacing: .1em;
    white-space: nowrap;
  }

  body.app-authenticated.app-has-company .app-topbar > .command-trigger,
  body.app-authenticated.app-has-company .app-topbar .web-push-menu,
  body.app-authenticated.app-has-company .app-topbar .topbar-help,
  body.app-authenticated.app-has-company .app-topbar .topbar-navigation,
  body.app-authenticated.app-has-company .app-topbar .dev-badge { display: none; }

  body.app-authenticated.app-has-company .app-topbar-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }
  body.app-authenticated.app-has-company .app-topbar .account-menu { display: block; }
  body.app-authenticated.app-has-company .account-summary {
    min-width: var(--control-target);
    min-height: var(--control-target);
    justify-content: center;
    padding: 4px;
  }
  body.app-authenticated.app-has-company .account-summary .account-identity,
  body.app-authenticated.app-has-company .account-summary > svg { display: none; }
  body.app-authenticated.app-has-company .account-avatar-wrap {
    position: relative;
    display: inline-grid;
    place-items: center;
  }
  body.app-authenticated.app-has-company .mobile-profile-alert-count {
    position: absolute;
    top: -4px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: #fff;
    background: var(--danger, #d83a45);
    border: 2px solid var(--card);
    border-radius: 999px;
    font-size: .58rem;
    font-weight: 850;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  body.app-authenticated.app-has-company .account-popover {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 68px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.app-authenticated.app-has-company .mobile-profile-primary {
    display: grid;
    gap: 3px;
    padding-bottom: 6px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--line);
  }
  body.app-authenticated.app-has-company .mobile-profile-primary :is(a, button) {
    min-height: var(--control-target);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 0;
    font: inherit;
  }
  body.app-authenticated.app-has-company .mobile-profile-primary svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: var(--brand);
  }
  body.app-authenticated.app-has-company .sidebar-mobile-account { display: none; }

  body.app-authenticated.app-has-company .app-workspace > .page {
    min-width: 0;
    max-width: 100%;
    padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  body.app-authenticated.app-has-company .app-workspace > .page :is(
    .canonical-page,
    .mobile-safe-surface,
    section,
    article,
    form,
    fieldset,
    .panel,
    .form-card,
    .movement-card,
    .table-wrap
  ) {
    min-width: 0;
    max-width: 100%;
  }

  body.app-authenticated.app-has-company :is(
    .canonical-kpi-grid-three,
    .canonical-kpi-grid-four,
    .canonical-metric-grid,
    .canonical-money-grid,
    .metric-grid,
    .owner-metrics,
    .stock-metrics,
    .summary-card-grid,
    .summary-grid,
    .compact-metrics,
    .rhythm-kpis,
    .owner-kpi-grid,
    .operational-day-grid
  ) {
    --titanor-card-grid-gap: var(--titanor-card-gap-mobile, 12px);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    grid-auto-rows: 1fr;
    gap: 12px !important;
  }
  body.app-authenticated.app-has-company :is(
    .canonical-kpi-grid,
    .canonical-metric-grid,
    .canonical-money-grid,
    .metric-grid,
    .owner-metrics,
    .stock-metrics,
    .summary-card-grid,
    .summary-grid,
    .compact-metrics,
    .rhythm-kpis,
    .owner-kpi-grid,
    .operational-day-grid
  ) > * {
    min-width: 0;
    min-height: 96px;
    height: 100%;
    padding: 16px !important;
  }
  body.app-authenticated.app-has-company :is(
    .canonical-kpi-grid,
    .canonical-metric-grid,
    .canonical-money-grid,
    .metric-grid,
    .owner-metrics,
    .stock-metrics,
    .summary-card-grid,
    .summary-grid,
    .compact-metrics,
    .rhythm-kpis,
    .owner-kpi-grid,
    .operational-day-grid
  ) > * > :is(h2, h3, p, small, span) {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }
  body.app-authenticated.app-has-company :is(
    .canonical-kpi-grid,
    .canonical-metric-grid,
    .canonical-money-grid,
    .metric-grid,
    .owner-metrics,
    .stock-metrics,
    .summary-card-grid,
    .summary-grid,
    .compact-metrics,
    .rhythm-kpis,
    .owner-kpi-grid,
    .operational-day-grid
  ) > * > strong {
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    font-size: clamp(1.3rem, 7vw, 1.85rem);
  }

  body.app-authenticated.app-has-company .canonical-metric-grid > * > strong {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  body.app-authenticated.app-has-company main.page:not(:has(> .canonical-pdv-page)) :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
  ) {
    width: 100%;
    min-width: 0;
    max-width: min(100%, var(--ui-control-max, 100%));
  }
  body.app-authenticated.app-has-company main.page:not(:has(> .canonical-pdv-page)) :is(
    .canonical-page-actions,
    .heading-actions,
    .form-actions
  ) {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  body.app-authenticated.app-has-company main.page:not(:has(> .canonical-pdv-page)) :is(
    .canonical-page-actions,
    .heading-actions,
    .form-actions
  ) > :is(a, button, form) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  body.app-authenticated.app-has-company main.page:not(:has(> .canonical-pdv-page)) :is(
    .canonical-page-actions,
    .heading-actions,
    .form-actions
  ) > form :is(a, button) { width: 100%; }

  body.app-authenticated.app-has-company main.page:not(:has(> .canonical-pdv-page)) .table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
  }
}

/* B3: material controls, without changing the shared shell or other forms. */
body.app-authenticated .canonical-os-item-row {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(190px, 1.3fr) 100px 75px 110px 95px 115px;
}
body.app-authenticated .canonical-os-item-row > * { grid-column: auto; min-width: 0; }
body.app-authenticated .canonical-os-item-row :is(.stock-checkbox, .row-error) { grid-column: 1 / -1; }
body.app-authenticated .canonical-os-item-row .stock-checkbox { display: flex; align-items: center; gap: 10px; width: 100%; }
body.app-authenticated .canonical-os-item-row .stock-checkbox input { flex: 0 0 auto; }
body.app-authenticated .canonical-os-item-row .stock-checkbox span { min-width: 0; }
body.app-authenticated .canonical-os-item-row .b3-remove-material { align-self: center; }
body.app-authenticated #service-order-items,
body.app-authenticated .product-detail-metrics + .canonical-kpi-grid { margin-top: var(--titanor-card-gap-three); }
body.app-authenticated #service-order-items[hidden],
body.app-authenticated #service-order-items-empty[hidden] { display: none; }
.b3-material-operations { padding-block: 16px; border-bottom: 1px solid var(--line); }
.b3-material-operations .canonical-actions { flex-wrap: wrap; gap: 12px; }
.b3-material-field { min-width: 0; display: grid; gap: 6px; align-content: start; }
.b3-material-field :is(input:not([type=checkbox]), select, textarea) { width: 100%; min-width: 0; }
.b3-material-field input[type=checkbox] { width: auto; }
.b3-material-action .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1250px) {
  body.app-authenticated .canonical-os-item-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.app-authenticated .canonical-os-item-row .service-item-main { grid-column: 1 / -1; }
  body.app-authenticated .canonical-os-item-row .sales-type { grid-column: span 2; }
}
@media (max-width: 700px) {
  body.app-authenticated #service-order-items,
  body.app-authenticated .product-detail-metrics + .canonical-kpi-grid { margin-top: var(--titanor-card-gap-mobile); }
  body.app-authenticated .canonical-os-item-row,
  .b3-material-action .form-grid { grid-template-columns: minmax(0, 1fr); }
  body.app-authenticated .canonical-os-item-row > * { grid-column: 1 / -1; }
  body.app-authenticated .canonical-os-item-row .sales-type { grid-column: 1 / -1; }
}

/* Settings houses share the existing list and search components. */
.settings-house-empty { display: none; }
.settings-action-list:not(:has(a)) + .settings-house-empty { display: block; }
.settings-breadcrumb { margin-bottom: 16px; }
.settings-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; list-style: none; margin: 0; padding: 0; }
.settings-breadcrumb li { min-width: 0; overflow-wrap: anywhere; }
.settings-breadcrumb li + li::before { content: "/"; padding-right: 8px; color: var(--muted); }
.settings-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 3px; }
.settings-breadcrumb a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.settings-back-link { font-size: .9rem; }
.settings-workspace .settings-group-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; min-width: 0; overscroll-behavior-inline: contain; padding-block: 4px; }
.settings-workspace .settings-group-nav > a { flex: 0 0 auto; white-space: nowrap; min-height: 44px; }

html[data-theme="light"] .settings-workspace { --muted: #53647a; }

/* W4-01: keep the fact readable beside long origin actions on a phone. */
@media (max-width: 575px) {
  .operational-day-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .operational-day-item > b { white-space: normal; }
  body.app-authenticated.app-has-company .operational-day-grid {
    grid-auto-rows: auto;
  }
}

/* W4-02: keep service identity and responsibility together on narrow screens. */
.service-order-operational-detail .quote-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.service-order-operational-detail .quote-summary > div { min-width: 0; overflow-wrap: anywhere; }
.service-order-operational-detail .service-next-step { margin-block: 12px; }
@media (min-width: 768px) {
  .service-order-operational-detail .quote-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Unit context uses the existing shell, forms and action hierarchy. */
.unit-context-bar {
  margin: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}
.unit-context-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.unit-context-form label { margin: 0; }
.unit-context-form select { width: min(100%, 360px); min-width: 0; }
.unit-context-help { margin: 8px 0 0; overflow-wrap: anywhere; }
.unit-context-help:only-child { margin: 0; }
.unit-settings-table { width: 100%; table-layout: fixed; }
.unit-settings-table td, .unit-settings-table th { overflow-wrap: anywhere; }
.unit-settings-table td small { display: block; }
.unit-settings-table .button { white-space: normal; }
.unit-settings-section { margin-top: 24px; }
.unit-details-form .field, .unit-details-form input, .unit-details-form textarea { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .unit-context-bar { padding: 12px 16px; }
  .unit-context-form label { width: 100%; }
  .unit-context-form select { flex: 1 1 180px; width: 100%; }
  .unit-context-form .button { flex: 0 1 auto; }
  .unit-settings-table .unit-contact-column { display: none; }
  .unit-settings-table th:first-child { width: 44%; }
  .unit-settings-table th:nth-child(2) { width: 24%; }
}
