/* ============================================================
   Integras Theme — extends Singularidade Design System
   Only project-specific overrides below.
   Base theme: singularidade-ui-vaadin (loaded via parent in theme.json)
   ============================================================ */

/* ---- SQL editor (integras-digital only) ---- */

.sql-editor {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: var(--lumo-font-size-s);
}

/* ---- Side navigation ---- */

/* No side navigation for anyone but an administrator (MainLayout's
   NO_DRAWER_CLASS): a person of a company who is not an administrator, and a
   person of the Integras Hub, whose navigation is in the header. The drawer
   stays out even if the layout would reopen it, and its toggle is not shown
   (the logo is the link home, beside it). */
vaadin-app-layout.integras-shell--no-drawer::part(drawer) {
  display: none;
}

vaadin-app-layout.integras-shell--no-drawer vaadin-drawer-toggle {
  display: none;
}

/* The drawer is as wide as its longest label (the library's rule), up to a
   cap: a long label ("Ações administrativas", "Acciones administrativas")
   breaks into two lines instead of widening the drawer — by 41 px in
   Portuguese and 63 px in Spanish — and narrowing every screen beside it. The
   words are in a span of their own (MainLayout.navItem), since the item keeps
   its own text on one line. 196 px: the narrowest drawer that holds
   "administrativas", the longest word of the three menus, plus 4 px (the
   menus were 190 px in Portuguese and 186 px in Spanish before). */
vaadin-app-layout::part(drawer) {
  max-width: 12.25rem;
}

.integras-nav__label {
  white-space: normal;
}

/* ---- Status badges (StatusBadge, CodeLabels) ----
   The words are the screen's language now ("Convite pendente", "Invitación
   pendiente"): the pill keeps them on one line instead of breaking it in two. */
.status-badge {
  white-space: nowrap;
}

/* ---- Module card elements ---- */

.module-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-10pct);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--lumo-space-s);
}

.module-card__name {
  margin: 0;
}

.module-card__version {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.module-card__meta {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.module-card__desc {
  margin: 0;
  font-size: var(--lumo-font-size-s);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Counts line (tools · resources · prompts), read from the connector descriptor. */
.module-card__counts-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-secondary-text-color);
}
.module-card__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.module-card__count-icon {
  width: 13px;
  height: 13px;
  color: var(--lumo-tertiary-text-color);
}
.module-card__count-sep {
  color: var(--lumo-contrast-30pct);
}
.module-card__price {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
}
/* Footer pinned to the bottom so every card's price + actions line up. */
.module-card__footer {
  margin-top: auto;
}
/* Clickable card body (icon + name + desc + counts) — opens the components dialog.
   The footer sits outside this, so its buttons aren't affected. */
.module-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-s);
  cursor: pointer;
}

/* Card is a flex column so price + actions can pin to the bottom (margin-top:
   auto on .module-card__counts) — keeps every card's footer aligned in the grid. */
.module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-s);
  height: 100%;
  box-sizing: border-box;
}

/* Uniform icon tile — every logo (and the no-logo puzzle fallback) is framed in a
   fixed square so cards line up regardless of the logo's aspect ratio. The logo is
   contained at ~34px, centered, with breathing room inside the 52px tile. */
.module-card__icon-tile {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.module-card__icon-tile img,
.module-card__icon-tile vaadin-icon {
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
}

/* Name + meta stacked next to the tile. min-width:0 lets long names ellipsis/wrap
   instead of forcing the card wider (avoids the horizontal scroll we hit before). */
.module-card__name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.module-card__name-row {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-xs);
}

/* "Verified/official" seal — info blue, distinct from the brand red and success
   green. Lumo ships no info token, so the colour is fixed (works on light + dark). */
.module-card__verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  background: #2f80ed;
}
.module-card__verified vaadin-icon {
  width: 10px;
  height: 10px;
  color: #fff;
}

/* "Beta" mark (ConnectorMarks, owner's decision of 2026-11-18): the theme's warning badge, a word, never
   clickable — after the name and the seal on the companies' card, never shrunk by a long name. */
.connector-mark--beta {
  flex: 0 0 auto;
}

/* What "Beta" means, wherever the mark is explained (the detail of a connector, the contract dialogs):
   the colour of the other notices of the storefront (.hub-sub-card__notice). */
.connector-beta-notice {
  margin: 0;
  color: var(--lumo-warning-text-color, var(--lumo-error-text-color));
  font-size: var(--lumo-font-size-s);
}

/* ---- Marketplace grid: uniform card width + height ---- */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
  align-items: stretch;
}
/* Cards fill their grid column (override the base .material-card max-width:400px)
   so the horizontal spacing equals the 16px grid gap — no oversized gutters. */
.marketplace-grid .module-card {
  max-width: none;
}

/* ---- "Ver" components dialog (read-only tools/resources/prompts) ---- */
.module-components-dialog__header {
  padding: var(--lumo-space-s) var(--lumo-space-m) 0;
}
.module-components-dialog__icon img,
.module-components-dialog__icon vaadin-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.module-components-dialog__title {
  margin: 0;
  font-size: var(--lumo-font-size-l);
}
.module-components-dialog__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lumo-space-xs) var(--lumo-space-s);
}
.module-components-dialog__notice {
  padding: var(--lumo-space-s) var(--lumo-space-m) 0;
}
.module-components-dialog__tags {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}
.module-components-dialog__empty {
  padding: var(--lumo-space-l);
  color: var(--lumo-secondary-text-color);
}

/* The "official" badge is a small verified seal inline in the header
   (see TenantMarketplaceView.buildOfficialBadge) -- no corner positioning. */

/* Tooltips — a touch larger and more readable. Vaadin tooltips can't be themed
   per instance from Flow, so this applies design-system-wide (intended). */
vaadin-tooltip-overlay::part(overlay) {
  max-width: 22rem;
  font-size: var(--lumo-font-size-s);
  line-height: 1.45;
  padding: var(--lumo-space-s) var(--lumo-space-m);
}

/* ---- Card corner actions (the +/− pair) ----
   Soft-filled round buttons pinned to a card's top-right corner: marketplace
   "+" (add a connector instance) and /modules "−" (delete an instance). They
   fill on hover. Colors come from the (DS-remapped) Lumo success/error tokens,
   so light and dark both work. */
.material-card { position: relative; }

vaadin-button.card-corner-action {
  position: absolute;
  top: var(--lumo-space-s);
  right: var(--lumo-space-s);
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  box-shadow: none;
  transition: transform 0.12s ease, background-color 0.12s ease,
              color 0.12s ease, border-color 0.12s ease;
}
vaadin-button.card-corner-action vaadin-icon {
  width: var(--lumo-icon-size-s);
  height: var(--lumo-icon-size-s);
  color: inherit;
}
vaadin-button.card-corner-action--add {
  background-color: var(--lumo-success-color-10pct);
  color: var(--lumo-success-text-color);
  border-color: var(--lumo-success-color-50pct);
}
vaadin-button.card-corner-action--add:hover {
  background-color: var(--lumo-success-color);
  color: var(--lumo-base-color);
  border-color: var(--lumo-success-color);
  transform: scale(1.06);
}
vaadin-button.card-corner-action--del {
  background-color: var(--lumo-error-color-10pct);
  color: var(--lumo-error-text-color);
  border-color: var(--lumo-error-color-50pct);
}
vaadin-button.card-corner-action--del:hover {
  background-color: var(--lumo-error-color);
  color: var(--lumo-base-color);
  border-color: var(--lumo-error-color);
  transform: scale(1.06);
}

/* reserve right space in the header so a long title doesn't slide under the "+" */
.card-header--corner { padding-right: 2.75rem; }

/* /modules — compact "Copiar link MCP" button (the tooltip reveals the endpoint) */
vaadin-button.module-card__mcp-copy {
  margin-top: var(--lumo-space-xs);
  border: 1px solid var(--lumo-contrast-20pct);
  border-radius: var(--lumo-border-radius-m);
  color: var(--lumo-primary-text-color);
  background-color: var(--lumo-base-color);
}
vaadin-button.module-card__mcp-copy:hover {
  border-color: var(--lumo-primary-color);
  background-color: var(--lumo-primary-color-10pct);
}

/* /modules card: the tool/resource/prompt counts get their own line between the
   description and the actions; the actions sit in a spaced footer with room to
   breathe (instead of inline-crowding the counts). */
.module-card__counts--row {
  display: block;
  margin: 0 0 var(--lumo-space-s);
}
.module-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lumo-space-s);
}
/* Footer (counts + actions) pinned to the bottom so cards in a row align,
   regardless of name/description length. */
.module-card__footer {
  margin-top: auto;
}

/* ---- /modules — plan usage progress panel ---- */

.module-usage {
  border: 1px solid var(--lumo-contrast-10pct);
  border-radius: var(--lumo-border-radius-l);
  background: var(--lumo-base-color);
  padding: var(--lumo-space-m) var(--lumo-space-l);
  box-shadow: var(--lumo-box-shadow-xs);
  margin-bottom: var(--lumo-space-s);
}

.module-usage__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--lumo-space-m);
}

.module-usage__label {
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
  color: var(--lumo-secondary-text-color);
}

.module-usage__count {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  white-space: nowrap;
}

.module-usage__bar {
  height: 8px;
  margin: var(--lumo-space-s) 0;
  border-radius: var(--lumo-border-radius-l);
  width: 100%;
}

/* Colour the ProgressBar fill using the Lumo success token */
.module-usage__bar::part(value) {
  background: var(--lumo-success-color);
  border-radius: var(--lumo-border-radius-l);
}

.module-usage__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lumo-space-m);
}

.module-usage__hint {
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-tertiary-text-color);
}

vaadin-button.module-usage__upgrade {
  font-size: var(--lumo-font-size-xs);
  font-weight: 600;
  color: var(--lumo-primary-text-color);
  background: var(--lumo-base-color);
  border: 1px solid var(--lumo-primary-color-50pct);
  border-radius: var(--lumo-border-radius-m);
  white-space: nowrap;
}
vaadin-button.module-usage__upgrade:hover {
  background: var(--lumo-primary-color-10pct);
  border-color: var(--lumo-primary-color);
}

/* ---- /modules — collapsible connector group (vaadin-details) ---- */

vaadin-details.connector-group {
  border: 1px solid var(--lumo-contrast-10pct);
  border-radius: var(--lumo-border-radius-l);
  background: var(--lumo-base-color);
  box-shadow: var(--lumo-box-shadow-xs);
  overflow: hidden;
  width: 100%;
}

/* Remove default padding from the Details summary so our own HLayout controls spacing */
vaadin-details.connector-group::part(summary) {
  cursor: pointer;
  user-select: none;
}

/* The chevron + summary content live inside <vaadin-details-summary>, whose Lumo
   :host padding is "space-s 0" (zero horizontal) — which is why ::part(summary)
   padding had no effect and the chevron (left) and count (right) sat glued to the
   box edges. Target the summary element directly (specificity beats the Lumo :host)
   to inset both; 24px aligns the header with the body's content padding. */
vaadin-details.connector-group vaadin-details-summary {
  padding-inline: var(--lumo-space-l);
}

vaadin-details.connector-group::part(summary):hover {
  background: var(--lumo-contrast-5pct);
}

vaadin-details.connector-group::part(content) {
  padding: 0 var(--lumo-space-l) var(--lumo-space-l);
  border-top: 1px solid var(--lumo-contrast-10pct);
}

/* Chevron rotation (Vaadin Details uses a toggle icon inside summary-icon part) */
vaadin-details.connector-group::part(toggle) {
  color: var(--lumo-tertiary-text-color);
  transition: transform 0.18s ease;
  margin-inline-start: var(--lumo-space-s);
  margin-inline-end: var(--lumo-space-s);
}

.connector-group__name-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.connector-group__name {
  margin: 0;
  font-size: var(--lumo-font-size-l);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connector-group__meta {
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-tertiary-text-color);
}

.connector-group__count {
  flex: 0 0 auto;
  text-align: right;
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-secondary-text-color);
  white-space: nowrap;
}

.connector-group__count-active {
  font-weight: 600;
  color: var(--lumo-success-text-color);
}

.connector-group__desc {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  margin: var(--lumo-space-m) 0 var(--lumo-space-xs);
  max-width: 760px;
}

.connector-group__caps {
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-tertiary-text-color);
  margin-bottom: var(--lumo-space-m);
}

.connector-group__body {
  /* no extra padding needed — vaadin-details::part(content) handles it */
}

/* ---- /modules — the title bar and the connectors' headers on a phone (wave 3) ----
   The title bar ("Conectores · 3 registros" and the search) had no margin and
   touched the side menu at 1280 px and the screen's edge at 390 px: it gets the
   cards' margin below it. On a phone a connector's header does not fit on one
   line: "1 ativa · conector único" goes under the name, aligned with it, instead
   of being cut at the right edge. */
.module-list__toolbar {
  padding-inline: var(--lumo-space-l);
  padding-top: var(--lumo-space-s);
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .module-list__toolbar {
    padding-inline: var(--lumo-space-m);
  }

  .module-list__usage,
  .module-list__groups {
    padding-inline: var(--lumo-space-m) !important;
  }

  vaadin-details.connector-group vaadin-details-summary {
    padding-inline: var(--lumo-space-m);
  }

  vaadin-details.connector-group::part(content) {
    padding: 0 var(--lumo-space-m) var(--lumo-space-m);
  }

  .connector-group__summary {
    flex-wrap: wrap;
    row-gap: var(--lumo-space-xs);
  }

  .connector-group__count {
    flex: 1 1 100%;
    margin-inline-start: calc(40px + var(--lumo-space-m));
    text-align: start;
    white-space: normal;
  }

  .module-usage {
    padding: var(--lumo-space-m);
  }

  .module-usage__foot {
    flex-wrap: wrap;
    row-gap: var(--lumo-space-s);
  }
}

/* ---- /modules — compact instance card grid ---- */

/* As many columns as fit; same count across groups (same width). No hard cap. */
.module-insts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--lumo-space-m);
  margin-top: var(--lumo-space-m);
}

.module-inst {
  position: relative;
  border: 1px solid var(--lumo-contrast-10pct);
  border-left: 3px solid var(--lumo-contrast-30pct);
  border-radius: var(--lumo-border-radius-l);
  background: var(--lumo-contrast-5pct);
  padding: var(--lumo-space-m);
  cursor: pointer;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
}

.module-inst:hover {
  background: var(--lumo-base-color);
  box-shadow: var(--lumo-box-shadow-s);
}

/* Built-in connector card: nothing to click into (no edit page), so no pointer/hover cue */
.module-inst--builtin {
  cursor: default;
}
.module-inst--builtin:hover {
  background: var(--lumo-contrast-5pct);
  box-shadow: none;
}
.module-inst__help {
  margin: 0;
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-secondary-text-color);
  line-height: 1.4;
}

/* status B: left accent border + dot/label colour, by ModuleStatus */
.module-inst--active { border-left-color: var(--lumo-success-color); }
.module-inst--error { border-left-color: var(--lumo-error-color); }

.module-inst__status {
  display: inline-flex;
  align-items: center;
  gap: var(--lumo-space-xs);
  font-size: var(--lumo-font-size-xs);
  font-weight: 600;
  color: var(--lumo-tertiary-text-color);
}
.module-inst__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--lumo-contrast-40pct);
}
.module-inst--active .module-inst__status { color: var(--lumo-success-text-color); }
.module-inst--active .module-inst__dot { background: var(--lumo-success-color); }
.module-inst--error .module-inst__status { color: var(--lumo-error-text-color); }
.module-inst--error .module-inst__dot { background: var(--lumo-error-color); }

.module-inst__name {
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-right: 28px; /* leave room for the "−" corner button */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-inst__foot {
  margin-top: var(--lumo-space-xs);
  display: flex;
  flex-wrap: wrap;
  gap: var(--lumo-space-xs);
  align-items: center;
}

/* Labelled action buttons in the instance card footer (Copiar link / Renomear) */
vaadin-button.module-inst__action {
  height: var(--lumo-size-s);
  min-width: 0;
  padding: 0 var(--lumo-space-s);
  margin: 0;
  font-size: var(--lumo-font-size-xs);
  font-weight: 600;
  color: var(--lumo-secondary-text-color);
  background: var(--lumo-base-color);
  border: 1px solid var(--lumo-contrast-20pct);
  border-radius: var(--lumo-border-radius-m);
  box-shadow: none;
}
vaadin-button.module-inst__action:hover {
  color: var(--lumo-primary-text-color);
  border-color: var(--lumo-primary-color-50pct);
  background: var(--lumo-primary-color-10pct);
}
vaadin-button.module-inst__action vaadin-icon {
  width: var(--lumo-icon-size-s);
  height: var(--lumo-icon-size-s);
  color: inherit;
}

/* Disabled "Renomear" when the instance is active */
vaadin-button.module-inst__action--disabled {
  color: var(--lumo-disabled-text-color);
  background: var(--lumo-contrast-5pct);
  border-color: var(--lumo-contrast-10pct);
  cursor: not-allowed;
}
vaadin-button.module-inst__action--disabled:hover {
  color: var(--lumo-disabled-text-color);
  background: var(--lumo-contrast-5pct);
  border-color: var(--lumo-contrast-10pct);
}

/* ---- Rename dialog ---- */

.rename-dialog__header {
  display: flex;
  align-items: flex-start;
  gap: var(--lumo-space-m);
  padding-bottom: var(--lumo-space-s);
}

.rename-dialog__header-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--lumo-primary-text-color);
  margin-top: 4px;
}

.rename-dialog__title {
  margin: 0;
  font-size: var(--lumo-font-size-l);
  font-weight: 700;
  color: var(--lumo-header-text-color);
  flex: 1 1 auto;
}

.rename-dialog__subtitle {
  display: block;
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  margin-top: var(--lumo-space-xs);
}

.rename-dialog__meta {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  background: var(--lumo-contrast-5pct);
  border-radius: var(--lumo-border-radius-m);
  padding: var(--lumo-space-s) var(--lumo-space-m);
}

.rename-dialog__meta-item {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
}

.rename-dialog__preview-box {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  border: 1px dashed var(--lumo-contrast-20pct);
  border-radius: var(--lumo-border-radius-m);
  padding: var(--lumo-space-s) var(--lumo-space-m);
}

.rename-dialog__preview-label {
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-tertiary-text-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rename-dialog__preview {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-body-text-color);
  word-break: break-all;
}

/* ---- Dashboard ---- */

.dashboard-card {
  border: 1px solid var(--singularidade-border, var(--lumo-contrast-10pct));
  border-radius: var(--lumo-border-radius-l);
  padding: var(--lumo-space-m);
  background: var(--lumo-base-color);
  box-shadow: var(--lumo-box-shadow-xs);
}

.dashboard-card h3 {
  margin: 0 0 var(--lumo-space-s) 0;
  font-size: var(--lumo-font-size-m);
  font-weight: 600;
  color: var(--lumo-secondary-text-color);
}

.dashboard-kpi {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  flex: 1 1 200px;
  min-width: 180px;
}

.dashboard-kpi__label {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-kpi__value {
  font-size: var(--lumo-font-size-xxxl);
  font-weight: 600;
  line-height: 1.1;
  color: var(--lumo-header-text-color);
  font-variant-numeric: tabular-nums;
}

.dashboard-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--lumo-tertiary-text-color);
  font-size: var(--lumo-font-size-s);
}

/* ApexCharts renders all SVG text with hardcoded #373d3f, which becomes
   illegible on Lumo dark theme. Remap to Lumo tokens so axis labels,
   legend entries, and tooltips follow the active theme. */
.apexcharts-text,
.apexcharts-title-text,
.apexcharts-subtitle-text,
.apexcharts-xaxis-label,
.apexcharts-yaxis-label,
.apexcharts-legend-text,
.apexcharts-datalabel,
.apexcharts-datalabels text {
  fill: var(--lumo-body-text-color) !important;
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
  color: var(--lumo-body-text-color) !important;
  background: var(--lumo-base-color) !important;
  border-color: var(--lumo-contrast-20pct) !important;
}

.apexcharts-tooltip {
  background: var(--lumo-base-color) !important;
  color: var(--lumo-body-text-color) !important;
  border: 1px solid var(--lumo-contrast-20pct) !important;
  box-shadow: var(--lumo-box-shadow-m) !important;
}

.apexcharts-tooltip-title {
  background: var(--lumo-contrast-5pct) !important;
  color: var(--lumo-header-text-color) !important;
  border-bottom-color: var(--lumo-contrast-20pct) !important;
}

.apexcharts-gridline,
.apexcharts-grid line {
  stroke: var(--lumo-contrast-10pct) !important;
}

.apexcharts-menu {
  background: var(--lumo-base-color) !important;
  border-color: var(--lumo-contrast-20pct) !important;
}

.apexcharts-menu-item {
  color: var(--lumo-body-text-color) !important;
}

.apexcharts-menu-item:hover {
  background: var(--lumo-contrast-5pct) !important;
}

/* ============================================================
   Category-grouped TreeGrid for module Tools/Resources/Prompts.
   Adds a soft contrast band to section-header rows so the
   admin's eye lands on the categories first, with the leaf
   rows reading as the visual default.
   ============================================================ */

.category-tree-grid vaadin-grid::part(row):has(vaadin-grid-tree-toggle:not([leaf])) {
  background: var(--lumo-contrast-5pct);
  font-weight: 600;
}

.category-tree-grid vaadin-grid::part(row):has(vaadin-grid-tree-toggle:not([leaf])):hover {
  background: var(--lumo-contrast-10pct);
}

/* Leaf rows: keep the existing clickable affordance, but inset the
   hierarchy column slightly so the parent/child relationship is
   immediately readable without relying solely on the toggle chevron. */
.category-tree-grid vaadin-grid-tree-toggle[leaf] {
  padding-inline-start: var(--lumo-space-m);
}

/* ---- Espaços dos usuários (KnowledgeSpacesView) ---- */
/* Lista de pessoas à esquerda, o espaço aberto à direita. A lista tem largura
   fixa: é um índice, e o espaço aberto é onde se trabalha. */
.knowledge-spaces {
  min-height: 0;
}

.knowledge-spaces__pane {
  flex: 0 0 22.5rem;
  width: 22.5rem;
  box-sizing: border-box;
  padding: var(--lumo-space-m);
  gap: var(--lumo-space-s);
  border-right: 1px solid var(--lumo-contrast-10pct);
  min-height: 0;
}

.knowledge-spaces__row {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-m);
  padding: var(--lumo-space-xs) 0;
  min-width: 0;
}

.knowledge-spaces__avatar {
  flex: none;
}

.knowledge-spaces__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.knowledge-spaces__email {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-spaces__detail {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-spaces__detail-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.knowledge-spaces__detail-head {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  padding: var(--lumo-space-m) var(--lumo-space-l) 0;
}

.knowledge-spaces__title {
  font-size: var(--lumo-font-size-l);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.knowledge-spaces__notice {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
}

.knowledge-spaces__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--lumo-space-s);
  padding: var(--lumo-space-xl);
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}

.knowledge-spaces__placeholder-icon {
  width: 2rem;
  height: 2rem;
  color: var(--lumo-contrast-30pct);
}

.knowledge-spaces__placeholder-title {
  font-weight: 600;
}

.knowledge-spaces__placeholder-help {
  max-width: 30rem;
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
}

/* Telas estreitas: a lista vai para cima e o espaço aberto para baixo. */
@media (max-width: 800px) {
  .knowledge-spaces {
    flex-direction: column;
  }

  .knowledge-spaces__pane {
    flex: 0 0 auto;
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--lumo-contrast-10pct);
  }
}

/* ---- navegador do Conhecimento (KnowledgeBrowser) ---- */
/* Pode encolher dentro de quem o contém (a tela do admin, a aba do Meu
   espaço): sem min-height 0 um item flex não fica menor que o conteúdo, e as
   grades empurrariam a página em vez de rolar dentro dela. */
.knowledge-browser {
  min-height: 0;
}

/* ---- árvore de pastas do Conhecimento (KnowledgeBrowser) ---- */
/* Toda linha guarda o lugar da seta, tenha filhos ou não, para os ícones de
   pasta ficarem na mesma coluna. O Lumo já esconde a seta da folha sem tirar
   a largura; o que desalinhava era o recuo de .category-tree-grid nas folhas,
   que esta árvore não usa mais. As regras abaixo deixam isso explícito. */
.knowledge-folder-tree vaadin-grid-tree-toggle[leaf] {
  padding-inline-start: 0;
}

.knowledge-folder-tree vaadin-grid-tree-toggle[leaf]::part(toggle) {
  visibility: hidden;
}

/* ---- /knowledge — moldura do módulo Conhecimento ---- */
/* KnowledgeLayout: o trilho à esquerda, da altura toda, e a tela atual à
   direita. O trilho é criado uma vez e o roteador só troca o conteúdo, então
   ele não se move nem pisca ao passar de uma seção para outra. */
.knowledge-layout {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.knowledge-layout__content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* A tela ocupa toda a altura da coluna, e as grades rolam dentro dela. */
.knowledge-layout__content > * {
  flex: 1 1 auto;
  min-height: 0;
}

/* ---- Meu espaço e Espaços dos usuários: corpo com as abas ---- */
/* O corpo fica preso à altura que a moldura dá e rola sozinho quando o que
   ele empilha (explicação, "Quem acessou" aberto, abas) não cabe — tela baixa,
   zoom, celular. Nada é cortado e a página em si não rola. Numa tela alta as
   abas ocupam o que sobra (base zero + crescer) e nunca ficam menores do que
   o conteúdo delas precisa (mínimo automático: a lista da Memória tem piso). */
.knowledge-space-body {
  min-height: 0;
  overflow-y: auto;
}

.knowledge-space-body > * {
  flex-shrink: 0;
}

.knowledge-space-tabs-frame {
  flex: 1 1 0;
  min-height: auto;
}

.knowledge-space-tabs__content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  /* A aba Arquivos mede pela altura que recebe; este piso a mantém usável. */
  min-height: 24rem;
}

.knowledge-space-tabs__content > * {
  flex: 1 1 auto;
}

/* "Quem acessou": a lista aberta nunca toma a tela; rola por dentro. */
.knowledge-access__grid {
  max-height: min(22rem, 35vh);
}

/* ---- cabeçalho das três telas (KnowledgeHeader) ---- */
/* Mesma altura em todas, com ou sem botão: o título não sobe nem desce ao
   trocar de seção. Nome da tela e nome do produto na mesma linha. */
.knowledge-header {
  flex: 0 0 auto;
  /* The whole width, always. The screens are VerticalLayouts, which do not
     stretch their children: the header used to end where its content ended,
     so the count and the screen's button ("Nova categoria") sat mid-screen
     instead of at the right edge, where every other screen has them. */
  align-self: stretch;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lumo-space-s) var(--lumo-space-m);
  min-height: 4rem;
  padding: var(--lumo-space-s) var(--lumo-space-l);
  box-sizing: border-box;
  border-bottom: 1px solid var(--lumo-contrast-10pct);
}

.knowledge-header__identity {
  display: flex;
  align-items: baseline;
  gap: var(--lumo-space-m);
  min-width: 0;
}

.knowledge-header__title {
  margin: 0;
  font-size: var(--lumo-font-size-xl);
  font-weight: 600;
  line-height: var(--lumo-line-height-xs);
  letter-spacing: -0.01em;
}

.knowledge-header__product {
  padding-left: var(--lumo-space-m);
  border-left: 1px solid var(--lumo-contrast-20pct);
  color: var(--lumo-tertiary-text-color);
  font-size: var(--lumo-font-size-s);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.knowledge-header__count {
  margin-left: auto;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
  font-variant-numeric: tabular-nums;
}

.knowledge-header__actions {
  display: flex;
  gap: var(--lumo-space-s);
}

.knowledge-header__actions:empty {
  display: none;
}

/* Configurações do Conhecimento: uma seção por opção, com o texto que diz o
   que ela faz — largura de leitura, não a da tela. */
.knowledge-settings__section {
  max-width: 44rem;
  padding: var(--lumo-space-m) var(--lumo-space-l);
  border: 1px solid var(--lumo-contrast-10pct);
  border-radius: var(--lumo-border-radius-l);
}

.knowledge-settings__title {
  margin: 0 0 var(--lumo-space-s);
  font-size: var(--lumo-font-size-l);
}

.knowledge-settings__text {
  margin: 0 0 var(--lumo-space-s);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

/* Respiro de Categorias e Lixeira, que não têm painéis próprios. */
.knowledge-page__body {
  padding: var(--lumo-space-m) var(--lumo-space-l) var(--lumo-space-l);
  box-sizing: border-box;
}

/* ---- Documentos: os dois painéis ---- */
/* Margem em volta da divisão e um vão de cada lado do divisor, para nada
   encostar na borda da tela, no divisor ou nas linhas. */
.knowledge-split {
  padding: var(--lumo-space-s) var(--lumo-space-l) 0;
  box-sizing: border-box;
}

.knowledge-panel {
  box-sizing: border-box;
}

.knowledge-panel--start {
  padding-right: var(--lumo-space-m);
}

.knowledge-panel--end {
  padding-left: var(--lumo-space-m);
}

.knowledge-panel__head {
  flex: 0 0 auto;
  min-height: 3.5rem;
  padding: var(--lumo-space-xs) 0 var(--lumo-space-s);
  box-sizing: border-box;
}

.knowledge-panel__hint {
  display: block;
  padding: 0 0 var(--lumo-space-s);
}

.knowledge-panel__hint:empty {
  display: none;
}

/* ---- A folder's name keeps its room, at any width (wave 3) ----
   The name came first and shrank to nothing beside its category label: at
   1280 px the folders' pane is about 270 px wide and a label like "Sem
   categoria" took all of it. When both do not fit on one line the label goes
   under the name, aligned with it (the icon's width and the row's gap). Only a
   row with a label wraps — a row is as wide as its content, and a name alone
   would drop under its icon. On one line the name grows and pushes the label to
   the right edge, so the label's margin only shows when it is under the name. */
vaadin-app-layout:not(.integras-shell--hub-person) vaadin-grid.knowledge-folder-tree vaadin-horizontal-layout:has(> span[theme], > .knowledge-category-pill) {
  flex-wrap: wrap;
  row-gap: 2px !important;
}

vaadin-app-layout:not(.integras-shell--hub-person) vaadin-grid.knowledge-folder-tree vaadin-horizontal-layout:has(> span[theme], > .knowledge-category-pill) > span:not([theme]):not(.knowledge-category-pill) {
  flex: 1 1 6rem;
}

vaadin-app-layout:not(.integras-shell--hub-person) vaadin-grid.knowledge-folder-tree vaadin-horizontal-layout > :is(span[theme], .knowledge-category-pill) {
  margin-inline-start: calc(1rem + var(--lumo-space-s));
}

/* ---- Conhecimento and Meu espaço on a phone, in the companies (wave 3) ----
   Side by side, the two panes had about 100 px each at 390 px: the folders'
   names disappeared and "Enviar arquivo" was cut. Up to 600 px they stack — the
   folders on top, at a fixed height that scrolls inside, and the open folder
   below, as wide as the screen —, the space's footer breaks into lines and
   "Quem acessou" wraps its text instead of cutting it. The Integras Hub person's
   Meu espaço has a phone design of its own, so it is left out. */
@media (max-width: 600px) {
  vaadin-app-layout:not(.integras-shell--hub-person) vaadin-split-layout.knowledge-split {
    flex-direction: column;
    padding: var(--lumo-space-s) var(--lumo-space-m) 0;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) vaadin-split-layout.knowledge-split::part(splitter) {
    display: none;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) vaadin-split-layout.knowledge-split > .knowledge-panel--start {
    flex: 0 0 auto !important;
    height: 13.5rem !important;
    padding: 0 0 var(--lumo-space-s) !important;
  }

  /* The folder list is as tall as the whole pane (setSizeFull) and fits under
     the pane's header only by shrinking. That is said here instead of being
     left to two rules from outside this file: the shared theme's
     `vaadin-grid { overflow: hidden }`, which is what lets a list shrink below
     its rows, and Lumo's `:host([all-rows-visible])`, which leaves out the
     `flex-shrink: 0` of Vaadin's own base styles. If the theme dropped that
     overflow, or Lumo added that flex-shrink, the pane would clip the bottom of
     the list and its last folders could not be reached in the Integras Hub's
     admin, whose lists show all their rows on a phone
     (KnowledgeBrowser.fitListsToPhones). */
  vaadin-app-layout:not(.integras-shell--hub-person) vaadin-split-layout.knowledge-split > .knowledge-panel--start > vaadin-grid.knowledge-folder-tree {
    min-height: 0;
    flex-shrink: 1;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) vaadin-split-layout.knowledge-split > .knowledge-panel--end {
    flex: 1 1 auto !important;
    min-height: 16rem;
    padding: var(--lumo-space-xs) 0 0 !important;
    border-top: 1px solid var(--lumo-contrast-10pct);
  }

  /* The open folder's name, then "Enviar arquivo" and "Enviar pasta" on the line below, never cut. */
  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-panel--end > .knowledge-panel__head {
    flex-wrap: wrap;
    row-gap: var(--lumo-space-xs);
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-panel--end [data-knowledge-upload] {
    flex-wrap: wrap;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-header {
    padding-inline: var(--lumo-space-m);
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-page__body {
    padding-inline: var(--lumo-space-m);
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-space-tabs__content {
    min-height: 34rem;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) vaadin-details.knowledge-access > vaadin-details-summary {
    align-items: flex-start;
    white-space: normal;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-quota {
    flex-wrap: wrap;
    gap: var(--lumo-space-xs) var(--lumo-space-m);
    padding: var(--lumo-space-s) var(--lumo-space-m);
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-quota > * {
    flex: 1 1 100%;
  }

  vaadin-app-layout:not(.integras-shell--hub-person) .knowledge-quota > .knowledge-quota__bar {
    width: auto !important;
  }
}

/* ---- arrastar e soltar arquivos e pastas no painel de documentos ---- */
/* A camada cobre o painel só enquanto há arquivos sendo arrastados sobre ele;
   não intercepta o ponteiro, para o arrasto continuar chegando ao painel. */
.knowledge-dropzone {
  position: relative;
}

.knowledge-dropzone__overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--lumo-space-l);
  box-sizing: border-box;
  pointer-events: none;
  border: 2px dashed var(--lumo-primary-color);
  border-radius: var(--lumo-border-radius-l);
  background-color: var(--lumo-base-color);
  background-image: linear-gradient(var(--lumo-primary-color-10pct), var(--lumo-primary-color-10pct));
  color: var(--lumo-primary-text-color);
  font-size: var(--lumo-font-size-l);
  font-weight: 600;
  text-align: center;
}

.knowledge-dropzone__overlay[hidden] {
  display: none;
}

.knowledge-dropzone__overlay--denied {
  border-color: var(--lumo-contrast-40pct);
  background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
  color: var(--lumo-secondary-text-color);
}

/* ---- painel de envio (canto inferior direito, como o do Drive) ---- */
/* Fica fora do fluxo da tela: o envio continua enquanto o admin navega pelas
   pastas, e uma barra dentro da lista sumiria junto com a lista. */
.knowledge-uploads {
  position: fixed;
  right: var(--lumo-space-l);
  bottom: var(--lumo-space-l);
  z-index: 100;
  width: min(22rem, calc(100vw - 2 * var(--lumo-space-m)));
  border-radius: var(--lumo-border-radius-l);
  border: 1px solid var(--lumo-contrast-10pct);
  background: var(--lumo-base-color);
  box-shadow: var(--lumo-box-shadow-m);
  overflow: hidden;
}

.knowledge-uploads[hidden] {
  display: none;
}

.knowledge-uploads__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lumo-space-s);
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border-bottom: 1px solid var(--lumo-contrast-10pct);
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
}

.knowledge-uploads__title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Mostrar só as falhas" — only shown once there is a failure to filter for. */
.knowledge-uploads__filter {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--lumo-space-xs);
  font-size: var(--lumo-font-size-xs);
  font-weight: 400;
  color: var(--lumo-secondary-text-color);
  white-space: nowrap;
  cursor: pointer;
}

.knowledge-uploads__filter[hidden] {
  display: none;
}

.knowledge-uploads--failed-only .knowledge-uploads__row:not([data-state="failed"]) {
  display: none;
}

.knowledge-uploads__close,
.knowledge-uploads__cancel {
  border: 0;
  background: none;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-l);
  line-height: 1;
  cursor: pointer;
  padding: 0 var(--lumo-space-xs);
  border-radius: var(--lumo-border-radius-s);
}

.knowledge-uploads__close:hover,
.knowledge-uploads__cancel:hover {
  background: var(--lumo-contrast-5pct);
  color: var(--lumo-body-text-color);
}

.knowledge-uploads__list {
  max-height: 14rem;
  overflow-y: auto;
}

.knowledge-uploads__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--lumo-space-xs) var(--lumo-space-s);
  padding: var(--lumo-space-s) var(--lumo-space-m);
  font-size: var(--lumo-font-size-s);
}

.knowledge-uploads__row + .knowledge-uploads__row {
  border-top: 1px solid var(--lumo-contrast-5pct);
}

.knowledge-uploads__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-uploads__state {
  color: var(--lumo-secondary-text-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.knowledge-uploads__row[data-state="done"] .knowledge-uploads__state {
  color: var(--lumo-success-text-color);
}

.knowledge-uploads__row[data-state="failed"] .knowledge-uploads__state {
  color: var(--lumo-error-text-color);
}

/* Por que falhou, numa linha própria abaixo do nome — nunca só "Falhou". */
.knowledge-uploads__reason {
  grid-column: 1 / -1;
  color: var(--lumo-error-text-color);
  font-size: var(--lumo-font-size-xs);
  white-space: normal;
}

.knowledge-uploads__reason[hidden] {
  display: none;
}

/* A barra ocupa a linha inteira, abaixo do nome. */
.knowledge-uploads__bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 99px;
  background: var(--lumo-contrast-10pct);
  overflow: hidden;
}

.knowledge-uploads__bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-interactive-primary, var(--lumo-primary-color));
  transition: width 120ms linear;
}

.knowledge-uploads__row[data-state="done"] .knowledge-uploads__bar > span {
  background: var(--lumo-success-color);
}

.knowledge-uploads__row[data-state="failed"] .knowledge-uploads__bar > span,
.knowledge-uploads__row[data-state="cancelled"] .knowledge-uploads__bar > span {
  background: var(--lumo-contrast-30pct);
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-uploads__bar > span { transition: none; }
}

/* ---- etiqueta de categoria ---- */
/* Mesma forma das etiquetas de situação, cor própria: situação é bom ou ruim,
   categoria não é nem uma coisa nem outra. */
.knowledge-category-pill {
  flex: none;
  padding: 2px var(--lumo-space-s);
  border-radius: var(--lumo-border-radius-l);
  border: 1px solid color-mix(in oklab, var(--color-interactive-primary, var(--lumo-primary-color)) 35%, transparent);
  background: color-mix(in oklab, var(--color-interactive-primary, var(--lumo-primary-color)) 14%, transparent);
  color: var(--lumo-body-text-color);
  font-size: var(--lumo-font-size-xxs);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: var(--lumo-line-height-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

/* Herdada da pasta de cima: a mesma etiqueta, dita mais baixo. */
.knowledge-category-pill--inherited {
  border-style: dashed;
  border-color: var(--lumo-contrast-20pct);
  background: var(--lumo-contrast-5pct);
  color: var(--lumo-secondary-text-color);
  font-weight: 500;
}

/* Barra de seleção: acima da lista, com conteúdo só quando há algo marcado.
   Sem nada marcado ela continua ocupando o lugar, invisível: sumir de vez
   empurrava a lista para baixo no primeiro clique, e o segundo clique caía na
   linha de cima (visto em produção em 01/10/2026). */
.knowledge-selection--empty {
  visibility: hidden;
}

.knowledge-selection {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-s);
  flex-wrap: wrap;
  margin-bottom: var(--lumo-space-s);
  padding: var(--lumo-space-xs) var(--lumo-space-s);
  border-radius: var(--lumo-border-radius-m);
  background: var(--singularidade-active, var(--lumo-primary-color-10pct));
  font-size: var(--lumo-font-size-s);
}

.knowledge-quota {
  flex: 0 0 auto;
  padding: var(--lumo-space-m) var(--lumo-space-l);
  box-sizing: border-box;
  border-top: 1px solid var(--lumo-contrast-10pct);
}

/* ---- as três faixas da barra de espaço ----
   Verde até 75%, amarelo de 75 a 90, vermelho acima. O primeiro aviso não é na
   metade: metade de uma cota vendida como suficiente não é notícia, e uma barra
   que amarela numa base fazendo exatamente o que foi comprada para fazer ensina
   o cliente a ignorar a cor — justo o que ela não pode perder, porque o
   vermelho é o único aviso antes de o envio ser recusado.
   Classe própria em vez do theme do Lumo porque ele só tem `error` e
   `contrast`: amarelo não existe lá, e três estados num atributo de dois
   valores viram dois estados. */
.knowledge-quota__bar::part(value) {
  background-color: var(--lumo-success-color);
}

.knowledge-quota__bar--warning::part(value) {
  background-color: var(--singularidade-warning, #e5a000);
}

.knowledge-quota__bar--critical::part(value) {
  background-color: var(--lumo-error-color);
}

/* ---- trilho de seções ---- */
/* Só lugares (Documentos, Categorias, Lixeira); ações ficam junto do conteúdo.
   O item da rota atual recebe o atributo `highlight`, aplicado pelo próprio
   RouterLink — é ele que acende, sem estado mantido à mão. */
.knowledge-rail {
  flex: 0 0 auto;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--lumo-space-m) 0;
  box-sizing: border-box;
  border-right: 1px solid var(--lumo-contrast-10pct);
  background: color-mix(in oklab, var(--lumo-contrast-5pct) 60%, transparent);
}

.knowledge-rail__item {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--lumo-border-radius-l);
  color: var(--lumo-secondary-text-color);
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.knowledge-rail__item:hover {
  background: var(--lumo-contrast-5pct);
  color: var(--lumo-body-text-color);
}

.knowledge-rail__item:focus-visible {
  outline: 2px solid var(--color-interactive-primary, var(--lumo-primary-color));
  outline-offset: 1px;
}

.knowledge-rail__item[highlight] {
  background: var(--singularidade-active, var(--lumo-primary-color-10pct));
  color: var(--color-interactive-primary, var(--lumo-primary-color));
}

.knowledge-rail__icon {
  width: 21px;
  height: 21px;
}

/* ---- ações do módulo: Nova pasta, Enviar arquivo, Nova categoria ---- */
/* Mesmo peso para as três — contorno e texto — e a cor só no ícone. */
vaadin-button.knowledge-action {
  background: transparent;
  border: 1px solid var(--lumo-contrast-10pct);
  color: var(--lumo-body-text-color);
  font-weight: 500;
}

vaadin-button.knowledge-action:hover {
  background: var(--lumo-contrast-5pct);
}

vaadin-button.knowledge-action > vaadin-icon {
  color: var(--color-interactive-primary, var(--lumo-primary-color));
}

vaadin-button.knowledge-action[disabled] {
  opacity: 0.5;
}

/* ---- ⋯ das linhas e o menu que ele abre ---- */
vaadin-button.knowledge-more {
  color: var(--lumo-tertiary-text-color);
  margin: 0;
  min-width: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--lumo-border-radius-m);
}

vaadin-button.knowledge-more:hover,
vaadin-button.knowledge-more[aria-expanded="true"] {
  background: var(--lumo-contrast-5pct);
  color: var(--lumo-body-text-color);
}

.knowledge-more__icon {
  width: 17px;
  height: 17px;
}

.knowledge-menu__item {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-s);
  min-width: 11rem;
}

.knowledge-menu__icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--lumo-secondary-text-color);
}

.knowledge-menu__item--danger,
.knowledge-menu__item--danger .knowledge-menu__icon {
  color: var(--lumo-error-text-color);
}

/* ---- Renomear e Mover ---- */
.knowledge-rename__suffix {
  color: var(--lumo-secondary-text-color);
}

.knowledge-move__label {
  display: block;
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  margin-bottom: var(--lumo-space-xs);
}

.knowledge-move__tree {
  border: 1px solid var(--lumo-contrast-10pct);
  border-radius: var(--lumo-border-radius-m);
}

.knowledge-move__line {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-s);
  min-width: 0;
}

.knowledge-move__icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--lumo-tertiary-text-color);
}

.knowledge-move__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Aviso de mudança de acesso: aparece ao escolher o destino, antes de mover. */
.knowledge-notice {
  display: flex;
  gap: var(--lumo-space-s);
  align-items: flex-start;
  margin-top: var(--lumo-space-m);
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border-radius: var(--lumo-border-radius-m);
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  background: var(--lumo-contrast-5pct);
}

.knowledge-notice--warning {
  color: var(--lumo-body-text-color);
  background: var(--color-feedback-warning-surface, rgba(251, 191, 36, 0.16));
  border: 1px solid var(--color-feedback-warning-border, #b45309);
}

.knowledge-notice__icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--color-feedback-warning-solid, #fbbf24);
}

@media (prefers-reduced-motion: reduce) {
  .knowledge-rail__item { transition: none; }
}

/* Welcome screen — each user-facing feature is a destination card
   (WelcomeView). The whole card is the link: one target, keyboard-reachable. */
.welcome-destination {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-m);
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--lumo-space-l);
  padding: var(--lumo-space-m) var(--lumo-space-l);
  border: 1px solid var(--color-border-default, var(--lumo-contrast-20pct));
  border-radius: 14px;
  background: var(--color-surface-raised, var(--lumo-base-color));
  color: var(--lumo-body-text-color);
  text-align: start;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.welcome-destination:hover {
  border-color: var(--color-interactive-primary, var(--lumo-primary-color));
  box-shadow: 0 2px 8px color-mix(in oklab, var(--color-interactive-primary, var(--lumo-primary-color)) 12%, transparent);
}
.welcome-destination:focus-visible {
  outline: 2px solid var(--color-interactive-primary, var(--lumo-primary-color));
  outline-offset: 2px;
}
.welcome-destination__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--color-interactive-primary, var(--lumo-primary-color)) 12%, transparent);
  color: var(--color-interactive-primary, var(--lumo-primary-color));
}
.welcome-destination__text {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  flex-grow: 1;
}
.welcome-destination__title {
  font-size: var(--lumo-font-size-l);
  font-weight: 600;
}
.welcome-destination__description {
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  line-height: 1.4;
}
.welcome-destination__chevron {
  flex-shrink: 0;
  color: var(--color-interactive-primary, var(--lumo-primary-color));
}

/* ADR-034 §8: "Quem acessou seu espaço" e "Baixar minha memória" no Meu espaço. */
.knowledge-access {
  width: 100%;
  margin: 0;
}

.knowledge-access__explanation {
  margin: 0 0 var(--lumo-space-s);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.knowledge-memory-export {
  text-decoration: none;
}

/* ------------------------------------------------------------------
 * Memória tab (ADR-034 Fase 2): MemoryNotesPanel, SpaceTabs
 * ------------------------------------------------------------------ */
.knowledge-space-tabs {
  flex-shrink: 0;
}

/* A aba cresce para ocupar a área; só a lista rola (nunca a aba inteira). */
.memory-notes {
  flex: 1 1 auto;
  gap: var(--lumo-space-s);
  padding-top: var(--lumo-space-s);
  box-sizing: border-box;
}

.memory-notes__notice {
  margin: 0;
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-5pct);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

/* Cabeçalho: o resumo à esquerda, as ações à direita. */
.memory-notes__header {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lumo-space-s) var(--lumo-space-m);
  width: 100%;
}

.memory-notes__counts {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--lumo-font-size-s);
  color: var(--lumo-secondary-text-color);
  font-variant-numeric: tabular-nums;
}

.memory-notes__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lumo-space-s);
}

.memory-notes__actions:empty {
  display: none;
}

.memory-notes__hint {
  flex: 0 0 auto;
  width: 100%;
}

/* Busca e filtros numa barra da largura toda. Largo (>= 1280px): uma linha só,
   a busca com o dobro de cada filtro. Médio (768-1279px): a busca numa linha,
   os filtros dividindo a seguinte. Estreito: um embaixo do outro. Nenhum campo
   tem texto de ajuda embaixo, então todos têm a mesma altura e alinham pela
   base. */
.memory-notes__toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--lumo-space-s) var(--lumo-space-m);
  width: 100%;
}

.memory-notes__toolbar > * {
  min-width: 0;
  box-sizing: border-box;
}

.memory-notes__search {
  flex: 2 1 0;
  display: flex;
  align-items: flex-end;
  gap: var(--lumo-space-s);
}

.memory-notes__search-field {
  flex: 1 1 auto;
  min-width: 0;
}

.memory-notes__filter {
  flex: 1 1 0;
}

.memory-notes__period {
  flex: 1.5 1 0;
}

.memory-notes__period-dates {
  display: flex;
  gap: var(--lumo-space-s);
}

/* Os campos de data já estão dentro do período, que tem o seu próprio
   espaçamento: sem este zero, o período ficaria mais alto que os vizinhos. */
.memory-notes__period-dates > vaadin-date-picker {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
}

/* A caixa de seleção fica da altura de um campo, centrada nela. */
.memory-notes__archived {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: var(--lumo-size-m);
  margin-bottom: var(--lumo-space-xs);
}

@media (max-width: 1279px) {
  .memory-notes__search {
    flex: 1 1 100%;
  }
}

@media (max-width: 767px) {
  .memory-notes__toolbar > * {
    flex: 1 1 100%;
  }
}

/* A lista ocupa o que sobra, com um mínimo legível; ela é quem rola. */
.memory-notes__grid {
  flex: 1 1 0;
  min-height: 240px;
}

.memory-notes__title,
.memory-notes__title-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-notes__title-cell {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-xs);
}

.memory-notes__title-cell > .memory-notes__title {
  min-width: 0;
}

/* Marcadores: chips inteiros sempre. Na coluna estreita eles quebram de linha
   em vez de serem cortados no meio da palavra ("claude" virava "clauc"). */
.memory-notes__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lumo-space-xs);
  min-width: 0;
  padding-block: var(--lumo-space-xs);
}

/* Um marcador sozinho mais largo que a coluna (até 40 caracteres) mostra
   reticências visíveis; a dica da célula traz todos por extenso. */
.memory-notes__tag {
  display: inline-block;
  flex: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-notes__muted {
  color: var(--lumo-secondary-text-color);
}

.memory-notes__review-due {
  color: var(--lumo-warning-text-color, var(--color-feedback-warning-border, #b45309));
  font-weight: 600;
}

/* Vazio: o estado vazio único (.empty-state) centrado no lugar da lista, e a
   dica da memória embaixo. */
.memory-notes__empty-slot {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--lumo-space-m);
  width: 100%;
  padding: var(--lumo-space-l) 0;
  box-sizing: border-box;
}

.memory-notes__empty-slot > .memory-setup {
  max-width: 40rem;
}

.empty-state .memory-notes__actions {
  justify-content: center;
}

.memory-notes__results {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-s);
  max-height: 40vh;
  overflow: auto;
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border: 1px solid var(--lumo-contrast-10pct);
  border-radius: var(--lumo-border-radius-m);
}

.memory-notes__results-heading {
  font-weight: 600;
}

.memory-notes__hit-meta {
  margin-left: var(--lumo-space-s);
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-secondary-text-color);
}

.memory-notes__hit-passage {
  margin: var(--lumo-space-xs) 0 0;
  font-size: var(--lumo-font-size-s);
  white-space: pre-wrap;
}

/* O leitor da nota: a mesma folga nos quatro lados, os dados num grid
   alinhado acima do texto, e a ação destrutiva sozinha à esquerda do rodapé. */
.memory-note::part(content) {
  padding: var(--lumo-space-m) var(--lumo-space-l);
}

.memory-note__destructive {
  margin-inline-end: auto;
}

.memory-note__meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  align-items: start;
  gap: var(--lumo-space-s) var(--lumo-space-m);
  padding-bottom: var(--lumo-space-m);
  margin-bottom: var(--lumo-space-m);
  border-bottom: 1px solid var(--lumo-contrast-10pct);
  font-size: var(--lumo-font-size-s);
}

.memory-note__meta-item {
  display: flex;
  flex-direction: column;
}

.memory-note__meta-label {
  font-size: var(--lumo-font-size-xs);
  color: var(--lumo-secondary-text-color);
}

.memory-note__body {
  overflow-wrap: anywhere;
}

.memory-note__body table {
  border-collapse: collapse;
}

.memory-note__body th,
.memory-note__body td {
  border: 1px solid var(--lumo-contrast-20pct);
  padding: var(--lumo-space-xs) var(--lumo-space-s);
}

.memory-note__current {
  width: 100%;
}

/* "Dicas" (ADR-035): one collapsible item per connector tip; the memory tip is one of them */
.connector-tip {
  box-sizing: border-box;
  text-align: start;
}

.connector-tip__text,
.connector-tip__steps,
.connector-tip__note {
  margin: 0 0 var(--lumo-space-s);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.connector-tip__items,
.connector-tip__examples {
  margin: 0 0 var(--lumo-space-s);
  padding-inline-start: var(--lumo-space-l);
  font-size: var(--lumo-font-size-s);
}

.connector-tip__phrase {
  font-size: var(--lumo-font-size-s);
}

.connector-tips {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-s);
}

.welcome-memory-setup {
  margin-top: var(--lumo-space-m);
}

/* ============================================================
   Integras Hub — sign-up and sign-in (ADR-043)
   Lumo tokens (mapped to @singularidade/tokens by the parent theme),
   so light and dark follow the theme. The Google button is the one
   exception: its colours are fixed by Google's branding rules (the
   code button under it borrows its border, so the two read as a pair).
   ============================================================ */

/* Google's border grey, in one place: the Google button's and, borrowed,
   the code button's under it. */
:root {
  --hub-provider-border: #747775;
}

[theme~="dark"] {
  --hub-provider-border: #8e918f;
}

/* "Continuar com Google": white, grey border, official "G" (Google's
   "Sign in with Google" rules); the dark variant on the dark theme. */
.hub-google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: var(--lumo-size-m);
  padding: 0 12px;
  box-sizing: border-box;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid var(--hub-provider-border);
  border-radius: var(--lumo-border-radius-m);
  font-family: "Roboto", var(--lumo-font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
}

.hub-google-button:hover {
  background: #f8f9fa;
  text-decoration: none;
}

.hub-google-button:focus-visible,
.hub-alt-button:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

[theme~="dark"] .hub-google-button {
  background: #131314;
  color: #e3e3e3;
}

[theme~="dark"] .hub-google-button:hover {
  background: #1f1f20;
}

.hub-google-logo {
  flex: none;
  width: 18px;
  height: 18px;
  background: url('./images/google-g.svg') center / contain no-repeat;
}

/* The code by e-mail, the Google button's equal on the Hub's login: neutral,
   full width, with the Google button's size and border tone. */
.hub-alt-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--lumo-size-m);
  padding: 0 12px;
  box-sizing: border-box;
  background: var(--lumo-base-color);
  color: var(--lumo-body-text-color);
  border: 1px solid var(--hub-provider-border);
  border-radius: var(--lumo-border-radius-m);
  font-size: var(--lumo-font-size-m);
  font-weight: 500;
  text-decoration: none;
}

.hub-alt-button:hover {
  background: var(--lumo-contrast-5pct);
  text-decoration: none;
}

/* "── ou ──" */
.hub-divider {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-m);
  width: 100%;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.hub-divider::before,
.hub-divider::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px solid var(--lumo-contrast-20pct);
}

/* "Já tenho conta: entrar" / "Não tem conta? Criar": centred under the main action. */
.hub-secondary-link {
  width: 100%;
  text-align: center;
  font-size: var(--lumo-font-size-s);
}

/* The tenant's logo and name on top of the sign-up and the sign-in by code,
   as the login shows them (BaseLoginView.setBranding). */
.hub-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--lumo-space-s);
  width: 100%;
}

.hub-brand img {
  height: 56px;
  max-width: 100%;
  object-fit: contain;
}

.hub-brand-name {
  margin: 0;
  font-size: var(--lumo-font-size-xl);
  letter-spacing: 0.04em;
}

/* Same brand → title distance on all entry screens. */
.hub-page-title {
  margin: var(--lumo-space-s) 0 0;
}

/* The optional consent: a plain row after the required ones, 8 px apart,
   no frame and no badge; "Como funciona" in the helper, aligned with the
   label text. */
vaadin-checkbox.hub-consent-optional {
  margin-top: var(--lumo-space-s);
  --vaadin-input-field-helper-font-size: var(--lumo-font-size-s);
  --vaadin-input-field-helper-spacing: 0;
}

/* The link starts where the label text does: the label is padded by
   space-xs, and so is Lumo's checkbox helper (padding-inline-start), so the
   helper's own margin goes to zero. */
vaadin-checkbox.hub-consent-optional::part(helper-text) {
  margin-left: 0;
  padding-inline-start: var(--lumo-space-xs);
}

vaadin-checkbox.hub-consent-optional > a[slot='helper'] {
  display: inline-block;
  padding-block: var(--lumo-space-xs);
}

/* The three legal links of the acceptance (Termos, Política, Como funciona),
   one rule: underlined, so inside a label they never rely on colour alone,
   and under the required rows' error messages "Como funciona" still reads
   as a link, never as a third message. */
.hub-terms-block a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* "(opcional)": same size and weight as the label, secondary colour. */
.hub-optional-mark {
  color: var(--lumo-secondary-text-color);
}

/* Keyboard focus on the links of the entry screens: the same primary ring as
   the Google and code buttons, never the browser's default. */
.hub-secondary-link a:focus-visible,
.hub-terms-block a:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
  border-radius: var(--lumo-border-radius-s);
}

.hub-login-options > .hub-secondary-link {
  margin-top: var(--lumo-space-s);
}

/* "Não foi possível entrar com o Google…" under the login title. */
.hub-form-error {
  margin: 0;
  color: var(--lumo-error-text-color);
  font-size: var(--lumo-font-size-s);
}

/* The card of the optional consent on the privacy screen: neutral, so it
   never reads as an error. */
.hub-consent-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--lumo-space-xs);
  width: 100%;
  box-sizing: border-box;
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border: 1px solid var(--lumo-contrast-10pct);
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-5pct);
}

/* The privacy contact under every tenant's login (LoginView): on a phone
   the address wraps under its label, the two lines kept together. */
vaadin-horizontal-layout.login-privacy {
  row-gap: 0;
}

/* ============================================================
   Integras Hub — login with the "Faixas" (design system v2):
   a brand panel with the cover band, the symbol, the name and
   the storefront's lead line, beside the ways in. Hub only
   (LoginView.arrangeHubPage, HubLoginPanel); the companies'
   login keeps BaseLoginView's single column.
   From 1024 px the panel is the left ~45 % of the page; below,
   the symbol and the name join the language bar in a header,
   the band under it, then the form (the lead line stays out).
   The band is decoration (aria-hidden, nothing on top of it).
   Its colours are theme variables: the brand's magenta, coral
   and orange, the dark slab and the tinted strip. The neutral
   and coral-100 tokens only exist under data-brand in the
   bindings, so the fallbacks carry the design system's values.
   ============================================================ */

:root {
  --hub-fx-magenta: var(--color-brand-primary, #e91e8b);
  --hub-fx-coral: var(--color-brand-secondary, #e8606a);
  --hub-fx-orange: var(--color-brand-tertiary, #f5a623);
  --hub-fx-slab: var(--color-neutral-800, #261a21);
  --hub-fx-strip: var(--color-brand-coral-100, #ffe4e6);
}

[theme~="dark"] {
  --hub-fx-slab: var(--color-neutral-600, #524049);
  --hub-fx-strip: var(--color-interactive-primary-subtle, rgba(251, 113, 133, 0.16));
}

.hub-fx-magenta,
.hub-fx-dots {
  fill: var(--hub-fx-magenta);
}

.hub-fx-coral {
  fill: var(--hub-fx-coral);
}

.hub-fx-orange {
  fill: var(--hub-fx-orange);
}

.hub-fx-slab {
  fill: var(--hub-fx-slab);
}

.hub-fx-strip {
  fill: var(--hub-fx-strip);
}

/* The page (the base view's vertical layout, re-arranged into a grid). On a
   phone, as on the site's phone layout: a 64 px header with the symbol and
   the name on the left and the bar on the right over a hairline, the band
   coming out from under it, then the form. The panel lends its pieces to
   the grid there (display: contents), so the name exists only once. */
vaadin-vertical-layout.hub-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "brand bar"
    "band band"
    "main main";
  overflow: auto;
}

.hub-login__panel,
.hub-login__text {
  display: contents;
}

.hub-login__brand,
.hub-login__bar {
  box-sizing: border-box;
  min-height: 64px;
  border-bottom: 1px solid var(--color-border-subtle, var(--lumo-contrast-10pct));
}

/* The padding on the right keeps the name off the language picker. Padding,
   not a column gap: a gap would cut the hairline under the header. */
.hub-login__brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 var(--lumo-space-s) 0 16px;
}

/* 8 px between the language picker and the theme button, as in the design
   system's sign-in bar: on a 320 px phone the name keeps its room. */
.hub-login__bar {
  grid-area: bar;
  gap: var(--lumo-space-s);
  padding: 0 var(--lumo-space-s) 0 0;
}

/* The band: a fixed 112 px drawing that fills the width and clips what
   bleeds; the phone's drawing below 600 px, the panel's from there. */
.hub-login__band {
  grid-area: band;
  display: block;
  height: 112px;
  line-height: 0;
}

.hub-login__band svg {
  display: block;
}

.hub-login__band--wide {
  display: none;
}

.hub-login__symbol {
  flex: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Never cut: on the narrowest phones the name takes two lines of the 64 px
   header. Narrower than 320 px, a word too long for its box breaks instead
   of running under the language picker. */
.hub-login__name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--color-text-primary, var(--lumo-header-text-color));
}

/* The lead line belongs to the panel only: a phone goes from the band to
   the form. */
.hub-login__lead {
  display: none;
}

/* The column: <main> with the ways in, then <footer> with the legal links
   and the privacy contact. Siblings, as on the artboard, so the footer is
   the page's contentinfo landmark. The ways in are centred; on a phone the
   form follows the band and only the spacer above the footer grows. */
.hub-login__column {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--lumo-space-l) 0 var(--lumo-space-m);
}

.hub-login__main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hub-login__spacer {
  flex: 1 1 0;
}

.hub-login__main > .hub-login__spacer:first-child {
  flex: 0 0 0;
}

/* "Entrar" centred over the buttons, in the panel's heading size. */
.hub-login .hub-page-title {
  margin: 0;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 2.25rem;
  letter-spacing: -0.02em;
}

.hub-login .hub-google-button,
.hub-login .hub-alt-button {
  min-height: 44px;
}

.hub-login__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: var(--lumo-space-l) var(--lumo-space-m) 0;
}

.hub-login__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 var(--lumo-space-s);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-xs);
}

/* 44 px targets, as on the artboard. */
.hub-login__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--lumo-secondary-text-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hub-login__legal a:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
  border-radius: var(--lumo-border-radius-s);
}

/* A tablet keeps the phone's order with the panel's drawing, its 40 px
   margin aligned with the stripes. */
@media (min-width: 600px) {
  .hub-login__band--wide {
    display: block;
  }

  .hub-login__band--narrow {
    display: none;
  }

  .hub-login__brand {
    padding-left: 40px;
  }

  .hub-login__bar {
    padding-right: var(--lumo-space-l);
  }
}

/* The brand panel: the left ~45 %, inset 16 px, the band bleeding through
   its top, the symbol, the name and the lead line at its foot; the bar and
   the column on the right, the ways in centred between them and the footer. */
@media (min-width: 1024px) {
  vaadin-vertical-layout.hub-login {
    grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "panel bar"
      "panel main";
  }

  .hub-login__panel {
    grid-area: panel;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    margin: 16px 0 16px 16px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--color-surface-sunken, var(--lumo-contrast-5pct));
    box-shadow: inset 0 0 0 1px var(--color-border-subtle, var(--lumo-contrast-10pct));
  }

  .hub-login__text {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 40px 48px;
  }

  .hub-login__brand,
  .hub-login__bar {
    min-height: 0;
    border-bottom: 0;
  }

  .hub-login__brand {
    gap: 12px;
    padding: 0;
  }

  .hub-login__bar {
    padding: var(--lumo-space-m) var(--lumo-space-l) 0;
  }

  .hub-login__symbol {
    width: 40px;
    height: 40px;
  }

  /* Heavy and tight, a short measure as on the cover (wide screens too). */
  .hub-login__lead {
    display: block;
    max-width: 10.5em;
    margin: 0;
    font-size: clamp(2rem, min(3.75vw, 6.2vh), 3rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--color-text-primary, var(--lumo-header-text-color));
    text-wrap: pretty;
  }

  .hub-login__column {
    padding-top: 0;
  }

  .hub-login__main > .hub-login__spacer:first-child {
    flex: 1 1 0;
  }
}

/* ============================================================
   Integras Hub — storefront "Conectores" (ramo B): catalog cards,
   category chips, "Assinados", connector detail, confirmation,
   loading. Hub only (HubConnectorsView and its parts); the
   companies' marketplace keeps .marketplace-grid / .module-card.
   Colours are theme tokens, so light and dark both work.
   ============================================================ */

.hub-store {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: var(--lumo-space-l) var(--lumo-space-l) var(--lumo-space-xl);
}

.hub-store__hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--lumo-space-m);
  width: 100%;
}

.hub-store__title {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hub-store__lead {
  margin: var(--lumo-space-xs) 0 0;
  max-width: 62ch;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-l);
  line-height: 1.5;
}

.hub-store__searchbar {
  width: 100%;
  margin-top: var(--lumo-space-l);
}

/* As wide as the grid of cards: it starts and ends with them, at any width. */
vaadin-text-field.hub-store__search {
  width: 100%;
  padding: 0;
}

vaadin-text-field.hub-store__search::part(input-field) {
  min-height: 48px;
  padding-inline: var(--lumo-space-m);
  border: 1px solid var(--singularidade-border);
  border-radius: 999px;
  background: var(--lumo-base-color);
  box-shadow: var(--lumo-box-shadow-xs);
  font-size: var(--lumo-font-size-m);
}

vaadin-text-field.hub-store__search[focused]::part(input-field) {
  border-color: var(--lumo-primary-color);
}

.hub-store__banner {
  width: 100%;
}

.hub-store-notice {
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--lumo-space-m);
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-5pct);
  font-size: var(--lumo-font-size-s);
}

.hub-store-notice--warning {
  background: var(--lumo-warning-color-10pct);
}

.hub-store__tabs {
  width: 100%;
  margin-top: var(--lumo-space-l);
  box-shadow: inset 0 -1px 0 var(--singularidade-border);
}

.hub-store__count {
  margin-inline-start: var(--lumo-space-xs);
}

.hub-store__content {
  width: 100%;
}

.hub-store__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
  margin: var(--lumo-space-m) 0 var(--lumo-space-s);
}

.hub-store-chip {
  font: inherit;
  font-size: var(--lumo-font-size-s);
  font-weight: 500;
  line-height: 1.2;
  padding: 7px 14px;
  border: 1px solid var(--singularidade-border);
  border-radius: 999px;
  background: var(--lumo-base-color);
  color: var(--lumo-body-text-color);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hub-store-chip:hover {
  border-color: var(--lumo-primary-color-50pct);
  background: var(--singularidade-hover);
}

.hub-store-chip--active,
.hub-store-chip--active:hover {
  border-color: var(--lumo-primary-color);
  background: var(--lumo-primary-color);
  color: var(--lumo-primary-contrast-color);
}

.hub-store-chip:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

/* On the dark theme the design system's border is faint (10-15%): the search and the chips get a
   stronger one, so they still read as a field and as buttons. */
[theme~="dark"] vaadin-text-field.hub-store__search::part(input-field),
[theme~="dark"] .hub-store-chip:not(.hub-store-chip--active) {
  border-color: var(--lumo-contrast-30pct);
}

[theme~="dark"] vaadin-text-field.hub-store__search[focused]::part(input-field) {
  border-color: var(--lumo-primary-color);
}

[theme~="dark"] .hub-store-chip:not(.hub-store-chip--active):hover {
  border-color: var(--lumo-primary-color-50pct);
}

/* 3 to 4 columns on a desktop, 1 on a phone. */
.hub-store__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--lumo-space-m);
  width: 100%;
  margin-top: var(--lumo-space-m);
  align-items: stretch;
}

@media (max-width: 600px) {
  .hub-store {
    padding: var(--lumo-space-m) var(--lumo-space-m) var(--lumo-space-l);
  }

  /* One row of chips that scrolls sideways, inside the page (the page itself never scrolls sideways). */
  .hub-store__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--lumo-space-m));
    padding: 2px var(--lumo-space-m);
    scrollbar-width: none;
  }

  .hub-store__chips::-webkit-scrollbar {
    display: none;
  }

  .hub-store-chip {
    flex: 0 0 auto;
  }

  .hub-store__grid {
    grid-template-columns: 1fr;
  }

  .hub-store__lead {
    font-size: var(--lumo-font-size-m);
  }
}

/* ---- Catalog card: one main action; the name stretches over the card ---- */

.hub-store-card.material-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  min-width: 0;
  max-width: none;
  height: 100%;
  box-sizing: border-box;
  padding: var(--lumo-space-l);
}

.hub-store-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--lumo-space-s);
  margin-bottom: var(--lumo-space-s);
}

/* Every connector sits on a white tile (connector icons guideline). */
.hub-store-card__tile.module-card__icon-tile,
.hub-detail__tile.module-card__icon-tile {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border: 1px solid var(--color-border-subtle, var(--lumo-contrast-10pct));
  border-radius: var(--lumo-border-radius-l);
  background: #ffffff;
}

.hub-store-card__tile.module-card__icon-tile img,
.hub-store-card__tile.module-card__icon-tile vaadin-icon {
  max-width: 44px;
  max-height: 44px;
}

.hub-store-card__name.module-card__name {
  margin: 0;
  font-size: var(--lumo-font-size-l);
  font-weight: 650;
  line-height: 1.25;
}

.hub-store-card__open {
  all: unset;
  color: var(--lumo-header-text-color);
  cursor: pointer;
}

/* The whole card is the link to the detail; the actions and badges sit above it. */
.hub-store-card__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}

.hub-store-card:has(.hub-store-card__open:focus-visible) {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

.hub-store-card__category {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-xs);
  line-height: 1.4;
}

.hub-store-card__value.module-card__desc {
  margin: var(--lumo-space-xs) 0 0;
  color: var(--lumo-secondary-text-color);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.hub-store-card__footer.module-card__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--lumo-space-xs);
  margin-top: auto;
  padding-top: var(--lumo-space-m);
}

/* Lumo gives buttons a vertical margin a link does not have: the same box for both, so every card's footer lines up. */
.hub-store-card__footer .hub-store-card__action {
  margin: var(--lumo-space-s) 0 0;
}

.hub-store-card__badge {
  align-self: flex-start;
  max-width: 100%;
}

.hub-store-card__offer {
  display: flex;
  align-items: baseline;
  min-height: 1.5em;
}

.hub-store-card__price {
  color: var(--lumo-header-text-color);
  font-size: var(--lumo-font-size-l);
  font-weight: 650;
}

.hub-store-card__per-month {
  margin-inline-start: 2px;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

/* "Gerenciar", the second action of a connector the person subscribes to: a link at the end of the price's line,
   so the main actions of a row of cards stay on one line; at least 24 px tall (WCAG 2.5.8). */
vaadin-button.hub-store-card__manage {
  position: relative;
  z-index: 1;
  min-height: 24px;
  margin-inline-start: auto;
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
}

.hub-store-card__action,
.hub-store-card__badge,
.hub-store-card__new {
  position: relative;
  z-index: 1;
}

/* "Novo" and "Beta" together in the card's top corner, above the name stretched over the card. */
.hub-store-card__marks {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--lumo-space-xs);
}

vaadin-button.hub-store-card__action,
a.hub-store-card__action {
  width: 100%;
}

/* "Adicionar ao Claude" is a link (a new tab), drawn as the theme's buttons. */
.hub-store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--lumo-space-xs);
  box-sizing: border-box;
  min-height: var(--lumo-size-m);
  padding: 0 var(--lumo-space-m);
  border-radius: var(--lumo-border-radius-m);
  font-size: var(--lumo-font-size-m);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-store-button vaadin-icon {
  width: var(--lumo-icon-size-s);
  height: var(--lumo-icon-size-s);
}

.hub-store-button--primary {
  background: var(--lumo-primary-color);
  color: var(--lumo-primary-contrast-color);
}

.hub-store-button--primary:hover {
  background: var(--color-interactive-primary-hover, var(--lumo-primary-color));
  box-shadow: var(--lumo-box-shadow-xs);
}

.hub-store-button:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

/* ---- Loading ---- */

.hub-store-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-s);
  min-height: 236px;
  box-sizing: border-box;
  padding: var(--lumo-space-l);
  border: 1px solid var(--singularidade-border);
  border-radius: var(--lumo-border-radius-l);
  background: var(--lumo-base-color);
}

.hub-store-skeleton > div {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--lumo-contrast-5pct) 25%, var(--lumo-contrast-10pct) 37%,
      var(--lumo-contrast-5pct) 63%);
  background-size: 400% 100%;
  animation: hub-store-shimmer 1.4s ease infinite;
}

.hub-store-skeleton > div:nth-child(1) {
  width: 56px;
  height: 56px;
  margin-bottom: var(--lumo-space-s);
  border-radius: var(--lumo-border-radius-l);
}

.hub-store-skeleton > div:nth-child(2) {
  width: 55%;
  height: 18px;
}

.hub-store-skeleton > div:nth-child(3) {
  width: 92%;
}

.hub-store-skeleton > div:nth-child(4) {
  width: 70%;
}

@keyframes hub-store-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-store-skeleton > div {
    animation: none;
  }
}

.hub-store__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- "Assinados": the old "Meus conectores", one card per contract ---- */

.hub-store__subs {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-m);
  width: 100%;
  margin-top: var(--lumo-space-m);
}

.hub-sub-card {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-m);
  box-sizing: border-box;
  padding: var(--lumo-space-l);
  border: 1px solid var(--singularidade-border);
  border-radius: var(--lumo-border-radius-l);
  background: var(--lumo-base-color);
  box-shadow: var(--lumo-box-shadow-xs);
  outline: none;
}

/* A click on the card's text focuses it (tabindex=-1) and draws nothing; "Gerenciar" marks the card it
   brings into view until the focus leaves it (HubConnectorsView#manageEntry). */
.hub-sub-card:focus-visible,
.hub-sub-card.hub-sub-card--target {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

.hub-sub-card__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lumo-space-m);
}

.hub-sub-card__identity {
  display: flex;
  flex: 1 1 200px;
  flex-direction: column;
  min-width: 0;
}

.hub-sub-card__name {
  margin: 0;
  font-size: var(--lumo-font-size-l);
  font-weight: 650;
}

/* The name with the "Beta" mark after it, on one line. */
.hub-sub-card__name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lumo-space-xs) var(--lumo-space-s);
}

.hub-sub-card__notice {
  margin: 0;
  color: var(--lumo-warning-text-color, var(--lumo-error-text-color));
  font-size: var(--lumo-font-size-s);
}

.hub-sub-card__gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 420px;
}

.hub-sub-card__gauge-label,
.hub-sub-card__extras-left {
  font-size: var(--lumo-font-size-s);
}

/* The pack's button says in short until when its queries count: on a phone it wraps instead of being cut. */
vaadin-button.hub-sub-card__buy {
  max-width: 100%;
  height: auto;
  min-height: var(--lumo-size-m);
}

vaadin-button.hub-sub-card__buy::part(label) {
  white-space: normal;
  text-align: start;
}

.hub-sub-card__extras {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: var(--lumo-font-size-s);
}

.hub-sub-card__rule {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-xs);
}

.hub-sub-card__pack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
}

.hub-sub-card__connect {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
}

vaadin-text-field.hub-sub-card__address {
  flex: 1 1 320px;
  min-width: 0;
}

.hub-sub-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
  padding-top: var(--lumo-space-m);
  border-top: 1px solid var(--singularidade-border);
}

.hub-sub-card__price {
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

.hub-sub-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
  margin-inline-start: auto;
}

.hub-store__related {
  width: 100%;
  margin-top: var(--lumo-space-xl);
}

.hub-store__section-title {
  margin: 0;
  font-size: var(--lumo-font-size-l);
}

.hub-store__section-text {
  margin: 4px 0 0;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

/* ---- After a purchase: the confirmation, and one or two that go well with it ---- */

.hub-store-success {
  width: 100%;
  box-sizing: border-box;
  margin-top: var(--lumo-space-m);
  padding: var(--lumo-space-l);
  border: 1px solid var(--lumo-success-color-50pct);
  border-radius: var(--lumo-border-radius-l);
  background: var(--lumo-success-color-10pct);
}

/* Back from a paid Checkout before the platform confirmed it: the same panel, in the colors of a wait. */
.hub-store-success.hub-store-success--pending {
  border-color: var(--lumo-primary-color-50pct);
  background: var(--lumo-primary-color-10pct);
}

.hub-store-success--pending .hub-store-success__icon {
  color: var(--lumo-primary-text-color);
}

.hub-store-success__head {
  display: flex;
  align-items: flex-start;
  gap: var(--lumo-space-m);
}

.hub-store-success__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--lumo-success-text-color);
}

.hub-store-success__words {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--lumo-space-s);
}

.hub-store-success__title {
  margin: 0;
  font-size: var(--lumo-font-size-l);
}

.hub-store-success__text {
  margin: 0;
  color: var(--lumo-secondary-text-color);
}

/* The confirmed purchase (wave 1 of the design system v2, artboard HubMomentos): a card with the Faixas in its top
   right corner, the connector's logo on its white tile, the title clear of the bands, "Adicionar ao Claude" in the
   large size. The bands and the words share one grid cell; the card clips the bands at its edges. */
.hub-store-success.hub-store-success--done {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--color-border-subtle, var(--lumo-contrast-10pct));
  border-radius: var(--lumo-border-radius-l);
  background: var(--color-surface-raised, var(--lumo-base-color));
  box-shadow: var(--lumo-box-shadow-xs);
}

/* On the dark theme the card's edge is the default border, as the DS v2 dark card: the subtle one nearly vanishes. */
[theme~="dark"] .hub-store-success.hub-store-success--done {
  border-color: var(--color-border-default, var(--lumo-contrast-20pct));
}

.hub-store-success--done > .hub-fx-corner {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: end;
}

.hub-store-success--done > .hub-store-success__head {
  grid-area: 1 / 1;
  gap: var(--lumo-space-m);
  padding: var(--lumo-space-l);
}

.hub-store-success__tile.module-card__icon-tile {
  width: 52px;
  height: 52px;
  min-width: 52px;
  margin: 0;
  border: 1px solid var(--color-border-subtle, var(--lumo-contrast-10pct));
  border-radius: var(--lumo-border-radius-m);
  background: var(--color-neutral-0, #ffffff);
}

.hub-store-success__tile.module-card__icon-tile img,
.hub-store-success__tile.module-card__icon-tile vaadin-icon {
  max-width: var(--size-10);
  max-height: var(--size-10);
}

.hub-store-success--done .hub-store-success__words {
  gap: var(--lumo-space-xs);
  min-width: 0;
}

/* Clear of the 96 px of bands. */
.hub-store-success--done .hub-store-success__title {
  padding-inline-end: 88px;
  font-size: var(--lumo-font-size-xxl);
  font-weight: 600;
  line-height: 1.75rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hub-store-success--done .hub-store-success__text {
  font-size: var(--lumo-font-size-m);
  line-height: 1.25rem;
}

.hub-store-success--done .hub-store-button {
  min-height: var(--lumo-size-l);
  margin-top: var(--size-3);
  padding: 0 var(--size-5);
  font-size: var(--lumo-font-size-l);
  line-height: 1.5rem;
}

/* "Combina com …": a section of its own under the card, with the catalog's cards, as far below it as the artboard's
   24 px. */
.hub-store-success__more {
  width: 100%;
  margin-top: var(--lumo-space-l);
}

.hub-store-success__more .hub-store__section-title {
  font-size: var(--lumo-font-size-xl);
  font-weight: 600;
  line-height: 1.5rem;
}

/* The chips of "Assinados" start the list, a step below the moment of the purchase. */
.hub-store-success + .hub-store__chips,
.hub-store-success__more + .hub-store__chips {
  margin-top: var(--lumo-space-xl);
}

@media (max-width: 600px) {
  .hub-store-success--done > .hub-store-success__head {
    gap: var(--size-3);
    padding: var(--size-5);
  }

  .hub-store-success--done .hub-store-success__title {
    padding-inline-end: 80px;
    font-size: 1.25rem;
    line-height: 1.625rem;
  }
}

/* ---- Connector detail (dialog) ---- */

.hub-detail__close {
  margin-inline-start: auto;
}

.hub-detail__body {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-l);
  padding: 0 var(--lumo-space-xs) var(--lumo-space-s);
}

.hub-detail__hero {
  display: flex;
  align-items: center;
  gap: var(--lumo-space-m);
}

.hub-detail__tile.module-card__icon-tile {
  width: 72px;
  height: 72px;
  min-width: 72px;
}

.hub-detail__tile.module-card__icon-tile img,
.hub-detail__tile.module-card__icon-tile vaadin-icon {
  max-width: 56px;
  max-height: 56px;
}

.hub-detail__identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hub-detail__name {
  margin: 0;
  font-size: var(--lumo-font-size-xxl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hub-detail__offer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
  margin-top: 4px;
}

.hub-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lumo-space-s);
}

.hub-detail__lead {
  margin: 0;
  line-height: 1.55;
}

.hub-detail__heading {
  margin: 0 0 var(--lumo-space-s);
  font-size: var(--lumo-font-size-m);
  font-weight: 650;
}

.hub-detail__examples {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-s);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-detail__examples li {
  display: flex;
  align-items: flex-start;
  gap: var(--lumo-space-s);
  padding: var(--lumo-space-s) var(--lumo-space-m);
  border-radius: var(--lumo-border-radius-m);
  background: var(--lumo-contrast-5pct);
}

.hub-detail__question {
  flex: 1 1 auto;
  line-height: 1.5;
}

.hub-detail__question::before {
  content: "“";
}

.hub-detail__question::after {
  content: "”";
}

.hub-detail__items {
  display: grid;
  gap: var(--lumo-space-s) var(--lumo-space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-detail__items li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-detail__routines {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.hub-detail__more {
  margin-top: var(--lumo-space-s);
}

.hub-detail__where {
  margin: 0 0 var(--lumo-space-s);
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
}

/* "O que ele faz": one tool per line, its name and what it does, whole — never cut without a way to read the rest
   (WCAG 1.4.4 and 1.4.10); "Mais N ferramentas" keeps the list short. */
.hub-detail__tools {
  grid-template-columns: minmax(0, 1fr);
}

.hub-detail__item-title {
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
}

.hub-detail__item-text,
.hub-detail__data {
  margin: 0;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
  line-height: 1.5;
}

.hub-detail__help {
  margin: 4px 0 0;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-xs);
}

/* ============================================================
   Ramo A: cabeçalho, estado vazio único, tour guiado
   ============================================================ */

/* ---- Cabeçalho: logo e nome como um link para o início ----
   MainLayout.installHomeLink tira o logo de dentro do botão da barra lateral
   (BaseAdminLayout, singularidade-ui-vaadin — o lugar ideal desta correção) e
   o põe, com o nome, num link para "/". Tudo centrado na linha da barra. */
.integras-navbar__home {
  display: inline-flex;
  align-items: center;
  gap: var(--lumo-space-s);
  /* Never narrower than the logo: on a small screen the name gives way, the logo stays whole. */
  min-width: calc(28px + 2 * var(--lumo-space-xs));
  overflow: hidden;
  height: var(--lumo-size-m);
  padding: 0 var(--lumo-space-xs);
  border-radius: var(--lumo-border-radius-m);
  color: var(--lumo-header-text-color);
  text-decoration: none;
}

.integras-navbar__home:hover .singularidade-navbar__title {
  color: var(--lumo-primary-text-color);
}

.integras-navbar__home:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

.integras-navbar__logo {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Celular: só o logo leva ao início; o nome não cabe ao lado do idioma e do menu.
   A barra aperta os vãos e o seletor de idioma para que, com o botão da barra
   lateral à esquerda, nada fique cortado na borda direita em 360 px. */
@media (max-width: 600px) {
  .integras-navbar__home .singularidade-navbar__title {
    display: none;
  }

  vaadin-horizontal-layout:has(> .integras-navbar__home) {
    gap: var(--lumo-space-s);
  }

  .integras-navbar__tools {
    gap: var(--lumo-space-xs);
  }

  .integras-navbar__tools vaadin-select {
    width: 5.75rem !important;
  }

  /* The user menu's button keeps only the photo (or the initials): the name, the e-mail and the caret
     do not fit. Only the button: the open menu is a light-DOM child of the same vaadin-menu-bar and its
     items are rows of an icon and a text too, so a wider selector emptied every item on a phone. */
  vaadin-menu-bar.ss-user-menu > vaadin-menu-bar-button vaadin-horizontal-layout > span,
  vaadin-menu-bar.ss-user-menu > vaadin-menu-bar-button vaadin-horizontal-layout > vaadin-icon {
    display: none;
  }
}

/* O lado do tema, do idioma e do menu do usuário ocupa só a largura que sobra.
   Com width: 100% (o padrão da biblioteca) ele entrava na divisão do espaço e
   cortava o nome ("INTEGRAS H…") mesmo com a barra quase vazia. */
.integras-navbar__tools {
  flex: 1 1 0%;
}

/* ---- Integras Hub: navegação no cabeçalho (MainLayout.installHubNav) ----
   Só a pessoa do Hub (integras-shell--hub-person): "Conectores" e "Meu espaço"
   são abas do cabeçalho, com ícone e nome, logo depois do logo, como no artboard
   "Navegação no topo" (DS v2, .ss-navlink): texto secundário; a aba ativa
   (aria-current="page") com a cor do texto, peso 600 e um traço de 2 px na cor
   primária sobre a linha de baixo do cabeçalho. Sem coluna lateral e sem ☰.
   O cabeçalho estica as abas até a linha de baixo. */
vaadin-app-layout.integras-shell--hub-person vaadin-horizontal-layout:has(> .integras-hub-nav) {
  align-self: stretch;
}

.integras-hub-nav {
  display: flex;
  flex: none;
  align-self: stretch;
  align-items: stretch;
  gap: 32px;
  /* 16 px of the header's own gap + 32: the artboard's 48 px from the name. */
  margin-inline-start: 32px;
}

.integras-hub-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.integras-hub-nav__link vaadin-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.integras-hub-nav__link:hover {
  color: var(--lumo-header-text-color);
}

.integras-hub-nav__link[aria-current="page"] {
  color: var(--lumo-header-text-color);
  font-weight: 600;
}

.integras-hub-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--lumo-primary-color);
}

.integras-hub-nav__link:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: -2px;
  border-radius: var(--lumo-border-radius-s);
}

/* Celular e tablet em pé: as duas abas descem para uma linha própria logo
   abaixo do topo, meio a meio, como no artboard "Navegação no celular". No
   topo ficam o logo, o idioma, o tema, o fuso e a pessoa. */
@media (max-width: 1023px) {
  vaadin-app-layout.integras-shell--hub-person vaadin-horizontal-layout:has(> .integras-hub-nav) {
    flex-wrap: wrap;
    row-gap: 0;
  }

  /* The top row keeps the header's height; the tabs' row adds 48 px under it. */
  vaadin-app-layout.integras-shell--hub-person .integras-navbar__tools {
    min-height: 56px;
  }

  /* Edge to edge, over the header's own side padding. */
  .integras-hub-nav {
    order: 1;
    flex: 1 0 calc(100% + 2 * var(--lumo-space-m));
    gap: 0;
    margin-inline: calc(-1 * var(--lumo-space-m));
    height: 48px;
  }

  .integras-hub-nav__link {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* ---- Integras Hub: "Minha conta" (HubAccountNav e as cinco abas) ----
   Uma página com cinco abas — Perfil, Pagamento, Armazenamento, Privacidade e
   Excluir a conta —, como no artboard "Minha conta unificada": título grande,
   as abas logo abaixo (desenho das abas do DS) e o conteúdo numa coluna de
   640 px, a mesma em todas as abas, para as abas nunca mudarem de lugar. */
.hub-account {
  box-sizing: border-box;
  max-width: calc(640px + 64px);
  padding: 24px 32px 32px;
}

.hub-account__header {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.hub-account__title {
  margin: 0;
  color: var(--lumo-header-text-color);
  font-size: 2rem;
  font-weight: 700;
  line-height: 2.5rem;
  letter-spacing: -0.02em;
}

.hub-account__tabs {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  margin-bottom: 8px;
  box-shadow: inset 0 -1px 0 var(--singularidade-border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

/* At least 44 × 44 px to touch: "Perfil" alone is 32 px wide, so the shorter names are centred in 44 px. */
.hub-account__tab {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--lumo-secondary-text-color);
  font-size: var(--lumo-font-size-s);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.hub-account__tab:hover {
  color: var(--lumo-header-text-color);
}

.hub-account__tab[aria-current="page"] {
  color: var(--lumo-header-text-color);
  font-weight: 600;
}

.hub-account__tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--lumo-primary-color);
}

.hub-account__tab:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: -2px;
  border-radius: var(--lumo-border-radius-s);
}

/* "Enviar foto" (ProfilePhotoField, the Hub and the companies): the outlined
   button of the screens, the colour only on the glyph — as "Enviar arquivo". */
vaadin-button.profile-photo__upload {
  background: transparent;
  border: 1px solid var(--lumo-contrast-20pct);
  color: var(--lumo-body-text-color);
  font-weight: 500;
}

vaadin-button.profile-photo__upload:hover {
  background: var(--lumo-contrast-5pct);
}

vaadin-button.profile-photo__upload > vaadin-icon {
  color: var(--color-interactive-primary, var(--lumo-primary-color));
}

/* "ou arraste aqui" only where a file can be dragged: not on a touch screen. */
@media (hover: none) and (pointer: coarse) {
  vaadin-upload.profile-photo > [slot="drop-label"] {
    display: none;
  }
}

/* The sections of a tab (Privacidade): one level under the page's title, in
   the size they had as H3 (Lumo's h3 is font-size-xl). */
.hub-account__section {
  margin: var(--lumo-space-m) 0 0;
  font-size: var(--lumo-font-size-xl);
}

/* Perfil: the form's fields take the column, the photo stays on top. */
.hub-account__form {
  width: 100%;
}

@media (max-width: 600px) {
  .hub-account {
    padding: 16px;
  }

  /* The five tabs do not fit a phone: they scroll sideways (the current one is
     brought into view), and the right edge fades to say there is more. */
  .hub-account__tabs {
    padding-inline-end: 32px;
    scroll-padding-inline: 32px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  }

  .hub-account__title {
    font-size: 1.625rem;
    line-height: 2rem;
  }
}

/* ---- Estado vazio único (EmptyState): Meu espaço, busca, lixeira, memória,
   compartilhadas, conectores ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--lumo-space-s);
  box-sizing: border-box;
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  padding: var(--lumo-space-xl) var(--lumo-space-l);
  text-align: center;
  white-space: normal;
}

.empty-state__icon {
  width: var(--lumo-icon-size-l);
  height: var(--lumo-icon-size-l);
  margin-bottom: var(--lumo-space-xs);
  color: var(--lumo-contrast-30pct);
}

.empty-state__title {
  font-size: var(--lumo-font-size-l);
  font-weight: 600;
  line-height: var(--lumo-line-height-s);
  color: var(--lumo-header-text-color);
}

.empty-state__text {
  max-width: 30rem;
  margin: 0;
  font-size: var(--lumo-font-size-s);
  line-height: var(--lumo-line-height-m);
  color: var(--lumo-secondary-text-color);
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--lumo-space-s);
  margin-top: var(--lumo-space-s);
}

/* Numa página: ocupa a altura livre e centraliza nela. */
.empty-state-page {
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 14rem;
  box-sizing: border-box;
  padding: var(--lumo-space-l);
}

/* Numa grade: ocupa o corpo da grade e centraliza nele. */
vaadin-grid > .empty-state {
  min-height: 100%;
}

/* ---- Tour guiado (Driver.js): o balão nas cores e na tipografia do tema ----
   Onda 1 do DS v2 (artboard HubMomentos): 360 px, 24 px de respiro, as Faixas
   no canto de cima à direita (product-tour.js), o título grande abaixo delas,
   "Pular" como botão terciário, a contagem e "Próximo" no tamanho grande. No
   primeiro passo não há "Voltar" (o Driver.js o deixa desligado: some). */
.driver-popover.integras-tour {
  box-sizing: border-box;
  width: 360px;
  min-width: 0;
  max-width: calc(100vw - var(--lumo-space-l));
  padding: var(--lumo-space-l);
  border: 1px solid var(--color-border-subtle, var(--lumo-contrast-10pct));
  border-radius: var(--lumo-border-radius-l);
  background-color: var(--color-surface-raised, var(--lumo-base-color));
  box-shadow: var(--lumo-box-shadow-xl);
  color: var(--lumo-body-text-color);
}

.driver-popover.integras-tour,
.driver-popover.integras-tour * {
  font-family: var(--lumo-font-family);
}

/* The bands run off the balloon's top and right edges: the drawing's own box clips them, rounded as the corner. */
.driver-popover.integras-tour .integras-tour__bands {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  border-top-right-radius: calc(var(--lumo-border-radius-l) - 1px);
  pointer-events: none;
}

.driver-popover.integras-tour .driver-popover-title {
  margin: 28px 0 0;
  font-size: var(--lumo-font-size-xxxl);
  font-weight: 700;
  line-height: 2.25rem;
  letter-spacing: -0.02em;
  color: var(--lumo-header-text-color);
}

.driver-popover.integras-tour .driver-popover-description {
  margin-top: var(--lumo-space-s);
  font-size: var(--lumo-font-size-m);
  line-height: 1.25rem;
  color: var(--lumo-secondary-text-color);
}

.driver-popover.integras-tour .driver-popover-footer {
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lumo-space-s);
  margin-top: var(--lumo-space-l);
}

.driver-popover.integras-tour .driver-popover-progress-text {
  margin-inline-end: auto;
  font-size: var(--lumo-font-size-s);
  line-height: 1.25rem;
  color: var(--lumo-secondary-text-color);
}

.driver-popover.integras-tour .driver-popover-navigation-btns {
  gap: var(--lumo-space-s);
}

.driver-popover.integras-tour .driver-popover-footer button {
  min-height: var(--lumo-size-l);
  margin: 0;
  padding: 0 var(--size-5);
  border: 1px solid var(--color-border-control, #8c7b86);
  border-radius: var(--lumo-border-radius-m);
  background-color: var(--color-surface-raised, var(--lumo-base-color));
  color: var(--lumo-body-text-color);
  font-size: var(--lumo-font-size-m);
  font-weight: 600;
  line-height: 1.25rem;
  letter-spacing: -0.01em;
  text-shadow: none;
}

.driver-popover.integras-tour .driver-popover-footer button:hover {
  background-color: var(--lumo-contrast-5pct);
}

.driver-popover.integras-tour .driver-popover-footer .driver-popover-next-btn {
  border-color: transparent;
  background-color: var(--lumo-primary-color);
  color: var(--lumo-primary-contrast-color);
}

.driver-popover.integras-tour .driver-popover-footer .driver-popover-next-btn:hover {
  background-color: var(--lumo-primary-color);
  box-shadow: inset 0 0 0 100px var(--lumo-tint-10pct);
}

/* The library shows "Voltar" disabled on the first step (inline display): there is nothing to go back to. */
.driver-popover.integras-tour .driver-popover-footer .driver-popover-prev-btn.driver-popover-btn-disabled {
  display: none !important;
}

.driver-popover.integras-tour .driver-popover-footer .integras-tour__skip {
  margin-inline-start: calc(-1 * var(--size-3));
  padding: 0 var(--size-3);
  border-color: transparent;
  background-color: transparent;
  color: var(--color-interactive-primary, var(--lumo-primary-text-color));
}

.driver-popover.integras-tour .driver-popover-footer .integras-tour__skip:hover {
  background-color: var(--lumo-primary-color-10pct);
}

.driver-popover.integras-tour .driver-popover-footer button:focus-visible {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: 2px;
}

.driver-popover.integras-tour .driver-popover-arrow-side-left {
  border-left-color: var(--color-surface-raised, var(--lumo-base-color));
}

.driver-popover.integras-tour .driver-popover-arrow-side-right {
  border-right-color: var(--color-surface-raised, var(--lumo-base-color));
}

.driver-popover.integras-tour .driver-popover-arrow-side-top {
  border-top-color: var(--color-surface-raised, var(--lumo-base-color));
}

.driver-popover.integras-tour .driver-popover-arrow-side-bottom {
  border-bottom-color: var(--color-surface-raised, var(--lumo-base-color));
}

/* With the balloon open, the Faixas are only on it: none on the page under the shade (artboard HubMomentos). */
.driver-active .hub-store .hub-fx-corner {
  visibility: hidden;
}

/* On the dark theme the darkened page is already dark: the highlighted element gets an outline,
   drawn inside it (Driver.js hides the overflow of its parent, which would cut one drawn outside). */
[theme~="dark"] .driver-active .driver-active-element {
  outline: 2px solid var(--lumo-primary-color);
  outline-offset: -2px;
}

/* ============================================================
   Integras Hub — onda 1 do Design System v2 (canvas das Faixas,
   artboards HubVazios, HubMomentos e HubNavCelular): as Faixas
   fora do login, os estados vazios e o Meu espaço no celular.
   Só o Hub: a pessoa do Hub (integras-shell--hub-person) e a
   vitrine, que só existe nele; as empresas ficam como estão.
   Cores do tema: as do login (--hub-fx-*) e as abaixo, com o
   valor do DS v2 de reserva enquanto os tokens v2 não chegam.
   Medidas pelos tokens (--lumo-*, --size-*); em px só as que não
   têm token (o desenho das Faixas, o respiro do vazio, 52 px).
   ============================================================ */

:root {
  --hub-tile: var(--color-interactive-secondary, #ece5eb);
  --hub-border-control: var(--color-border-control, #8c7b86);
  --hub-primary-subtle: var(--color-interactive-primary-subtle, #fff1f2);
}

[theme~="dark"] {
  --hub-tile: var(--color-interactive-secondary, #3a2c33);
  --hub-primary-subtle: var(--color-interactive-primary-subtle, rgba(251, 113, 133, 0.16));
}

/* ---- As Faixas: o canto (96 × 56, as faixas saindo pela borda de cima e
   pela da direita) e o emblema dos vazios (metade do tamanho: 28/16/12,
   4 px entre elas). Decoração, aria-hidden (HubFaixas). ---- */
.hub-fx-corner {
  width: 96px;
  height: 56px;
  line-height: 0;
  pointer-events: none;
}

.hub-fx-corner svg {
  display: block;
}

.hub-fx-emblem {
  display: flex;
  flex-direction: column;
  gap: var(--lumo-space-xs);
  width: 56px;
}

.hub-fx-emblem__band {
  display: block;
  border-radius: var(--lumo-border-radius-s);
}

.hub-fx-emblem__band--magenta {
  height: 28px;
  background: var(--hub-fx-magenta);
}

.hub-fx-emblem__band--coral {
  height: var(--size-4);
  background: var(--hub-fx-coral);
}

.hub-fx-emblem__band--orange {
  height: var(--size-3);
  background: var(--hub-fx-orange);
}

/* ---- Estado vazio do Hub (EmptyState), como o do DS: o ícone num ladrilho
   de 64 px, o título no tamanho de seção, o texto menor e a ação abaixo. Vale
   para as telas da pessoa do Hub: a vitrine e o Meu espaço. ---- */
vaadin-app-layout.integras-shell--hub-person .empty-state {
  gap: 0;
  max-width: calc(400px + 2 * var(--lumo-space-l));
}

vaadin-app-layout.integras-shell--hub-person .empty-state__icon {
  box-sizing: content-box;
  flex: none;
  width: var(--size-8);
  height: var(--size-8);
  margin: 0;
  padding: var(--lumo-space-m);
  border-radius: var(--lumo-border-radius-l);
  background: var(--hub-tile);
  color: var(--color-text-secondary, var(--lumo-secondary-text-color));
}

vaadin-app-layout.integras-shell--hub-person .empty-state__icon > svg {
  display: block;
}

vaadin-app-layout.integras-shell--hub-person .empty-state__title {
  margin-top: var(--lumo-space-m);
  font-size: var(--lumo-font-size-xl);
  font-weight: 600;
  line-height: 1.5rem;
  color: var(--lumo-header-text-color);
  text-wrap: balance;
}

vaadin-app-layout.integras-shell--hub-person .empty-state__text {
  margin-top: var(--lumo-space-s);
  font-size: var(--lumo-font-size-m);
  line-height: 1.25rem;
  text-wrap: balance;
}

vaadin-app-layout.integras-shell--hub-person .empty-state__actions {
  margin-top: var(--lumo-space-m);
}

/* Na vitrine, o vazio respira abaixo das categorias como no artboard: 112 px até o ícone (o .ss-empty dele). */
.hub-store .empty-state {
  padding: 112px var(--lumo-space-m) var(--size-12);
}

/* A ação de um vazio da vitrine: 44 px; a segunda classe a desenha com contorno. */
vaadin-button.hub-store-empty__action {
  height: var(--lumo-size-l);
  min-height: var(--lumo-size-l);
  margin: 0;
  padding: 0 var(--size-5);
  font-size: var(--lumo-font-size-m);
  font-weight: 600;
  letter-spacing: -0.01em;
}

vaadin-button.hub-store-empty__action--secondary {
  border: 1px solid var(--hub-border-control);
  background: var(--color-surface-raised, var(--lumo-base-color));
  color: var(--lumo-body-text-color);
}

vaadin-button.hub-store-empty__action--secondary:hover {
  background: var(--hub-tile);
}

@media (max-width: 600px) {
  .hub-store .empty-state {
    padding: var(--size-12) 0 var(--size-8);
  }
}

/* ---- Meu espaço no celular (artboard HubNavCelular, 390 px; vale até
   600 px e cabe em 320): uma coluna que rola como página. O trilho vira os
   mesmos ícones no cabeçalho, ao lado do nome (MyKnowledgeLayout), antes do
   "?"; a explicação e "Quem acessou…" inteiros; Arquivos e Memória; as
   pastas numa caixa; a pasta aberta com a dica, os dois botões de envio lado
   a lado e o vazio numa caixa. As listas crescem com as linhas até 50; uma
   mais longa rola dentro de uma caixa (KnowledgeBrowser.fitListsToPhones). ---- */
.knowledge-rail.knowledge-rail--inline {
  display: none;
}

@media (max-width: 600px) {
  vaadin-app-layout.integras-shell--hub-person .knowledge-layout > .knowledge-rail {
    display: none;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-rail.knowledge-rail--inline {
    display: flex;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    width: auto;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    background: none;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-rail--inline .knowledge-rail__item {
    width: var(--lumo-size-l);
    height: var(--lumo-size-l);
    border-radius: var(--lumo-border-radius-m);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-rail--inline .knowledge-rail__item[highlight] {
    background: var(--hub-primary-subtle);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-rail--inline .knowledge-rail__icon {
    width: var(--size-5);
    height: var(--size-5);
  }

  /* O cabeçalho: o nome sobre "Integras · Summa", os ícones e o "?" no fim.
     Sem lugar para os dois (320 px), os ícones descem para a linha de baixo. */
  vaadin-app-layout.integras-shell--hub-person .knowledge-header {
    gap: var(--lumo-space-xs) var(--lumo-space-s);
    min-height: 0;
    padding: var(--size-3) var(--lumo-space-m) 0;
    border-bottom: 0;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__identity {
    flex: 1 1 7rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__title {
    font-size: var(--lumo-font-size-xl);
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: 0;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__product {
    padding-inline-start: 0;
    border-inline-start: 0;
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    line-height: 1.25rem;
    letter-spacing: 0;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__count {
    order: 10;
    flex-basis: 100%;
    margin-inline-start: 0;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__count:empty {
    display: none;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__places ~ .knowledge-header__actions::before {
    content: "";
    align-self: center;
    width: 1px;
    height: var(--size-6);
    margin-inline-end: 6px;
    background: var(--color-border-default, var(--lumo-contrast-20pct));
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__actions vaadin-button {
    width: var(--lumo-size-l);
    height: var(--lumo-size-l);
    margin: 0;
  }

  /* O corpo: 16 px de margem, a explicação e "Quem acessou…" no tamanho do texto. */
  vaadin-app-layout.integras-shell--hub-person .knowledge-page__body.knowledge-space-body {
    gap: 0;
    padding: 0 var(--lumo-space-m) var(--lumo-space-l);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-personal__explanation {
    margin-top: var(--size-3) !important;
    font-size: var(--lumo-font-size-m);
    line-height: 1.25rem;
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-details.knowledge-access {
    margin: var(--lumo-space-xs) 0 0;
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-details.knowledge-access > vaadin-details-summary {
    align-items: flex-start;
    padding-block: 10px;
    white-space: normal;
    font-size: var(--lumo-font-size-m);
    line-height: 1.25rem;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-space-tabs {
    width: 100%;
    box-sizing: border-box;
  }

  /* Arquivos: as pastas e a pasta aberta uma embaixo da outra. */
  vaadin-app-layout.integras-shell--hub-person .knowledge-browser {
    height: auto !important;
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-split-layout.knowledge-split {
    flex-direction: column;
    flex-grow: 0 !important;
    height: auto !important;
    padding: 0;
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-split-layout.knowledge-split::part(splitter) {
    display: none;
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-split-layout.knowledge-split > .knowledge-panel {
    flex: none !important;
    height: auto !important;
    padding: 0 !important;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--start > .knowledge-panel__head {
    min-height: 0;
    padding: var(--lumo-space-m) 0 var(--lumo-space-s);
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-grid.knowledge-folder-tree {
    box-sizing: border-box;
    padding: var(--lumo-space-xs);
    border: 1px solid var(--color-border-default, var(--lumo-contrast-20pct));
    border-radius: var(--lumo-border-radius-l);
    background: var(--color-surface-raised, var(--lumo-base-color));
  }

  /* Uma lista com mais de 50 linhas rola dentro de uma caixa de altura fixa:
     o celular não desenha centenas de linhas de uma vez (KnowledgeBrowser). */
  vaadin-app-layout.integras-shell--hub-person vaadin-grid.knowledge-list--long {
    height: min(70vh, 560px) !important;
  }

  /* A pasta aberta: o nome, a dica, os dois envios lado a lado e a lista.
     O cabeçalho do painel some como caixa para os seus dois itens entrarem
     na ordem do artboard (a dica vem antes dos botões). */
  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end > .knowledge-panel__head {
    display: contents;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end > .knowledge-panel__head > span {
    order: 1;
    margin-top: var(--size-5);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end > .knowledge-panel__hint {
    order: 2;
    margin-top: var(--lumo-space-xs);
    padding: 0;
    font-size: var(--lumo-font-size-s) !important;
    line-height: 1.25rem;
  }

  /* Lado a lado; sem 9rem para cada um (320 px), um embaixo do outro, nunca cortados. */
  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end [data-knowledge-upload] {
    order: 3;
    flex-wrap: wrap;
    width: 100%;
    margin-top: var(--size-3);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end [data-knowledge-upload] > vaadin-button {
    flex: 1 1 9rem;
    min-width: 0;
    height: var(--lumo-size-l);
    margin: 0;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end > .knowledge-selection {
    order: 4;
    margin: var(--size-3) 0 0;
  }

  /* Nada a marcar numa pasta vazia: a barra de seleção não guarda lugar. */
  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end:has(> vaadin-grid.knowledge-documents--empty) > .knowledge-selection--empty {
    display: none;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end > vaadin-grid {
    order: 5;
    width: 100%;
    margin-top: var(--size-3);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-panel--end > .knowledge-dropzone__overlay {
    order: 6;
  }

  /* A pasta vazia: só o vazio, numa caixa, sem o cabeçalho das colunas. */
  vaadin-app-layout.integras-shell--hub-person vaadin-grid.knowledge-documents--empty {
    border: 1px solid var(--color-border-default, var(--lumo-contrast-20pct));
    border-radius: var(--lumo-border-radius-l);
    background: var(--color-surface-raised, var(--lumo-base-color));
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-grid.knowledge-documents--empty::part(header-row) {
    display: none;
  }

  vaadin-app-layout.integras-shell--hub-person vaadin-grid.knowledge-documents--empty .empty-state {
    padding: var(--lumo-space-l) var(--lumo-space-m);
  }

  /* Os botões do Meu espaço com o contorno do DS: "Nova pasta" e os envios. */
  vaadin-app-layout.integras-shell--hub-person vaadin-button.knowledge-action {
    border-color: var(--hub-border-control);
  }
}

/* 320 px: o nome, os três ícones e o "?" ainda numa linha — ícones de 40 px e o nome um ponto menor. */
@media (max-width: 359px) {
  vaadin-app-layout.integras-shell--hub-person .knowledge-header {
    column-gap: var(--lumo-space-xs);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__identity {
    flex-basis: 6rem;
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__title {
    font-size: var(--lumo-font-size-l);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-rail--inline .knowledge-rail__item,
  vaadin-app-layout.integras-shell--hub-person .knowledge-header__actions vaadin-button {
    width: var(--size-10);
    height: var(--size-10);
  }

  vaadin-app-layout.integras-shell--hub-person .knowledge-header__places ~ .knowledge-header__actions::before {
    margin-inline-end: 3px;
  }
}
