/*
 * painel — the surface's own layer over the kit (ui/tokens.css, ui/layout.css).
 *
 * Only what the kit does not have: the sign-in pages, the header menus, form
 * sections, and the lists on the empreendimento detail. Every colour is a kit
 * token. Latão is not used here at all: the two Latão spots per screen stay the
 * kit's .btn--primary and the active .app-nav__link (BRAND.md section 3).
 */

/*
 * The kit gives .field, .choices, .btn and others an author `display`, which
 * beats the browser's [hidden] rule, so `element.hidden = true` would not hide
 * them. This restores the attribute's meaning for the whole surface.
 */
[hidden] { display: none !important; }

body {
  display: flex;
  flex-direction: column;
}

main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: 50;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.skip-link:focus { top: var(--space-2); }

.page { flex: 1 0 auto; }

.app-footer {
  padding: var(--space-4);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ------------------------------------------------------------ sign-in pages */

.auth__main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-4);
}

/* The mark above the card (.brand-mark) and the background come from
   ui/brand-motion.css, shared with painel-admin/ and site/. */

.auth__card { width: min(28rem, 100%); }

.auth__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
}

.auth__title { font-size: 1.5rem; }
.auth__lead { color: var(--text-muted); }
.auth__alert:empty { display: none; }

.auth__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

.auth__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.auth__link {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.auth__link:hover { text-decoration-color: currentColor; }

.auth__email {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  overflow-wrap: anywhere;
}

.auth__email-label {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn--block { width: 100%; }

/* -------------------------------------------------------------- notices */

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  border-radius: var(--radius);
  font-weight: 500;
}

.notice .material-symbols-outlined { font-size: 1.25rem; }
.notice--success { border-left-color: var(--inctor-concluido); }
.notice--success .material-symbols-outlined { color: var(--success-text); }
.notice--info { border-left-color: var(--inctor-planejado); }
.notice--info .material-symbols-outlined { color: var(--text-muted); }

/* ------------------------------------------------------------- languages */

.lang {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.lang__option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.25rem;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.lang__option:hover { background: var(--surface-hover); color: var(--text); }
.lang__option[aria-pressed="true"] { border-color: var(--border-strong); color: var(--text); }
.lang__flag { font-size: 1.125rem; line-height: 1; }

.lang--menu { display: flex; flex-direction: column; }

.lang--menu .lang__option {
  justify-content: flex-start;
  min-height: var(--touch-target);
  border: 0;
  color: var(--text);
  font-size: inherit;
  font-weight: 400;
}

.lang--menu .lang__option[aria-pressed="true"] {
  background: var(--surface-sunken);
  font-weight: 500;
}

/* ------------------------------------------------------ company chooser */

.company-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.company-choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.company-choice__icon { color: var(--text-muted); }
.company-choice__name { flex: 1 1 auto; min-width: 0; font-size: 1rem; }

/* ---------------------------------------------------------------- header */

.company-slot {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}

.company-switch,
.company-name,
.user-menu__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
}

.company-switch,
.user-menu__button { cursor: pointer; }

.company-switch:hover,
.user-menu__button:hover { background: var(--surface-hover); }

.company-slot .material-symbols-outlined,
.user-menu__button .material-symbols-outlined {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.company-switch,
.company-name { max-width: 100%; min-width: 0; }

.company-switch__name {
  min-width: 0;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-anchor { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 16rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-flat);
}

.menu--end { left: auto; right: 0; }

.menu__label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu__item:hover { background: var(--surface-hover); }
.menu__item .material-symbols-outlined { color: var(--text-muted); font-size: 1.25rem; }
.menu__item[aria-current="true"] { font-weight: 500; cursor: default; }
.menu__item[aria-current="true"]:hover { background: transparent; }
.menu__text { flex: 1 1 auto; }

.menu__who {
  margin-bottom: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.menu__who-name { font-weight: 500; }

.menu__who-line {
  color: var(--text-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.menu__sep {
  margin: var(--space-2) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* "Topo do sistema": on a narrow screen the name goes and the symbol stays. */
@media (max-width: 48rem) {
  .brand-lockup__name,
  .user-menu__name { display: none; }
  .company-switch__name { max-width: 9rem; }
}

/* Phone: the navigation takes a second row under the symbol, company and menu. */
@media (max-width: 40rem) {
  .app-header { flex-wrap: wrap; row-gap: 0; }
  .company-slot { flex: 1 1 auto; padding-left: var(--space-2); }
  .company-switch__name { max-width: none; }

  .app-nav {
    order: 3;
    flex: 1 0 100%;
    min-height: 2.75rem;
    margin: 0 calc(-1 * var(--space-3));
    padding: 0 var(--space-2);
    border-top: 1px solid var(--border);
  }
}

/* ------------------------------------------------------------ page bits */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  align-self: flex-start;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover { color: var(--text); }
.back-link .material-symbols-outlined { font-size: 1.25rem; }

.page-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
}

.page > .state {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.grid-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

.grid-link:hover { text-decoration-color: currentColor; }

.cell-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.cell-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.cell-strong { font-weight: 500; }

.cell-sub {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.tag {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.status--muted { color: var(--text-muted); }

.grid-toggle {
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------- form sections */

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.form-section__title { font-size: 1rem; }

.form-subgroup {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Radio options with a title and a one-line explanation, laid out as cards. */
.field--cards .choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: var(--space-3);
}

.field--cards .choice {
  align-items: flex-start;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field--cards .choice:has(input:checked) {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}

.field--cards .choice input { margin-top: 0.2rem; flex: none; }
.field--cards .choice > span { display: flex; flex-direction: column; gap: 0.125rem; }

.choice__title { font-weight: 500; }

.choice__text {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.checklist .choices {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--space-1);
  max-height: 15rem;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.input[readonly] {
  background: var(--surface-sunken);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- detail */

.summary-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.summary-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.summary-group + .summary-group {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.summary-group__title { font-size: 0.9375rem; }
.summary dd { overflow-wrap: anywhere; }
.summary dd.is-empty { color: var(--text-muted); }

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

.people li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.timeline li {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.people li:last-child,
.timeline li:last-child { border-bottom: 0; }

.timeline__when {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.card__empty {
  padding: var(--space-4);
  color: var(--text-muted);
}

.card .state { min-height: 8rem; }

/* ------------------------------------------------------------ início */

/*
 * The start screen, owner's choice (2026-09-12): square tiles as in BRAND
 * section 6, but each in a different brand colour, with a large centred icon
 * and small text below it. Tinta, Aço and Aço claro, in module order; Latão is left out, since the
 * screen already spends its two Latão spots on the primary button and the
 * active menu item. 11 px gap, 16 px from 768 px up; two per row on a phone.
 */
.module-home {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 11rem));
  gap: 11px;
}

@media (min-width: 768px) {
  .module-home { gap: 16px; }
}

.module-tile {
  --tile-bg: var(--inctor-tinta);
  --tile-fg: var(--inctor-osso);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  aspect-ratio: 1 / 1;
  padding: var(--space-3);
  border: 1px solid transparent;
  text-align: center;
  border-radius: var(--radius);
  background: var(--tile-bg);
  color: var(--tile-fg);
  text-decoration: none;
}

.module-tile[data-module="diarios"] { --tile-bg: var(--inctor-aco); }
/* Orçamento: Osso with Tinta text (owner's decision). On the light theme's
   Osso ground an Aço claro edge draws the square; on Tinta it stands out on
   its own. */
.module-tile[data-module="orcamento"] {
  --tile-bg: var(--inctor-osso);
  --tile-fg: var(--inctor-tinta);
  border-color: var(--inctor-aco-claro);
}
.module-tile[data-module="equipe"] { --tile-bg: var(--inctor-aco-claro); --tile-fg: var(--inctor-tinta); }
/* Cronograma: Latão claro with Tinta text and icon (owner's decision; 8.98:1).
   Strong Latão stays off the tiles, so this is not one of the two Latão spots. */
.module-tile[data-module="cronograma"] { --tile-bg: var(--inctor-latao-claro); --tile-fg: var(--inctor-tinta); }

/* Dark theme: a Tinta tile on the Tinta ground keeps an edge. */
:root[data-theme="dark"] .module-tile { border-color: rgb(239 235 227 / 0.18); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .module-tile { border-color: rgb(239 235 227 / 0.18); }
}

.module-tile:hover { box-shadow: inset 0 0 0 2px currentColor; }
.module-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* The icon takes the room above a fixed text area, so every icon sits at the
   same height whatever the length of its tile's text. */
.module-tile__icon {
  display: grid;
  flex: 1 1 auto;
  place-items: center;
  line-height: 1;
}
.module-tile__icon .material-symbols-outlined { font-size: 4rem; }

.module-tile__text {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.125rem;
  min-width: 0;
  height: 4.4rem;       /* name, number, and up to two lines of context */
}

.module-tile__name { font-size: 0.875rem; font-weight: 600; line-height: 1.25; }

/* Number, dot and context centred under the name; a long context wraps. */
.module-tile__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.3;
  opacity: 0.85;
}

.module-tile__meta .status-dot { align-self: center; flex: none; }
/* the context always starts its own line, so every tile has the same rows */
.module-tile__context { flex-basis: 100%; min-width: 0; }

.module-tile__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}

/* --------------------------------------------------------- diário de obra */

.cell-main--end { align-items: flex-end; }

/* Equipe: status badge with the last-administrator ⓘ on the same line. */
.status-with-tip { display: inline-flex; align-items: center; gap: 0.125rem; }

/*
 * The diary grid has eight columns and a filter row: at the kit's 1 rem cell
 * padding it runs past a 1440 px screen. Tighter cells keep it inside the card;
 * narrower screens still scroll (kit behaviour). Row actions are icon-only.
 */
.diario-grid .grid__table th,
.diario-grid .grid__table td { padding-left: var(--space-2); padding-right: var(--space-2); }
.diario-grid .grid__table th:first-child,
.diario-grid .grid__table td:first-child { padding-left: var(--space-4); }
.diario-grid .grid__table th:last-child,
.diario-grid .grid__table td:last-child { padding-right: var(--space-4); }
.diario-grid .grid__filter-input.input[type="date"] { width: 8rem; min-width: 0; }

.diario-form__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.diario-form__content > .form-section:first-child {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.diario-observacao {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.diario-observacao .field__label { font-family: var(--font-display); font-weight: 700; font-variation-settings: "wdth" 112; font-size: 1rem; }

.diario-where {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: 1rem;
}

.diario-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.diario-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* The RDO header: label over value, three to a row. */
.diario-head {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.diario-head__item { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.diario-head dt { color: var(--text-muted); font-size: 0.8125rem; font-weight: 500; }
.diario-head dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.diario-head dd.is-empty { color: var(--text-muted); font-weight: 400; }

/* Tables of the form and of the view: simple, bordered, scroll sideways. */
.dtable-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dtable-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dtable th {
  padding: var(--space-2);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.dtable tbody th { color: var(--text); background: transparent; }

.dtable td {
  padding: var(--space-1);
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.dtable tbody th { border-top: 1px solid var(--border); vertical-align: middle; }

.dtable .input,
.dtable .select,
.dtable .textarea {
  min-height: 2.25rem;
  padding: 0.3rem var(--space-2);
  font-size: 0.875rem;
}

.dtable .textarea { min-height: 2.25rem; resize: vertical; }
.dtable .input[aria-invalid="true"],
.dtable .select[aria-invalid="true"],
.dtable .textarea[aria-invalid="true"] { border-color: var(--danger); outline: 1px solid var(--danger); }

.dtable .is-numeric { text-align: right; }
.dtable td.is-numeric { font-variant-numeric: tabular-nums; }
.dtable__wide { min-width: 14rem; }
.dtable__qty { width: 7rem; min-width: 6rem; }
.dtable__unit { width: 6rem; min-width: 5rem; }
.dtable__code { width: 6.5rem; min-width: 5.5rem; }
.dtable__origin { width: 7.5rem; min-width: 7rem; }
.dtable__select { width: 12rem; min-width: 11rem; }
.dtable__remove { width: 1%; text-align: center; }
.dtable td.dtable__remove { vertical-align: middle; }

.dtable--turnos td { width: 30%; }
.dtable--turnos tbody th { width: 10%; }

.dtable--read td {
  padding: var(--space-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dtable--read td.is-numeric {
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}

.dtable-foot { display: flex; }

.dtable-error {
  color: var(--error-text);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* The photo report: one photo large, the comment under it. */
.carousel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Flex, not grid: a grid's auto row gives the image no definite height to
   fit into, and a tall photo came out cropped. */
.carousel__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(14rem, 45vh, 26rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  overflow: hidden;
}

.carousel__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: 24rem;
  padding: var(--space-4);
  color: var(--text-muted);
  text-align: center;
}

.carousel__empty .material-symbols-outlined { font-size: 2rem; }

.carousel__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.carousel__position { color: var(--text-muted); font-size: 0.875rem; font-weight: 500; }

.carousel__flag { color: var(--text-muted); font-size: 0.8125rem; }
.carousel__flag:empty { display: none; }
.carousel__flag--error { color: var(--error-text); font-weight: 500; }

.carousel__caption-field { display: flex; flex-direction: column; gap: var(--space-1); }
.carousel__caption { min-height: 4rem; }
.carousel__caption-text { font-weight: 500; overflow-wrap: anywhere; }

.carousel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.carousel__message {
  color: var(--error-text);
  font-size: 0.8125rem;
  font-weight: 500;
}

.diario-history { border: 1px solid var(--border); border-radius: var(--radius); }

/* View modal: PDF and Editar on the left of the footer, Fechar on the right. */
.modal__foot-start {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-right: auto;
}

/* -------------------------------------------------------------- orçamento */

/* Sub-navigation inside a module (Catálogos: Disciplinas, Insumos). The
   active link is underlined in the text colour, never Latão: the screen's two
   Latão spots stay the primary button and the active menu item. */
.subnav {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.subnav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  margin-bottom: -1px;
  padding: 0 var(--space-3);
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.subnav__link:hover { color: var(--text); }
.subnav__link[aria-current="page"] { color: var(--text); border-bottom-color: currentColor; }
.subnav__link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* A disciplina's colour: a small square beside its name. */
.orc-swatch {
  display: inline-block;
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgb(12 24 36 / 0.25);
  vertical-align: -0.05em;
}

.orc-muted { color: var(--text-muted); }

/* What "Criar pavimentos" and "Aplicar disciplinas" will do, from the API's preview. */
.orc-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.orc-preview[aria-busy="true"] { opacity: 0.7; }
.orc-preview__lead { font-weight: 500; }
.orc-preview__muted { color: var(--text-muted); font-weight: 400; }
.orc-preview__error { color: var(--error-text); }

.orc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.orc-chip {
  padding: 0.125rem var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.8125rem;
}

.orc-chip--existing {
  border-style: dashed;
  color: var(--text-muted);
  text-decoration: line-through;
}

.orc-checktools { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.orc-aplicar { align-items: start; }
.orc-aplicar > .field { min-width: 0; }

.orc-medicao {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: var(--space-3) var(--space-4);
}

.input[type="color"] {
  width: 4.5rem;
  padding: 0.25rem;
  cursor: pointer;
}

/* The home grid has seven columns and a filter row; tighter cells keep it in the card. */
.orc-home-grid .grid__table th,
.orc-home-grid .grid__table td { padding-left: var(--space-2); padding-right: var(--space-2); }
.orc-home-grid .grid__table th:first-child,
.orc-home-grid .grid__table td:first-child { padding-left: var(--space-4); }
.orc-home-grid .grid__filter-input.input[type="date"] { width: 8rem; min-width: 0; }

/* Imports: the file field, the file line with its ⓘ, the status counts. */
.input.orc-file { padding: 0.4rem var(--space-2); cursor: pointer; }

.orc-import-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.orc-import-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 500;
}

.orc-import-grid { border: 1px solid var(--border); border-radius: var(--radius); }
/* The reason is the column people read: it keeps a readable width, the grid scrolls. */
.orc-import-grid .grid__table td:last-child,
.orc-import-grid .grid__table th:last-child { min-width: 20rem; white-space: normal; }

/* ----------------------------------------------------------- quantitativo */

/* Grids with many numeric columns: tighter cells keep them inside the card. */
.qt-grid .grid__table th,
.qt-grid .grid__table td,
.orc-import-grid .grid__table th,
.orc-import-grid .grid__table td { padding-left: var(--space-2); padding-right: var(--space-2); }
.qt-grid .grid__table th:first-child,
.qt-grid .grid__table td:first-child { padding-left: var(--space-4); }

.qt-link-select { min-width: 12rem; min-height: 2.25rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }

.qt-notices { display: flex; flex-direction: column; gap: var(--space-2); }

/* "Sai da Estrutura…" and the lengths, under the indicators. */
.qt-summary {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- serviços */

/* The service name selects it: its items show in the card below. */
.sv-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.sv-link:hover { text-decoration-color: currentColor; }
.sv-link[aria-pressed="true"] { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.sv-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ORCAMENTO-019: the Itens column is the way into the items card ("3 itens", "Adicionar itens"). */
.sv-itens-btn { white-space: nowrap; }
.sv-itens-btn[aria-pressed="true"] { border-color: var(--border-strong); }

/* The scope (a tipologia or the whole building) in a card head. */
.sv-scope-host { display: flex; align-items: center; }
.sv-scope { min-width: 14rem; min-height: 2.25rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* A service name fits on one or two lines instead of a three-line link. */
.sv-grid .grid__table th:nth-child(2),
.sv-grid .grid__table td:nth-child(2) { min-width: 16rem; }

.cell-line--end { justify-content: flex-end; }
.sv-diff { justify-content: flex-end; }

/* ------------------------------------------------------------ cronograma */

/* "Adicionar à equipe": search the registry, pick several. */
.cr-searchrow { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cr-searchrow .input { flex: 1 1 14rem; min-width: 0; }

.cr-picklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 16rem;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cr-pick { align-items: flex-start; padding: var(--space-1) 0; }
.cr-pick input { margin-top: 0.2rem; flex: none; }

/* A label with its control on one line, in a card head. */
.cr-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cr-title-note { font-family: var(--font-text); font-size: 0.875rem; font-weight: 400; }

/* The jornada: one hour field per weekday. */
.cr-jornada {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(7rem, 100%), 1fr));
  gap: var(--space-3);
}

/* ----------------------------------------------------- local-only link */

.dev-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.dev-link__label { font-size: 0.875rem; font-weight: 500; }

.dev-link__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dev-link__input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
}

.dev-link__note {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Cronograma — "Material a chegar" (CRONOGRAMA-009) */
.cr-alerta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2, 0.5rem); }
.cr-alerta { display: flex; align-items: baseline; gap: var(--space-2, 0.5rem); }
.cr-alerta .status-dot { flex: none; transform: translateY(-0.1em); }
.cr-alerta-foot { margin: var(--space-3, 0.75rem) 0 0; }

/* Cronograma — Planejamento, Programação do dia, Painel da obra (CRONOGRAMA-010/011) */
.pl-weeknav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 0.5rem); margin: 0 0 var(--space-4, 1rem); }
.pl-weeknav__title { flex: 1 1 16rem; text-align: center; }
.pl-weeknav .input { width: auto; }
.pl-board-wrap { overflow-x: auto; }
.pl-board { width: 100%; min-width: 56rem; border-collapse: collapse; font-size: 0.875rem; }
.pl-board th, .pl-board td { padding: var(--space-2, 0.5rem); border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.pl-board thead th { background: var(--surface-sunken); font-weight: 600; }
.pl-board .is-numeric { text-align: right; }
.pl-board tbody + tbody { border-top: 2px solid var(--border-strong); }
.pl-recurso th, .pl-recurso td { background: var(--surface-sunken); }
.pl-recurso__name { min-width: 14rem; }
.pl-recurso__name .pl-cell--add { margin-top: var(--space-1, 0.25rem); }
.pl-frente__name { font-weight: 400; padding-left: var(--space-5, 1.5rem) !important; }
.pl-board tfoot th, .pl-board tfoot td { font-weight: 600; border-top: 2px solid var(--border-strong); }
.pl-cell { min-width: 3rem; min-height: 2.25rem; padding: var(--space-1, 0.25rem) var(--space-2, 0.5rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: right; }
.pl-cell:hover { border-color: var(--border-strong); }
.pl-cell:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pl-cell--empty { border-style: dashed; color: var(--text-muted); text-align: center; }
.pl-cell--excede { border-color: var(--inctor-atraso, #C0392B); }
.pl-over, .pl-over .tabular { color: var(--error-text); font-weight: 600; }
.pl-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--space-2, 0.5rem); }
.pl-day-choice { align-items: flex-start; }
.pl-fora { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2, 0.5rem); }
.indicators--five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .indicators--five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pn-indicators { display: grid; gap: var(--space-5, 1.5rem); }
.pn-dias { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2, 0.5rem); }
.pn-dias li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3, 0.75rem); }
.rz-dias { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 0.5rem); margin-bottom: var(--space-4, 1rem); }
.pg-group th { background: var(--surface-sunken); font-weight: 600; text-align: left; }
.print-only { display: none; }
.pg-assinaturas { margin-top: var(--space-6, 2rem); display: grid; gap: var(--space-5, 1.5rem); }
@media print {
  .app-header, .app-nav, .app-footer, .subnav, .page-head__actions, .back-link, .pg-no-print, .toast-host, .toasts { display: none !important; }
  .print-only { display: grid !important; }
  body, .page { background: #fff !important; color: #000 !important; }
  .card { border: 0 !important; box-shadow: none !important; }
  .indicator { break-inside: avoid; }
}

/* Diário — the day's plan in the form (CRONOGRAMA-013) */
.dplan { display: grid; gap: var(--space-3, 0.75rem); margin-bottom: var(--space-4, 1rem); }
.dplan__title { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.dplan__add { display: flex; flex-wrap: wrap; gap: var(--space-2, 0.5rem); align-items: center; }
.dplan__add .select { width: auto; min-width: 14rem; max-width: 100%; }
.dteam { display: grid; gap: var(--space-2, 0.5rem); }
.dteam__row { display: grid; gap: var(--space-2, 0.5rem); padding: var(--space-3, 0.75rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dteam__who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 0.5rem); }
.dteam__who .cell-main { flex: 1 1 12rem; }
.dteam__hours-list { display: grid; gap: var(--space-2, 0.5rem); }
.dteam__hour { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 0.5rem); }
.dteam__hour > span:first-child { flex: 1 1 12rem; min-width: 0; }
.dteam__hours { width: 5.5rem; }
.dteam__motivo .input { width: 100%; }
.dplan__fora { display: grid; gap: var(--space-2, 0.5rem); }
.dplan__fora-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 0.5rem); }
.dplan__fora-row > span { flex: 1 1 14rem; }

/* Cronograma — "Gerar pelo orçamento" (CRONOGRAMA-012) */
.cr-gerar-list { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--space-1, 0.25rem); }

/* ------------------------------------------------ insumo catalog (ORCAMENTO-018)
 * The reference above the grid (label, UF picker, regime), the counts line, and
 * the SINAPI pick of "Novo insumo". */
.orc-ref { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.orc-ref__label { font-weight: 500; color: var(--text); }
.orc-ref-summary { margin: 0; padding: var(--space-3) var(--space-4) 0; }
.orc-ref-link { margin: var(--space-2) 0 0; }
.orc-proprio { color: var(--text-muted); }
.orc-novo__picked {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.orc-novo__picked p { margin: 0; }
.orc-novo__ref { margin: 0; font-weight: 500; }
.orc-novo__manual { margin: 0; }

/* ORCAMENTO-019: one SINAPI result in the search combobox (ui/combobox.js): the code in bold, the description and
   unit under it, and the reference price on the right (custos). */
.sn-option { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-width: 0; }
.sn-option__main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.sn-option__desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sn-option__preco { flex: none; text-align: right; font-weight: 500; }

/* ------------------------------------------- guided Orçamento flow (ORCAMENTO-024)
 * The stepper above each step's page: five links with a mark (✓ concluída, the
 * number otherwise) in the status colour, the API's summary line under the name,
 * and the current step underlined in the text colour like .subnav — never Latão,
 * so the screen keeps its two Latão spots. Narrow screens scroll the steps. */
.orc-flow { display: grid; gap: var(--space-2); min-width: 0; }

/* position: relative keeps the steps' visually hidden state labels inside the
   scroller; without it they widen a phone's layout viewport (see .grid__scroll). */
.orc-steps { position: relative; overflow-x: auto; border-bottom: 1px solid var(--border); }
.orc-steps__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(9.5rem, 1fr));
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.orc-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: var(--touch-target);
  height: 100%;
  margin-bottom: -1px;
  padding: var(--space-2) var(--space-2) var(--space-3);
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
}
.orc-step:hover { color: var(--text); background: var(--surface-hover); }
.orc-step:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.orc-step[aria-current="step"] { color: var(--text); border-bottom-color: currentColor; }

.orc-step__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.orc-step__mark .material-symbols-outlined { font-size: 1rem; }
.orc-step__mark--concluido { border-color: var(--inctor-concluido); color: var(--inctor-concluido); }
.orc-step__mark--andamento { border-color: var(--inctor-andamento); }
.orc-step__mark--planejado { border-color: var(--inctor-planejado); }

.orc-step__text { display: flex; flex-direction: column; min-width: 0; }
.orc-step__label { font-weight: 600; }
.orc-step__resumo { font-size: 0.8125rem; line-height: 1.3; color: var(--text-muted); }

.orc-flow__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  min-height: 2rem;
}
.orc-flow__next { margin-left: auto; }
.orc-flow__hint,
.orc-flow__done { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: 0.875rem; }
.orc-flow__tabs { margin-top: var(--space-1); }

.orc-crumbs__list { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.orc-crumbs__item + .orc-crumbs__item::before { content: "›"; margin: 0 var(--space-2); color: var(--text-muted); }
.orc-crumbs__item a { color: var(--text-muted); }
.orc-crumbs__item a:hover { color: var(--text); }
.orc-crumbs__item [aria-current="page"] { font-weight: 600; }

/* Nova torre's preview: each planta with its pavimentos. */
.orc-plantas { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.orc-plantas__name { margin: 0 0 var(--space-1); }

/* A unit in the Plantas grid, linked to its ambientes. */
a.orc-chip--link { display: inline-block; color: var(--text); text-decoration: none; }
a.orc-chip--link:hover { background: var(--surface-hover); }

/* The manual frentes, closed below the flow. */
.orc-avancado { min-width: 0; }
.orc-avancado__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-1);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.orc-avancado__summary::-webkit-details-marker { display: none; }
.orc-avancado__summary .material-symbols-outlined { transition: transform 0.15s ease; transform: rotate(-90deg); }
.orc-avancado[open] .orc-avancado__summary .material-symbols-outlined { transform: none; }
.orc-avancado__summary:hover { color: var(--text); }
.orc-avancado__hint { font-weight: 400; font-size: 0.875rem; }
.orc-avancado__actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.orc-avancado[open] > .card { margin-top: var(--space-2); }

/* Ambientes: the unit picker and the quick table. */
.orc-amb__picker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.orc-amb__picker .select { width: auto; min-width: min(18rem, 100%); max-width: 100%; }
.orc-amb th, .orc-amb td { padding-left: var(--space-2); padding-right: var(--space-2); }
.orc-amb th:first-child, .orc-amb td:first-child { padding-left: var(--space-4); }
.orc-amb tbody tr:hover { background: transparent; }
.orc-amb .orc-amb__input { min-height: 2.25rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.orc-amb select.orc-amb__input { width: 10rem; }
.orc-amb input[name="name"] { width: 11rem; }
.orc-amb input[name="largura"],
.orc-amb input[name="comprimento"],
.orc-amb input[name="peDireito"] { width: 5rem; }
.orc-amb input[name="portas"],
.orc-amb input[name="janelas"] { width: 3.5rem; }
.orc-amb .orc-amb__input[aria-invalid="true"] { border-color: var(--danger); }
.orc-amb__medidas { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.orc-amb__piso, .orc-amb__servicos { white-space: nowrap; }
.orc-amb__new td { background: var(--surface-sunken); }
.orc-amb tr[aria-busy="true"] { opacity: 0.7; }
.orc-amb__foot { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.orc-amb__status { margin: 0; min-height: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.orc-amb__status.is-error { color: var(--error-text); }
.orc-amb__help { margin: 0; }

/* ------------------------------------- Orçamento part 2 (ORCAMENTO-024): table, review, ambiente serviços */

/* The single budget table: the grouping and filter bar, then a tree of rows in the kit's table. */
.orc-tab__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.orc-tab__controls, .orc-tab__filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.orc-tab__label { font-weight: 500; color: var(--text-muted); }
.orc-tab__sep { color: var(--text-muted); }
.orc-tab__controls .select, .orc-tab__filters .select { width: auto; min-width: 0; max-width: 100%; min-height: 2.25rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.orc-tab__notices:not(:empty) { padding: var(--space-3) var(--space-4) 0; }
.orc-tab th, .orc-tab td { padding-left: var(--space-2); padding-right: var(--space-2); }
.orc-tab th:first-child, .orc-tab td:first-child { padding-left: var(--space-3); }
.orc-tab tbody th { font-weight: 400; text-align: left; }
.orc-tab__indent { display: inline-flex; align-items: center; gap: var(--space-1); padding-left: calc(var(--depth, 0) * 1.25rem); min-width: 14rem; }
.orc-tab__toggle .material-symbols-outlined { transition: transform 0.15s ease; transform: rotate(-90deg); }
.orc-tab__toggle[aria-expanded="true"] .material-symbols-outlined { transform: none; }
.orc-tab__toggle-space { display: inline-block; flex: none; width: 2rem; }
.orc-tab__row--d0 { background: var(--surface-sunken); }
.orc-tab__total th, .orc-tab__total td { border-top: 2px solid var(--border-strong); font-weight: 600; text-align: left; }
.orc-tab__total .is-numeric { text-align: right; }
.grid__scroll[aria-busy] { opacity: 0.6; }
.orc-tab__foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.orc-tab__foot:has(> [hidden]:only-child) { display: none; }
.orc-tab__fonte { margin: 0; }

/* Serviços review: one card per disciplina, the recipe card with its composição line. */
.sv-groups { display: grid; gap: var(--space-4); min-width: 0; }
.sv-group__meta { font-weight: 400; color: var(--text-muted); }
.sv-rascunho { display: block; font-size: 0.8125rem; }
.sv-receita__title { display: grid; gap: 0.125rem; min-width: 0; }
.sv-receita__sub { margin: 0; }
.sv-receita .card__head { flex-wrap: wrap; }
.sv-receita .card__action { flex-wrap: wrap; }

/* The ambiente's serviços panel. */
.orc-amb__servicos .sv-link { white-space: nowrap; }
.orc-amb-sv__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.orc-amb-sv__incluir { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.orc-amb-sv__select { width: auto; min-width: min(16rem, 100%); max-width: 100%; }
.orc-amb-sv__grid { border: 1px solid var(--border); border-radius: var(--radius); }

/* The sticky app header never covers what a link or scrollIntoView brings to the top. */
html { scroll-padding-top: 4.5rem; }

/* Serviços measuring the same walls (ORCAMENTO-023 sobreposicao): the aviso and the way to the others. */
.orc-overlap { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); font-size: 0.8125rem; }
.orc-overlap .status { white-space: normal; }

/* ---------------------------------------------- Orçamento guiado (ORCAMENTO-028) */

/* The wizard's step indicator is the flow's (.orc-steps) with four steps as buttons. */
.orc-steps__list--4 { grid-template-columns: repeat(4, minmax(9.5rem, 1fr)); }
button.orc-step {
  width: 100%;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
button.orc-step:disabled { cursor: default; }
button.orc-step:disabled:not([aria-current]) { opacity: 0.75; }
button.orc-step:disabled:hover { background: transparent; color: var(--text-muted); }
button.orc-step[aria-current="step"]:hover { color: var(--text); }

.orc-assist { display: grid; gap: var(--space-4); min-width: 0; }
.orc-assist__body { display: grid; gap: var(--space-4); min-width: 0; }
/* ORCAMENTO-029: the step's actions stay reachable, stuck to the bottom of the viewport (safe area included). */
.orc-assist__foot {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.orc-assist__foot:empty { display: none; }
.orc-assist__foot > :only-child { margin-left: auto; }
@media (max-width: 40rem) {
  .orc-assist__foot { margin: 0 calc(-1 * var(--space-3)); border-left: 0; border-right: 0; border-radius: 0; }
  .orc-assist__foot .btn { flex: 1 1 auto; justify-content: center; }
}
.orc-assist__note { margin: 0; }
.orc-assist__note .material-symbols-outlined { font-size: 1rem; vertical-align: -0.2em; }
.orc-assist__add { display: flex; }
.orc-assist__torre-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.orc-assist__torre-card .card__head { flex-wrap: wrap; }
.orc-assist__group {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.orc-assist__garagem-row, .orc-assist__pisos { align-items: end; }
.orc-assist__count .input { max-width: 8rem; }
.orc-assist__check .choices { min-height: var(--touch-target, 2.75rem); align-items: center; }
.orc-assist__label { margin: 0; }
.orc-assist__unidades { display: grid; gap: var(--space-2); }
.orc-assist__units-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.orc-assist__units-foot > .field { flex: 0 1 auto; min-width: min(16rem, 100%); }
.orc-assist__units { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.orc-assist__unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}
.orc-assist__unit .orc-assist__remove { margin-top: 1.75rem; }
.orc-assist__unit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: var(--space-1) 0 0; font-size: 0.8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.orc-assist__rascunho .status { font-size: 0.8125rem; }
@media (max-width: 560px) {
  .orc-assist__unit { grid-template-columns: minmax(0, 1fr) auto; }
  .orc-assist__unit > .field:first-child { grid-column: 1 / -1; }
  .orc-assist__unit .orc-assist__remove { margin-top: 1.75rem; }
}

/* The preview's tree: torre › planta › unidade (open for its ambientes). */
.orc-assist-tree, .orc-assist-tree ul { margin: 0; padding: 0; list-style: none; }
.orc-assist-tree { display: grid; gap: var(--space-4); }
.orc-assist-tree__name { margin: 0 0 var(--space-1); }
.orc-assist-tree__plantas { display: grid; gap: var(--space-3); padding-left: var(--space-4) !important; border-left: 2px solid var(--border); }
.orc-assist-tree__planta { display: grid; gap: var(--space-2); }
.orc-assist-tree__unidades { display: grid; gap: var(--space-1); }
.orc-assist-tree__unidade { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.orc-assist-tree__unidade > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-height: var(--touch-target, 2.75rem);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  list-style: none;
}
.orc-assist-tree__unidade > summary::-webkit-details-marker { display: none; }
.orc-assist-tree__unidade > summary .material-symbols-outlined { transition: transform 0.15s ease; transform: rotate(-90deg); }
.orc-assist-tree__unidade[open] > summary .material-symbols-outlined { transform: none; }
.orc-assist-tree__unidade > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.orc-assist-tree__unidade .cell-main { flex: 1 1 14rem; min-width: 0; }
.orc-assist-tree__unidade .grid__scroll { border-top: 1px solid var(--border); }
.orc-assist__amb th, .orc-assist__amb td { padding-left: var(--space-2); padding-right: var(--space-2); }
.orc-assist__amb th:first-child, .orc-assist__amb td:first-child { padding-left: var(--space-3); }

/* Catálogos › Modelos de unidade: the ambientes rows in the model form. */
.orc-mod__amb th:first-child, .orc-mod__amb td:first-child { padding-left: var(--space-2); }
.orc-mod__amb input[name="larguraMm"],
.orc-mod__amb input[name="comprimentoMm"],
.orc-mod__amb input[name="peDireitoMm"] { width: 5rem; }
.orc-mod__amb input[name="portas"],
.orc-mod__amb input[name="janelas"] { width: 3.5rem; }
.orc-mod__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-2); }
.orc-mod__status { margin: 0; }
.orc-mod__status.is-error { color: var(--error-text); }

/* Serviços: the review mark. ORCAMENTO-029: in a bar that sticks under the app header, with the next step and the
   avisos, so "Marcar serviços como revisados" is always one click away. */
.sv-revisao { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sv-revisao__status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 0.875rem; color: var(--text-muted); }
.sv-sticky {
  position: sticky;
  top: var(--app-header-h, 3.5rem);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-height: 3.25rem;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sv-sticky:not(:has(> :not([hidden]):not(:empty))) { display: none; }
.sv-sticky__avisos { font-size: 0.875rem; color: var(--error-text); font-weight: 500; }
.sv-sticky__next { margin-left: auto; }
.sv-sticky__next:empty { display: none; }
html:has(.sv-sticky) { scroll-padding-top: calc(var(--app-header-h, 3.5rem) + var(--sv-sticky-h, 3.25rem) + var(--space-3)); }

/* Serviços: the disciplina cards closed to one line (ORCAMENTO-029). */
.sv-group__head { min-height: 0; padding: 0; }
.sv-group:not(.is-open) .sv-group__head { border-bottom: 0; }
.sv-group .card__title { flex: 1 1 auto; min-width: 0; }
.sv-groups:has(> .sv-group) { gap: var(--space-2); }
.sv-group.is-open { margin-block: var(--space-2); }
.sv-group__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--touch-target, 2.75rem);
  padding: var(--space-2) var(--space-4);
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sv-group__toggle:hover { background: var(--surface-hover); }
.sv-group__toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sv-group__toggle > .material-symbols-outlined { flex: none; transition: transform 0.15s ease; transform: rotate(-90deg); }
.sv-group__toggle[aria-expanded="true"] > .material-symbols-outlined { transform: none; }
.sv-group__text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); min-width: 0; }
.sv-group__name { font-weight: 600; }
.sv-group__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-3); font-size: 0.875rem; font-weight: 400; color: var(--text-muted); }
.sv-group__fact + .sv-group__fact::before { content: "·"; margin-right: var(--space-3); color: var(--text-muted); }
.sv-group__fact .status { font-size: 0.8125rem; }

/* Serviços: the avisos the API keeps until they are resolved. */
.sv-avisos { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-left: 3px solid var(--inctor-atraso); border-radius: var(--radius); background: var(--surface); }
.sv-avisos__title { margin: 0; font-size: 1rem; }
.sv-avisos__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.sv-avisos__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); }
.sv-avisos__item .status { white-space: normal; }
.orc-avisos { display: grid; gap: var(--space-2); }
.orc-assist__previa { display: grid; gap: var(--space-4); min-width: 0; }

/* Parâmetros: the suggested área equivalente under the typed one. */
.cst-sugestao { display: grid; justify-items: start; gap: var(--space-1); margin-top: var(--space-1); font-size: 0.8125rem; color: var(--text-muted); }
.cst-sugestao__text { margin: 0; }
.cst-sugestao__use { margin-left: calc(-1 * var(--space-2)); }

/* ORCAMENTO-030: the tutorial's offer on the Orçamento home — one discreet line, no Latão (the page keeps its primary
   "Novo orçamento guiado" and the active nav item). The coach marks themselves are the kit's (.coach, layout.css). */
/* On a phone the tutorial's card docks at the bottom edge: the wizard's action bar sticks right above it. */
.coach-docked .orc-assist__foot { bottom: var(--coach-dock-h, 0px); }
.tut-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--choice-accent);
  border-radius: var(--radius);
  background: var(--surface);
}
.tut-offer__icon { color: var(--text-muted); font-size: 1.5rem; }
.tut-offer__text { flex: 1 1 18rem; min-width: 0; }
.tut-offer__title { margin: 0; padding: 0; font-family: var(--font-text); font-size: 0.9375rem; font-weight: 600; }
.tut-offer__lead { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: 0.875rem; }
.tut-offer__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 40rem) {
  .tut-offer__icon { display: none; }
  .tut-offer__actions { width: 100%; }
  .tut-offer__actions .btn { flex: 1 1 auto; }
}
