@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/geist-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Identidade Celio: papel quente, tinta quase preta e um único verde de destaque.
   --bg é a superfície (cartões, campos); --page é o fundo da página; --nav é o menu. */
:root {
  --page: #f6f4ef;
  --nav: #f0ede6;
  --bg: #ffffff;
  --sidebar: #faf8f4;
  --ink: #17181b;
  --secondary: #3d3f45;
  --muted: #5e6067;
  --faint: #6c6e75;
  --dim: #b9b4a8;
  --line: #17181b14;
  --control-border: #17181b24;
  --soft: #f3f1ec;
  --active: #e8e4dc;
  --track: #ece9e2;
  --accent: #0b7a5b;
  --accent-ink: #0b5b44;
  --accent-soft: #0b7a5b14;
  --accent-line: #0b7a5b73;
  --warn: #8a5a00;
  --warn-dot: #b57400;
  --warn-soft: #fbf6ea;
  --control-shadow: #2820120a;
  --card-shadow: 0 10px 24px -16px #28201259;
  --drawer-shadow: #2820121f;
  --toast-shadow: #28201240;
  --backdrop: #17181b4d;
  --radius: 10px;
  --radius-card: 18px;
  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  background: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
button svg {
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
.sidebar {
  width: 248px;
  height: 100dvh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--nav);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  align-self: flex-start;
  border-radius: 9px;
}
.brand-mark {
  width: 24px;
  height: 24px;
  stroke: none;
}
.brand-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}
.brand-core {
  fill: var(--accent);
}
.brand-moon {
  fill: var(--ink);
}
.brand-on-dark .brand-ring {
  stroke: #f6f4ef;
}
.brand-on-dark .brand-moon {
  fill: #f6f4ef;
}
.brand-on-dark .brand-core {
  fill: #3dbe94;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
}
.nav-link svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.nav-label {
  flex: 1;
  min-width: 0;
}
.nav-link:hover {
  background: var(--active);
  color: var(--ink);
}
.nav-link.active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 2px #28201214;
}
.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.nav-count:empty {
  display: none;
}
.nav-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
}
.nav-group-head svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.nav-sub {
  margin: 0 0 6px 20px;
  padding-left: 10px;
  border-left: 1px solid #17181b29;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-sub .nav-link {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13.5px;
}
.nav-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--faint);
}
.nav-caption svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.8;
}
.nav-tip {
  position: fixed;
  z-index: 60;
  width: 230px;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--page);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  box-shadow: 0 12px 28px -10px #00000059;
  pointer-events: none;
}
.nav-tip::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--ink);
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-bottom .nav-link {
  min-height: 38px;
  font-size: 13.5px;
}
.sidebar-bottom .nav-link svg {
  width: 16px;
  height: 16px;
}
.market-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 2px;
}
.account-initials {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid #17181b1a;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.account-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.account-text > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-org {
  font-size: 11.5px;
  color: var(--faint);
}
.account-org:empty {
  display: none;
}
.market-account .button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  background: transparent;
  box-shadow: none;
}
.org-switch select {
  width: 100%;
  height: 34px;
  margin: 4px 0;
  padding: 0 10px;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: var(--bg);
  font-size: 13px;
}
.dot {
  width: 7px;
  height: 7px;
  background: var(--dim);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.shell {
  margin-left: 248px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main {
  width: 100%;
  padding: 28px 36px 40px;
  flex: 1;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.page-heading > div:first-child {
  max-width: min(100%, 1100px);
}
.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.page-heading .button,
.home-head .button {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
}
.page-heading .button.primary,
.home-head .button.primary {
  font-weight: 600;
}
.page-heading .button svg,
.home-head .button svg {
  width: 16px;
  height: 16px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.eyebrow svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.8;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 6px;
}
.page-heading p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.button {
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary);
  white-space: nowrap;
  background: var(--bg);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}
.button:hover {
  border-color: #17181b4d;
  color: var(--ink);
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}
.button.primary:hover {
  filter: brightness(1.08);
  color: white;
  border-color: var(--accent);
}
.button.primary:disabled {
  background: var(--dim);
  border-color: var(--dim);
  cursor: not-allowed;
  filter: none;
}
.button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.card {
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--bg);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head.flush {
  padding: 0;
  border: 0;
}
.card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.card-head .count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--faint);
}
.card-head a,
.reuse-note a {
  color: var(--accent);
  font-size: 13px;
}
.card-head a:hover,
.reuse-note a:hover {
  color: var(--accent-ink);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--secondary);
  font-size: 12.5px;
  white-space: nowrap;
}
.pill.outline {
  background: none;
  border: 1px solid #17181b1a;
  font-size: 12px;
  padding: 3px 9px;
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  padding: 2px 8px;
}
.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.muted {
  color: var(--faint);
}
.tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--track);
  flex-wrap: wrap;
}
.tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 2px #2820121f;
}
.tab span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 0 14px;
  gap: 12px;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #17181b1f;
  border-radius: 11px;
  background: var(--bg);
  height: 42px;
  width: 320px;
  max-width: 100%;
  padding: 0 14px;
  color: var(--faint);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.search svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.search input {
  border: 0;
  outline: none !important;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  background: transparent;
  color: var(--ink);
}
.search:focus-within {
  border-color: #0b7a5b80;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search input::placeholder {
  color: #8a8c92;
}
.search kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  color: var(--faint);
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg);
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}
th {
  position: relative;
  font-size: 12px;
  color: var(--faint);
  font-weight: 400;
  height: 42px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
td {
  height: 60px;
  padding: 8px 20px;
  border-bottom: 1px solid #17181b0f;
  color: var(--secondary);
}
tbody tr:last-child td {
  border: 0;
}
tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover {
  background: var(--sidebar);
}
tbody tr[data-edit] {
  cursor: pointer;
}
.row-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.agent-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.row-title {
  border: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  color: var(--ink);
}
.row-title:hover {
  text-decoration: underline;
}
.row-description {
  font-size: 12.5px;
  color: var(--faint);
  max-width: 300px;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: 3px;
}
.cell-empty {
  color: var(--faint);
}
.cell-warn {
  font-size: 12px;
  color: var(--warn);
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.mono.warn {
  color: var(--warn);
}
/* Situação: um ponto colorido e a palavra, sem moldura. */
.status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
}
.status .dot {
  width: 7px;
  height: 7px;
  background: #c9c4b8;
}
.status.ready {
  color: var(--secondary);
}
.status.ready .dot {
  background: var(--accent);
}
.status.error {
  color: var(--warn);
}
.status.error .dot {
  background: var(--warn-dot);
}
.status.paused .dot {
  background: #9a9ca2;
}
@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 #0b7a5b59;
  }
  70% {
    box-shadow: 0 0 0 7px #0b7a5b00;
  }
  100% {
    box-shadow: 0 0 0 0 #0b7a5b00;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .status.live .dot {
    animation: status-pulse 2.2s infinite;
  }
}
.reuse-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.reuse-note svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  stroke-width: 1.7;
  margin-top: 1px;
}
.reuse-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--secondary);
}
.reuse-note strong {
  font-weight: 500;
  color: var(--ink);
}
.reuse-note a {
  font-size: inherit;
}
.number-cell {
  color: var(--muted);
  font-size: 13px;
}
.icon-button {
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--faint);
}
.icon-button:hover {
  background: var(--active);
  color: var(--ink);
}
.icon-button svg {
  width: 14px;
  height: 14px;
}
.empty {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 30px;
  color: var(--faint);
}
.empty-symbol {
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: var(--sidebar);
  color: var(--muted);
}
.empty-symbol svg {
  width: 20px;
  height: 20px;
}
.empty h2 {
  font-size: 14.5px;
  color: var(--secondary);
  font-weight: 500;
  margin: 0 0 5px;
}
.empty p {
  font-size: 13px;
  max-width: 310px;
  margin: 0 0 17px;
  color: var(--faint);
}
.empty-actions {
  display: flex;
  gap: 7px;
}
.error-banner,
.form-error {
  padding: 10px;
  background: var(--sidebar);
  border: 1px solid var(--dim);
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 12px;
}
.settings-panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 20px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.setting-row:last-child {
  border: 0;
}
.setting-row span {
  color: var(--muted);
}
.setting-row a {
  text-decoration: underline;
}
dialog#editor {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--control-border);
  padding: 0;
  width: 540px;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  box-shadow: -10px 0 50px var(--drawer-shadow);
}
dialog::backdrop {
  background: var(--backdrop);
}
#editor-form {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 25px;
  border-bottom: 1px solid var(--line);
}
.drawer-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.4px;
}
.drawer-body {
  overflow: auto;
  padding: 22px 25px;
  flex: 1;
}
.editor-intro {
  margin: 0 0 23px;
  font-size: 14px;
  color: var(--muted);
}
.field {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 16px;
}
.field input,
.field textarea,
.field select,
#config-json {
  display: block;
  width: 100%;
  border: 1px solid #17181b1f;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: #0b7a5b80;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field textarea {
  resize: vertical;
}
.optional {
  font-size: 12px;
  color: var(--faint);
  font-weight: 400;
  margin-left: 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.config-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.text-button {
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
}
.text-button:hover {
  text-decoration: underline;
}
.field-help {
  font-size: 12px;
  color: var(--faint);
  margin: 6px 0 9px;
}
#config-json {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  background: var(--sidebar);
  tab-size: 2;
}
.drawer-footer {
  padding: 16px 25px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}
.danger {
  color: var(--muted);
}
.danger:hover {
  border-color: var(--muted);
}
#delete-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  max-width: 360px;
  width: calc(100% - 32px);
}
#delete-dialog h2 {
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
}
#delete-dialog p {
  font-size: 14px;
  color: var(--muted);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 104px);
  transform: translateX(-50%);
  padding: 10px 17px;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 3px 15px var(--toast-shadow);
  z-index: 10;
}
@media (max-width: 1000px) {
  main {
    padding: 28px 24px 40px;
  }
  .sidebar {
    width: 224px;
  }
  .shell {
    margin-left: 224px;
  }
  .row-description {
    max-width: 190px;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 12px 16px 8px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .nav-caption,
  .nav-group-head {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .nav-group,
  .nav-sub {
    display: contents;
  }
  .nav-link,
  .nav-sub .nav-link {
    font-size: 13px;
    min-height: 34px;
    padding: 0 10px;
    gap: 6px;
  }
  .nav-link svg {
    display: none;
  }
  .nav-label {
    flex: none;
  }
  .nav-count {
    margin-left: 0;
  }
  .shell {
    margin: 0;
    min-height: 0;
  }
  main {
    padding: 24px 16px 40px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 20px;
  }
  .page-heading p {
    font-size: 14px;
  }
  h1 {
    font-size: 28px;
  }
  .search {
    width: 100%;
  }
  .search kbd {
    display: none;
  }
  #toast {
    left: 50%;
    max-width: 90vw;
    white-space: nowrap;
  }
  .drawer-heading {
    padding: 18px 20px;
  }
  .drawer-body {
    padding: 20px;
  }
  .drawer-footer {
    padding: 15px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.form-error {
  white-space: pre-line;
}

.mobile-settings {
  display: none;
}
@media (max-width: 700px) {
  .mobile-settings {
    display: flex;
    margin-left: auto;
  }
  .mobile-settings svg {
    display: block;
  }
}

.creation-note {
  margin: -5px 0 18px;
}
.advanced-config {
  border-top: 1px solid var(--line);
  margin-top: 22px;
}
.advanced-config summary {
  padding: 14px 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.advanced-config summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.advanced-body {
  padding-bottom: 5px;
}

/* Full-page agent workspace; the creation dialog remains a separate flow. */
.canvas-mode {
  overflow: hidden;
}
.canvas-mode > .sidebar,
.canvas-mode > .shell {
  display: none;
}
.agent-workspace {
  position: fixed;
  inset: 0;
  background: var(--page);
  --inspector-space: 0px;
}
.inspector-open .agent-workspace {
  --inspector-space: 400px;
}
.workspace-header {
  position: absolute;
  inset: 0 0 auto;
  height: 54px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 23px;
  background: var(--bg);
  z-index: 2;
}
.workspace-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.workspace-back:hover {
  color: var(--ink);
}
.workspace-back svg {
  width: 14px;
  height: 14px;
}
.workspace-separator {
  color: var(--dim);
}
.workspace-header h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0;
  max-width: 35vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-caption {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.agent-canvas {
  position: absolute;
  inset: 54px var(--inspector-space) 0 0;
  overflow: hidden;
  touch-action: none;
  background-color: var(--page);
  background-image:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--line) 55%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--line) 55%, transparent) 1px,
      transparent 1px
    );
  background-size: 24px 24px;
}
.agent-canvas:focus-visible {
  outline-offset: -3px;
}
.agent-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 248px;
  padding: 17px 17px 0;
  background: var(--bg);
  border: 1px solid var(--control-border);
  border-radius: 12px;
  box-shadow: 0 3px 12px var(--drawer-shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%);
  transform-origin: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.agent-node:hover {
  border-color: var(--dim);
}
.agent-node[aria-expanded="true"] {
  border-color: var(--muted);
  outline: 2px solid var(--line);
  outline-offset: 3px;
}
.node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}
.node-top > svg:first-child {
  width: 26px;
  height: 26px;
  padding: 5px;
  box-sizing: content-box;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.node-type {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
}
.node-top > svg:last-child {
  margin-left: auto;
  color: var(--dim);
  width: 13px;
}
.node-name {
  font-size: 14.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.node-objective {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 17px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.node-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: calc(100% + 34px);
  margin: auto -17px 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.node-footer > span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--secondary);
}
.node-footer svg {
  width: 11px;
  height: 11px;
}
.canvas-tools,
.canvas-controls {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 2px 8px var(--drawer-shadow);
}
.canvas-tools {
  top: 73px;
  left: calc((100% - var(--inspector-space)) / 2);
  transform: translateX(-50%);
}
.canvas-tools .icon-button {
  width: 30px;
  height: 29px;
}
.canvas-tools .active {
  background: var(--active);
  color: var(--ink);
}
.canvas-controls {
  bottom: 19px;
  left: 20px;
}
.canvas-controls .icon-button {
  height: 27px;
  width: 27px;
}
.zoom-level {
  width: 45px;
  border: 0;
  font-size: 12px;
  padding: 4px 0;
  color: var(--muted);
  border-radius: 7px;
}
.zoom-level:hover {
  background: var(--soft);
}
.control-divider {
  width: 1px;
  height: 17px;
  background: var(--line);
  margin: 0 3px;
}
.canvas-help {
  position: absolute;
  right: calc(23px + var(--inspector-space));
  bottom: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.canvas-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  align-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  padding: 25px;
  text-align: center;
}
.canvas-message p {
  flex-basis: 100%;
}
.hand-tool,
.hand-tool .agent-node {
  cursor: grab;
}
.agent-canvas.dragging,
.agent-canvas.dragging .agent-node {
  cursor: grabbing;
}
.canvas-mode dialog#editor {
  top: 54px;
  bottom: 0;
  width: 400px;
  height: calc(100dvh - 54px);
  max-height: calc(100dvh - 54px);
  box-shadow: none;
}
.canvas-mode .drawer-heading {
  padding: 20px;
}
.canvas-mode .drawer-heading h2 {
  font-size: 17px;
}
.canvas-mode .drawer-body {
  padding: 20px;
}
.canvas-mode .drawer-footer {
  padding: 14px 20px;
}
.canvas-mode #toast {
  left: calc((100% - 0px) / 2);
  z-index: 5;
}
@media (max-width: 700px) {
  .workspace-header {
    padding: 0 15px;
    gap: 9px;
  }
  .workspace-header h1 {
    max-width: 40vw;
  }
  .workspace-caption {
    display: none;
  }
  .canvas-help {
    left: 20px;
    right: 20px;
    bottom: 68px;
    text-align: center;
    font-size: 11px;
  }
  .inspector-open .agent-workspace {
    --inspector-space: 0px;
  }
  .canvas-mode dialog#editor {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 72dvh;
    max-height: 72dvh;
    border-top: 1px solid var(--control-border);
    border-left: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -5px 24px var(--drawer-shadow);
  }
  .canvas-controls {
    bottom: 17px;
    left: 15px;
  }
}

/* Reusable components and personality atelier. Color lives in the portrait coins. */
.personality-view .summary,
.personality-view .registry,
.personality-view main > .note {
  display: none;
}
.personality-library-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
#personality-library-count,
#ai-model-count {
  font-size: 13px;
  color: var(--faint);
}
.personality-library-tools > button {
  margin-left: auto;
}
.personality-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 18px;
  align-items: stretch;
}
.personality-library-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-card);
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  min-width: 0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.personality-library-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -26px #28201259;
}
.personality-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.personality-card-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.personality-library-item .avatar-coin {
  padding: 0;
  border: 0;
  box-shadow: none;
  flex: none;
}
.personality-library-item .avatar-coin img {
  width: 46px;
  height: 46px;
}
.personality-library-item .personality-coin-name {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-align: left;
}
.personality-card-summary {
  font-size: 13px;
  color: var(--faint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.personality-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
}
.personality-card-users {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.personality-card-avatars {
  display: flex;
}
.personality-card-avatars .agent-avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border: 2px solid var(--bg);
  margin-left: -6px;
}
.personality-card-avatars .agent-avatar:first-child {
  margin-left: 0;
}
.personality-edit-hint {
  font-size: 13px;
  color: var(--accent);
}
.dashed-tile {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-card);
  border: 1.5px dashed #17181b2e;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  padding: 24px;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
.dashed-tile:hover {
  border-color: #0b7a5b80;
  color: var(--accent);
}
.dashed-tile strong {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.dashed-tile > span:last-child {
  max-width: 230px;
}
.dashed-tile-plus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  border: 1px solid #17181b1a;
}
.dashed-tile-plus svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.avatar-coin {
  display: inline-flex;
  position: relative;
  border-radius: 50%;
  padding: 4px;
  border: 1px solid var(--control-border);
  background: var(--bg);
  box-shadow:
    0 3px 0 var(--line),
    0 5px 12px var(--drawer-shadow);
}
.avatar-coin img {
  display: block;
  width: 78px;
  height: 78px;
  border-radius: 50%;
}
.personality-coin-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-top: 11px;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
}
.personality-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 42px 20px 50px;
  border: 1px dashed var(--control-border);
  border-radius: 11px;
}
.personality-empty h3 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.25px;
  margin: 14px 0 7px;
}
.personality-empty p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}
.empty-portrait-row {
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-portrait-row img {
  width: 65px;
  height: 65px;
  margin: 0 -3px;
  border: 3px solid var(--bg);
  border-radius: 50%;
}
.empty-portrait-row img:nth-child(2) {
  width: 78px;
  height: 78px;
  margin-top: -8px;
}
.personality-starters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 21px;
}
.personality-starters button {
  font-size: 12px;
  padding: 7px 10px;
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
}
.personality-starters button:hover {
  border-color: var(--dim);
  color: var(--ink);
}
#personality-editor {
  width: 860px;
  max-width: calc(100% - 36px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 70px var(--toast-shadow);
}
#personality-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 42px);
}
.personality-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.personality-dialog-header h2 {
  font-size: 19px;
  margin: 2px 0 0;
  font-weight: 500;
  letter-spacing: -0.4px;
}
.personality-dialog-body {
  display: grid;
  grid-template-columns: 254px 1fr;
  overflow: auto;
  min-height: 0;
}
.personality-dressing-room {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 28px 23px 23px;
  text-align: center;
}
.personality-preview-coin {
  display: inline-flex;
  padding: 6px;
  border-radius: 50%;
  border: 1px solid var(--control-border);
  background: var(--bg);
  box-shadow:
    0 5px 0 var(--line),
    0 8px 18px var(--drawer-shadow);
  transform: rotate(-5deg);
}
.personality-preview-coin img {
  width: 112px;
  height: 112px;
  display: block;
  border-radius: 50%;
}
.personality-dressing-room h3 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin: 21px 0 5px;
  overflow-wrap: anywhere;
}
.personality-dressing-room > p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}
.personality-preview-traits {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 13px;
  min-height: 45px;
}
.personality-preview-traits span {
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 16px;
  padding: 3px 7px;
  align-self: start;
  animation: personality-pop 0.18s ease-out;
}
@keyframes personality-pop {
  from {
    transform: scale(0.85);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.avatar-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin: 24px 0 10px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.avatar-heading > span:last-child {
  font-size: 11px;
  color: var(--muted);
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.avatar-picker button {
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 50%;
  line-height: 0;
  background: var(--bg);
}
.avatar-picker button img {
  width: 100%;
  border-radius: 50%;
}
.avatar-picker button:hover {
  transform: translateY(-2px);
}
.avatar-picker button[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--bg);
}
.shuffle-personality {
  width: 100%;
  margin-top: 16px;
  background: var(--bg);
  font-size: 12px;
}
.personality-fields {
  padding: 24px;
  min-width: 0;
}
.personality-field-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 8px;
}
.personality-field-heading > span:last-child {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.markdown-editor {
  border: 1px solid var(--control-border);
  border-radius: 10px;
  overflow: hidden;
}
.markdown-tabs {
  display: flex;
  align-items: center;
  padding: 5px;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
}
.markdown-tabs button {
  border: 0;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
}
.markdown-tabs button:hover,
.markdown-tabs button.active {
  color: var(--ink);
  background: var(--bg);
}
.markdown-formatting {
  display: flex;
  margin-left: auto;
}
.markdown-formatting button {
  padding: 4px 6px;
}
#personality-description {
  display: block;
  width: 100%;
  min-height: 190px;
  max-height: 360px;
  border: 0;
  padding: 12px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  background: var(--bg);
}
#personality-description::placeholder {
  color: var(--faint);
}
.markdown-preview {
  min-height: 190px;
  max-height: 360px;
  overflow: auto;
  padding: 12px 15px;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  margin: 8px 0;
}
.markdown-preview p {
  margin: 0 0 9px;
}
.markdown-preview ul,
.markdown-preview ol {
  padding-left: 20px;
}
.markdown-preview a {
  text-decoration: underline;
}
.markdown-preview blockquote {
  border-left: 2px solid var(--line);
  padding-left: 10px;
  margin-left: 0;
  color: var(--muted);
}
.markdown-preview pre {
  padding: 8px;
  background: var(--soft);
  border-radius: 7px;
  white-space: pre-wrap;
}
.markdown-placeholder {
  color: var(--muted);
}
.traits-heading {
  margin-top: 22px;
  margin-bottom: 5px;
}
.personality-fields .field-help {
  margin-bottom: 12px;
}
.trait-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.trait-picker button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--control-border);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 12px;
  background: var(--bg);
  color: var(--muted);
}
.trait-picker button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.trait-picker button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--muted);
}
.trait-plus {
  width: 9px;
  font-size: 13px;
}
#personality-form-error {
  margin-top: 15px;
  margin-bottom: 0;
}
.personality-dialog-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.personality-dialog-footer > span {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}
/* Ações do cabeçalho do canvas: um único formato, o do botão Componentes. */
.workspace-header .button {
  height: 30px;
  padding: 0 11px;
  gap: 6px;
  font-size: 12px;
}
.workspace-header .button svg {
  width: 13px;
  height: 13px;
}
.workspace-header .button[aria-expanded="true"] {
  background: var(--active);
  border-color: transparent;
  color: var(--ink);
}
.workspace-components-button {
  margin-left: auto;
}
.agent-workspace {
  --component-space: 0px;
}
.components-open .agent-workspace {
  --component-space: 300px;
}
.agent-canvas {
  left: var(--component-space);
}
.canvas-tools {
  left: calc((100% + var(--component-space) - var(--inspector-space)) / 2);
}
.canvas-controls {
  left: calc(20px + var(--component-space));
}
.agent-components {
  position: absolute;
  left: 16px;
  top: 72px;
  bottom: 78px;
  width: 272px;
  padding: 16px 14px 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 3px 15px var(--drawer-shadow);
  overflow: auto;
}
.component-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.component-tray-header h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
.component-tray-header .eyebrow {
  font-size: 10.5px;
}
.component-tray-help {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 12px 0;
}
/* Itens do painel: a mesma linha compacta para todos os tipos de componente. */
.personality-selection {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.personality-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: none;
  text-align: left;
}
/* Skills e conectores: o toque vertical rola a lista (como antes de usarem esta
   linha); o arrasto horizontal até o agente segue valendo. */
.agent-components .personality-option[data-resource-select] {
  touch-action: pan-y;
}
.personality-option:hover:not(:disabled) {
  background: var(--soft);
}
.personality-option .avatar-coin {
  grid-row: 1 / span 2;
  padding: 0;
  box-shadow: none;
}
.personality-option .avatar-coin img {
  width: 32px;
  height: 32px;
  filter: grayscale(1);
  opacity: 0.6;
}
.component-icon-option .avatar-coin img {
  padding: 7px;
}
.personality-option .personality-coin-name,
.personality-use-state {
  display: block;
  margin: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.personality-option .personality-coin-name {
  align-self: end;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}
.personality-use-state {
  align-self: start;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}
.personality-option.selected {
  background: var(--accent-soft);
}
.personality-option.selected .avatar-coin {
  border-color: var(--accent-line);
}
.personality-option.selected .avatar-coin img {
  filter: none;
  opacity: 1;
}
.personality-option.selected .personality-use-state {
  color: var(--accent-ink);
}
.coin-check {
  display: none;
  position: absolute;
  right: -2px;
  bottom: 0;
  width: 15px;
  height: 15px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  color: var(--bg);
  font-size: 9px;
  line-height: 11px;
  text-align: center;
}
.selected .coin-check {
  display: block;
}
.agent-components .field-help {
  margin: 10px 0 0;
  font-size: 11px;
}
/* Vazio não ocupa espaço, mas segue na árvore: é uma região role="status". */
.agent-components .field-help:empty {
  margin: 0;
}
.component-selection-empty {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  padding: 18px 10px;
  background: var(--sidebar);
  border-radius: 10px;
}
.component-tray-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}
.component-tray-footer .button {
  height: 32px;
  font-size: 12px;
}
.component-tray-footer a {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.node-personalities {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -3px 0 14px;
  font-size: 11px;
  color: var(--muted);
}
.node-personality-stack {
  display: flex;
  padding-left: 0;
}
.node-personality-stack img {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -6px;
}
.node-personality-stack img:first-child {
  margin-left: 0;
}
.avatar-coin,
.avatar-picker button,
.trait-picker button {
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}
@media (max-width: 900px) {
  .personality-dialog-body {
    grid-template-columns: 220px 1fr;
  }
  .personality-dressing-room {
    padding: 24px 18px;
  }
}
@media (max-width: 700px) {
  .personality-intro {
    padding: 20px 0;
    gap: 10px;
  }
  .personality-intro h2 {
    font-size: 18px;
  }
  .intro-coins {
    display: none;
  }
  .personality-library-tools {
    flex-wrap: wrap;
    gap: 10px;
  }
  .personality-library-tools .search {
    max-width: none;
    width: 100%;
  }
  #personality-library-count {
    margin-right: auto;
  }
  .personality-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .personality-starters {
    gap: 7px;
  }
  .personality-starters button {
    font-size: 11px;
  }
  #personality-editor {
    max-width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }
  #personality-form {
    max-height: calc(100dvh - 18px);
  }
  .personality-dialog-header {
    padding: 16px;
  }
  .personality-dialog-header h2 {
    font-size: 18px;
  }
  .personality-dialog-body {
    display: block;
  }
  .personality-dressing-room {
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .personality-preview-coin img {
    width: 87px;
    height: 87px;
  }
  .personality-dressing-room h3 {
    margin-top: 16px;
  }
  .personality-preview-traits {
    min-height: 0;
  }
  .avatar-heading {
    margin-top: 18px;
  }
  .avatar-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }
  .shuffle-personality {
    width: auto;
  }
  .personality-fields {
    padding: 20px;
  }
  .personality-dialog-footer {
    padding: 13px 15px;
  }
  .personality-dialog-footer > span {
    display: none;
  }
  .components-open .agent-workspace {
    --component-space: 0px;
  }
  .agent-components {
    left: 15px;
    right: 15px;
    width: auto;
    bottom: auto;
    max-height: calc(100dvh - 155px);
    top: 70px;
    padding: 16px;
    z-index: 3;
  }
  .canvas-controls {
    left: 15px;
  }
  .workspace-header .button {
    padding: 0 7px;
    font-size: 11px;
  }
  .workspace-header h1 {
    max-width: 24vw;
  }
  .workspace-back {
    font-size: 12px;
  }
  .workspace-header {
    gap: 7px;
  }
  .workspace-header .status {
    font-size: 10.5px;
    padding: 2px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-coin,
  .avatar-picker button,
  .trait-picker button,
  .components-chevron {
    transition: none;
  }
  .personality-preview-traits span {
    animation: none;
  }
}

/* Personality wiring shares the canvas coordinate system. */
.personality-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.personality-link {
  stroke: var(--dim);
  stroke-width: 1.5;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.personality-links circle {
  fill: var(--bg);
  stroke: var(--muted);
  stroke-width: 1.3;
}
.personality-nodes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.personality-canvas-node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 102px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}
.personality-canvas-node .avatar-coin {
  padding: 3px;
}
.personality-canvas-node .avatar-coin img {
  width: 56px;
  height: 56px;
}
.linked-personality-name {
  display: block;
  max-width: 110px;
  font-size: 11.5px;
  line-height: 15px;
  font-weight: 500;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bg);
  border-radius: 5px;
  padding: 0 3px;
}
.linked-personality-type {
  font-size: 10px;
  line-height: 13px;
  color: var(--muted);
  background: var(--bg);
  margin-top: 2px;
  border-radius: 5px;
  padding: 0 3px;
}
.personality-canvas-node:hover .avatar-coin {
  border-color: var(--muted);
}
.agent-canvas.dragging .personality-canvas-node,
.hand-tool .personality-canvas-node {
  cursor: grabbing;
}
.personality-option {
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.personality-option img,
.personality-canvas-node img {
  -webkit-user-drag: none;
}
.personality-drag-active,
.personality-drag-active * {
  cursor: grabbing !important;
  user-select: none !important;
}
.personality-drag-active .agent-components {
  pointer-events: none;
}
.personality-drag-source {
  opacity: 0.35;
}
.personality-drag-ghost {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translate(-50%, -65%);
  max-width: 140px;
}
.personality-drag-ghost img {
  width: 64px;
  height: 64px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 5px 20px var(--toast-shadow);
  transform: rotate(-8deg);
}
.personality-drag-ghost span {
  font-size: 12px;
  background: var(--accent);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 16px;
  margin-top: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 140px;
}
.personality-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 7px;
  box-shadow: 0 0 0 10px var(--accent-soft);
}
.personality-drop-target::after {
  content: "Solte para conectar";
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--bg);
  background: var(--accent);
  border-radius: 16px;
  padding: 4px 10px;
  white-space: nowrap;
}
.agent-node[aria-busy="true"] {
  border-style: dashed;
}
@media (max-width: 700px) {
  .personality-drag-active .agent-components {
    opacity: 0.12;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .personality-canvas-node {
    animation: connected-personality 0.2s ease-out;
  }
  @keyframes connected-personality {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}

.canvas-marquee {
  position: absolute;
  z-index: 4;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 3px;
  pointer-events: none;
}
.agent-node.canvas-selected {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.personality-canvas-node.canvas-selected .avatar-coin {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.personality-link.canvas-selected-link {
  stroke: var(--accent);
  stroke-width: 2;
}
.canvas-selection-actions {
  position: absolute;
  top: 122px;
  left: calc((100% + var(--component-space) - var(--inspector-space)) / 2);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 2px 8px var(--drawer-shadow);
  white-space: nowrap;
}
#canvas-selection-count {
  font-size: 12px;
  color: var(--muted);
}
.canvas-selection-actions .button {
  height: 27px;
  font-size: 12px;
}
#canvas-selection-error {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  white-space: normal;
  margin: 0;
}
@media (max-width: 700px) {
  .canvas-selection-actions {
    max-width: calc(100% - 24px);
    gap: 6px;
    padding: 5px 6px 5px 9px;
  }
  #canvas-selection-count {
    font-size: 11px;
  }
  .canvas-selection-actions .button {
    font-size: 11px;
    padding: 0 7px;
  }
}

.canvas-context-menu {
  position: fixed;
  z-index: 10;
  min-width: 180px;
  padding: 5px;
  background: var(--bg);
  border: 1px solid var(--control-border);
  border-radius: 10px;
  box-shadow: 0 6px 24px var(--toast-shadow);
}
.canvas-context-menu button {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  text-align: left;
  font-size: 13px;
}
.canvas-context-menu button:hover:not(:disabled),
.canvas-context-menu button:focus-visible {
  background: var(--soft);
  outline-offset: -1px;
}
.canvas-context-menu button:disabled {
  cursor: default;
  opacity: 0.45;
}
.canvas-context-menu button span {
  font-size: 12px;
  color: var(--muted);
}

/* Biblioteca: capas compactas, sumário lateral e página de leitura. */
.book-view .summary,
.book-view .registry,
.book-view main > .note {
  display: none;
}
.book-open .page-heading {
  display: none;
}
.book-open main {
  padding-top: 20px;
}
@media (min-width: 701px) {
  .book-open .book-workspace {
    min-height: max(590px, calc(100dvh - 185px));
  }
}
.book-library {
  min-width: 0;
}
/* Base de conhecimento: formas de adicionar e a lista de documentos. */
.doc-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.doc-option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
button.doc-option:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.doc-option .channel-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.doc-option .channel-icon svg {
  width: 18px;
  height: 18px;
}
.doc-option > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.doc-option strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 500;
}
.doc-option strong + span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--faint);
}
.doc-option.is-soon .channel-icon {
  background: var(--soft);
  color: var(--faint);
}
.doc-option.is-soon strong {
  color: var(--muted);
}
.doc-soon {
  font-size: 11.5px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 6px;
  background: #efece5;
  color: var(--muted);
}
.doc-list {
  overflow: hidden;
}
.doc-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.doc-tools .search {
  width: 240px;
  height: 36px;
}
.doc-scroll {
  overflow-x: auto;
}
.doc-table {
  min-width: 640px;
}
.doc-row {
  display: grid;
  grid-template-columns: 2.6fr 1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #17181b0f;
  font-size: 13px;
  color: var(--secondary);
  transition: background 0.15s ease;
}
a.doc-row:hover {
  background: var(--sidebar);
}
#book-shelf > .doc-row:last-child {
  border-bottom: 0;
}
.doc-head-row {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--faint);
}
.doc-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.doc-thumb {
  width: 36px;
  height: 44px;
  flex: none;
  border-radius: 6px;
  background: var(--page);
  border: 1px solid #17181b1a;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
}
.doc-thumb i {
  height: 2px;
  border-radius: 2px;
  background: #c9c4b8;
}
.doc-thumb i:first-child {
  height: 3px;
  width: 70%;
  background: var(--accent);
}
.doc-thumb i:nth-child(3) {
  width: 80%;
}
.doc-thumb i:nth-child(4) {
  width: 60%;
}
.doc-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.doc-text strong {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}
.doc-text span {
  font-size: 12.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-row .mono {
  font-size: 12.5px;
}
.doc-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}
.doc-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.doc-empty p {
  margin: 0 0 16px;
}
@media (max-width: 700px) {
  .doc-list .card-head {
    flex-wrap: wrap;
  }
  .doc-tools,
  .doc-tools .search {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .doc-option {
    transition: none;
  }
}
.book-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
#book-save-state {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.book-workspace {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-height: 590px;
}
.book-contents {
  padding: 24px 14px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.book-contents-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}
.book-contents h2 {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  margin: 16px 0 8px;
  overflow-wrap: anywhere;
}
.book-contents > p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  overflow-wrap: anywhere;
}
.book-contents-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.book-contents > .book-reorder-help {
  font-size: 11px;
  margin: 5px 0 14px;
}
#book-chapters {
  max-height: 410px;
  overflow-y: auto;
}
.book-chapter-row {
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  margin-bottom: 4px;
  padding-right: 3px;
}
.book-chapter-row:hover {
  background: var(--soft);
}
.book-chapter-row.active {
  background: var(--active);
}
.book-drag {
  display: flex;
  padding: 10px 1px;
  color: var(--dim);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.book-drag svg {
  width: 13px;
}
.book-chapter-row [role="tab"] {
  display: flex;
  text-align: left;
  gap: 8px;
  align-items: baseline;
  border: 0;
  padding: 10px 3px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.chapter-number {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.chapter-movers {
  display: flex;
  flex-direction: column;
}
.chapter-movers .icon-button {
  width: 20px;
  height: 19px;
  padding: 0;
  font-size: 12px;
}
.chapter-movers button:disabled {
  cursor: default;
  opacity: 0.25;
}
.book-chapter-row.drop-target {
  border-color: var(--ink);
  border-top-width: 2px;
}
.book-chapter-row.is-dragging {
  opacity: 0.45;
}
.book-add-chapter {
  margin-top: 12px;
  justify-content: center;
  border-style: dashed;
  font-size: 13px;
}
.book-delete-link {
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  align-self: flex-start;
}
.book-contents > .book-delete-link {
  margin-top: auto;
  padding-top: 30px;
}
.book-page {
  min-width: 0;
  padding: 25px 36px 20px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.book-page-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.book-edit-link {
  font-size: 12px;
  border-color: transparent;
  padding: 4px 5px;
}
.book-edit-link svg {
  width: 13px;
  height: 13px;
}
.book-edit-link kbd {
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 3px;
  letter-spacing: 0;
}
.book-chapter-title {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
  margin: 30px 0 22px;
  overflow-wrap: anywhere;
}
.book-title-input {
  width: 100%;
  min-width: 0;
  margin: 24px 0 16px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 24px;
  background: var(--bg);
}
.book-reading.markdown-preview {
  padding: 0;
  font-size: 14.5px;
  line-height: 1.85;
  max-height: none;
  min-height: 280px;
  overflow: visible;
}
.book-reading h1,
.book-reading h2,
.book-reading h3 {
  font-size: 18px;
  line-height: 1.45;
  margin: 22px 0 12px;
}
.book-reading p {
  margin-bottom: 14px;
}
.book-reading hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.book-reading code {
  font-size: 13px;
  background: var(--soft);
  padding: 2px 3px;
}
.book-blank-page {
  padding: 45px 0;
  color: var(--muted);
}
.book-markdown-editor {
  margin-top: 4px;
}
.book-markdown-editor .markdown-tabs > span {
  padding-left: 8px;
  font-size: 12px;
  color: var(--muted);
}
#chapter-content {
  display: block;
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 0;
  padding: 16px;
  background: var(--bg);
  font:
    14px/1.85 ui-monospace,
    monospace;
}
.book-writing-help {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  padding: 8px 0;
}
.book-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 28px;
  font-size: 12px;
  color: var(--muted);
}
.book-page-footer .button {
  font-size: 12px;
}
.book-page-footer button:disabled {
  cursor: default;
}
#book-dialog {
  width: min(460px, calc(100% - 32px));
  border: 1px solid var(--control-border);
  border-radius: 12px;
  padding: 26px;
}
#book-dialog::backdrop {
  background: var(--backdrop);
}
#book-dialog fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.book-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.book-dialog-header h2 {
  margin: 4px 0 14px;
  font-size: 22px;
  font-weight: 500;
}
#book-dialog label {
  display: block;
  font-size: 14px;
  margin-top: 18px;
}
#book-dialog input,
#book-dialog textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 9px 10px;
  font-size: 14px;
}
#book-dialog textarea {
  resize: vertical;
}
.book-dialog-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}
@media (max-width: 1100px) {
  .book-workspace {
    grid-template-columns: 215px minmax(0, 1fr);
  }
  .book-page {
    padding: 22px;
  }
  .book-edit-link kbd {
    display: none;
  }
}
@media (max-width: 700px) {
  .book-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .book-contents {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 14px;
  }
  .book-contents h2 {
    margin-top: 10px;
  }
  .book-contents > p {
    margin-bottom: 12px;
  }
  #book-chapters {
    max-height: 200px;
  }
  .book-contents > .book-delete-link {
    padding-top: 12px;
  }
  .book-page {
    padding: 22px 18px;
    min-height: 440px;
  }
  .book-topbar {
    gap: 6px;
  }
  #book-save-state {
    order: 4;
    width: 100%;
    margin: 2px 0 0;
  }
  .book-topbar [data-book-action="details"] {
    margin-left: auto;
  }
  .book-topbar .button {
    font-size: 12px;
  }
  .book-chapter-title,
  .book-title-input {
    font-size: 21px;
  }
  .book-page-meta {
    font-size: 10.5px;
  }
}

/* Revisão editorial: uma pequena oficina de palavras. */
.book-ai-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.markdown-tabs .book-ai-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 0;
  border: 1px solid var(--control-border);
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}
.book-ai-button svg {
  width: 13px;
  height: 13px;
}
.book-ai-button:not(:disabled):hover svg {
  animation: format-twinkle 0.8s ease-in-out;
}
.book-ai-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(
    110deg,
    transparent 20%,
    var(--soft) 50%,
    transparent 80%
  );
  pointer-events: none;
}
.book-ai-button:not(:disabled):hover::after {
  animation: format-sweep 0.8s ease;
}
.book-ai-button:disabled {
  cursor: default;
}
.book-markdown-editor .markdown-formatting {
  margin-left: 4px;
}
#book-format-dialog {
  width: min(940px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--control-border);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 18px 70px var(--drawer-shadow);
}
#book-format-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
#book-format-dialog[open] {
  animation: format-appear 0.24s ease-out;
}
.book-format-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 25px 28px 20px;
  border-bottom: 1px solid var(--line);
}
.book-format-heading > .icon-button {
  margin-left: auto;
  flex-shrink: 0;
}
.book-format-heading h2 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  margin: 5px 0 0;
}
.book-format-heading .eyebrow {
  font-size: 10.5px;
}
.format-magic-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sidebar);
  flex-shrink: 0;
}
.format-magic-icon svg {
  width: 22px;
  height: 22px;
}
.is-formatting .format-magic-icon svg {
  animation: format-twinkle 2.4s ease-in-out infinite;
}
#book-format-body {
  padding: 22px 28px;
}
.book-format-working {
  min-height: 310px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.format-orbit {
  position: relative;
  height: 46px;
  width: 86px;
  margin: 8px 0 18px;
  color: var(--secondary);
}
.format-orbit span {
  position: absolute;
  font-size: 27px;
  animation: format-float 2.5s ease-in-out infinite;
}
.format-orbit span:nth-child(1) {
  left: 30px;
  top: 0;
}
.format-orbit span:nth-child(2) {
  left: 8px;
  top: 24px;
  font-size: 16px;
  animation-delay: -0.8s;
}
.format-orbit span:nth-child(3) {
  right: 3px;
  top: 19px;
  font-size: 19px;
  animation-delay: -1.6s;
}
.format-shimmer {
  font-size: 19px;
  margin: 0 0 7px;
  font-weight: 500;
  background: linear-gradient(
    100deg,
    var(--ink) 30%,
    var(--dim) 50%,
    var(--ink) 70%
  );
  background-size: 240% 100%;
  color: transparent;
  background-clip: text;
  animation: format-shimmer 2.8s linear infinite;
}
.book-format-working .field-help {
  max-width: 300px;
  margin: 0;
}
.format-paper {
  width: min(270px, 85%);
  padding: 19px 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin: 26px 0 4px;
  transform: rotate(-2deg);
  background: var(--sidebar);
}
.format-paper i {
  display: block;
  height: 5px;
  width: 100%;
  background: var(--line);
  border-radius: 3px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.format-paper i:first-child {
  width: 55%;
  height: 7px;
  margin-bottom: 16px;
}
.format-paper i:last-child {
  width: 70%;
  margin: 0;
}
.format-paper i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--bg), transparent);
  animation: format-sweep 2s ease-in-out infinite;
}
.format-paper i:nth-child(2)::after {
  animation-delay: 0.15s;
}
.format-paper i:nth-child(3)::after {
  animation-delay: 0.3s;
}
.format-paper i:nth-child(4)::after {
  animation-delay: 0.45s;
}
.book-format-summary {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
}
.book-format-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.book-format-comparison section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.book-format-comparison > section > h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
}
.book-format-comparison > section > h3 > span {
  font-size: 10px;
  margin-left: auto;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.book-format-comparison > section > h3 svg {
  width: 13px;
  height: 13px;
}
.book-format-comparison pre,
.book-format-comparison .markdown-preview {
  height: min(42dvh, 400px);
  min-height: 220px;
  max-height: none;
  overflow: auto;
  margin: 0;
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
}
.book-format-comparison pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font);
  color: var(--muted);
}
.book-format-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: var(--sidebar);
}
.book-format-footer > span {
  font-size: 12px;
  color: var(--muted);
  margin-right: auto;
}
.book-format-footer .button {
  font-size: 13px;
}
.book-format-error {
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.book-format-error > span {
  font-size: 32px;
  color: var(--muted);
}
.book-format-error p {
  max-width: 430px;
  font-size: 14.5px;
  margin: 15px 0 22px;
}
.book-format-undo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--sidebar);
  border-radius: var(--radius);
  margin: 10px 0;
  font-size: 12px;
  animation: format-appear 0.3s ease-out;
}
.book-format-undo svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.book-format-undo button {
  margin-left: auto;
  font-size: 12px;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.format-applied {
  animation: format-ink 0.9s ease-out;
}
@keyframes format-twinkle {
  0%,
  100% {
    transform: rotate(0) scale(1);
  }
  50% {
    transform: rotate(25deg) scale(1.18);
  }
}
@keyframes format-float {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-7px) rotate(12deg);
    opacity: 1;
  }
}
@keyframes format-sweep {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}
@keyframes format-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -140% 0;
  }
}
@keyframes format-appear {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes format-ink {
  0% {
    box-shadow: 0 0 0 4px var(--line);
    background: var(--soft);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    background: var(--bg);
  }
}
@media (max-width: 700px) {
  .book-markdown-editor .markdown-tabs {
    flex-wrap: wrap;
  }
  .book-markdown-editor .markdown-formatting {
    margin-left: auto;
  }
  .book-format-comparison {
    grid-template-columns: minmax(0, 1fr);
  }
  .book-format-heading {
    padding: 18px 16px;
    gap: 10px;
  }
  .book-format-heading h2 {
    font-size: 18px;
  }
  .format-magic-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
  }
  #book-format-body {
    padding: 18px 16px;
  }
  .book-format-footer {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .book-format-footer > span {
    width: 100%;
    margin-bottom: 4px;
  }
  .book-format-footer > button:first-of-type {
    margin-left: auto;
  }
  .format-shimmer {
    font-size: 18px;
  }
  .book-format-comparison pre,
  .book-format-comparison .markdown-preview {
    height: 220px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #book-format-dialog[open],
  .format-magic-icon svg,
  .format-orbit span,
  .format-shimmer,
  .format-paper i::after,
  .book-ai-button svg,
  .book-ai-button::after,
  .format-applied,
  .book-format-undo {
    animation: none !important;
  }
  .format-shimmer {
    background: none;
    color: var(--ink);
  }
  #book-format-dialog::backdrop {
    backdrop-filter: none;
  }
}

/* Live Testing follows the compact monochrome workspace. */
#live-testing-dialog {
  width: min(1080px, calc(100vw - 40px));
  max-width: none;
  height: min(760px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  color: var(--ink);
  background: var(--bg);
}
.live-testing-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.live-testing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.live-testing-header > div {
  margin-right: auto;
}
.live-testing-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 500;
}
.live-testing-shell .eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.live-testing-body {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.live-testing-settings {
  padding: 22px 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.live-testing-settings h3 {
  margin: 5px 0 8px;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.live-testing-settings p,
.live-testing-settings small {
  font-size: 13px;
  color: var(--muted);
}
.live-testing-settings .field {
  margin: 22px 0 0;
}
.live-testing-settings select {
  width: 100%;
  border: 1px solid var(--control-border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 7px;
}
.live-testing-settings textarea {
  font-family: monospace;
  font-size: 13px;
}
#live-testing-summary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.live-testing-settings details {
  margin-top: 22px;
  font-size: 13px;
}
.live-testing-settings .live-testing-note {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.live-testing-shell pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-family: monospace;
  max-height: 260px;
  overflow-y: auto;
}
.live-testing-conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
#live-testing-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
}
.live-testing-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
  max-width: 350px;
  margin: auto;
  color: var(--muted);
}
.live-testing-empty-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 22px;
  color: var(--ink);
}
.live-testing-empty h3 {
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  margin: 18px 0 0;
}
.live-testing-empty p {
  font-size: 14px;
}
.live-testing-empty > span:last-child {
  font-size: 12px;
}
.live-testing-message {
  width: fit-content;
  max-width: 92%;
  margin: 0 0 22px;
  overflow-wrap: anywhere;
}
.live-testing-message > strong {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.live-testing-message > div {
  white-space: pre-wrap;
  line-height: 1.7;
}
.live-testing-message.user {
  margin-left: auto;
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 14px;
}
.live-testing-message details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.live-testing-message details pre {
  background: var(--sidebar);
  padding: 10px;
  border: 1px solid var(--line);
}
#live-testing-status {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding: 0 24px 10px;
  min-height: 25px;
}
.live-testing-error {
  margin: 0 20px 10px;
  border: 1px solid var(--control-border);
  border-left: 3px solid var(--ink);
  padding: 10px 12px;
  font-size: 13px;
}
#live-testing-form {
  margin: 0 20px 20px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  padding: 12px;
}
#live-testing-input {
  width: 100%;
  border: 0;
  background: transparent;
  resize: vertical;
  min-height: 64px;
  max-height: 160px;
  font-size: 14px;
}
.live-testing-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.live-testing-composer-footer > span {
  font-size: 11px;
  color: var(--muted);
}
.live-testing-composer-footer .button {
  font-size: 13px;
}
@media (max-width: 640px) {
  #live-testing-dialog {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  .live-testing-header {
    padding: 12px;
  }
  .live-testing-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .live-testing-settings {
    max-height: 175px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .live-testing-settings .field {
    margin-top: 12px;
  }
  #live-testing-messages {
    padding: 16px;
  }
  #live-testing-form {
    margin: 0 12px 12px;
  }
  .live-testing-composer-footer > span {
    max-width: 160px;
  }
  .workspace-header {
    gap: 7px;
    padding: 0 10px;
  }
  .workspace-header h1 {
    min-width: 0;
    flex: 1;
    max-width: none;
  }
  .workspace-back span {
    display: none;
  }
  #live-testing-toggle {
    padding: 0 8px;
  }
  .workspace-components-button {
    padding: 0 8px;
  }
}

/* Fontes locais do agente: biblioteca por consulta, com cópias explícitas. */
.component-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-top: 12px;
  padding: 3px;
  border-radius: 11px;
  background: var(--track);
}
.component-category-tabs button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
}
.component-category-tabs button svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.component-category-tabs button span {
  min-width: 0;
  white-space: nowrap;
}
.component-category-tabs button:hover {
  color: var(--ink);
}
.component-category-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: var(--bg);
  box-shadow: 0 1px 2px #2820121f;
  font-weight: 500;
}
.component-search {
  width: 100%;
  height: 32px;
  gap: 7px;
  padding: 0 10px;
  margin-bottom: 8px;
  border-radius: 9px;
}
.component-search svg {
  width: 13px;
  height: 13px;
}
.component-search input {
  min-width: 0;
  font-size: 12.5px;
}
.agent-book-item {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.agent-book-item .personality-option {
  flex: 1;
}
.agent-book-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.agent-book-actions button {
  font-size: 10.5px;
  color: var(--muted);
  padding: 2px 4px;
  min-height: 20px;
  max-width: 100%;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.agent-book-actions button:hover {
  color: var(--ink);
}
.node-books {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0;
}
.node-books:empty {
  display: none;
}
#agent-source-dialog {
  width: min(980px, calc(100% - 30px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 12px;
}
#agent-source-dialog::backdrop {
  background: var(--backdrop);
}
.agent-source-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 24px 15px;
  border-bottom: 1px solid var(--line);
}
.agent-source-header h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 5px 0 8px;
  overflow-wrap: anywhere;
}
.agent-source-header > div {
  min-width: 0;
}
.agent-source-header > button {
  margin-left: auto;
  flex-shrink: 0;
}
.agent-source-header p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.agent-source-search {
  display: flex;
  padding: 14px 24px;
  gap: 8px;
}
.agent-source-search .search {
  flex: 1;
  min-width: 0;
}
.agent-source-search input {
  min-width: 0;
}
.agent-source-search .button {
  font-size: 13px;
}
#agent-source-error {
  margin: 0 24px 12px;
}
.agent-source-results {
  padding: 0 24px 16px;
  max-height: 200px;
  overflow: auto;
}
.agent-source-results button {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  margin-bottom: 6px;
  padding: 10px 12px;
}
.agent-source-results strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.agent-source-results span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.agent-source-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  min-height: 400px;
}
#agent-source-toc {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 15px 12px;
  overflow: auto;
  max-height: 54dvh;
}
#agent-source-toc button {
  display: block;
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  padding: 9px 8px;
  font-size: 13px;
  width: 100%;
  overflow-wrap: anywhere;
}
#agent-source-toc button > span {
  font-size: 11px;
  color: var(--muted);
  margin-right: 7px;
}
#agent-source-toc button.active {
  background: var(--active);
}
#agent-source-toc button:hover {
  background: var(--soft);
}
#agent-source-toc .agent-source-section {
  padding: 5px 8px 5px 28px;
  font-size: 11px;
  color: var(--muted);
}
.agent-source-reading {
  min-width: 0;
  padding: 25px;
  max-height: 54dvh;
  overflow: auto;
}
.agent-source-reading > h3 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
#agent-source-content {
  padding: 0;
  min-height: 0;
  max-height: none;
  overflow: visible;
  font-size: 14px;
}
#agent-source-more {
  margin-top: 18px;
  font-size: 12px;
}
@media (max-width: 700px) {
  .agent-source-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #agent-source-toc {
    max-height: 150px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .agent-source-reading {
    padding: 20px 16px;
    min-height: 240px;
    max-height: 42dvh;
  }
  .agent-source-header {
    padding: 20px 16px 14px;
  }
  .agent-source-search {
    padding: 12px 16px;
  }
  .agent-source-results {
    padding: 0 16px 12px;
  }
}

/* A resposta usa Markdown; rótulos e inspeção continuam separados do conteúdo. */
.live-testing-message > .live-testing-markdown {
  white-space: normal;
  min-width: 0;
}
.live-testing-markdown > :first-child {
  margin-top: 0;
}
.live-testing-markdown > :last-child {
  margin-bottom: 0;
}
.live-testing-markdown p {
  margin: 0 0 12px;
}
.live-testing-markdown strong {
  font-weight: 600;
}
.live-testing-markdown h1,
.live-testing-markdown h2,
.live-testing-markdown h3,
.live-testing-markdown h4,
.live-testing-markdown h5,
.live-testing-markdown h6 {
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  margin: 20px 0 10px;
  letter-spacing: 0;
}
.live-testing-markdown ul,
.live-testing-markdown ol {
  margin: 8px 0 14px;
  padding-left: 22px;
}
.live-testing-markdown li {
  margin: 4px 0;
}
.live-testing-markdown li > p {
  margin-bottom: 6px;
}
.live-testing-markdown a {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.live-testing-markdown a:hover {
  color: var(--muted);
}
.live-testing-markdown blockquote {
  border-left: 2px solid var(--control-border);
  padding-left: 12px;
  margin: 12px 0;
  color: var(--muted);
}
.live-testing-markdown code {
  font:
    13px/1.6 ui-monospace,
    monospace;
  background: var(--soft);
  padding: 2px 4px;
  border-radius: 5px;
}
.live-testing-markdown pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
}
.live-testing-markdown pre code {
  padding: 0;
  background: none;
}
.live-testing-markdown hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.live-testing-markdown table {
  white-space: normal;
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
  margin: 12px 0;
}
.live-testing-markdown th,
.live-testing-markdown td {
  height: auto;
  font-size: inherit;
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}
.live-testing-markdown th {
  background: var(--sidebar);
  font-weight: 500;
}

.live-testing-markdown tbody tr:last-child td {
  border: 1px solid var(--line);
}
.live-testing-markdown tbody tr:hover {
  background: transparent;
}

/* AI Modelos reuse the workspace's compact component library and dialogs. */
.ai-model-view .summary,
.ai-model-view .registry,
.ai-model-view main > .note {
  display: none;
}
.ai-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.ai-model-card {
  text-align: left;
  background: var(--bg);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  display: grid;
  gap: 7px;
  font: inherit;
}
.ai-model-card:hover {
  background: var(--sidebar);
}
.ai-model-card img {
  width: 40px;
  height: 40px;
}
.ai-model-card small {
  color: var(--muted);
}
#ai-model-editor {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.ai-model-fields {
  padding: 24px;
  display: grid;
  gap: 10px;
}
.ai-model-fields label {
  font-weight: 500;
}
.ai-model-fields input,
.ai-model-fields select,
#book-ai-model {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: var(--bg);
}
#book-ai-model {
  width: auto;
  max-width: 160px;
  font-size: 13px;
  padding: 5px;
}

.ai-model-advanced-fields {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}
#ai-model-advanced summary {
  cursor: pointer;
  font-weight: 500;
}

/* Communication channels share the compact component library and native dialog. */
.channel-view .summary,
.channel-view .registry,
.channel-view main > .note {
  display: none;
}
.section-title {
  margin: 28px 0 12px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title .count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}
.channel-library-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.channel-library-tools .search {
  flex: 1 1 240px;
  max-width: 360px;
  margin-right: auto;
}
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 14px;
}
.channel-providers {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.channel-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg);
  text-align: left;
  min-width: 0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.channel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -26px #28201259;
}
.channel-card.has-error {
  border-color: #8a5a004d;
}
.channel-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.channel-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--soft);
  display: grid;
  place-items: center;
}
.channel-icon img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}
.channel-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
}
.tint-green {
  background: #0b7a5b1a;
  color: var(--accent);
}
.tint-blue {
  background: #e8eefb;
  color: #2b3e9e;
}
.tint-amber {
  background: #fbf2e1;
  color: var(--warn);
}
.tint-neutral {
  background: #efece5;
  color: var(--secondary);
}
.channel-card-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.channel-card-id strong {
  font-size: 15.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.channel-card-id .mono {
  font-size: 11.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-card-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  font-size: 13px;
  color: #6b4600;
}
.channel-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
}
.channel-agent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
}
.channel-agent .agent-avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.channel-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.channel-tile:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}
.channel-tile .channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.channel-tile .channel-icon svg {
  width: 18px;
  height: 18px;
}
.channel-tile strong {
  font-size: 14.5px;
  font-weight: 500;
}
.channel-tile > span:last-child {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--faint);
}
.channel-empty {
  grid-column: 1 / -1;
  padding: 28px 20px;
  border: 1px dashed #17181b33;
  border-radius: var(--radius-card);
  text-align: center;
}
.channel-empty h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 5px;
}
.channel-empty p {
  color: var(--muted);
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .channel-card,
  .channel-tile {
    transition: none;
  }
}
#channel-provider-picker,
#channel-editor {
  width: 820px;
  max-width: calc(100% - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  box-shadow: 0 15px 70px var(--toast-shadow);
}
#channel-provider-picker {
  width: 620px;
}
.channel-provider-options {
  padding: 20px 24px 24px;
}
.channel-provider-options > p {
  margin: 0 0 16px;
  color: var(--muted);
}
#channel-provider-picker .channel-providers {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}
#channel-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 30px);
}
.channel-dialog-body {
  display: grid;
  grid-template-columns: 270px 1fr;
  overflow: auto;
}
.channel-guide {
  background: var(--sidebar);
  padding: 24px;
  border-right: 1px solid var(--line);
  font-size: 14px;
}
.channel-guide > img {
  width: 42px;
  height: 42px;
}
.channel-guide h3 {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
  margin: 16px 0;
}
.channel-guide ol {
  padding-left: 18px;
}
.channel-guide li {
  padding: 0 0 13px 4px;
}
.channel-guide p {
  margin: 5px 0 0;
  color: var(--muted);
}
.channel-guide a {
  color: var(--secondary);
  text-underline-offset: 3px;
}
.channel-fields {
  padding: 24px;
  min-width: 0;
}
.channel-fields .field {
  margin-bottom: 20px;
}
.channel-fields input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 9px 10px;
}
.channel-fields label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
.channel-fields small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.channel-token-row {
  display: flex;
  gap: 6px;
}
.channel-token-row input {
  flex: 1;
  font-size: 13px;
}
.channel-identity {
  font-size: 13px;
  padding: 10px;
  background: var(--soft);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.channel-scope {
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.channel-scope p {
  color: var(--muted);
  margin: 6px 0;
}
#channel-form .personality-dialog-footer > span {
  flex: 1;
}
#channel-form [data-for][hidden] {
  display: none;
}
.channel-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.channel-fields small.channel-hint {
  margin: -8px 0 18px;
}
.channel-webhook,
.channel-qr {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sidebar);
  font-size: 14px;
}
.channel-webhook p {
  margin: 6px 0 0;
  color: var(--muted);
}
.channel-webhook label {
  margin: 12px 0 6px;
}
.channel-webhook input {
  font-family: var(--mono, monospace);
}
.channel-warning {
  margin: 0 0 16px;
  padding: 10px;
  border-left: 3px solid var(--dim);
  background: var(--soft);
  font-size: 14px;
}
.channel-qr {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.channel-qr img {
  width: 220px;
  height: 220px;
  padding: 8px;
  border-radius: var(--radius);
  background: #fff;
}
.channel-qr p {
  margin: 0;
  color: var(--muted);
}
.channel-qr-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 650px) {
  .channel-dialog-body {
    grid-template-columns: 1fr;
  }
  .channel-field-row {
    grid-template-columns: 1fr;
  }
  .channel-guide {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .channel-guide ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 22px;
  }
  .channel-library-tools {
    flex-wrap: wrap;
    gap: 10px;
  }
  .channel-library-tools .search {
    flex-basis: 100%;
  }
  .channel-library-tools .search {
    max-width: none;
  }
  .channel-providers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #channel-form .personality-dialog-footer {
    flex-wrap: wrap;
    padding: 14px;
    gap: 8px;
  }
}
@media (max-width: 380px) {
  .channel-providers {
    grid-template-columns: 1fr;
  }
}

/* Saved connector sessions, sharing the canvas header and compact type scale. */
.sessions-mode {
  overflow: hidden;
}
.sessions-mode > .sidebar,
.sessions-mode > .shell {
  display: none;
}
.agent-sessions {
  position: fixed;
  inset: 0;
  background: var(--bg);
}
.sessions-header {
  height: 54px;
  padding: 0 23px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
}
.sessions-header h1 {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
#sessions-agent-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sessions-refresh {
  margin-left: auto;
  flex-shrink: 0;
}
.sessions-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100% - 54px);
}
.sessions-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
}
.sessions-sidebar-heading {
  padding: 16px 16px 0;
}
.sessions-sidebar-heading h2 {
  font-size: 14.5px;
  margin: 0 0 4px;
  font-weight: 500;
}
.sessions-sidebar-heading > span {
  color: var(--muted);
  font-size: 12px;
}
#sessions-list {
  overflow-y: auto;
  min-height: 0;
  padding: 0;
}
.session-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
}
.session-list-item:hover {
  background: var(--soft);
}
.session-list-item.selected {
  background: var(--active);
  border-left-color: var(--ink);
}
.session-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.session-item-top strong {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-item-meta {
  display: flex;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-item-preview {
  color: var(--secondary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-conversation,
#session-detail {
  min-height: 0;
  height: 100%;
}
#session-detail {
  display: flex;
  flex-direction: column;
}
.session-detail-header {
  border-bottom: 1px solid var(--line);
  padding: 14px 24px 11px;
}
.session-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}
.session-detail-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.session-detail-header p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.session-transcript {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 16px 24px;
}
.session-messages {
  max-width: 820px;
  margin: 0 auto;
}
.session-message {
  width: fit-content;
  max-width: 85%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.session-message.from-participant {
  margin-left: auto;
  background: var(--soft);
  border-color: transparent;
}
.session-message-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.session-message-meta strong {
  color: var(--secondary);
  font-weight: 500;
}
.session-message-text {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
}
.session-delivery {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.session-message-error {
  color: var(--secondary);
  font-size: 13px;
  border-top: 1px solid var(--control-border);
  padding-top: 9px;
  margin: 10px 0 0;
}
.sessions-empty {
  margin: auto;
  text-align: center;
  padding: 50px 24px;
  max-width: 440px;
}
.sessions-empty h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 9px;
}
.sessions-empty p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.sessions-sidebar .sessions-empty {
  padding: 30px 12px;
}
.sessions-sidebar .sessions-empty h2 {
  font-size: 14px;
}
.sessions-sidebar .sessions-empty p {
  font-size: 13px;
}
.sessions-list-note {
  padding: 15px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}
.sessions-list-note .button {
  display: block;
  margin: 12px auto 0;
}
.session-history-end {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}
.sessions-mobile-back {
  display: none;
}

.session-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.session-contact-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--control-border);
  background: var(--bg);
  color: var(--muted);
}

.session-contact-avatar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-item-top time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sessions-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 14px;
  padding: 7px 9px;
  background: var(--bg);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
}

.sessions-search svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--muted);
}

.sessions-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-size: 12px;
  background: transparent;
}

.sessions-search:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.session-metadata {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.session-metadata summary {
  cursor: pointer;
  width: fit-content;
  font-size: 11px;
}

.session-tool-group {
  max-width: 85%;
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.session-tool-group > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}

.session-tool-group > summary::-webkit-details-marker {
  display: none;
}

.session-tool-group > summary::after {
  content: "›";
  font-size: 14.5px;
  margin-left: 1px;
}

.session-tool-group[open] > summary::after {
  transform: rotate(90deg);
}

.session-tool-group > summary svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.session-tool-names {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
}

.session-tool-count {
  font-size: 11px;
  background: var(--soft);
  border-radius: var(--radius);
  padding: 0 4px;
}

.session-tool-records {
  border-left: 1px solid var(--control-border);
  padding-left: 12px;
  margin: 5px 0 10px 5px;
}

.session-tool-record {
  padding: 6px 0;
}

.session-tool-record > div {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 12px;
  color: var(--secondary);
}

.session-tool-record time {
  font-size: 11px;
  color: var(--muted);
}

.session-tool-record pre {
  margin: 6px 0 0;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--soft);
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}

.session-date-divider {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin: 8px 0 16px;
}

.session-older {
  padding: 0 0 12px;
}
@media (max-width: 760px) {
  .workspace-header {
    flex-wrap: wrap;
    align-content: center;
    height: 94px;
    padding: 10px 14px;
    gap: 6px 8px;
  }
  .workspace-header::before {
    content: "";
    flex-basis: 100%;
    order: 1;
  }
  .workspace-header h1 {
    max-width: none;
    flex: 1;
  }
  .workspace-header .button {
    order: 2;
  }
  .workspace-components-button {
    margin-left: 0;
  }
  .workspace-header .button {
    font-size: 12px;
    padding: 6px 8px;
  }
  .agent-canvas {
    top: 94px;
  }
  .canvas-tools {
    top: 113px;
  }
  .agent-components {
    top: 110px;
    max-height: calc(100dvh - 135px);
  }
  .sessions-header {
    padding: 0 14px;
    gap: 9px;
  }
  .sessions-header h1 {
    gap: 9px;
  }
  .sessions-layout {
    grid-template-columns: 1fr;
  }
  .session-conversation {
    display: none;
  }
  .has-session .sessions-sidebar {
    display: none;
  }
  .has-session .session-conversation {
    display: block;
  }
  .sessions-mobile-back {
    display: inline-flex;
    margin-bottom: 15px;
  }
  .session-detail-header {
    padding: 18px;
  }
  .session-transcript {
    padding: 20px 16px;
  }
  .session-message {
    max-width: 96%;
  }
}

.ai-model-footer {
  flex-wrap: wrap;
}
#delete-ai-model {
  margin-right: auto;
}

/* Attached books share one canvas connection and open a document picker. */
.book-stack .avatar-coin {
  isolation: isolate;
}
.book-stack .avatar-coin::before,
.book-stack .avatar-coin::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--control-border);
  border-radius: inherit;
  background: var(--bg);
  box-shadow: 0 3px 0 var(--line);
  z-index: -1;
  transform: translate(7px, -5px);
}
.book-stack .avatar-coin::before {
  transform: translate(14px, -10px);
  z-index: -2;
}
.book-stack .avatar-coin img {
  background: var(--bg);
}
.book-count {
  position: absolute;
  right: -3px;
  bottom: -2px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  line-height: 15px;
  text-align: center;
}
#agent-books-dialog {
  width: min(560px, calc(100% - 30px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 12px;
}
#agent-books-dialog::backdrop {
  background: var(--backdrop);
}
#agent-books-list {
  padding: 0 24px 12px;
}
.attached-book-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.attached-book-row:last-child {
  border-bottom: 0;
}
.attached-book-row > img {
  width: 40px;
  height: 40px;
}
.attached-book-row > div:first-of-type {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.attached-book-row strong {
  font-size: 14px;
  font-weight: 500;
}
.attached-book-row .field-help {
  margin: 4px 0 0;
}
.attached-book-actions,
.agent-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attached-book-actions .button {
  font-size: 12px;
}
.agent-source-actions {
  padding: 14px 24px 0;
}
@media (max-width: 600px) {
  .attached-book-row {
    flex-wrap: wrap;
  }
  .attached-book-actions {
    width: 100%;
    padding-left: 52px;
  }
}

/* Conversation inbox: fixed-height virtual rows and compact native filters. */
#sessions-list {
  flex: 1;
  overflow-anchor: none;
}
#sessions-list .session-list-item {
  height: 80px;
  box-sizing: border-box;
}
.inbox-tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px 10px;
}
.inbox-tabs button {
  flex: 1;
  font-size: 12px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.inbox-tabs button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--active);
  border-color: var(--control-border);
}
.inbox-filters {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 16px;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.inbox-filters > summary {
  cursor: pointer;
}
#inbox-filter-count:not(:empty) {
  padding: 1px 5px;
  margin-left: 5px;
  background: var(--active);
  border-radius: var(--radius);
  color: var(--ink);
}
.inbox-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 8px;
  padding: 12px 0 3px;
  max-height: 225px;
  overflow: auto;
}
.inbox-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
}
.inbox-filter-grid select,
.inbox-filter-grid input {
  width: 100%;
  min-width: 0;
  height: 29px;
  font-size: 12px;
  padding: 4px 6px;
  background: var(--bg);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  color: var(--ink);
}
#inbox-clear {
  grid-column: 1/-1;
  justify-self: start;
  font-size: 12px;
  height: 27px;
}
.inbox-updates {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.inbox-updates button {
  width: 100%;
  padding: 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--secondary);
  background: var(--soft);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
}
.session-detail-title {
  flex-wrap: wrap;
}
.session-detail-title h2 {
  flex: 1;
  min-width: 0;
}
.session-archive {
  margin-left: auto;
  font-size: 12px;
  height: 27px;
  padding: 0 9px;
}
.session-history-picker {
  margin-top: 8px;
  font-size: 12px;
  color: var(--secondary);
}
.session-history-picker > summary {
  cursor: pointer;
  width: fit-content;
}
.session-history-picker > summary span {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}
[data-session-history] {
  max-height: 160px;
  overflow: auto;
  max-width: 440px;
  margin-top: 8px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}
[data-session-history] a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: var(--secondary);
}
[data-session-history] a[aria-current] {
  background: var(--active);
  color: var(--ink);
}
[data-session-history] a:hover {
  background: var(--soft);
}
[data-session-history] small {
  color: var(--muted);
  font-size: 11px;
}
[data-session-history] .button {
  font-size: 12px;
  margin: 6px 0;
}
[data-session-history] p {
  padding: 6px;
}
@media (max-width: 760px) {
  .session-archive {
    font-size: 11px;
  }
  .inbox-filter-grid {
    max-height: 190px;
  }
}
.inbox-channel-error {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 16px;
}

/* Mini CRM: funil Kanban, lista, pendências e editor lateral do lead. */
.crm-view .summary,
.crm-view .registry,
.crm-view main > .note {
  display: none;
}
.crm-library {
  --crm-overdue: #b42318;
}
.crm-tabs {
  margin-bottom: 4px;
}

.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
}
.crm-toolbar .search {
  flex: 1 1 240px;
  width: auto;
}
.crm-toolbar .button.primary {
  margin-left: auto;
}
.crm-filter {
  height: 42px;
  border: 1px solid #17181b1f;
  border-radius: 11px;
  padding: 0 12px;
  font-size: 13.5px;
  background: var(--bg);
  min-width: 0;
}
input.crm-filter {
  width: 120px;
}
.crm-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--secondary);
}
.crm-muted {
  color: var(--faint);
  font-size: 13px;
  margin: 4px 0;
}
.crm-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: stretch;
  /* Colunas com altura fixa: cada uma rola sozinha e os cabeçalhos ficam visíveis. */
  height: max(420px, calc(100dvh - 330px));
}
.crm-column {
  background: #efece5;
  border-radius: 16px;
  padding: 12px 0 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-column > header,
.crm-recency {
  margin: 0 14px;
}
.crm-recency {
  font-size: 12px;
  color: var(--faint);
}
.crm-recency .text-button {
  font-size: 12px;
  text-decoration: underline;
}
.crm-column-more {
  padding: 2px 0 8px;
}
.crm-column.drop {
  outline: 2px dashed var(--faint);
  outline-offset: -2px;
}
.crm-column > header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 2px 4px;
}
.crm-column h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.crm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.crm-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}
.crm-outcome {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.crm-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 12px 12px;
}
.crm-card {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--bg);
  border: 1px solid #17181b0f;
  border-radius: 12px;
  padding: 12px 13px;
  cursor: grab;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.crm-card:hover,
.crm-card:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px #28201266;
}
.crm-card.dragging {
  opacity: 0.5;
}
.crm-card strong {
  font-size: 14px;
  font-weight: 500;
}
.crm-card-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--faint);
}
.crm-card-foot time {
  margin-left: auto;
}
.crm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.crm-tags span {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 7px;
  color: var(--secondary);
  background: var(--bg);
}
.crm-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  background: var(--soft);
  border-radius: 5px;
  padding: 0 5px;
  color: var(--secondary);
}
.crm-badge svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.crm-badge.overdue {
  color: var(--crm-overdue, #b42318);
  background: #fdecea;
}
.crm-more {
  width: 100%;
}
.crm-more-row {
  display: flex;
  justify-content: center;
  padding: 14px 0;
}
.crm-stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.crm-task-group {
  margin-bottom: 22px;
}
.crm-task-group h3,
.crm-section h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
}
.crm-task-group h3 span,
.crm-section h3 span {
  font-size: 12px;
  color: var(--muted);
  background: var(--soft);
  padding: 1px 5px;
  border-radius: 5px;
  margin-left: 4px;
}
.crm-task-group.overdue h3 {
  color: var(--crm-overdue, #b42318);
}
.crm-tasks,
.crm-notes,
.crm-contacts,
.crm-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crm-tasks li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.crm-tasks label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 200px;
  font-size: 14px;
}
.crm-tasks label input {
  margin-top: 3px;
}
.crm-tasks small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.crm-tasks li.done label span {
  text-decoration: line-through;
  color: var(--faint);
}
.crm-tasks li.overdue .crm-task-meta {
  color: var(--crm-overdue, #b42318);
}
.crm-task-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--faint);
}
.crm-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--secondary);
}
.crm-agent-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--ink);
  color: white;
  border-radius: 5px;
  padding: 0 4px;
}
.crm-settings-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 16px 0;
}
.crm-settings-card.column {
  flex-direction: column;
  align-items: stretch;
}
.crm-settings-card h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 500;
}
.crm-settings-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 640px;
}
.crm-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.crm-stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.crm-stage-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.crm-stage-list input[name="name"] {
  flex: 1 1 160px;
}
.crm-stage-list input,
.crm-stage-list select,
.crm-inline-form input,
.crm-note-form textarea,
.crm-attribute input,
.crm-stage-select select {
  height: 30px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 0 8px;
  font-size: 14px;
  background: var(--bg);
  min-width: 0;
}
.crm-stage-list input[type="color"],
.crm-inline-form input[type="color"] {
  width: 34px;
  padding: 2px;
}
.crm-stage-list .crm-count {
  margin-left: 0;
}
.crm-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.crm-inline-form input:not([type="color"]) {
  flex: 1 1 140px;
}
.crm-note-form {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin-bottom: 8px;
}
.crm-note-form textarea {
  width: 100%;
  height: auto;
  padding: 7px 8px;
  resize: vertical;
}

/* Editor lateral do lead. */
dialog.crm-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  border: 0;
  border-left: 1px solid var(--control-border);
  padding: 0;
  width: 620px;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  box-shadow: -10px 0 50px var(--drawer-shadow);
}
dialog.crm-drawer[open] {
  display: flex;
  flex-direction: column;
}
.crm-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 25px;
  border-bottom: 1px solid var(--line);
}
.crm-drawer-head .eyebrow {
  margin: 0;
}
.crm-drawer-body {
  overflow: auto;
  padding: 20px 25px 30px;
  flex: 1;
}
.crm-new-lead h2,
.crm-lead-head h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.4px;
}
.crm-new-lead h2 {
  margin-bottom: 18px;
}
.crm-lead-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.crm-lead-head > div {
  flex: 1;
  min-width: 0;
}
.crm-lead-head p {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}
.crm-section {
  border-top: 1px solid var(--line);
}
.crm-section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}
.crm-section > summary::-webkit-details-marker {
  display: none;
}
.crm-section > summary::before {
  content: "›";
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  width: 10px;
  transition: transform 0.15s ease;
}
.crm-section[open] > summary::before {
  transform: rotate(90deg);
}
.crm-section > summary h3 {
  margin: 0;
}
.crm-section > summary:hover::before {
  color: var(--ink);
}
.crm-section > summary:focus-visible {
  outline: 2px solid var(--faint);
  outline-offset: 2px;
}
.crm-section[open] {
  padding-bottom: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .crm-section > summary::before {
    transition: none;
  }
}
.crm-attributes {
  display: grid;
  gap: 4px;
}
.crm-attribute {
  display: grid;
  grid-template-columns: minmax(90px, 32%) 1fr auto;
  align-items: center;
  gap: 8px;
}
.crm-attribute > span {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
}
.crm-notes li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.crm-notes p {
  margin: 0 0 3px;
  font-size: 14px;
  white-space: pre-wrap;
}
.crm-contacts li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.crm-contacts li > span:first-child {
  flex: 1;
  display: grid;
}
.crm-contacts small {
  font-size: 12px;
  color: var(--muted);
}
.crm-timeline li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 5px 0;
  color: var(--secondary);
}
.crm-timeline time {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}
.crm-lead-footer {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.crm-compact-fields summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 0;
}
.crm-lead.compact .crm-lead-head {
  align-items: center;
  margin-bottom: 8px;
}
.crm-lead.compact .crm-section > summary {
  padding: 9px 0;
}
@media (max-width: 700px) {
  .crm-board {
    grid-auto-columns: 82%;
    height: 70dvh;
  }
  .crm-toolbar .button.primary {
    margin-left: 0;
  }
  .crm-lead-head {
    flex-wrap: wrap;
  }
  .crm-attribute {
    grid-template-columns: 1fr auto;
  }
  .crm-attribute > span {
    grid-column: 1 / -1;
  }
}
.agent-crm {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px 2px;
  margin: 0 0 16px;
}
.agent-crm legend {
  font-size: 13px;
  font-weight: 500;
  padding: 0 4px;
}
.session-crm {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--bg);
}
.session-crm > summary {
  cursor: pointer;
  font-size: 13px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.session-crm[open] > summary {
  border-bottom: 1px solid var(--line);
}
.session-crm-body {
  max-height: 46vh;
  overflow: auto;
  padding: 10px 0;
}
.session-crm-picker {
  display: grid;
  gap: 8px;
}
.session-crm-picker .search {
  width: 100%;
}
.session-crm-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.session-crm-actions:not(:empty) + * {
  margin-top: 8px;
}

/* Settings: compact administrator management, using the shared controls. */
.settings-view .summary,
.settings-view main > .note,
.settings-view .table-footer {
  display: none;
}
/* Organização: cada formulário é um cartão; em telas largas ficam lado a lado. */
#org-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}
#org-body > .users-feedback {
  grid-column: 1 / -1;
}
.org-form {
  margin: 0;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.org-form h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
}
.org-form .field:last-of-type {
  margin-bottom: 12px;
}
.org-actions {
  align-self: center;
}
/* Linhas de rótulo e valor ficam em largura de leitura, sem esticar pela tela. */
#plan-body {
  max-width: 640px;
}
.users-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.users-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 500;
}
.users-heading p,
.users-role-note,
.users-footer,
.workspace-details {
  font-size: 14px;
  color: var(--muted);
}
.users-heading p {
  margin: 0;
}
.users-count,
.user-self {
  border-radius: 7px;
  background: var(--soft);
  padding: 2px 6px;
  font-size: 12px;
  color: var(--muted);
}
.users-role-note {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 20px;
}
.users-role-note strong {
  color: var(--ink);
  font-weight: 500;
}
.users-search {
  max-width: 340px;
  margin-bottom: 14px;
}
.users-search input {
  min-width: 0;
  width: 100%;
}
.users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.users-table {
  width: 100%;
  border-collapse: collapse;
}
.users-table th {
  color: var(--faint);
  font-weight: 400;
  font-size: 13px;
}
.users-table th,
.users-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.users-table tr:last-child td {
  border-bottom: 0;
}
.user-identity {
  display: flex;
  gap: 10px;
  align-items: center;
}
.user-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #efece5;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.user-identity strong {
  font-weight: 500;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.user-self {
  margin-left: 7px;
}
.user-email {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.user-role {
  display: inline-block;
  border-radius: 999px;
  background: var(--soft);
  color: var(--secondary);
  padding: 4px 10px;
  font-size: 13px;
}
.users-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.users-table .users-actions-heading {
  text-align: right;
}
.users-footer {
  margin: 12px 0 0;
  font-size: 13px;
}
.users-feedback {
  padding: 36px 18px;
  text-align: center;
  border: 1px dashed var(--control-border);
  border-radius: 9px;
  color: var(--muted);
}
.users-feedback h3 {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}
.users-feedback p {
  font-size: 14px;
}
.workspace-details {
  max-width: 1040px;
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.workspace-details summary {
  cursor: pointer;
  margin-bottom: 16px;
}
.user-dialog {
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--bg);
}
.user-dialog form {
  display: flex;
  flex-direction: column;
}
.user-dialog-body {
  padding: 0 24px 20px;
  font-size: 14px;
}
.user-dialog-body > p:first-child {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}
.user-dialog-body .field-help {
  line-height: 1.5;
  color: var(--muted);
}
.user-fixed-role {
  margin-top: 6px;
  font-size: 14px;
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .users-heading {
    align-items: flex-start;
  }
  .users-heading p {
    max-width: 210px;
  }
  .users-heading > button {
    flex-shrink: 0;
  }
  .users-role-note {
    align-items: flex-start;
  }
  .users-search {
    max-width: none;
  }
  .users-table th,
  .users-table td {
    padding: 10px;
  }
  .users-table th:nth-child(2),
  .users-table td:nth-child(2) {
    display: none;
  }
  .user-avatar {
    display: none;
  }
  .users-actions {
    flex-direction: column;
  }
  .user-dialog .personality-dialog-header {
    padding: 18px 20px;
  }
  .user-dialog-body {
    padding: 0 20px 16px;
  }
}

/* Agendamentos: tarefas dos agentes, histórico de execuções e automação. */
.schedules-view .summary,
.schedules-view .registry,
.schedules-view main > .note {
  display: none;
}
.schedules-library {
  min-width: 0;
}
.schedule-tabs {
  margin-bottom: 18px;
}

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.schedule-toolbar .search {
  flex: 1;
  max-width: 340px;
}
.schedule-toolbar .search input {
  width: 100%;
  min-width: 0;
}
.schedule-toolbar .button.primary {
  margin-left: auto;
}
.schedule-name {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.schedule-name:hover {
  text-decoration: underline;
}
.schedule-badge {
  display: inline-block;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--muted);
  vertical-align: 1px;
}
.schedule-status {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--sidebar);
  white-space: nowrap;
}
.schedule-status .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dim);
}
.schedule-status.succeeded .dot {
  background: #15803d;
}
.schedule-status.failed,
.schedule-status.interrupted {
  color: #b42318;
}
.schedule-status.failed .dot,
.schedule-status.interrupted .dot {
  background: #b42318;
}
.schedule-status.running .dot {
  background: #2563eb;
  animation: schedule-pulse 1s ease-in-out infinite alternate;
}
@keyframes schedule-pulse {
  to {
    opacity: 0.3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-status.running .dot {
    animation: none;
  }
}
.schedule-table td {
  vertical-align: top;
}
.schedule-muted {
  color: var(--muted);
  font-size: 14px;
}
.schedule-detail .users-heading {
  margin-top: 12px;
}
.schedule-detail .users-heading p {
  max-width: 640px;
}
.schedule-facts {
  max-width: 760px;
}
.schedule-subtitle {
  margin: 24px 0 8px;
  font-size: 14px;
  font-weight: 500;
}
.schedule-pre {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--sidebar);
  font: 13px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.schedule-dialog {
  width: 680px;
}
.schedule-dialog form {
  max-height: calc(100dvh - 32px);
}
.schedule-dialog .user-dialog-body {
  overflow-y: auto;
  padding-top: 20px;
}
.schedule-form > p:first-child {
  margin-bottom: 20px;
}
.schedule-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  font-size: 14px;
}
.schedule-kind legend {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  padding: 0;
}
.schedule-kind label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.mono-input {
  font-family: var(--mono) !important;
}
.schedule-invalid {
  color: #b42318;
}
.schedule-narrow {
  max-width: 200px;
}
.schedule-secrets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.schedule-secrets li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.schedule-secrets li .user-email {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.schedule-secret-agents {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.schedule-secret-agents legend {
  padding: 0;
  margin-bottom: 6px;
}
.schedule-secret-agents label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.schedule-log .schedule-subtitle:first-of-type {
  margin-top: 12px;
}
@media (max-width: 760px) {
  .schedule-table th:nth-child(2),
  .schedule-table td:nth-child(2),
  .schedule-table th:nth-child(4),
  .schedule-table td:nth-child(4) {
    display: none;
  }
  .schedule-toolbar .button.primary {
    margin-left: 0;
  }
  .schedule-dialog .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Célio: avatar com aceno na sidebar e tela do agente de gestão. */
.celio-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.celio-cta:hover {
  border-color: var(--accent-line);
  box-shadow: var(--card-shadow);
}
.celio-cta-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.celio-cta-avatar img,
.celio-avatar {
  display: block;
  border-radius: 50%;
  flex-shrink: 0;
}
.celio-cta-avatar img {
  width: 34px;
  height: 34px;
}
.celio-cta-bubble {
  font-size: 13px;
  line-height: 1.45;
  color: var(--secondary);
}
.celio-cta-bubble strong {
  color: var(--ink);
  font-weight: 600;
}
.celio-cta-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.celio-cta-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.celio-cta.active {
  border-color: var(--accent-line);
}
.celio-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.celio-mode {
  overflow: hidden;
}
.celio-mode > .sidebar,
.celio-mode > .shell {
  display: none;
}
.celio-workspace {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.celio-header h1 {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.celio-header h1 .celio-avatar {
  width: 24px;
  height: 24px;
}
.celio-subtitle {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.celio-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.celio-model {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.celio-model select {
  height: 31px;
  max-width: 220px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0 6px;
  font-size: 13px;
  color: var(--ink);
}
.celio-toggle {
  display: none;
}
.celio-count:not(:empty) {
  padding: 0 5px;
  border-radius: var(--radius);
  background: var(--active);
  font-size: 12px;
}
.celio-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  position: relative;
}
.celio-history,
.celio-created {
  min-height: 0;
}
.celio-history {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
}
.celio-conversations {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.celio-empty-list {
  padding: 18px 16px;
}
.celio-empty-list h2 {
  font-size: 14px;
  margin: 0 0 4px;
  font-weight: 500;
}
.celio-empty-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.celio-conversation-item .session-item-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: 100%;
}
.celio-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.celio-chat-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 28px 12px;
  min-width: 0;
}
.celio-chat-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#celio-chat-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.celio-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px max(28px, calc((100% - 760px) / 2));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.celio-welcome {
  margin: auto 0;
  max-width: 560px;
  align-self: center;
  text-align: center;
}
.celio-welcome-avatar {
  margin: 0 auto;
}
.celio-welcome h3 {
  margin: 14px 0 6px;
  font-size: 18px;
  font-weight: 600;
}
.celio-welcome p {
  margin: 0 0 18px;
  color: var(--secondary);
}
.celio-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  text-align: left;
}
.celio-suggestion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg);
}
.celio-suggestion:hover {
  background: var(--soft);
  border-color: var(--control-border);
}
.celio-hint {
  margin-top: 16px !important;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--soft);
  font-size: 14px;
}
.celio-hint a,
.celio-action-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.celio-message {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.celio-message-avatar {
  width: 28px;
  height: 28px;
}
.celio-message-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.celio-message.user {
  align-self: flex-end;
  max-width: 80%;
  background: var(--soft);
  border-radius: 10px 10px 2px 10px;
  padding: 9px 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.celio-markdown {
  font-size: 14.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.celio-markdown table {
  border-collapse: collapse;
  font-size: 14px;
}
.celio-markdown th,
.celio-markdown td {
  border: 1px solid var(--line);
  padding: 4px 6px;
}
.celio-steps {
  color: var(--muted);
  font-size: 13px;
}
.celio-steps summary {
  cursor: pointer;
  width: fit-content;
}
.celio-steps ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.celio-thinking {
  color: var(--muted);
  font-size: 14px;
  padding-left: 36px;
  animation: celio-pulse 1.4s ease-in-out infinite;
}
@keyframes celio-pulse {
  50% {
    opacity: 0.4;
  }
}
@media (prefers-reduced-motion: reduce) {
  .celio-thinking {
    animation: none;
  }
}
.celio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.celio-action,
.celio-activity-item {
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  background: var(--bg);
}
.celio-action.pending,
.celio-activity-item.pending {
  border-color: var(--ink);
}
.celio-action.cancelled {
  opacity: 0.6;
}
.celio-action header,
.celio-activity-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.celio-action.applied .celio-action-status::before,
.celio-activity-item.applied .celio-activity-status::before {
  content: "✓ ";
}
.celio-action.failed .celio-action-status,
.celio-activity-item.failed .celio-activity-status,
.celio-action-error {
  color: #b42318;
}
.celio-action p,
.celio-activity-item p {
  margin: 0;
  font-size: 14px;
}
.celio-action code,
.celio-activity-item code {
  font:
    13px/1.6 ui-monospace,
    monospace;
  background: var(--soft);
  padding: 1px 4px;
  border-radius: 5px;
}
.celio-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.celio-error {
  margin: 0 28px 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #fef3f2;
  color: #b42318;
  font-size: 14px;
  white-space: pre-line;
}
.celio-composer {
  border-top: 1px solid var(--line);
  padding: 14px max(28px, calc((100% - 760px) / 2)) 16px;
  display: grid;
  gap: 8px;
}
.celio-composer textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--bg);
}
.celio-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--faint);
  font-size: 12px;
}
.celio-created {
  border-left: 1px solid var(--line);
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
}
.celio-created .sessions-sidebar-heading {
  padding-bottom: 12px;
}
.celio-activity {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 14px 16px;
  display: grid;
  align-content: start;
  gap: 18px;
}
.celio-activity-empty p {
  margin: 8px 2px;
  color: var(--muted);
  font-size: 13px;
}
.celio-activity-group {
  display: grid;
  gap: 8px;
}
.celio-activity-group h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.celio-activity-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.celio-activity-origin {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.celio-activity-origin:hover,
.celio-activity-link:hover {
  color: var(--ink);
}
.celio-activity-link {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
/* Telas médias: as criações viram uma gaveta; estreitas: o histórico também. */
@media (max-width: 1180px) {
  .celio-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .celio-created {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 100%);
    z-index: 5;
    box-shadow: -12px 0 32px var(--drawer-shadow);
    display: none;
  }
  .celio-workspace.created-open .celio-created {
    display: flex;
  }
  #celio-created-toggle {
    display: inline-flex;
  }
}
@media (max-width: 820px) {
  .celio-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .celio-history {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 100%);
    z-index: 5;
    box-shadow: 12px 0 32px var(--drawer-shadow);
    display: none;
  }
  .celio-workspace.history-open .celio-history {
    display: flex;
  }
  #celio-history-toggle {
    display: inline-flex;
  }
  .celio-subtitle,
  .celio-model > span {
    display: none;
  }
  .celio-model select {
    max-width: 150px;
  }
}
@media (max-width: 700px) {
  .celio-cta {
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
  }
  .celio-cta-bubble {
    display: none;
  }
  .celio-cta-button {
    flex: 1;
  }
  .celio-header {
    padding: 0 12px;
    gap: 8px;
  }
  .celio-header .workspace-back span:last-child,
  .celio-header .workspace-separator {
    display: none;
  }
  .celio-header-actions {
    gap: 4px;
  }
  .celio-header-actions .button {
    padding: 0 8px;
  }
  .celio-new-label {
    display: none;
  }
  .celio-model select {
    max-width: 96px;
  }
  .celio-messages,
  .celio-composer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .celio-chat-header {
    padding: 12px 14px 10px;
  }
  .celio-suggestions {
    grid-template-columns: 1fr;
  }
  #celio-chat-meta {
    display: none;
  }
}

/* Website widget configuration uses the existing channel editor primitives. */
.widget-site-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin-bottom:10px;padding:10px;border:1px solid var(--line,#e9e9e9);border-radius:9px}.widget-site-row input,.widget-site-row select{min-width:0;width:100%}.widget-site-row [data-origin]{grid-column:1/-1}.widget-site-row [data-path]{grid-column:1}.widget-site-row [data-mode]{grid-column:1}.widget-site-row [data-widget-remove]{grid-column:2;grid-row:2/4}.widget-preview{display:flex;flex-direction:column;gap:12px;background:#fafafa;border:1px solid #ddd;border-radius:12px;padding:16px;width:100%;margin-top:8px}.widget-preview.mobile{max-width:280px}.widget-preview p{white-space:pre-wrap;overflow-wrap:anywhere;background:white;padding:12px;border-radius:9px}.widget-preview span{font-size:14px;color:#737373}.widget-preview button{border:0;border-radius:50%;width:40px;height:40px;color:white}#widget-settings select,#widget-settings textarea{width:100%}#widget-settings small{display:block;margin:6px 0 12px}#widget-settings details{margin:12px 0}#widget-settings input[type=checkbox]{width:auto}#widget-install textarea{font-family:monospace;font-size:13px}
#webpage-settings select,#webpage-settings textarea{width:100%}#webpage-settings small{display:block;margin:6px 0 12px}#webpage-settings details{margin:12px 0}#webpage-settings input[type=checkbox]{width:auto}#webpage-auth>label{display:block}.webpage-share{margin-top:16px;padding-top:12px;border-top:1px solid var(--line,#e9e9e9)}.webpage-share-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.webpage-share-actions a.button{text-decoration:none}.webpage-qr{width:168px;height:168px;margin-top:8px;padding:8px;background:#fff;border:1px solid var(--line,#e9e9e9);border-radius:12px}.webpage-qr svg{display:block;width:100%;height:100%;stroke:none}.webpage-qr svg path{stroke:none;fill:#000}

/* Sites: criação por conversa. Galeria em #sites, ateliê em tela cheia em #sites/:id.
   A base continua monocromática: a cor vem do próprio site gerado, que é o protagonista. */
.sites-view .summary,
.sites-view .registry,
.sites-view main > .note,
.sites-view .toolbar,
.sites-view #tabs {
  display: none;
}
.sites-library {
  min-width: 0;
}
.site-muted {
  color: var(--muted);
}

/* Começo: um único campo, como uma conversa. */
.site-start {
  max-width: 760px;
  margin: 4px 0 44px;
}
.site-start-title {
  display: block;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.site-start-help {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 62ch;
  margin: 0 0 16px;
}
.site-start-warning {
  font-size: 13px;
  color: var(--secondary);
  background: var(--soft);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: 10px 0 0;
}
.site-start-warning a,
.site-link {
  color: var(--ink);
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.site-composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  background: var(--bg);
  padding: 8px 8px 8px 12px;
  box-shadow: 0 1px 2px var(--control-shadow);
  transition: border-color 0.15s;
}
.site-composer:focus-within {
  border-color: var(--ink);
}
.site-composer textarea {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  padding: 4px 0;
  max-height: 180px;
  color: var(--ink);
}
/* Composer do ateliê com anexos: imagens e áudio acima do campo. */
.site-composer-rich {
  flex-direction: column;
  align-items: stretch;
  padding: 6px 8px;
}
.site-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.site-tool {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.site-tool:hover:not(:disabled),
.site-tool[aria-pressed="true"] {
  background: var(--soft);
  color: var(--ink);
}
.site-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.site-tool svg {
  width: 17px;
  height: 17px;
}
.site-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 6px;
}
.site-attachments[hidden] {
  display: none;
}
.site-attachment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  font-size: 13px;
  color: var(--secondary);
}
.site-attachment.image {
  width: 52px;
  height: 52px;
  overflow: hidden;
}
.site-attachment.image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.site-attachment.audio,
.site-attachment.recording {
  height: 32px;
  padding: 0 4px 0 10px;
}
.site-attachment svg {
  width: 13px;
  height: 13px;
}
.site-attachment button {
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
}
.site-attachment.image button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: color-mix(in srgb, var(--ink) 75%, transparent);
  color: var(--bg);
}
.site-attachment.image button svg {
  width: 10px;
  height: 10px;
}
.site-attachment button:hover {
  color: var(--ink);
}
.site-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d64545;
  animation: site-rec 1.2s ease-in-out infinite;
}
@keyframes site-rec {
  50% {
    opacity: 0.3;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-rec-dot {
    animation: none;
  }
}
.site-compose-note {
  margin: 4px 2px 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--secondary);
}
.site-compose-note[hidden] {
  display: none;
}
.site-composer-large textarea {
  min-height: 72px;
  font-size: 15px;
}
.site-send {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.site-send:disabled {
  background: var(--dim);
  cursor: not-allowed;
}
.site-send svg {
  width: 16px;
  height: 16px;
}
.site-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.site-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--secondary);
  cursor: pointer;
  text-align: left;
}
.site-chip:hover {
  border-color: var(--control-border);
  background: var(--soft);
  color: var(--ink);
}

/* Galeria com miniaturas reais: a tela de Sites é só ela; criar abre #sites/new. */
.site-gallery-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 22px;
}
.site-list-actions .button {
  height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 14px;
}
.site-list-actions {
  display: flex;
  gap: 8px;
}
.site-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 56px 24px;
  border: 1px dashed var(--control-border);
  border-radius: 16px;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
}
.site-empty h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin: 6px 0 0;
}
.site-empty p {
  max-width: 52ch;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.site-empty-art {
  display: grid;
  gap: 5px;
  width: 120px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.site-empty-art i {
  display: block;
  height: 6px;
  border-radius: 5px;
  background: var(--line);
}
.site-empty-art i:first-child {
  width: 70%;
  height: 9px;
  background: var(--ink);
}
.site-empty-art i:last-child {
  width: 45%;
}
.site-create-nav {
  margin: 0 0 18px;
}
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 18px;
}
.site-grid-empty {
  margin: 0;
  padding: 24px;
  color: var(--faint);
}
.site-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.site-card:hover,
.site-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px -26px #28201259;
}
.site-thumb {
  display: block;
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #f4f1ea;
  border-bottom: 1px solid var(--line);
}
.site-thumb iframe {
  /* Viewport de ~1.200px reduzido a 25%: a miniatura mostra a página como no computador. */
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 400%;
  border: 0;
  transform: scale(0.25);
  transform-origin: 0 0;
  pointer-events: none;
}
.site-thumb-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--faint);
}
.site-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}
.site-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.site-card-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.site-card-name {
  font-size: 15.5px;
  font-weight: 500;
}
.site-card-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.site-card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.site-card-foot .agent-avatar {
  width: 18px;
  height: 18px;
  font-size: 9px;
}
@media (prefers-reduced-motion: reduce) {
  .site-card,
  .personality-library-item,
  .dashed-tile {
    transition: none;
  }
}

.site-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12.5px;
  color: var(--faint);
}
.site-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9c4b8;
}
.site-status.live {
  color: var(--secondary);
}
.site-status.live::before {
  background: var(--accent);
}

/* Ateliê em tela cheia. */
.site-builder-mode {
  overflow: hidden;
}
.site-builder-mode > .sidebar,
.site-builder-mode > .shell {
  display: none;
}
.site-builder {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  z-index: 1;
}
.site-builder-loading {
  margin: auto;
}
.site-bar {
  flex: none;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 23px;
  border-bottom: 1px solid var(--line);
}
.site-bar h1 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0;
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-bar-tabs {
  display: none;
}
.site-devices {
  display: inline-flex;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.site-devices button {
  width: 32px;
  height: 29px;
  border: 0;
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.site-devices button + button {
  border-left: 1px solid var(--control-border);
}
.site-devices button[aria-pressed="true"] {
  background: var(--soft);
  color: var(--ink);
}
.site-devices svg {
  width: 15px;
  height: 15px;
}
.site-studio {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(330px, 400px) 1fr;
}

/* Conversa. */
.site-talk {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}
.site-brief {
  flex: none;
  max-height: 36%;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-brief-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  position: sticky;
  top: 0;
  background: var(--bg);
}
.site-brief-head::after {
  content: "⌄";
  color: var(--muted);
  transition: transform 0.15s;
}
.site-brief-head[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}
.site-brief-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.site-brief-empty {
  margin: 0;
  padding: 0 16px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.site-brief-list {
  margin: 0;
  padding: 0 16px 12px;
  display: grid;
  gap: 8px;
}
.site-brief-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.site-brief-row dt {
  color: var(--muted);
}
.site-brief-row dd {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.site-brief-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--soft);
  border-radius: 7px;
  padding: 1px 2px 1px 6px;
}
.site-tag button,
.site-brief-x {
  width: 16px;
  height: 16px;
  flex: none;
  border: 0;
  background: none;
  color: var(--dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.site-tag button:hover,
.site-brief-x:hover {
  color: var(--ink);
}
.site-tag svg,
.site-brief-x svg {
  width: 10px;
  height: 10px;
}
.site-thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Perguntas críticas do assistente: cartões com opções clicáveis, resposta livre e "Decida por mim". */
.site-questions {
  display: grid;
  gap: 8px;
}
.site-q {
  margin: 0;
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
/* Tipo só no pontinho, em tons apagados: a base continua monocromática. */
.site-q-kind.risk {
  --q-accent: #b4532a;
}
.site-q-kind.doubt {
  --q-accent: #5b7aa8;
}
.site-q-kind.suggestion {
  --q-accent: #5f8a6b;
}
.site-q legend {
  float: left;
  width: 100%;
  padding: 0;
  line-height: 1.45;
}
.site-q legend + * {
  clear: both;
}
.site-q-kind {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.site-questions.answered .site-q-kind {
  display: inline-flex;
  margin: 0 6px 0 0;
}
.site-q-kind::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--q-accent, var(--muted));
}
.site-q-text {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
}
.site-q-why {
  margin: -2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.site-q-options {
  display: grid;
  gap: 6px;
}
.site-q-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.site-q-option:hover {
  border-color: var(--control-border);
  background: var(--soft);
}
.site-q-option.on {
  border-color: var(--ink);
  background: var(--soft);
}
.site-q-option > span:nth-child(2) {
  flex: 1;
}
.site-q-dot,
.site-q-box {
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--control-border);
  display: grid;
  place-items: center;
}
.site-q-dot {
  border-radius: 50%;
}
.site-q-box {
  border-radius: 7px;
}
.site-q-option.on .site-q-dot {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--bg);
  background: var(--ink);
}
.site-q-option.on .site-q-box {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.site-q-box svg {
  width: 10px;
  height: 10px;
  stroke-width: 2.4;
}
.site-q-rec {
  flex: none;
  font-size: 12px;
  color: var(--muted);
}
.site-q-other {
  border: 0;
  border-bottom: 1px dashed var(--control-border);
  padding: 5px 2px;
  font: inherit;
  font-size: 14px;
  background: transparent;
  color: var(--ink);
  outline: 0;
}
.site-q-other:focus {
  border-bottom-color: var(--ink);
  border-bottom-style: solid;
}
.site-q-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 0;
}
.site-q-count {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
}
.site-q-foot .site-link {
  font-size: 13px;
  color: var(--secondary);
}
.site-questions.answered {
  gap: 4px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  max-width: 88%;
}
.site-questions.answered p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.site-msg {
  max-width: 88%;
  font-size: 14px;
  line-height: 1.55;
}
.site-msg p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.site-msg.user {
  align-self: flex-end;
  background: var(--ink);
  color: white;
  border-radius: 14px 14px 4px 14px;
  padding: 8px 12px;
}
.site-msg.assistant {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
}
.site-msg.error {
  border-color: #f0c4c4;
  background: #fff7f7;
}
.site-msg.pending {
  width: 88%;
}
.site-version-chip {
  margin-top: 8px;
  border: 1px solid var(--control-border);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.site-version-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.site-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.site-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
  animation: site-typing 1.2s infinite ease-in-out;
}
.site-typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.site-typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes site-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
/* Etapas da construção (padrão "Agent Plan" do 21st, em versão nativa). */
.site-steps {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  position: relative;
}
.site-steps::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  border-left: 1px dashed var(--control-border);
}
.site-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 0;
  color: var(--dim);
}
.site-steps li svg {
  width: 15px;
  height: 15px;
  flex: none;
  background: var(--bg);
  border-radius: 50%;
}
.site-steps li.done {
  color: var(--muted);
}
.site-steps li.done svg {
  color: #1f9d5c;
}
.site-steps li.doing {
  color: var(--ink);
  font-weight: 500;
}
.site-steps li.doing svg {
  animation: site-spin 0.9s linear infinite;
}
@keyframes site-spin {
  to {
    transform: rotate(360deg);
  }
}
.site-steps-note {
  margin-top: 8px !important;
  font-size: 12px;
  color: var(--muted);
}
.site-compose {
  flex: none;
  padding: 0 16px 16px;
}
.site-compose .site-chips {
  margin: 0 0 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-compose .site-chip {
  white-space: nowrap;
}
.site-readonly {
  margin: 0 16px 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Palco: moldura de navegador sobre a grade do Canvas. */
.site-stage {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 32px 18px;
  overflow: auto;
  background-color: var(--bg);
  background-image: linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
.site-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--control-border);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 18px 50px -24px #0000003d, 0 2px 6px #0000000d;
  overflow: hidden;
  transition: max-width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.site-frame.mobile {
  max-width: 392px;
  border-radius: 22px;
}
.site-frame-bar {
  flex: none;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
}
.site-frame-dots {
  display: inline-flex;
  gap: 5px;
}
.site-frame-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--active);
}
.site-frame.mobile .site-frame-dots {
  display: none;
}
.site-frame-url {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  color: var(--secondary);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.site-frame-open {
  color: var(--muted);
  display: grid;
}
.site-frame-open:hover {
  color: var(--ink);
}
.site-frame-open svg {
  width: 14px;
  height: 14px;
}
.site-frame-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: white;
}
.site-frame-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Construindo: a versão atual fica na tela, inativa, com um aviso até a nova chegar. */
.site-frame-body.working iframe {
  pointer-events: none;
  filter: saturate(0.7);
  opacity: 0.72;
  transition: opacity 0.3s, filter 0.3s;
}
.site-applying {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18px;
  pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 35%, transparent), transparent 140px);
}
.site-applying-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.site-applying-pill svg {
  flex: none;
  width: 14px;
  height: 14px;
  animation: site-spin 0.9s linear infinite;
}
@keyframes site-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-applying-pill svg {
    animation: none;
  }
}

/* Pedido de mudança numa parte apontada da prévia (botão direito): uma barra compacta
   ancorada na parte, como o composer da conversa. */
.site-pick {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 8px;
  border: 1px solid var(--control-border);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(37, 99, 235, 0.14);
  animation: site-pick-in 0.12s ease-out;
}
@keyframes site-pick-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-pick {
    animation: none;
  }
}
.site-pick-kind {
  flex: none;
  align-self: center;
  max-width: 110px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
}
.site-pick textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  outline: 0;
  padding: 6px 0;
  max-height: 140px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  background: transparent;
  color: var(--ink);
}
.site-canvas-empty {
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.site-canvas-empty p {
  margin: 0;
  max-width: 42ch;
}
.site-canvas-empty p:first-child {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
/* Planta da página: desenhada seção por seção enquanto a IA constrói. */
.site-blueprint {
  height: 100%;
  padding: 22px 28px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 26px;
  background: #fbfbfb;
}
.site-blueprint > * {
  opacity: 0;
  animation: site-draw 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.site-blueprint > :nth-child(2) {
  animation-delay: 0.5s;
}
.site-blueprint > :nth-child(3) {
  animation-delay: 1s;
}
.site-blueprint > :nth-child(4) {
  animation-delay: 1.5s;
}
.site-blueprint i,
.site-blueprint b,
.site-blueprint span {
  display: block;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--active) 0%, var(--soft) 50%, var(--active) 100%);
  background-size: 200% 100%;
  animation: site-shimmer 1.6s linear infinite;
}
.bp-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bp-nav i {
  width: 56px;
  height: 9px;
}
.bp-nav i:first-child {
  width: 110px;
  height: 14px;
  margin-right: auto;
}
.bp-nav b {
  width: 96px;
  height: 26px;
  border-radius: 999px;
}
.bp-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
}
.bp-hero div {
  display: grid;
  gap: 12px;
}
.bp-hero i {
  height: 26px;
}
.bp-hero i.thin {
  height: 10px;
}
.bp-hero b {
  width: 140px;
  height: 34px;
  border-radius: 999px;
  margin-top: 8px;
}
.bp-hero span {
  aspect-ratio: 4 / 3;
  border-radius: 18px;
}
.bp-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.bp-cards span {
  height: 96px;
  border-radius: 14px;
}
.bp-lines {
  display: grid;
  gap: 10px;
  align-content: start;
}
.bp-lines i {
  height: 10px;
}
.w80 {
  width: 80%;
}
.w70 {
  width: 70%;
}
.w60 {
  width: 60%;
}
.w50 {
  width: 50%;
}
.w40 {
  width: 40%;
}
.site-frame.mobile .bp-hero,
.site-frame.mobile .bp-cards {
  grid-template-columns: 1fr;
}
.site-frame.mobile .bp-nav i:not(:first-child) {
  display: none;
}
@keyframes site-draw {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes site-shimmer {
  to {
    background-position: -200% 0;
  }
}
.site-versions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  min-height: 26px;
}
.site-versions-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}
.site-versions-note {
  font-size: 12px;
  color: var(--muted);
}
.site-version-pill {
  position: relative;
  height: 24px;
  min-width: 34px;
  padding: 0 9px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.site-version-pill:hover {
  border-color: var(--ink);
}
.site-version-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.site-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1f9d5c;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Gaveta de ajustes. */
.site-drawer {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: none;
  width: min(420px, 100vw);
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0;
  box-shadow: -12px 0 40px var(--drawer-shadow);
}
.site-drawer::backdrop {
  background: var(--backdrop);
}
.site-drawer form {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.site-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.site-drawer-head h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}
.site-drawer-head svg {
  width: 14px;
  height: 14px;
}
.site-drawer-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-content: start;
}
.site-drawer-body .field-help a {
  color: var(--ink);
}
.site-drawer-alert {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fff8e6;
  border: 1px solid #f1dfae;
  font-size: 13px;
  line-height: 1.5;
}
.site-address {
  display: flex;
  align-items: center;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.site-address input {
  border: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}
.site-address span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.site-drawer-danger {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.site-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .site-bar {
    padding: 0 12px;
    gap: 8px;
  }
  .site-bar .workspace-separator,
  .site-bar h1,
  .site-bar [data-site-state],
  .site-devices,
  .site-bar [data-site-settings] span,
  .site-bar .site-domain-name,
  .site-publish-extra {
    display: none;
  }
  /* No celular, a situação do domínio fica só no ponto colorido. */
  .site-bar .site-domain-pill {
    font-size: 0;
    gap: 0;
    padding: 4px;
    border: 0;
    background: none;
  }
  .site-bar-tabs {
    display: inline-flex;
    border: 1px solid var(--control-border);
    border-radius: 999px;
    padding: 2px;
  }
  .site-bar-tabs button {
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
  }
  .site-bar-tabs button[aria-selected="true"] {
    background: var(--ink);
    color: white;
  }
  .site-studio {
    grid-template-columns: 1fr;
  }
  .site-studio[data-pane="chat"] .site-stage,
  .site-studio[data-pane="preview"] .site-talk {
    display: none;
  }
  .site-stage {
    padding: 12px;
  }
  .site-frame.desktop {
    border-radius: 12px;
  }
  .site-start-title {
    font-size: 18px;
  }
}
/* Ateliê compartilhado: quem está aqui e quem escreveu cada mensagem. */
.site-people {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.site-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--active);
  border: 2px solid var(--bg);
  margin-left: -6px;
}
.site-avatar:first-child {
  margin-left: 0;
}
.site-people-label {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22vw;
}
.site-msg-author {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
}
.site-msg.user.other {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--control-border);
  border-radius: 14px 14px 4px 14px;
}
@media (max-width: 900px) {
  .site-people-label {
    display: none;
  }
}

/* Assistente de criação: Negócio → Links úteis → Visual → Revisão. */
.site-wizard {
  max-width: 820px;
  margin: 4px 0 44px;
}
.wz-steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wz-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wz-steps li + li::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--control-border);
}
.wz-steps button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 6px 4px 2px;
  border-radius: 999px;
  cursor: pointer;
}
.wz-steps button:disabled {
  cursor: default;
  color: var(--dim);
}
.wz-steps .current button {
  color: var(--ink);
  font-weight: 500;
}
.wz-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--control-border);
  display: grid;
  place-items: center;
  font-size: 13px;
  background: var(--bg);
}
.wz-steps .current .wz-dot {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.wz-steps .done .wz-dot {
  border-color: var(--ink);
  color: var(--ink);
}
.wz-dot svg {
  width: 12px;
  height: 12px;
}
.wz-body {
  min-height: 220px;
}
.wz-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.wz-spacer {
  flex: 1;
}
.wz-reset {
  font-size: 13px;
  color: var(--muted);
}
.wz-paste {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--control-border);
  border-radius: 16px;
  background: var(--bg);
}
.wz-paste:focus-within {
  border-color: var(--ink);
}
.wz-paste input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 15px;
  padding: 4px 6px;
  background: transparent;
}
.wz-paste.small input {
  font-size: 14px;
}
.wz-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 18px;
}
.wz-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  font: inherit;
  font-size: 13px;
  color: var(--secondary);
  cursor: pointer;
}
.wz-kind:hover {
  border-color: var(--control-border);
  background: var(--soft);
  color: var(--ink);
}
.wz-badge {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--muted);
}
.wz-badge[data-kind="Doctoralia"] {
  background: #00a990;
}
.wz-badge[data-kind="Currículo Lattes"] {
  background: #1d4f91;
}
.wz-badge[data-kind="LinkedIn"] {
  background: #0a66c2;
}
.wz-badge[data-kind="Instagram"] {
  background: #c13584;
}
.wz-badge[data-kind="Google Maps"] {
  background: #188038;
}
.wz-badge[data-kind="Facebook"] {
  background: #1877f2;
}
.wz-badge[data-kind="Texto"],
.wz-badge[data-kind="Site atual"] {
  background: var(--ink);
}
.wz-cards {
  display: grid;
  gap: 10px;
}
.wz-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px 40px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  animation: wz-in 0.25s ease-out;
}
.wz-card.thin,
.wz-card.blocked {
  border-color: #f1dfae;
}
.wz-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--dim);
}
.wz-shimmer {
  background: linear-gradient(90deg, var(--active) 0%, var(--soft) 50%, var(--active) 100%);
  background-size: 200% 100%;
  animation: site-shimmer 1.4s linear infinite;
}
.wz-card-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
}
.wz-card-kind {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.wz-card-main strong {
  font-weight: 500;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wz-desc {
  margin: 0;
  font-size: 13px;
  color: var(--secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wz-facts {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.wz-facts li {
  font-size: 13px;
  background: var(--soft);
  border-radius: 10px;
  padding: 2px 8px;
}
.wz-facts li span {
  color: var(--muted);
  margin-right: 5px;
}
.wz-url {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.wz-url:hover {
  color: var(--ink);
}
.wz-ok {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  color: #146c43;
}
.wz-ok svg {
  width: 12px;
  height: 12px;
}
.wz-reading {
  font-size: 13px;
  color: var(--muted);
}
.wz-warn {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}
.wz-warn p {
  margin: 0;
  font-size: 13px;
  color: #7a5b0b;
}
.wz-warn textarea,
.wz-card.note textarea,
.wz-notes textarea {
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  background: var(--bg);
}
.wz-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wz-remove:hover {
  background: var(--soft);
  color: var(--ink);
}
.wz-remove svg {
  width: 12px;
  height: 12px;
}
.wz-thumb-text {
  font-size: 20px;
}
.wz-empty,
.wz-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}
.wz-styles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.wz-style {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  font: inherit;
  cursor: pointer;
}
.wz-style:hover {
  border-color: var(--control-border);
}
.wz-style.selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.wz-style strong {
  font-weight: 500;
  font-size: 14px;
  margin-top: 6px;
}
.wz-style span:last-child {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.wz-swatches {
  display: flex;
  height: 28px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.wz-swatches i {
  flex: 1;
}
.wz-style-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wz-style-line .wz-swatches {
  width: 72px;
  height: 18px;
}
.wz-notes {
  margin-bottom: 12px;
}
.wz-refs {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
}
.wz-refs li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 6px 36px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.wz-refs li svg {
  width: 13px;
  height: 13px;
  color: #146c43;
  flex: none;
}
.wz-refs .wz-remove {
  top: 3px;
}
.wz-review {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.wz-review section {
  padding: 14px 16px;
}
.wz-review section + section {
  border-top: 1px solid var(--line);
}
.wz-review header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.wz-review h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.wz-review p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.wz-review-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 5px;
}
.wz-review-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-width: 0;
}
.wz-review-list svg {
  width: 13px;
  height: 13px;
  flex: none;
}
.wz-review-list li.ok svg {
  color: #146c43;
}
.wz-review-list li.warn svg {
  color: #b7791f;
}
@keyframes wz-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Fontes no ateliê ("O que já entendi"). */
.site-sources {
  padding: 4px 16px 14px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.site-sources-title {
  color: var(--muted);
}
.site-sources ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-sources a {
  color: inherit;
  text-decoration: none;
}
.site-sources a:hover {
  text-decoration: underline;
}
.site-tag.warn {
  background: #fff4d6;
}
.site-source-add {
  display: flex;
  gap: 6px;
}
.site-source-add input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  padding: 0 8px;
  height: 29px;
  font: inherit;
  font-size: 13px;
}
.site-images-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.site-images-hint {
  margin: 0;
  color: var(--muted);
}
.site-sources .site-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.site-image {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.site-image a {
  display: block;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  /* Xadrez discreto: logos transparentes continuam visíveis. */
  background: repeating-conic-gradient(var(--soft) 0% 25%, transparent 0% 50%) 50% / 12px 12px;
}
.site-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.site-image input,
.site-image-text {
  min-width: 0;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 1px 4px;
  font: inherit;
  font-size: 12px;
  background: none;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-image input:hover,
.site-image input:focus {
  border-color: var(--control-border);
  background: var(--bg);
}
.site-image button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 75%, transparent);
  color: var(--bg);
  cursor: pointer;
}
.site-image button.confirm {
  background: #c0392b;
  color: #fff;
}
.site-image button svg {
  width: 10px;
  height: 10px;
}
@media (max-width: 640px) {
  .wz-steps li + li::before {
    width: 10px;
  }
  .wz-steps button span:last-child {
    display: none;
  }
  .wz-steps .current button span:last-child {
    display: inline;
  }
  .wz-card {
    grid-template-columns: 44px 1fr;
  }
  .wz-thumb {
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wz-card,
  .wz-shimmer {
    animation: none;
  }
}

/* Consumo de tokens do site: discreto, ao lado das versões. */
.site-usage {
  margin-left: 10px;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  cursor: help;
  white-space: nowrap;
}
.site-usage:hover {
  color: var(--muted);
}

/* Domínio próprio: botão no topo do ateliê e painel lateral próprio. */
.site-drawer .site-drawer-form {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.site-domain-button {
  max-width: 300px;
  gap: 6px;
}
.site-domain-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-domain-pill {
  --pill-ink: var(--muted);
  --pill-line: var(--line);
  --pill-dot: var(--dim);
  --pill-bg: var(--bg);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--pill-ink);
  background: var(--pill-bg);
  border: 1px solid var(--pill-line);
  border-radius: 999px;
  padding: 0 8px 0 7px;
  white-space: nowrap;
}
.site-domain-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pill-dot);
}
.site-domain-pill[data-state="pending"],
.site-domain-pill[data-state="unpublished"] {
  --pill-ink: #8a5a00;
  --pill-line: #f1dfae;
  --pill-dot: #e0a100;
  --pill-bg: #fffaf0;
}
.site-domain-pill[data-state="pending"]::before {
  animation: celio-pulse 1.6s infinite ease-in-out;
}
.site-domain-pill[data-state="failed"] {
  --pill-ink: #b42318;
  --pill-line: #f5c2bd;
  --pill-dot: #d92d20;
  --pill-bg: #fff6f5;
}
.site-domain-pill[data-state="live"] {
  --pill-ink: #146c43;
  --pill-line: #b7e0c8;
  --pill-dot: #1f9d5c;
  --pill-bg: #f3fbf6;
}
.site-domain-status {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sidebar);
}
.site-domain-status[data-state="live"] {
  border-color: #b7e0c8;
  background: #f3fbf6;
}
.site-domain-status[data-state="pending"],
.site-domain-status[data-state="unpublished"] {
  border-color: #f1dfae;
  background: #fffcf5;
}
.site-domain-status[data-state="failed"] {
  border-color: #f5c2bd;
  background: #fff8f7;
}
.site-domain-status strong {
  font-size: 15px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.site-domain-status p {
  margin: 0;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.5;
}
.site-domain-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  min-width: 0;
}
.site-domain-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 18px;
}
/* Linha que liga os passos. */
.site-domain-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 11.5px;
  top: 26px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
.site-domain-step[data-step="done"]:not(:last-child)::before {
  background: #b7e0c8;
}
.site-domain-step > div {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
  padding-top: 3px;
}
.site-domain-step h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.site-domain-step p {
  margin: 0;
}
.site-domain-step[data-step="todo"] h3 {
  color: var(--muted);
}
.site-domain-step code {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.site-domain-step a {
  color: var(--ink);
  font-weight: 500;
}
.site-domain-step .field-help svg {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  color: var(--muted);
}
.site-domain-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--control-border);
  background: var(--bg);
  position: relative;
}
.site-domain-mark svg {
  width: 13px;
  height: 13px;
}
.site-domain-step[data-step="current"] .site-domain-mark {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}
.site-domain-step[data-step="done"] .site-domain-mark {
  color: #146c43;
  background: #f3fbf6;
  border-color: #b7e0c8;
}
.site-domain-step[data-step="wait"] .site-domain-mark {
  border-color: #f1dfae;
  background: #fffaf0;
}
.site-domain-mark .site-typing {
  gap: 2px;
}
.site-domain-mark .site-typing i {
  width: 3px;
  height: 3px;
  background: #e0a100;
}
.site-domain-platform {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.site-domain-platform code {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.site-domain-panel .site-drawer-foot {
  justify-content: flex-start;
}
.site-domain-add {
  display: flex;
  gap: 8px;
  width: 100%;
}
.site-domain-add input {
  flex: 1;
  min-width: 0;
  height: 31px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
}
.site-dns {
  width: 100%;
  justify-self: stretch;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.site-dns th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.site-dns td {
  padding: 6px 8px;
  vertical-align: top;
}
.site-dns th:first-child,
.site-dns td:first-child {
  width: 52px;
}
.site-dns td + td {
  word-break: break-all;
}
.site-dns code {
  display: inline;
  white-space: normal;
  word-break: break-all;
  background: none;
  padding: 0;
}
.site-copy {
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0 0 0 4px;
  vertical-align: middle;
}
.site-copy:hover {
  color: var(--ink);
}
.site-copy svg {
  width: 12px;
  height: 12px;
}
.site-domain-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .site-domain-pill::before,
  .site-blueprint > *,
  .site-blueprint i,
  .site-blueprint b,
  .site-blueprint span,
  .site-typing i,
  .site-steps li.doing svg {
    animation: none;
    opacity: 1;
  }
  .site-frame {
    transition: none;
  }
}

#widget-preview-button { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 17px; box-shadow: 0 6px 20px #0002; }
#widget-preview-button.widget-chat-solid svg { fill: currentColor; stroke: none; fill-rule: evenodd; }
#widget-preview-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#widget-preview p { background: color-mix(in srgb, currentColor 5%, transparent); color: inherit; }
#widget-preview .widget-wave { animation: widget-wave 4.2s ease-in-out infinite; }
@keyframes widget-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #widget-preview .widget-wave { animation: none; } }
#widget-settings input[type="color"] { width: 100%; height: 38px; padding: 4px; cursor: pointer; }
#widget-settings input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
#widget-settings input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
#widget-settings .widget-animation-label { display: flex; align-items: center; gap: 8px; }
#widget-settings .widget-animation-label input { margin: 0; }

/* Início: resumo do negócio. */
.home-view .page-heading {
  display: none;
}
.home-library {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}
.home-head h1 {
  font-size: 28px;
  margin: 4px 0 0;
}
.home-date,
.home-caption {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.home-caption {
  font-size: 11px;
  letter-spacing: 0.06em;
}
.home-create {
  position: relative;
}
.home-create > summary {
  list-style: none;
  cursor: pointer;
}
.home-create > summary::-webkit-details-marker {
  display: none;
}
.home-create-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 230px;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -22px #28201266;
  display: flex;
  flex-direction: column;
}
.home-create-menu a {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--secondary);
}
.home-create-menu a:hover {
  background: var(--sidebar);
  color: var(--ink);
}
.home-customize {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 18px 40px -26px #28201259;
}
.home-customize-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.home-customize-head h2 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 500;
}
.home-customize-head span {
  font-size: 13px;
  color: var(--faint);
}
.home-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.home-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sidebar);
  text-align: left;
}
.home-option > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.home-option strong {
  font-size: 14px;
  font-weight: 500;
}
.home-option small {
  font-size: 12.5px;
  color: var(--faint);
}
.switch {
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  padding: 2px;
  background: #d9d5cc;
  transition: background 0.2s ease;
}
.switch span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #00000033;
  transition: transform 0.2s ease;
}
[aria-checked="true"] > .switch {
  background: var(--accent);
}
[aria-checked="true"] > .switch span {
  transform: translateX(16px);
}
/* Um único grid: duas colunas no notebook, quatro lado a lado em telas largas. */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
@media (min-width: 1700px) {
  .home-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.home-list {
  overflow: hidden;
}
.home-list ul,
.home-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.home-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid #17181b0f;
  transition: background 0.15s ease;
}
.home-row:hover {
  background: var(--sidebar);
}
.home-row .agent-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.home-row-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.home-row-text strong {
  font-size: 14.5px;
  font-weight: 500;
}
.home-row-text span {
  font-size: 12.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-row-text .mono {
  font-size: 11.5px;
}
.home-site-thumb {
  width: 52px;
  height: 38px;
  flex: none;
  border-radius: 7px;
  border: 1px solid #17181b1a;
  background: #f4f1ea;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
}
.home-site-thumb span {
  height: 3px;
  border-radius: 2px;
  background: #1c1b18;
}
.home-site-thumb span:nth-child(1) {
  width: 60%;
  height: 4px;
}
.home-site-thumb span:nth-child(2) {
  width: 85%;
  opacity: 0.35;
}
.home-site-thumb span:nth-child(3) {
  width: 40%;
  height: 5px;
  margin-top: auto;
}
.home-add {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  color: var(--muted);
  font-size: 13.5px;
}
.home-add:hover {
  color: var(--ink);
}
.home-add svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}
.home-empty {
  margin: 0;
  padding: 18px 20px;
  font-size: 13.5px;
  color: var(--faint);
  border-bottom: 1px solid #17181b0f;
}
.home-appts {
  padding: 8px 0 !important;
}
.home-appt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 20px;
}
.home-appt > .mono {
  width: 48px;
  flex: none;
  font-size: 13px;
  color: var(--secondary);
}
.home-appt-bar {
  width: 2px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--accent);
}
.home-appt.past > .mono,
.home-appt.past strong {
  color: #8a8c92;
}
.home-appt.past .home-appt-bar {
  background: #17181b1a;
}
.home-crm {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-crm .home-empty {
  padding: 0;
  border: 0;
}
.home-funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--secondary);
}
.home-funnel-row > span:first-child {
  width: 110px;
  flex: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-funnel-track {
  flex: 1;
  height: 26px;
  border-radius: 7px;
  background: var(--page);
  overflow: hidden;
}
.home-funnel-track span {
  display: block;
  height: 100%;
  border-radius: 7px;
  min-width: 4px;
}
.home-funnel-row .mono {
  width: 28px;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink);
}
.home-followups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.home-followup {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.home-followup:hover > span:first-child {
  text-decoration: underline;
}
.home-lean {
  padding: 28px;
  border-radius: var(--radius-card);
  border: 1px dashed #17181b33;
  color: var(--muted);
  font-size: 14px;
}
.home-lean span {
  color: var(--accent);
}

/* Configurações: seções na lateral, conteúdo ao lado. */
.settings-nav {
  float: left;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-area main > section,
.settings-area main > #marketplace-library {
  margin-left: 224px;
}
.settings-area main::after {
  content: "";
  display: block;
  clear: both;
}
.settings-nav-caption {
  padding: 12px 12px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.settings-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
}
.settings-nav a:hover {
  background: var(--track);
  color: var(--ink);
}
.settings-nav a.active {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 1px 2px #28201214;
}
@media (max-width: 900px) {
  .settings-nav {
    float: none;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .settings-nav-caption {
    display: none;
  }
  .settings-area main > section,
  .settings-area main > #marketplace-library {
    margin-left: 0;
  }
}

.settings-library[data-tab="org"] > :not([data-panel="org"]),
.settings-library[data-tab="users"] > :not([data-panel="users"]),
.settings-library[data-tab="plan"] > :not([data-panel="plan"]) {
  display: none;
}
.settings-library {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.settings-library .users-heading h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.home-onboarding { margin-top: 0; }
.doc-tools .sort select {
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  max-width: none;
}
.org-actions {
  grid-column: 1 / -1;
}
