.demo-visual {
  /* A paleta clara é o padrão, independente do tema da página. */
  color-scheme: light;
  --demo-ink: #16404d;
  --demo-accent: #dda853;
  --demo-mint: #a6cdc6;
  --demo-cream: #fbf5dd;
  --demo-line: #e0e8e8;
  position: relative;
  container-type: inline-size;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: var(--demo-ink);
  text-align: left;
  font-family: inherit;
  line-height: 1.45;
  pointer-events: none;
  user-select: none;
}
.demo-visual > div { position: relative; font-size: clamp(8px, 1.8cqi, 11px); }
.demo-visual *, .demo-visual *::before, .demo-visual *::after { box-sizing: border-box; }
.demo-visual svg { display: block; flex-shrink: 0; width: 1.35em; height: 1.35em; }
.demo-visual p, .demo-visual figure { margin: 0; }
.demo-visual--hero { padding: 1.75rem 1rem 2.5rem 0; }
.demo-visual--segment { padding-top: 1.75rem; }
.demo-caption {
  display: inline-block;
  position: absolute;
  top: -2.2em;
  left: 1.3em;
  padding: .32em .7em;
  border-radius: .4em .4em 0 0;
  color: var(--demo-ink);
  background: #dceae5;
  font-size: .85em;
  font-weight: 650;
  letter-spacing: .015em;
}
.demo-window {
  display: grid;
  grid-template-columns: 10.7em minmax(0, 1fr);
  min-height: 28.3em;
  overflow: hidden;
  border: .4em solid #e5eaea;
  border-radius: .85em;
  background: #f5f8f9;
  box-shadow: 0 1.5em 3.5em -1.9em rgba(22,64,77,.4), 0 .4em 1em rgba(22,64,77,.12), 0 0 0 1px #d8e1e2;
}
.demo-sidebar {
  display: flex;
  flex-direction: column;
  gap: .28em;
  min-width: 0;
  padding: 1.15em .7em .9em;
  color: #e5eeed;
  background: var(--demo-ink);
}
.demo-brand { display: flex; align-items: center; gap: .55em; margin: 0 .35em 1.1em; font-size: .83em; font-weight: 600; }
.demo-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-brand svg { width: 1.2em; height: 1.2em; color: #e4c68f; }
.demo-menu-item { display: flex; align-items: center; gap: .7em; min-height: 2.6em; padding: .45em .65em; border-radius: .35em; font-size: .79em; }
.demo-menu-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-menu-item svg { width: 1.25em; height: 1.25em; color: #b9d3d0; }
.demo-menu-item--active { color: var(--demo-ink); background: var(--demo-accent); font-weight: 650; }
.demo-menu-item--active svg { color: var(--demo-ink); }
.demo-menu-item--last { margin-top: .7em; opacity: .8; }
.demo-sidebar-foot { display: flex; align-items: center; gap: .5em; margin: auto .45em .1em; padding-top: 2em; color: #b5cfc9; font-size: .64em; white-space: nowrap; }
.demo-online { width: .55em; height: .55em; border-radius: 50%; background: var(--demo-mint); }
.demo-workspace { min-width: 0; }
.demo-topbar { display: flex; align-items: center; gap: .8em; min-height: 3.5em; padding: .6em 1.1em; border-bottom: 1px solid var(--demo-line); background: #fbfcfd; }
.demo-breadcrumb { color: #7a8e93; font-size: .7em; }
.demo-search { display: flex; align-items: center; gap: .5em; width: 10em; min-height: 1.6em; margin-left: auto; padding: .2em .5em; border: 1px solid var(--demo-line); border-radius: .35em; color: #8b9da0; background: white; font-size: .7em; }
.demo-top-icon { width: 1.1em !important; height: 1.1em !important; }
.demo-avatar { display: flex; justify-content: center; align-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--demo-mint); }
.demo-avatar svg { width: 1em; height: 1em; }
.demo-content { padding: 1.25em 1.2em 1em; }
.demo-welcome { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1em; gap: .6em; }
.demo-welcome > div { display: grid; gap: .1em; }
.demo-welcome > div > span { color: #6b7f84; font-size: .7em; }
.demo-welcome strong { font-size: 1.18em; letter-spacing: -.025em; }
.demo-date { display: flex; align-items: center; gap: .4em; color: #6b7f84; font-size: .7em; }
.demo-card { min-width: 0; padding: .85em; border: 1px solid var(--demo-line); border-radius: .45em; background: white; }
.demo-card-heading { display: flex; justify-content: space-between; align-items: center; gap: .5em; margin-bottom: .75em; }
.demo-card-heading strong { display: flex; align-items: center; gap: .4em; font-size: .85em; font-weight: 650; }
.demo-card-heading strong svg { color: #37786f; }
.demo-card-heading > span { display: flex; align-items: center; gap: .3em; color: #6c8588; font-size: .61em; white-space: nowrap; }
.demo-appointment { display: flex; align-items: center; gap: .65em; min-height: 2.5em; padding: .35em 0; }
.demo-appointment + .demo-appointment { border-top: 1px solid #f0f3f3; }
.demo-appointment time { min-width: 2.8em; color: #60767a; font-size: .72em; }
.demo-marker { align-self: stretch; width: .2em; flex-shrink: 0; min-height: 1.8em; border-radius: 5px; background: #6ba69d; }
.demo-marker--gold { background: var(--demo-accent); }
.demo-appointment > div { display: grid; min-width: 0; gap: .12em; }
.demo-appointment > div > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72em; font-weight: 550; }
.demo-appointment > div > span { color: #88999c; font-size: .58em; }
.demo-pill { display: inline-block; padding: .28em .5em; border-radius: .35em; font-size: .62em; font-weight: 550; white-space: nowrap; }
.demo-appointment > .demo-pill { margin-left: auto; }
.demo-pill--mint { color: #315f56; background: #e0efe9; }
.demo-pill--cream { color: #77561d; background: #fcf0d6; }
.demo-bottom-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: .7em; margin-top: .75em; }
.demo-task-list { display: grid; gap: .55em; }
.demo-task { display: flex; align-items: flex-start; gap: .5em; color: #526a70; font-size: .7em; }
.demo-checkbox { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: .95em; height: .95em; margin-top: .14em; border: 1px solid #bdcbce; border-radius: 2px; }
.demo-checkbox--done { border-color: #64988c; color: var(--demo-ink); background: var(--demo-mint); }
.demo-checkbox svg { width: .8em; height: .8em; stroke-width: 2.2; }
.demo-contract-row { display: grid; justify-items: start; gap: .2em; padding: .25em 0 .65em; }
.demo-contract-row > span:first-child { color: #667b80; font-size: .66em; }
.phone-frame { position: absolute; right: -1.3em; bottom: -2.2em; z-index: 2; width: 11.8em; min-height: 23.9em; padding: .38em; border: .17em solid #61716f; border-radius: 1.7em; background: #152326; box-shadow: .25em 1em 1.7em -.6em rgba(16,39,43,.4); transform: rotate(1deg); }
.phone-camera { position: absolute; top: .6em; left: 50%; z-index: 3; width: 3.2em; height: .7em; border-radius: .6em; background: #152326; transform: translateX(-50%); }
.phone-screen { display: flex; flex-direction: column; position: relative; min-height: 22.85em; padding: 2.8em .8em .9em; border-radius: 1.25em; background: #fff; }
.phone-status { display: flex; justify-content: space-between; position: absolute; top: 1em; left: 1.1em; right: 1.1em; z-index: 2; font-size: .48em; font-weight: 650; }
.phone-heading { display: flex; align-items: center; justify-content: space-between; gap: .3em; font-size: .8em; font-weight: 700; letter-spacing: -.02em; }
.phone-profile { display: flex; justify-content: center; align-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: #deeee8; font-size: .8em; }
.phone-greeting { margin: .4em 0 1.25em; color: #7b8e90; font-size: .6em; }
.phone-day { display: flex; align-items: flex-start; gap: .45em; padding: .8em .6em; border: 1px solid #eadbb4; border-radius: .55em; background: var(--demo-cream); }
.phone-day > svg { color: #8b681d; width: 1em; height: 1em; }
.phone-day > div { display: grid; gap: .25em; }
.phone-day strong { font-size: .58em; font-weight: 650; }
.phone-day span { color: #7c8073; font-size: .55em; }
.phone-menu-item { display: flex; align-items: center; gap: .65em; min-height: 3.2em; margin-top: .6em; padding: .5em .65em; border-radius: .4em; background: #f4f8f7; font-size: .7em; }
.phone-menu-item > svg { color: #4d887e; width: 1.3em; height: 1.3em; }
.phone-menu-arrow { margin-left: auto; transform: rotate(-90deg); width: .8em !important; height: .8em !important; }
.phone-bottom-line { width: 3.6em; height: .2em; margin: 1.2em auto 0; border-radius: 2em; background: #203739; }
.demo-segment-title { display: flex; align-items: center; justify-content: space-between; gap: .6em; margin: .4em 0 1.2em; }
.demo-segment-title > strong { font-size: 1.4em; letter-spacing: -.03em; }
.demo-feature-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55em; }
.demo-feature { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .65em; min-height: 5.3em; padding: .6em .25em; border: 1px solid var(--demo-line); border-radius: .45em; background: white; text-align: center; }
.demo-feature svg { width: 1.5em; height: 1.5em; color: #417b71; }
.demo-feature:nth-child(2n) svg { color: #a5782c; }
.demo-feature > span { font-size: .67em; line-height: 1.3; }
.demo-bottom-grid--segment { gap: .6em; margin-top: 1em; }
.demo-bottom-grid--segment > .demo-card { min-height: 10.2em; }
.demo-client-access { display: flex; flex-direction: column; background: #edf5f1; }
.demo-client-access > p { color: #678178; font-size: .72em; line-height: 1.5; }
.demo-access-link { display: flex; align-items: center; justify-content: space-between; gap: .25em; margin-top: auto; padding: .6em; border-radius: .4em; color: #375e56; background: #d4e8df; font-size: .67em; font-weight: 650; }
.demo-footer-note { display: flex; align-items: center; justify-content: flex-end; gap: .4em; margin-top: 1.3em; color: #819592; font-size: .66em; }
.demo-footer-note svg { width: 1.1em; height: 1.1em; }
@container (max-width: 440px) {
  .demo-window { grid-template-columns: 8.8em minmax(0, 1fr); }
  .demo-sidebar { padding-left: .45em; padding-right: .45em; }
  .demo-content { padding-left: .8em; padding-right: .8em; }
  .demo-menu-item { font-size: .72em; gap: .5em; }
  .demo-sidebar-foot { font-size: .52em; }
  .demo-search { width: 7em; }
  .demo-appointment > .demo-pill, .demo-breadcrumb, .demo-card-heading > span { display: none; }
  .demo-visual--hero .demo-contracts { padding-right: 1.7em; }
  .demo-segment-title > strong { font-size: 1.2em; }
  .demo-feature > span { font-size: .6em; }
  .demo-feature-grid { gap: .3em; }
  .demo-bottom-grid--segment .demo-task { font-size: .65em; }
  .phone-frame { right: -.2em; font-size: .91em; }
}
@media (prefers-reduced-motion: reduce) {
  .phone-frame { transform: none; }
}

/* Paleta escura das demonstrações, independente do tema da página. */
[data-demo-theme="dark"] .demo-visual {
  color-scheme: dark;
  --demo-champagne: #e3bc76;
  --demo-ink: #f4f7f7;
  --demo-accent: #58dfc0;
  --demo-mint: #58dfc0;
  --demo-cream: #e3bc76;
  --demo-line: #385058;
}
[data-demo-theme="dark"] .demo-caption { color: #10232a; background: var(--demo-accent); }
[data-demo-theme="dark"] .demo-window {
  background: #142d33;
  border-color: #263e45;
  box-shadow: 0 1.5em 3.5em -1.9em #020b10a8, 0 .4em 1em #020b104d, 0 0 0 1px #526c73;
}
[data-demo-theme="dark"] .demo-sidebar { color: var(--demo-ink); background: #10232a; }
[data-demo-theme="dark"] .demo-brand svg { color: var(--demo-champagne); }
[data-demo-theme="dark"] .demo-menu-item svg { color: #b7c7ca; }
[data-demo-theme="dark"] .demo-menu-item--active,
[data-demo-theme="dark"] .demo-menu-item--active svg { color: #10232a; }
[data-demo-theme="dark"] .demo-sidebar-foot { color: #b7c7ca; }
[data-demo-theme="dark"] .demo-topbar { background: #163139; }
[data-demo-theme="dark"] .demo-search { color: #b7c7ca; background: #10232a; }
[data-demo-theme="dark"] .demo-avatar { color: #10232a; background: var(--demo-accent); }
[data-demo-theme="dark"] .demo-breadcrumb,
[data-demo-theme="dark"] .demo-welcome > div > span,
[data-demo-theme="dark"] .demo-date,
[data-demo-theme="dark"] .demo-card-heading > span,
[data-demo-theme="dark"] .demo-appointment time,
[data-demo-theme="dark"] .demo-appointment > div > span,
[data-demo-theme="dark"] .demo-contract-row > span:first-child,
[data-demo-theme="dark"] .demo-footer-note { color: #b7c7ca; }
[data-demo-theme="dark"] .demo-card,
[data-demo-theme="dark"] .demo-feature { background: #19343b; }
[data-demo-theme="dark"] .demo-card-heading strong svg,
[data-demo-theme="dark"] .demo-feature svg { color: var(--demo-accent); }
[data-demo-theme="dark"] .demo-feature:nth-child(2n) svg { color: var(--demo-champagne); }
[data-demo-theme="dark"] .demo-appointment + .demo-appointment { border-color: #385058; }
[data-demo-theme="dark"] .demo-marker { background: var(--demo-accent); }
[data-demo-theme="dark"] .demo-marker--gold { background: var(--demo-champagne); }
[data-demo-theme="dark"] .demo-pill--mint { color: #10232a; background: #88d8c4; }
[data-demo-theme="dark"] .demo-pill--cream { color: #10232a; background: var(--demo-champagne); }
[data-demo-theme="dark"] .demo-task { color: #e0eaea; }
[data-demo-theme="dark"] .demo-checkbox { border-color: #8ba5ad; }
[data-demo-theme="dark"] .demo-checkbox--done { color: #10232a; background: var(--demo-accent); border-color: var(--demo-accent); }
[data-demo-theme="dark"] .demo-client-access { background: #1b3b41; }
[data-demo-theme="dark"] .demo-client-access > p { color: #b7c7ca; }
[data-demo-theme="dark"] .demo-access-link { color: #10232a; background: var(--demo-accent); }
[data-demo-theme="dark"] .phone-frame { background: #091a20; border-color: #70888d; box-shadow: .25em 1em 1.7em -.6em #020b10a8; }
[data-demo-theme="dark"] .phone-camera { background: #07151a; }
[data-demo-theme="dark"] .phone-screen { background: #10232a; }
[data-demo-theme="dark"] .phone-profile { color: #10232a; background: var(--demo-accent); }
[data-demo-theme="dark"] .phone-greeting { color: #b7c7ca; }
[data-demo-theme="dark"] .phone-day { color: #10232a; background: var(--demo-champagne); border-color: #f0d39d; }
[data-demo-theme="dark"] .phone-day > svg,
[data-demo-theme="dark"] .phone-day span { color: #263c3e; }
[data-demo-theme="dark"] .phone-menu-item { background: #19343b; }
[data-demo-theme="dark"] .phone-menu-item > svg { color: var(--demo-accent); }
[data-demo-theme="dark"] .phone-bottom-line { background: #e0eaea; }


/* Interruptor externo ao figure ilustrativo, sem alterar o layout do mock. */
.demo-preview { position: relative; min-width: 0; }
.demo-theme-toggle {
  position: absolute;
  top: 0;
  right: 1rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.demo-theme-toggle:hover { border-color: var(--accent); }
.demo-toggle-track {
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--line);
}
.demo-toggle-thumb {
  display: block;
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .18s ease;
}
.demo-theme-toggle[aria-checked="true"] .demo-toggle-track { background: var(--accent); border-color: var(--accent); }
.demo-theme-toggle[aria-checked="true"] .demo-toggle-thumb { transform: translateX(12px); background: var(--ink-deep); }
@media (prefers-reduced-motion: reduce) {
  .demo-toggle-thumb { transition: none; }
}

