/* Baluarte Material Design v1.5 — padrões compostos candidatos. */

:root {
  --pattern-elevation-composer: 0 8px 6px -5px rgba(0, 0, 0, .03);
}

[data-theme="dark"] {
  --pattern-elevation-composer: 0 8px 6px -5px rgba(255, 255, 255, .03);
}

/* Composer conversacional. */
.b-composer {
  position: relative;
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 560px;
  padding: var(--b-space-7) var(--b-space-4) var(--b-space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--b-shape-composer-radius);
  corner-shape: var(--b-corner-squircle);
  background: var(--bg);
  box-shadow: var(--pattern-elevation-composer);
  transition:
    border-color var(--b-motion-fast) var(--b-ease-standard),
    box-shadow var(--b-motion-fast) var(--b-ease-standard);
}
.b-composer:focus-within {
  border-color: var(--accent);
  box-shadow: var(--pattern-elevation-composer), inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}
.b-composer__textarea {
  box-sizing: border-box;
  inline-size: 100%;
  padding-block: 0;
  padding-inline: var(--b-space-4);
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--b-text-xl);
  line-height: var(--b-leading-normal);
  resize: none;
  outline: none;
}
.b-composer__textarea::placeholder { color: var(--text-muted); }
.b-composer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-start: var(--b-space-5);
}
.b-composer__group { display: flex; align-items: center; gap: var(--b-space-3); }
.b-composer__action { flex: 0 0 auto; }

/* Canvas shells preserve the source product's intentional wide/narrow relationship. */
.b-canvas-shell {
  box-sizing: border-box;
  inline-size: min(var(--b-canvas-inline-wide), 100%);
  min-inline-size: 0;
}

.b-canvas-shell--sources { inline-size: min(var(--b-canvas-inline-sources), 100%); }

@media (max-width: 767px) {
  .b-canvas-shell,
  .b-canvas-shell--sources { inline-size: min(var(--b-canvas-inline-overlay), 100%); }
}

/* Próximas ações sugeridas. */
.b-suggestions { display: flex; flex-direction: column; inline-size: 100%; max-inline-size: 560px; }
.b-suggestions__title {
  color: var(--text-subtle);
  font-size: var(--b-text-sm);
  font-weight: var(--b-weight-medium);
  margin-block-end: var(--b-space-1);
}
.b-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--b-space-4);
  padding: var(--b-space-3) var(--b-space-5);
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--b-text-md);
  text-align: start;
  cursor: pointer;
  transition: background var(--b-motion-base) var(--b-ease-standard);
}
.b-suggestion:hover { background: var(--surface-hover); }
.b-suggestion .b-row-label { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-suggestion .b-icon { --b-icon-size: var(--b-icon-compact); color: var(--text-subtle); flex: 0 0 auto; }
.b-suggestion + .b-suggestion { border-block-start: 1px solid var(--divider); }

/* Artefato de arquivo. */
.b-file-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 56px;
  block-size: 56px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--b-shape-interactive-radius);
  corner-shape: var(--b-corner-squircle);
  background: var(--file-text);
  color: var(--b-white);
  font: inherit;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--b-motion-base) var(--b-ease-standard);
}
.b-file-tile:hover:not(:disabled) { transform: translateY(-1px); }
.b-file-tile:active:not(:disabled) { filter: brightness(.94); transform: none; }
.b-file-tile:disabled { cursor: not-allowed; opacity: .5; }

.b-file-tile .b-icon { --b-icon-size: var(--b-icon-display); }

.b-file-card {
  display: flex;
  font-family: inherit;
  color: inherit;
  text-align: start;
  align-items: center;
  gap: var(--b-space-3);
  inline-size: 100%;
  max-inline-size: 360px;
  padding: var(--b-space-3);
  border: 1px solid var(--border);
  border-radius: var(--b-shape-interactive-radius);
  corner-shape: var(--b-corner-squircle);
  background: var(--bg);
  text-decoration: none;
  cursor: pointer;
}
.b-file-card:hover { background: var(--surface-hover); }
.b-file-card:active,
.b-file-card[aria-current] { background: var(--surface-selected); }
.b-file-card__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  flex: 0 0 auto;
  border-radius: var(--b-radius-xl);
  corner-shape: var(--b-corner-rounded);
  background: var(--file-text);
  color: var(--b-white);
}
.b-file-card__tile .b-icon { --b-icon-size: var(--b-icon-default); }
.b-file-card__info { min-inline-size: 0; display: flex; flex-direction: column; justify-content: center; }
.b-file-card__name {
  font-size: var(--b-text-sm);
  font-weight: var(--b-weight-medium);
  line-height: 18px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.b-file-card__ext { font-size: var(--b-text-xs); line-height: 18px; color: var(--text-muted); }
.b-file-tile--csv  { background: var(--file-csv); }
.b-file-tile--doc  { background: var(--file-doc); }
.b-file-tile--xls  { background: var(--file-xls); }
.b-file-tile--ppt  { background: var(--file-ppt); }
.b-file-tile--txt  { background: var(--file-txt); }
.b-file-tile--json { background: var(--file-json); }
.b-file-tile--xml  { background: var(--file-xml); }
.b-file-tile--zip  { background: var(--file-zip); }
.b-file-tile--code { background: var(--file-code); }
.b-file-tile--html { background: var(--file-html); }
.b-file-tile--png,
.b-file-tile--jpg,
.b-file-tile--svg,
.b-file-tile--image { background: var(--file-image); }
.b-file-tile--audio { background: var(--file-audio); }
.b-file-tile--video { background: var(--file-video); }
.b-file-tile--pdf  { background: var(--file-pdf); }

.b-file-card__tile--pdf { background: var(--file-pdf); }
.b-file-card__tile--doc { background: var(--file-doc); }
.b-file-card__tile--xls { background: var(--file-xls); }
.b-file-card__tile--ppt { background: var(--file-ppt); }
.b-file-card__tile--code { background: var(--file-code); }
.b-file-card__tile--image { background: var(--file-image); }


/* Toolbar de workspace contextual. */
.b-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  block-size: 48px;
  /* 8px de inset visual menos 1px da borda do frame. */
  padding-inline: calc(var(--b-space-4) - 1px);
  border-block-end: 1px solid var(--border);
  background: var(--bg);
}
.b-workspace-toolbar__group { display: flex; min-inline-size: 0; align-items: center; gap: var(--b-space-2); }
.b-workspace-toolbar__group:first-child { flex: 1 1 auto; }
.b-workspace-toolbar__group:last-child { flex: 0 0 auto; }
.b-workspace-toolbar__divider {
  inline-size: 1px;
  block-size: 20px;
  margin-inline: var(--b-space-3);
  background: var(--border);
}
.b-workspace-toolbar__name {
  min-inline-size: 0;
  font-size: var(--b-text-sm);
  font-weight: var(--b-weight-medium);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toolbelt flutuante. */
.b-toolbelt {
  display: inline-flex;
  align-items: center;
  gap: var(--b-space-2);
  padding: var(--b-space-3) var(--b-space-4);
  border: 1px solid var(--border);
  border-radius: var(--b-radius-2xl);
  background: var(--bg);
  box-shadow: var(--elevation-3);
}
.b-tool { flex: 0 0 auto; }
.b-tool[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Seletor de cor do padrão. */
.b-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--b-space-3);
  padding: var(--b-space-5);
  border: 1px solid var(--border);
  border-radius: var(--b-radius-xl);
  background: var(--bg);
  inline-size: max-content;
}
.b-color-swatch {
  inline-size: 22px;
  block-size: 22px;
  border: 2px solid transparent;
  border-radius: var(--b-radius-circle);
  cursor: pointer;
  padding: 0;
}
.b-color-swatch[aria-pressed="true"] { border-color: var(--text); }
.b-color-dot {
  display: inline-block;
  inline-size: 18px;
  block-size: 18px;
  border: 2px solid var(--border);
  border-radius: var(--b-radius-circle);
}

/* Segmented usa diretamente o contrato core `.b-segmented`. */
/* Item de fonte ou referência. */
.b-link-item {
  display: flex;
  flex-direction: column;
  gap: var(--b-space-2);
  padding: var(--b-space-5) var(--b-space-6);
  border-radius: var(--b-shape-interactive-radius);
  corner-shape: var(--b-corner-squircle);
  text-decoration: none;
  transition: background var(--b-motion-fast) var(--b-ease-standard);
}
.b-link-item:hover { background: var(--surface-hover); }
.b-link-item:active,
.b-link-item[aria-current] { background: var(--surface-selected); }
.b-link-item__head {
  display: flex;
  align-items: center;
  gap: var(--b-space-5);
}
.b-link-item__favicon {
  inline-size: 20px;
  block-size: 20px;
  border-radius: var(--b-radius-xs);
  background: var(--surface-2);
  flex: 0 0 auto;
}
.b-link-item__title { font-size: var(--b-text-md); font-weight: var(--b-weight-medium); color: var(--text); }
.b-link-item__snippet {
  font-size: var(--b-text-sm);
  color: var(--text-muted);
  line-height: var(--b-leading-snug);
  padding-inline-start: 30px;
}
