/* CENTRAL 5.4 — CENTRAL ADAPTATIVA
   Uma composição para qualquer tela, posições locais no Livre e guias animados. */

:root{
  --v54-paper:#f8f3e9;
  --v54-paper-deep:#e9dfcf;
  --v54-ink:#303323;
  --v54-moss:#5e6838;
  --v54-line:rgba(104,94,74,.20);
}

/* O conteúdo reconhecido ocupa a segunda coluna apenas quando realmente existe. */
.capture-workspace:not(.capture-has-recognition){grid-template-columns:minmax(0,1fr)!important}
.capture-workspace:not(.capture-has-recognition) .capture-compose-panel{
  width:min(610px,100%);box-sizing:border-box;margin-inline:auto;
}

/* Ações auxiliares nas preferências. */
.profile-guide-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.profile-guide-actions .soft-button{margin:0!important;min-height:46px;padding:10px;font-size:.7rem;line-height:1.25}

/* Tutorial comum, inspirado em papel, tinta e pequenos movimentos físicos. */
.guide-tutorial{
  position:fixed;inset:0;z-index:2600;box-sizing:border-box;padding:20px;
  display:grid;place-items:center;background:rgba(43,41,34,.28);backdrop-filter:blur(12px) saturate(.7);
}
.guide-tutorial.hidden{display:none!important}
.guide-card{
  position:relative;box-sizing:border-box;width:min(94vw,520px);max-height:min(92dvh,720px);overflow:auto;
  padding:31px;border:1px solid rgba(116,104,81,.27);border-radius:30px;
  color:var(--v54-ink);background:
    radial-gradient(ellipse at 92% 6%,rgba(153,165,100,.16),transparent 28%),
    radial-gradient(ellipse at 8% 94%,rgba(208,177,145,.14),transparent 30%),
    linear-gradient(145deg,#fcf9f1,#f2eadc);
  box-shadow:0 34px 100px rgba(46,41,32,.23);opacity:0;transform:translateY(16px) scale(.97);
  transition:opacity .24s ease,transform .34s cubic-bezier(.2,.82,.2,1);
}
.guide-card::before{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:.22;
  background:radial-gradient(circle,rgba(76,67,49,.22) 0 .45px,transparent .7px);background-size:9px 10px;
}
.guide-card.is-visible{opacity:1;transform:none}
.guide-close{
  position:absolute;z-index:3;right:18px;top:18px;width:38px;height:38px;padding:0;border-radius:50%;
  display:grid;place-items:center;background:rgba(237,230,217,.9);color:#555648;font-size:1.25rem;
}
.guide-copy{position:relative;z-index:2;padding-right:42px}
.guide-copy>span{display:block;color:#70764b;font:650 .61rem/1 Inter,sans-serif;letter-spacing:.13em;text-transform:uppercase}
.guide-copy h2{max-width:410px;margin:10px 0 9px;font:400 clamp(2rem,7vw,2.7rem)/.98 "DM Serif Display",Georgia,serif;letter-spacing:-.025em;text-wrap:balance}
.guide-copy p{max-width:440px;margin:0;color:#777166;font-size:.77rem;line-height:1.55}
.guide-scene{
  position:relative;z-index:2;box-sizing:border-box;height:250px;margin:24px 0 17px;padding:18px;
  overflow:hidden;border:1px solid rgba(113,102,81,.18);border-radius:24px;
  background:rgba(250,247,238,.54);box-shadow:inset 0 1px rgba(255,255,255,.72);
}
.guide-footer{position:relative;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:14px}
.guide-footer small{color:#928b7f;font-size:.61rem}
.guide-footer button{min-width:130px;min-height:44px;padding:10px 18px;border-radius:999px;background:linear-gradient(135deg,#768148,#566232);color:#fffdf6;font-weight:650}
.guide-platform-choice{position:relative;z-index:2;display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:-5px 0 17px}
.guide-platform-choice.hidden{display:none!important}
.guide-platform-choice button{min-height:42px;border:1px solid rgba(103,110,65,.25);border-radius:13px;background:rgba(245,243,224,.82);color:#596039;font-size:.7rem;font-weight:650}

/* Livre: o dedo move um bloco e o quadro respira. */
.guide-free-board{position:absolute;inset:0;background-image:radial-gradient(circle,rgba(115,109,91,.22) .8px,transparent 1px);background-size:20px 20px}
.guide-free-board>i{position:absolute;width:160px;height:1px;background:rgba(95,89,72,.09);transform:rotate(-25deg)}
.guide-free-board>i:first-child{left:-12px;top:80px}.guide-free-board>i:nth-child(2){right:-25px;bottom:70px;transform:rotate(19deg)}
.guide-note{position:absolute;width:112px;min-height:78px;padding:18px 12px;box-sizing:border-box;display:grid;place-items:center;text-align:center;color:#444130;font:600 1.05rem/1 Caveat,cursive;box-shadow:0 12px 24px rgba(60,52,40,.13)}
.guide-note.one{left:18%;top:24%;background:#d8d8b8;transform:rotate(-4deg);animation:guide-note-drag 3.5s ease-in-out infinite}
.guide-note.two{right:13%;bottom:17%;background:#e3c8b8;transform:rotate(4deg)}
.guide-hand{position:absolute;left:42%;top:49%;font-size:1.55rem;filter:grayscale(.25);animation:guide-hand-drag 3.5s ease-in-out infinite}
.guide-free-board em{position:absolute;right:16px;top:16px;width:39px;height:39px;display:grid;place-items:center;border-radius:50%;font-style:normal;background:#626a3c;color:white;box-shadow:0 7px 16px rgba(58,66,34,.2)}
@keyframes guide-note-drag{0%,16%,100%{translate:0 0;rotate:0deg}48%,72%{translate:74px 42px;rotate:3deg}}
@keyframes guide-hand-drag{0%,16%,100%{translate:0 0;opacity:.25}28%{opacity:1}48%,72%{translate:74px 42px;opacity:1}84%{opacity:.2}}

/* Agenda e Finanças: uma frase se transforma em um bloco reconhecido. */
.guide-agenda,.guide-finance{height:100%;display:grid;align-content:center;justify-items:center;gap:13px}
.guide-phrase{width:min(92%,360px);box-sizing:border-box;padding:15px 18px;border:1px solid rgba(120,110,89,.25);border-radius:999px;background:rgba(255,253,247,.78);text-align:center;color:#666358;font-size:.8rem;animation:guide-phrase-pulse 3s ease-in-out infinite}
.guide-agenda>span,.guide-finance>span{color:#7d8456;animation:guide-arrow 3s ease-in-out infinite}
.guide-recognition-row,.guide-finance article{width:min(88%,350px);box-sizing:border-box;min-height:70px;border:1px solid rgba(107,112,67,.22);border-radius:16px;background:linear-gradient(110deg,rgba(255,255,255,.6),rgba(232,234,207,.82));box-shadow:0 10px 24px rgba(57,51,39,.07);animation:guide-block-arrive 3s cubic-bezier(.2,.8,.2,1) infinite}
.guide-recognition-row{display:grid;grid-template-columns:74px 1fr;grid-template-rows:1fr 1fr;align-items:center;padding:11px 14px}
.guide-recognition-row i{grid-row:1/3;font-style:normal;color:#59623a;font-weight:700}.guide-recognition-row b{align-self:end;font:400 1.15rem/1 "DM Serif Display",Georgia,serif}.guide-recognition-row small{align-self:start;color:#827c70}
.guide-finance article{display:flex;align-items:center;gap:11px;padding:12px 14px}
.guide-finance article>i{width:34px;height:34px;border-radius:50%;background:#c7cfa5;box-shadow:inset 0 0 0 10px #e7ead4}
.guide-finance article p{display:flex;flex:1;flex-direction:column;margin:0}.guide-finance article p b{font-size:.82rem}.guide-finance article p small{margin-top:3px;color:#878074;font-size:.63rem}.guide-finance article>strong{color:#946757;font-size:.77rem}
@keyframes guide-phrase-pulse{0%,100%{box-shadow:none}45%{border-color:rgba(105,117,61,.45);box-shadow:0 0 0 5px rgba(112,125,66,.08)}}
@keyframes guide-arrow{0%,32%{opacity:.2;translate:0 -4px}48%,100%{opacity:1;translate:0 2px}}
@keyframes guide-block-arrive{0%,36%{opacity:0;translate:0 13px;scale:.96}55%,90%{opacity:1;translate:0 0;scale:1}100%{opacity:.75}}

/* Instalação: instrução específica para cada família de dispositivo. */
.guide-install-device{position:relative;height:100%;display:grid;align-content:center;justify-items:center;gap:14px}
.guide-browser-bar{width:min(90%,390px);box-sizing:border-box;display:flex;justify-content:space-between;padding:12px 15px;border:1px solid rgba(112,104,86,.22);border-radius:13px;background:#fbf8f1;color:#777166;font-size:.7rem;box-shadow:0 8px 20px rgba(50,44,34,.06)}
.guide-browser-bar b{display:grid;place-items:center;width:26px;height:26px;margin:-6px;border-radius:8px;background:#eaeddb;color:#59613b;font-size:1rem;animation:guide-install-tap 2.2s ease-in-out infinite}
.guide-install-device ol{width:min(88%,350px);margin:0;padding:0;display:grid;gap:8px;list-style:none;color:#5d594f;font-size:.72rem}
.guide-install-device li{display:flex;align-items:center;gap:9px}.guide-install-device li i{width:23px;height:23px;display:grid;place-items:center;border:1px solid #a7aa83;border-radius:50%;font-style:normal;color:#656b44;font-size:.6rem}
.guide-home-icon{position:absolute;right:18px;bottom:8px;width:66px;height:66px;display:grid;place-items:center;border-radius:18px;background:linear-gradient(145deg,#7b8550,#535e32);color:#e7e7cc;box-shadow:0 13px 24px rgba(52,58,31,.23);letter-spacing:.12em;animation:guide-home-arrive 2.8s ease-in-out infinite}
.guide-home-icon b{display:block;color:white;font-size:.56rem;letter-spacing:0}
.guide-desktop-window{position:absolute;right:20px;bottom:12px;width:105px;height:70px;display:grid;place-items:center;border:5px solid #646948;border-top-width:14px;border-radius:8px;background:#f7f2e8;color:#454a2f;font:400 1.1rem "DM Serif Display",Georgia,serif;animation:guide-home-arrive 2.8s ease-in-out infinite}
.guide-device-cloud{height:100%;display:flex;align-items:center;justify-content:center;gap:9px;flex-wrap:wrap}.guide-device-cloud span{padding:12px 16px;border:1px solid rgba(104,111,66,.23);border-radius:999px;background:#eff0dd;color:#5f663f;font-size:.72rem;animation:guide-device-float 2.6s ease-in-out infinite}.guide-device-cloud span:nth-child(2){animation-delay:-.8s}.guide-device-cloud span:nth-child(3){animation-delay:-1.6s}
@keyframes guide-install-tap{0%,100%{scale:1}50%{scale:1.18;background:#dfe5bd}}
@keyframes guide-home-arrive{0%,25%{opacity:0;translate:0 15px;scale:.85}50%,88%{opacity:1;translate:0;scale:1}100%{opacity:.8}}
@keyframes guide-device-float{50%{translate:0 -7px}}

/* Celulares estreitos e/ou baixos: nenhuma ação fica fora da área útil. */
@media(max-width:420px){
  .topbar{height:68px!important;padding:12px 14px 8px!important}
  .feed-topbar .brand strong{font-size:1.28rem!important}.feed-topbar .brand-dots{width:33px!important}
  .corner-control{width:46px!important;height:46px!important;border-radius:17px!important}.corner-control small{font-size:.52rem!important}
  .feed-counter{display:none!important}
  .feed-view{padding-inline:9px!important}.feed-focus{inset-inline:9px!important}.habit-field{inset-inline:-1px!important}
  .feed-scroller{padding:8px 0 4px!important}.feed-slide{height:100%;min-height:100%!important;padding:12px 4px 14px!important;box-sizing:border-box}
  .feed-card,.feed-empty{box-sizing:border-box!important;width:100%!important;height:calc(100% - 2px)!important;min-height:0!important;max-height:none!important;padding:42px 18px 17px!important;border-radius:25px!important}
  .feed-card-main{padding:10px 2px!important}.feed-title{font-size:clamp(2rem,11vw,2.75rem)!important}.feed-guidance{margin-top:13px!important;font-size:.69rem!important}
  .focus-card-bottom{padding:6px!important}.focus-card-bottom .feed-actions{grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr)!important;gap:4px!important}.focus-card-bottom .feed-actions .feed-edit-button{width:40px!important;height:40px!important}.focus-card-bottom .feed-actions button{height:40px!important;font-size:.64rem!important}
  .feed-gesture{height:30px!important;font-size:.55rem!important;gap:7px!important}
  .capture-button{right:12px!important;bottom:76px!important;width:52px!important;height:52px!important}.capture-button span{width:30px!important;height:30px!important}
  .bottom-nav,.bottom-nav.four{height:68px!important;padding-inline:4px!important}.nav-item small{font-size:.55rem!important}.nav-item svg{width:20px!important;height:20px!important}
  .agenda-view,.finance-view{padding:8px 12px 14px!important}.agenda-view .section-header,.finance-view .section-header{padding-inline:2px!important}.agenda-view .section-header h1,.finance-header h1{font-size:clamp(2.5rem,13vw,3.05rem)!important}
  .appointment-card{grid-template-columns:78px minmax(0,1fr)!important}.appointment-time{font-size:.82rem!important;padding-inline:8px 15px!important}.appointment-main{padding-left:17px!important}.appointment-main strong{font-size:1rem!important}
  .finance-summary{grid-template-columns:1fr 1fr!important}.finance-summary article{padding:11px 9px!important}.finance-summary strong{font-size:.78rem!important}
  .profile-guide-actions{grid-template-columns:1fr}
  .guide-tutorial{padding:10px}.guide-card{width:100%;max-height:calc(100dvh - 20px);padding:25px 20px 20px;border-radius:24px}.guide-copy h2{font-size:2.03rem}.guide-scene{height:215px;margin-block:18px 13px;padding:12px}.guide-footer{align-items:flex-end}.guide-footer small{max-width:110px}.guide-footer button{min-width:115px}.guide-platform-choice{grid-template-columns:1fr}.guide-platform-choice button{min-height:38px}.guide-note.one{left:8%}.guide-note.two{right:6%}.guide-home-icon,.guide-desktop-window{right:6px;bottom:2px;transform:scale(.82)}
}

@media(max-width:360px){
  .topbar{height:62px!important;padding-top:9px!important}.brand{gap:5px!important}.feed-topbar .brand strong{font-size:1.12rem!important}.brand-dots{width:29px!important}.corner-control{width:42px!important;height:42px!important}
  .feed-card,.feed-empty{padding:38px 14px 13px!important}.feed-title{font-size:clamp(1.72rem,10.7vw,2.3rem)!important}.feed-eyebrow{margin-bottom:10px!important}.context-help{margin-top:9px!important}.feed-guidance{margin-top:9px!important}
  .focus-priority-rail{top:19px!important}.focus-card-bottom .feed-actions button{font-size:.58rem!important}.feed-gesture{display:flex!important}
  .habit-leaf{width:82px!important;height:48px!important}.habit-leaf strong{max-width:56px!important;font-size:.6rem!important}
  .section-header p{font-size:.62rem!important}.appointment-card{grid-template-columns:70px minmax(0,1fr)!important}.appointment-main{padding-left:15px!important;padding-right:8px!important}.appointment-main .reminder-chip{font-size:.56rem!important}
}

@media(max-height:650px) and (max-width:899px){
  .topbar{height:58px!important;padding-top:7px!important}.corner-control{width:40px!important;height:40px!important}.corner-control small{display:none!important}.feed-topbar .brand-dots{display:none!important}
  .bottom-nav,.bottom-nav.four{height:58px!important}.capture-button{bottom:64px!important;width:48px!important;height:48px!important}
  .feed-focus{grid-template-rows:minmax(0,1fr) 24px!important}.feed-slide{padding-top:7px!important;padding-bottom:9px!important}.feed-card,.feed-empty{padding-top:31px!important;padding-bottom:10px!important}.feed-title{font-size:clamp(1.65rem,8.5vw,2.2rem)!important}.feed-card-main{padding-block:5px!important}.feed-guidance{display:none}.focus-card-bottom .feed-actions button{height:36px!important}.focus-card-bottom .feed-actions .feed-edit-button{height:36px!important;width:36px!important}.feed-gesture{height:24px!important}
}

/* Desktop: cabeçalho, conteúdo e navegação ocupam células estáveis da grade. */
@media(min-width:900px){
  .app-shell,.app-shell.no-topbar{height:100dvh!important;min-height:0!important;max-height:100dvh!important;overflow:hidden!important}
  .topbar,.app-shell.no-topbar .topbar{grid-column:2!important;grid-row:1!important;min-width:0}
  .bottom-nav,.bottom-nav.four{grid-column:1!important;grid-row:1/3!important;height:100%!important}
  .main-stage,.app-shell.no-topbar .main-stage{grid-column:2!important;grid-row:2!important;height:auto!important;min-height:0!important;padding:14px clamp(24px,3.2vw,56px) 18px!important;overflow:hidden!important}
  .view.active{min-height:0}
  .feed-focus{grid-template-rows:minmax(0,1fr) 30px!important}.feed-scroller{padding:7px 0 3px!important}.feed-slide{box-sizing:border-box;height:100%;min-height:100%!important;padding:10px 18px 12px!important}
  .feed-card,.feed-empty{box-sizing:border-box;width:min(760px,72vw)!important;height:min(100%,650px)!important;min-height:0!important;max-height:650px!important;padding:50px 48px 25px!important}
  .feed-card-main{padding-block:16px 10px!important}.feed-title{font-size:clamp(3rem,4.7vw,4.85rem)!important}.focus-card-bottom{flex:0 0 auto}.feed-actions{max-width:470px;width:100%!important;margin-inline:auto!important}
  .agenda-view.active{height:100%;display:flex!important;flex-direction:column;overflow:hidden!important;padding:0 0 4px!important}.agenda-view .section-header{display:flex!important;flex:0 0 auto;min-height:82px!important;padding:5px 4px 15px!important;margin:0!important}.agenda-view .agenda-list{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;margin:0 auto!important}.agenda-complete-link{flex:0 0 auto!important}
  .finance-view.active{height:100%;min-height:0;padding:0 0 4px!important;grid-template-columns:minmax(270px,390px) minmax(360px,1fr)!important;grid-template-rows:auto auto auto minmax(0,1fr)!important;gap:10px clamp(22px,3vw,42px)!important;overflow:hidden!important}.finance-header{display:flex!important;min-height:76px;margin:0!important;padding:4px 3px 10px!important}.balance-card{min-height:124px;margin:0!important;padding:18px!important}.balance-card strong{font-size:clamp(2.65rem,3.8vw,3.3rem)!important}.finance-summary{margin:0!important}.finance-insight{align-self:start}.finance-list-head{margin:0 0 2px!important}.finance-list{min-height:0;overflow:auto!important}
  dialog.modal[open],#captureDialog[open],#habitManagerDialog[open]{
    box-sizing:border-box!important;position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;
    max-width:100vw!important;max-height:100dvh!important;margin:0!important;padding:24px!important;
    display:grid!important;place-items:center!important;overflow:auto!important;background:transparent!important;border:0!important;
  }
  dialog.modal[open]>.sheet,#captureDialog[open]>.capture-sheet,#habitManagerDialog[open]>.habits-sheet{margin:auto!important}
  #habitManagerDialog .habits-sheet{width:min(620px,calc(100vw - 64px))!important;max-height:calc(100dvh - 54px)!important;overflow:auto}
}

@media(min-width:900px) and (max-height:760px){
  .main-stage,.app-shell.no-topbar .main-stage{padding-top:8px!important;padding-bottom:10px!important}.feed-slide{padding-block:6px 8px!important}.feed-card,.feed-empty{height:100%!important;max-height:570px!important;padding:40px 42px 18px!important}.feed-title{font-size:clamp(2.65rem,4.35vw,4.2rem)!important}.feed-eyebrow{margin-bottom:11px!important}.feed-guidance{margin-top:13px!important}.focus-card-bottom{padding:6px!important}.focus-card-bottom .feed-actions button{height:40px!important}.agenda-view .section-header,.finance-header{min-height:67px!important;padding-bottom:8px!important}.section-header h1,.finance-header h1{font-size:2.65rem!important}.appointment-card{min-height:104px!important}.balance-card{min-height:106px!important;padding-block:14px!important}.balance-card strong{font-size:2.65rem!important}
}

@media(prefers-reduced-motion:reduce){
  .guide-card,.guide-note,.guide-hand,.guide-phrase,.guide-agenda>span,.guide-finance>span,.guide-recognition-row,.guide-finance article,.guide-browser-bar b,.guide-home-icon,.guide-desktop-window,.guide-device-cloud span{animation:none!important;transition:none!important}
}
