/* Site preferences share storage and naming with the clinic portal. */
:root {
  color-scheme: light;
  --surface: #fff;
  --surface-soft: #f1f7f6;
  --action: #0f766e;
  --action-hover: #07544e;
}
:root[data-tema="escuro"] {
  color-scheme: dark;
  --ink: #e7f1ee;
  --muted: #adc4bf;
  --teal: #65d6c0;
  --teal-dark: #9ce6d7;
  --mint: #1c413c;
  --paper: #10252a;
  --line: #345159;
  --surface: #11292e;
  --surface-soft: #17343a;
}
.site-preferences {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  flex-shrink: 0;
}
.locale-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  width: 86px;
  min-height: 44px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.locale-control .icon { width: 17px; height: 17px; }
.locale-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font: 16px Karla, sans-serif;
  color: var(--ink);
  background: var(--surface);
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}
.theme-toggle .icon { width: 20px; height: 20px; }
.theme-toggle .theme-sun,
[data-tema="escuro"] .theme-toggle .theme-moon { display: none; }
[data-tema="escuro"] .theme-toggle .theme-sun { display: block; }
.locale-control:hover, .theme-toggle:hover { background: var(--mint); }
.locale-control:has(:focus-visible), .theme-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.header-inner { gap: 24px; }
.header-actions { gap: 16px; }
.desktop-nav { gap: 21px; white-space: nowrap; }
.header-actions > .button, .header-actions > .text-button { white-space: nowrap; }
.button { background: var(--action); border-color: var(--action); }
.button:hover { background: var(--action-hover); border-color: var(--action-hover); }
.stage-bottom, .finance-demo-summary > div > span { color: var(--muted); }
.theme-changing *, .theme-changing *::before, .theme-changing *::after {
  transition: none !important;
}
.faq-list summary > span { min-width: 0; }
.faq-list summary .icon { margin-inline: 4px; }

/* Surfaces and examples retain their individual hierarchy in the dark palette. */
[data-tema="escuro"] body { background: #091b20; }
[data-tema="escuro"] .site-header { background: #0d2227; border-color: var(--line); }
[data-tema="escuro"] .hero { background: #102b30; }
[data-tema="escuro"] :is(.brand img, .login-dialog-content > img) { content: url("assets/marca-clara.svg"); }
[data-tema="escuro"] :is(.product-window, .chat-person, .agenda-mini, .chat-compose,
  .stage-chat, .stage-chat-footer, .catalogue-slide, .resource-windowbar,
  .resource-paper, .resource-meal, .kanban-card, .resource-form b,
  .catalogue-pagination button, .menu-toggle, .skip-link, dialog) {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
[data-tema="escuro"] :is(.chat-demo, .feature-preview, .workflow-stage,
  .resource-window, .kanban-card.quiet) { background: var(--paper); border-color: var(--line); }
[data-tema="escuro"] :is(.contact-row.active, .agenda-mini > p, .stage-top,
  .state-text, .stage-chat-body, .resource-kanban > div, .resource-meal header,
  .dialog-close, .noscript) { background: var(--surface-soft); }
[data-tema="escuro"] :is(.bubble.incoming, .resource-bubble, .preview-message) {
  background: #203c43;
  border-color: var(--line);
}
[data-tema="escuro"] :is(.bubble.outgoing, .resource-bubble.own, .preview-answer,
  .demo-label, .avatar, .avatar.small, .new-appointment, .status,
  .resource-demo-badge, .resource-row > small, .document-ready,
  .calendar-week .current, .resource-days .current, .stage-next) {
  background: var(--mint);
  color: #b6ead6;
  border-color: #3c695e;
}
[data-tema="escuro"] .stage-next:hover { background: #28574c; }
[data-tema="escuro"] .status.pending { background: #4d3f24; color: #f2d799; }
[data-tema="escuro"] .agenda-demo-rows .featured-event { background: var(--mint); border-color: #548b78; }
[data-tema="escuro"] :is(.mock-search, .contact-row small, .contact-row time,
  .chat-person small, .chat-date, .bubble small, .chat-compose, .agenda-caption,
  .demo-caption, .preview-title > span, .preview-meta, .preview-event small,
  .stage-top, .state-text, .stage-contact small, .stage-note, .stage-chat-footer,
  .stage-footnote, .stage-bottom, .calendar-week, .calendar-week b,
  .agenda-demo-rows small, .finance-demo-summary > div > span,
  .finance-demo-summary small, .bar-chart small, .people-illustration, .footer small,
  .catalogue-copy li, .resource-toolbar > span, .resource-activity, .resource-context,
  .resource-contact small, .resource-kanban h4 > span, .kanban-card small,
  .resource-days > span, .resource-days b, .resource-row > span,
  .resource-sequence small, .resource-timeline span, .resource-timeline small,
  .resource-paper header small, .paper-block span, .paper-block p,
  .resource-paper footer, .resource-meal > div > span, .resource-meal > p,
  .resource-financial span, .resource-chart small, .resource-form > div > span) {
  color: var(--muted);
}
[data-tema="escuro"] :is(.chat-confirmed, .replay-button, .resource-tag,
  .paper-mark, .finance-line b, .bubble small > span, .bubble small .icon) { color: var(--teal); }
[data-tema="escuro"] :is(.contact-row, .mini-appointment, .preview-event,
  .resource-toolbar, .resource-context, .resource-contact, .resource-tag,
  .resource-row, .resource-paper > header, .resource-paper footer,
  .bar-chart, .resource-chart, .resource-meal, .paper-mark, .resource-timeline > div) {
  border-color: var(--line);
}
[data-tema="escuro"] .resource-timeline > div:before { border-color: var(--paper); }
[data-tema="escuro"] .kanban-card.success { border-color: #548b78; }
[data-tema="escuro"] :is(.paper-lines span, .window-dots > span) { background: #45615d; }
[data-tema="escuro"] .finance-line .icon { background: var(--mint); }
[data-tema="escuro"] .login-options > a:hover { background: var(--surface-soft); border-color: var(--teal); }
[data-tema="escuro"] .solutions { background: #06443f; }
[data-tema="escuro"] .catalogue-rail a[aria-selected="true"] .catalogue-track { background: #34675c; }
[data-tema="escuro"] .catalogue.is-ready .catalogue-slide { box-shadow: 0 16px 36px -22px #0009; }
[data-tema="escuro"] { scrollbar-color: #587f76 #10252a; }
[data-tema="escuro"] ::selection { background: #326456; color: #f0fff8; }

@media (max-width: 1400px) {
  .desktop-nav { display: none; }
  .header-actions { margin-left: auto; }
  .menu-toggle { display: grid; place-items: center; }
}
@media (max-width: 680px) {
  .header-inner { gap: 10px; padding-inline: 16px; }
  .header-actions { gap: 8px; }
  .header-actions > .text-button { display: none; }
  .site-preferences { padding: 0; border: 0; gap: 0; }
  .menu-toggle { width: 44px; height: 44px; }
  .brand img { width: clamp(88px, 29vw, 151px); }
  .locale-control { width: 80px; }
  .catalogue-playback { flex-wrap: wrap; row-gap: 2px; }
}
@media (max-width: 380px) {
  .catalogue-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Perfil oficial, sempre à vista, inclusive quando o menu está recolhido. */
.header-instagram {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dark);
  background: var(--mint);
  transition: color .2s, background-color .2s, border-color .2s;
}
.header-instagram .icon { width: 23px; height: 23px; stroke-width: 1.8; }
.header-instagram:hover { color: var(--surface); background: var(--teal-dark); border-color: var(--teal-dark); }
.header-instagram:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
@media (max-width: 380px) {
  .header-inner { padding-inline: 12px; gap: 8px; }
  .header-actions { gap: 4px; }
  .locale-control { width: 52px; }
  .locale-control > .icon { display: none; }
}

@media (min-width: 681px) and (max-width: 900px) {
  .header-actions > .button-small { display: none; }
}
