/* Painel inicial: opção 3, com os controles reais do aplicativo. */
body[data-view="home"] { background: #061b2b; }
body[data-view="home"]::before, body[data-view="home"]::after { display: none; }
body[data-view="home"] > .topbar { display: none; }
body[data-view="home"] main { max-width: 1080px; }
#homeView { padding: 0; min-height: 100dvh; color: #fff; background: #061b2b; }
#homeView svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#homeView button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#homeView button:focus-visible { outline: 3px solid #76d8ff; outline-offset: 4px; }
#homeView button:disabled { opacity: .6; cursor: wait; }
.home-hero { position: relative; isolation: isolate; display: grid; grid-template-columns: 66px minmax(0,1fr); grid-template-areas: "logo actions" "title title" "connection connection"; gap: 16px; padding: calc(22px + var(--fm-safe-top,env(safe-area-inset-top))) 22px 52px; min-height: 254px; overflow: hidden; }
.home-hero-photo { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 63% 48%; }
.home-hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,rgba(3,21,36,.86),rgba(3,21,36,.43) 62%,rgba(3,21,36,.12)),linear-gradient(0deg,#061b2b,transparent 45%); }
.home-header-actions { grid-area: actions; align-self: start; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#homeView .home-header-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 13px; border: 1px solid #97b4c766; border-radius: 99px; color: #fff; background: #09243cd9; font-size: .875rem; font-weight: 650; }
.home-header-button svg { width: 22px; height: 22px; }
.home-brand { display: contents; }
.home-brand > div { grid-area: title; }
.home-logo { grid-area: logo; display: block; width: 66px; height: 66px; padding: 5px; border-radius: 14px; background: #fff; object-fit: contain; }
#homeView .home-brand h1 { margin: 0; color: #fff; font-size: clamp(1.375rem,6vw,1.875rem); line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.home-brand p { margin: 4px 0 0; color: #ccdeec; font-size: 1rem; line-height: 1.4; }
.home-connection { grid-area: connection; justify-self: start; display: inline-flex; align-items: center; gap: 9px; max-width: 100%; margin: 0; border: 1px solid #83b4c85c; border-radius: 99px; padding: 8px 12px; font-size: .875rem; line-height: 1.3; color: #e1f4f7; background: #062337d9; }
.home-connection .dot { flex: 0 0 9px; box-shadow: none; }
.home-connection:has(.online) { color: #aff0ce; border-color: #3bb17b80; }
.home-connection:has(.offline) { color: #ffdb93; border-color: #bd8b3480; }
.home-content { position: relative; display: grid; gap: 16px; margin-top: -24px; padding: 0 20px calc(24px + var(--fm-safe-bottom,env(safe-area-inset-bottom))); }
.home-work-card { position: relative; min-width: 0; padding: 18px 20px; border: 1px solid #e4eef6; border-radius: 20px; color: #092238; background: #fff; }
.home-work-card label { margin: 0 0 6px; color: #5a7187; font-size: .875rem; line-height: 1.4; font-weight: 500; }
.home-work-control { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 20px; gap: 16px; align-items: center; min-height: 44px; }
#homeWorkName { display: block; font-size: 1.25rem; line-height: 1.35; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
#homeView .home-chevron { width: 20px; height: 20px; color: #a6bfd2; }
.home-work-card .home-chevron { color: #5a7187 !important; }
#homeView #workSelect { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 1rem; }
.home-work-card:focus-within { outline: 3px solid #39bcf7; outline-offset: 3px; }
.home-photo-alert { display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 16px 18px; border: 1px solid #f2b94b; border-radius: 18px; color: #4e3000; background: #fff3cf; text-align: left; box-shadow: 0 8px 24px rgba(96,58,0,.12); }
.home-alert-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: #b96c00; font-size: 1.25rem; font-weight: 850; }
.home-photo-alert strong,.home-photo-alert small { display: block; }
.home-photo-alert strong { font-size: 1rem; line-height: 1.35; }
.home-photo-alert small { margin-top: 3px; color: #74500f; font-size: .8125rem; line-height: 1.4; }
.home-photo-alert .home-chevron { color: #9a6200!important; }
.home-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.home-actions { display: grid; gap: 14px; min-width: 0; }
#homeView .home-action { display: grid; grid-template-columns: 42px minmax(0,1fr) 20px; align-items: center; gap: 16px; min-height: 90px; width: 100%; margin: 0; padding: 20px; border: 1px solid #31556e; border-radius: 20px; background: #112e44; color: #fff; text-align: left; transition: background .15s ease; }
.home-action-icon { width: 42px; height: 42px; }
.home-action-copy { display: block; min-width: 0; }
.home-action-copy strong { display: block; font-size: 1.25rem; font-weight: 750; line-height: 1.25; letter-spacing: -.015em; }
.home-action-copy small { display: block; margin-top: 5px; color: #bdd3e5; font-size: .875rem; line-height: 1.4; }
#homeView .home-primary { grid-template-columns: 46px minmax(0,1fr); min-height: 100px; border-color: #36b9f4; background: linear-gradient(115deg,#007fba,#079fdf); }
.home-primary .home-action-icon { width: 46px; height: 46px; }
.home-primary .home-action-copy strong { font-size: 1.5rem; }
.home-primary .home-action-copy small { color: #e1f5ff; }
#homeView .home-resume { width: 100%; margin: 0; padding: 15px 18px; min-height: 48px; border: 1px solid #64b9e0; border-radius: 16px; background: #183d52; color: #e4f5ff; font-size: .875rem; font-weight: 650; line-height: 1.45; }
#homeView .home-sync-card { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 18px; border: 1px solid #e4eef6; border-radius: 20px; background: #fff; color: #19364a; text-align: left; }
.home-cloud { width: 36px; height: 36px; color: #577891; }
.home-cloud-check { visibility: hidden; }
.home-sync-card[data-state="confirmed"] .home-cloud { color: #079965; }
.home-sync-card[data-state="confirmed"] .home-cloud-check { visibility: visible; }
.home-sync-card[data-state="pending"] .home-cloud { color: #a96310; }
.home-sync-card[data-state="syncing"] .home-cloud { color: #087dab; }
.home-sync-copy { min-width: 0; }
.home-sync-copy strong { display: block; color: #132c41; font-size: 1rem; line-height: 1.35; font-weight: 750; overflow-wrap: anywhere; }
.home-sync-copy small { display: block; margin-top: 5px; color: #5a7187; font-size: .875rem; line-height: 1.4; }
.home-queue-link { display: flex; align-items: center; gap: 3px; border-radius: 12px; padding: 10px 8px; background: #eaf4fa; color: #106585; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.home-sync-card[data-state="confirmed"] .home-queue-link { color: #087d55; background: #e5f5ee; }
#homeView .home-queue-link .home-chevron { width: 15px; height: 15px; color: inherit; }
.home-offline-note { margin: 4px 0 0; color: #b4cbdc; font-size: .875rem; line-height: 1.5; text-align: center; }
@media (hover: hover) {
  #homeView .home-action:hover { background: #1b415b; }
  #homeView .home-primary:hover { background: #088bcc; }
  #homeView .home-sync-card:hover { background: #eef8fd; }
}
@media (max-width: 359px) {
  .home-hero { padding-left: 16px; padding-right: 16px; }
  #homeView .home-header-button { padding: 10px; }
  .home-content { padding-left: 14px; padding-right: 14px; gap: 14px; }
  #homeView .home-action { padding: 17px; gap: 12px; grid-template-columns: 34px minmax(0,1fr) 16px; }
  #homeView .home-primary { grid-template-columns: 38px minmax(0,1fr); }
  .home-action-icon { width: 34px; height: 34px; }
  .home-primary .home-action-icon { width: 38px; height: 38px; }
  .home-action-copy strong { font-size: 1.125rem; }
  #homeView .home-sync-card { grid-template-columns: 30px minmax(0,1fr); }
  .home-cloud { width: 30px; height: 30px; }
  .home-queue-link { grid-column: 2; justify-self: start; padding: 5px 9px; }
}
@media (min-width: 760px) {
  body[data-view="home"] main { padding: 28px; }
  #homeView { display: none; min-height: calc(100dvh - 56px); border: 1px solid #26455b; border-radius: 28px; overflow: hidden; }
  #homeView.active { display: grid; grid-template-columns: minmax(260px,.9fr) minmax(0,1.1fr); }
  .home-hero { padding: 30px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 590px; }
  .home-hero-photo { object-position: 43% center; }
  .home-hero::after { background: linear-gradient(0deg,#061b2b 1%,rgba(3,21,36,.64) 42%,rgba(3,21,36,.12)); }
  .home-header-actions { position: absolute; left: 20px; right: 20px; top: 24px; }
  .home-brand { display: grid; justify-items: start; gap: 20px; }
  .home-brand > div, .home-logo { grid-area: auto; }
  .home-logo { width: 78px; height: 78px; }
  #homeView .home-brand h1 { font-size: 1.875rem; }
  .home-connection { align-self: flex-start; margin-top: 20px; }
  .home-content { margin: 0; padding: 28px; align-content: center; }
  #homeView .home-sync-card { grid-template-columns: 30px minmax(0,1fr); }
  .home-queue-link { grid-column: 2; justify-self: start; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { #homeView .home-action { transition: none; } }
