/* Scoped home composition; conversation, project and artifact layouts stay intact. */
.home-mark { display:block; margin:0 auto 20px; border-radius:10px; }
#empty-state { align-items:center; text-align:center; padding:32px 20px; gap:0; }
.chat-main.is-home>.messages { display:flex; flex-direction:column; }
.chat-main.is-home #empty-state { flex:1 0 auto; justify-content:safe center !important; min-height:min-content; }
#empty-state h1 { font:500 clamp(1.55rem,2.4vw,2rem)/1.25 var(--font-ui); letter-spacing:-.03em; text-wrap:balance; margin:0 0 18px; }
.home-tagline { margin:0; color:var(--slate); font-size:.94rem; line-height:1.5; }
.home-services { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; width:100%; margin:14px auto 0; text-align:left; }
.home-service { display:flex; gap:12px; align-items:flex-start; text-align:left; min-width:0; min-height:116px; padding:19px 16px; color:var(--ink); background:color-mix(in srgb,var(--surface) 80%,transparent); border:1px solid var(--border); border-radius:18px; font:inherit; cursor:pointer; transition:background .15s,border-color .15s; }
.home-service>svg { width:22px; height:22px; flex:0 0 22px; fill:none; stroke:var(--accent-ink); stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; margin-top:2px; }
.home-service>span { display:grid; gap:6px; min-width:0; }
.home-service strong { font-size:.94rem; line-height:1.35; font-weight:600; }
.home-service small { font-size:.77rem; line-height:1.5; font-weight:400; color:var(--slate); }
.home-service:hover,.home-service[aria-pressed=true] { background:color-mix(in srgb,var(--fluqxo-teal) 6%,var(--surface)); border-color:color-mix(in srgb,var(--fluqxo-teal) 40%,var(--border)); }
.home-service:focus-visible { outline:2px solid var(--fluqxo-teal); outline-offset:4px; }
.home-service:disabled { opacity:.65; cursor:progress; }
@media(max-width:640px) {
 .home-services { grid-template-columns:minmax(0,1fr); gap:10px; max-width:390px; }
 .home-service { min-height:70px; padding:14px 17px; align-items:center; border-radius:16px; }
 .home-service>span { gap:3px; }
 .home-service>svg { margin-top:0; }
 .home-tagline { font-size:.86rem; }
 .home-services { margin-top:10px; }
}
@media(max-height:700px) {
 #empty-state .home-mark { margin-bottom:12px; }
 #empty-state h1 { font-size:1.6rem; margin-bottom:17px; }
 .home-service { padding:10px 14px; min-height:62px; }
}
@media(prefers-reduced-motion:reduce){.home-service{transition:none}}
.home-suggestions { width:min(100%,720px); max-width:100%; color:var(--slate); font-size:.86rem; }
.home-suggestions>summary { display:flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; min-height:44px; padding:0 6px; border-radius:8px; list-style:none; }
.home-suggestions>summary::-webkit-details-marker { display:none; }
#empty-state .suggestion-grid { display:flex; flex-wrap:wrap; justify-content:center; gap:8px !important; margin-top:8px; }
#empty-state .suggestion-card { flex-direction:row; align-items:center; min-height:44px; padding:8px 14px; gap:8px; border-radius:24px; box-shadow:none; font-size:.85rem; }
#empty-state .suggestion-icon { width:20px !important; height:20px !important; flex-basis:20px !important; border-radius:0 !important; background:none; }
.sidebar .workspace-nav button, .sidebar-home-row, .sidebar-footer-row { min-height:44px; gap:12px; }
#sidebar .workspace-nav button, #sidebar .sidebar-home-row, #sidebar .sidebar-footer-row { font:500 .9375rem/1.4 var(--font-ui); color:var(--ink); padding:10px 12px; border-radius:10px; }
#sidebar .workspace-nav button svg, #sidebar .sidebar-home-row>svg, #sidebar .sidebar-footer-icon { color:var(--slate); }
#sidebar .sidebar-footer-icon { width:20px; height:20px; flex-basis:20px; background:none; border:0; border-radius:0; }
#sidebar .sidebar-home-row.is-active, #sidebar .workspace-nav button.is-active, #sidebar .conversation-item.is-active { background:color-mix(in srgb,var(--accent-ink) 10%,var(--nav-surface)); box-shadow:none; color:var(--ink); }
#sidebar .sidebar-heading { font:600 .75rem/1.4 var(--font-ui); color:var(--slate); letter-spacing:.055em; }
#sidebar .conversation-item { min-height:44px; font-size:.9rem; color:var(--slate); }
#sidebar .brand-name { color:var(--ink); }
#sidebar .brand-endorse { color:var(--slate); }
#sidebar :is(button,.conversation-item):focus-visible { outline:2px solid var(--accent-ink); outline-offset:2px; }
.sidebar .workspace-nav button svg, .sidebar-home-row>svg, .sidebar-footer-icon svg, .composer-tools svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.workspace-nav svg *, .sidebar-home-row>svg *, .sidebar-footer-icon svg *, .composer-tools svg * { stroke-width:1.75; }
.sidebar .workspace-nav button svg { flex-basis:20px; }
.home-suggestions>summary:focus-visible, .suggestion-card:focus-visible { outline:2px solid var(--fluqxo-teal); outline-offset:4px; }
@media (min-width:769px) {
 .chat-main.is-home:not(.workspace-view-open):not(.agent-view-open) { justify-content:center; }
 .chat-main.is-home>.chat-header { position:absolute; top:0; left:0; right:0; }
 .chat-main.is-home:not(.workspace-view-open):not(.agent-view-open)>.messages { flex:0 1 auto; min-height:0; }
 .chat-main.is-home #empty-state { min-height:0; padding-bottom:12px; }
 .chat-main.is-home>.composer-area { margin-bottom:clamp(36px,14vh,160px); }
}
@media (max-width:768px) {
 #empty-state { min-height:100%; padding:24px 18px; }
 #empty-state h1 { font-size:clamp(1.55rem,5.4vw,1.85rem); }
 .home-mark { width:32px; height:32px; margin-bottom:18px; }
}

/* Atalhos de topo: marca clicável e ícone de nova conversa. */
.sidebar-header .brand-compact { cursor:pointer; border-radius:10px; }
.sidebar-header .brand-compact:focus-visible { outline:2px solid var(--fluqxo-teal,#2f6f66); outline-offset:3px; }

/* Janelas baixas: a tela inicial encolhe (logo, título e margens) para o logo e os chips caberem sem cortar. */
@media (max-height:640px) {
  #empty-state { padding-top:12px; padding-bottom:12px; }
  #empty-state .home-mark { width:32px; height:32px; margin-bottom:8px; }
  #empty-state h1 { font-size:1.35rem; margin-bottom:8px; }
  #empty-state .home-service { padding-top:8px; padding-bottom:8px; }
}

/* Reserve the header in the desktop home layout, even when content grows. */
@media (min-width:769px) {
 .chat-main.is-home:not(.workspace-view-open):not(.agent-view-open) {
  padding-top: calc(3.85rem + env(safe-area-inset-top));
  justify-content: safe center;
 }
 .chat-main.is-home:not(.workspace-view-open):not(.agent-view-open) #empty-state {
  margin: 0 auto;
  min-height: min-content;
 }
 .chat-main.is-home:not(.workspace-view-open):not(.agent-view-open) > .composer-area {
  margin-bottom: clamp(8px, 4vh, 40px);
 }
}
@media (min-width:769px) and (max-height:640px) {
 .chat-main.is-home #empty-state .home-mark { width:32px; height:32px; margin-bottom:8px; }
 .chat-main.is-home #empty-state h1 { font-size:1.35rem; margin-bottom:8px; }
}
@media (min-width:769px) and (max-height:550px) {
 .chat-main.is-home #empty-state { padding-top:6px; padding-bottom:6px; }
 .chat-main.is-home .home-services { margin-top:8px; }
}

/* iPhone (PWA): como app nativo, o aviso fica DENTRO da área segura e a caixa de texto rente a ele. */
@media (max-width:768px) {
  html .composer-area { padding-bottom:0; }
  html .chat-composer { padding-bottom:0; }
  html .chat-main > .composer-area > .disclaimer { margin:0 auto; padding:6px 12px max(6px, calc(env(safe-area-inset-bottom) - 20px)); line-height:1.25; }
}

/* Teste "Tela inteira": html e body acompanham a altura calculada (o iOS informa 47 px a menos no app instalado). */
html.full-height, html.full-height body { height: var(--app-height); }

/* Mapa completo no celular: respeita a barra de status/indicador do iPhone (o botão Fechar cobria o horário e a bateria). */
@media (max-width: 500px) {
  html .relationship-map-dialog {
    height: var(--app-height, 100dvh); max-height: var(--app-height, 100dvh);
    padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
}
