/* CENTRAL 5.2 — CAPTAÇÃO VIVA
   Ajustes de responsividade, leitura semântica progressiva e movimento orgânico. */

:root{
  --v52-moss:#596234;
  --v52-moss-deep:#444c28;
  --v52-paper:#fbf8f0;
  --v52-paper-soft:#f1ebdf;
  --v52-line:rgba(108,98,76,.22);
}

.sr-only{
  position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;
}

/* O botão flutuante e seu miolo permanecem círculos em qualquer proporção. */
.capture-button{
  box-sizing:border-box!important;width:56px!important;height:56px!important;aspect-ratio:1/1!important;
  padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important;
}
.capture-button span{
  box-sizing:border-box!important;width:32px!important;height:32px!important;aspect-ratio:1/1!important;
  display:grid!important;place-items:center!important;border-radius:50%!important;
  background:rgba(250,247,237,.13)!important;color:#fffaf0!important;
  font:300 1.5rem/1 Inter,sans-serif!important;padding:0!important;
}

/* Barra de decisão: o preenchimento acompanha o gesto antes da ação acontecer. */
.focus-card-bottom{
  --decision-progress:0;isolation:isolate;overflow:hidden!important;
  transition:border-color .2s ease,box-shadow .2s ease!important;
}
.focus-card-bottom::before{
  content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  transform:scaleX(var(--decision-progress));transition:transform .08s linear,background-color .18s ease;
}
.feed-card.swipe-complete .focus-card-bottom::before{
  transform-origin:left center;background:linear-gradient(90deg,#79874b,#566132);
}
.feed-card.swipe-later .focus-card-bottom::before{
  transform-origin:right center;background:linear-gradient(90deg,#fffdf8,#fdfbf5);
  box-shadow:inset 0 0 0 1px rgba(111,101,80,.12);
}
.feed-card.swipe-complete .focus-card-bottom{border-color:rgba(76,86,43,.45)!important;box-shadow:0 8px 24px rgba(63,72,35,.16)!important}
.feed-card.swipe-later .focus-card-bottom{border-color:rgba(147,136,112,.26)!important;box-shadow:0 8px 24px rgba(58,51,39,.07)!important}
.focus-card-bottom>*{position:relative;z-index:1}
.focus-card-bottom .feed-actions{
  width:100%!important;display:grid!important;grid-template-columns:minmax(0,1fr) 48px minmax(0,1fr)!important;
  gap:8px!important;align-items:center!important;
}
.focus-card-bottom .feed-actions::before{display:none!important;content:none!important}
.focus-card-bottom .feed-actions .feed-edit-button{
  width:48px!important;height:44px!important;padding:0!important;border-radius:50%!important;
  display:grid!important;place-items:center!important;background:rgba(255,253,247,.94)!important;
  color:#777466!important;box-shadow:0 4px 12px rgba(58,51,38,.08)!important;
  transition:transform .2s ease,background-color .2s ease,box-shadow .2s ease!important;
}
.focus-card-bottom .feed-actions .feed-edit-button span{font:700 .58rem/1 Inter,sans-serif;letter-spacing:.13em;transform:translateX(.05em)}
.focus-card-bottom .feed-actions .feed-edit-button:hover{transform:rotate(6deg) scale(1.05);background:#fff!important;box-shadow:0 7px 17px rgba(58,51,38,.13)!important}
.focus-card-bottom .feed-actions .feed-edit-button:active{transform:scale(.94)}
.feed-card.swiping .focus-card-bottom .feed-edit-button{animation:feed-edit-pulse .72s ease-in-out infinite alternate}
@keyframes feed-edit-pulse{to{transform:scale(1.06);box-shadow:0 7px 18px rgba(58,51,38,.14)}}

/* Folhas mais naturais: ponta, recortes irregulares, textura e nervuras. */
.habit-leaf{
  width:clamp(104px,25vw,132px)!important;height:72px!important;min-height:0!important;
  padding:10px 17px 11px 21px!important;border:0!important;border-radius:0!important;
  clip-path:polygon(0 54%,5% 38%,15% 24%,31% 12%,52% 5%,73% 8%,89% 19%,98% 36%,100% 49%,96% 63%,84% 78%,66% 90%,45% 97%,25% 91%,10% 76%)!important;
  background:
    radial-gradient(ellipse at 31% 20%,rgba(255,255,255,.40),transparent 29%),
    repeating-linear-gradient(151deg,rgba(255,255,255,.055) 0 1px,transparent 1px 6px),
    linear-gradient(145deg,#d9d9b8 0%,#bcc393 48%,#96a16f 100%)!important;
  filter:drop-shadow(0 10px 8px rgba(52,49,34,.18))!important;transform-origin:6% 54%!important;
  color:#30351e!important;
}
.habit-leaf::before{
  content:"";position:absolute;inset:3px 6px 5px 5px;pointer-events:none;
  background:radial-gradient(ellipse at 58% 55%,transparent 0 52%,rgba(66,73,39,.10) 53% 54%,transparent 55%);
  opacity:.8;
}
.habit-leaf::after{
  content:"";position:absolute;left:11%;top:18%;width:63%;height:28%;pointer-events:none;
  border-radius:50%;background:linear-gradient(150deg,rgba(255,255,255,.27),transparent 70%);transform:rotate(-8deg);
}
.habit-leaf strong{
  position:relative;z-index:3;max-width:88px!important;padding:3px 7px;border-radius:999px;
  background:rgba(250,248,232,.46);color:#2f351d;text-shadow:0 1px rgba(255,255,255,.62);
  font:650 .78rem/1.12 Inter,ui-sans-serif,sans-serif!important;letter-spacing:-.015em!important;
  -webkit-line-clamp:2!important;overflow-wrap:anywhere;
}
.habit-leaf-vein{
  z-index:1!important;left:6px!important;top:52%!important;width:85%!important;height:1px!important;
  background:linear-gradient(90deg,rgba(57,64,32,.42),rgba(57,64,32,.14))!important;
  transform:rotate(-3deg)!important;
}
.habit-leaf-vein::before,.habit-leaf-vein::after{
  content:"";position:absolute!important;left:42%!important;width:1px!important;height:24px!important;
  background:rgba(58,66,34,.18)!important;transform-origin:center!important;
}
.habit-leaf-vein::before{top:-20px!important;transform:rotate(57deg)!important}
.habit-leaf-vein::after{top:-3px!important;transform:rotate(-55deg)!important}
.habit-leaf[data-tone="1"]{background:radial-gradient(ellipse at 31% 20%,rgba(255,255,255,.42),transparent 29%),repeating-linear-gradient(151deg,rgba(255,255,255,.05) 0 1px,transparent 1px 6px),linear-gradient(145deg,#e8e1cb,#c7c09d 55%,#aaa47f)!important}
.habit-leaf[data-tone="2"]{background:radial-gradient(ellipse at 31% 20%,rgba(255,255,255,.38),transparent 29%),repeating-linear-gradient(151deg,rgba(255,255,255,.05) 0 1px,transparent 1px 6px),linear-gradient(145deg,#d0d8b8,#a8b384 55%,#869568)!important}
.habit-leaf[data-tone="3"]{background:radial-gradient(ellipse at 31% 20%,rgba(255,255,255,.40),transparent 29%),repeating-linear-gradient(151deg,rgba(255,255,255,.05) 0 1px,transparent 1px 6px),linear-gradient(145deg,#e7d5c6,#c9b097 55%,#ad927b)!important}
.habit-leaf[data-tone="4"]{background:radial-gradient(ellipse at 31% 20%,rgba(255,255,255,.42),transparent 29%),repeating-linear-gradient(151deg,rgba(255,255,255,.05) 0 1px,transparent 1px 6px),linear-gradient(145deg,#d8dfd6,#afbdaf 55%,#8fa092)!important}
.habit-leaf.held,.habit-leaf.dragging{filter:drop-shadow(0 18px 14px rgba(48,45,31,.27))!important}

/* Captação progressiva. */
#captureDialog{inset:0!important;margin:auto!important;width:auto!important;max-width:none!important;overflow:visible!important}
#captureDialog .capture-sheet{
  width:min(960px,calc(100vw - 80px))!important;max-width:960px!important;
  min-height:min(580px,calc(100dvh - 84px));max-height:calc(100dvh - 64px)!important;
  padding:28px!important;overflow:hidden!important;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:18px;
}
.capture-head{margin:0!important;align-items:center!important}
.capture-head>button{flex:0 0 auto}
.capture-head span{font-size:1.7rem!important;text-transform:none}
.capture-head small{font-size:.72rem}
.capture-workspace{min-height:0;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);gap:28px;align-items:stretch}
.capture-compose-panel{
  min-width:0;padding:34px 26px;display:flex;flex-direction:column;justify-content:center;
  border:1px solid rgba(121,110,88,.18);border-radius:24px;
  background:linear-gradient(145deg,rgba(255,255,255,.48),rgba(238,230,215,.27));
}
.capture-question{
  margin:0 0 20px;text-align:center;color:#363829;
  font:400 clamp(1.65rem,2.4vw,2.25rem)/1.05 "DM Serif Display",Georgia,serif;
}
.capture-field{width:100%}
.capture-field textarea{
  width:100%;min-height:112px!important;max-height:180px;padding:18px 19px!important;
  border-radius:22px!important;font-size:1rem!important;line-height:1.52!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
.capture-example{margin:12px 4px 0;color:#948c80;text-align:center;font-size:.67rem;line-height:1.4}
.capture-recognition{
  position:relative;min-width:0;min-height:0;padding:20px;overflow-y:auto;overscroll-behavior:contain;
  border:1px solid rgba(109,103,75,.20);border-radius:24px;
  background:linear-gradient(155deg,rgba(244,242,224,.72),rgba(238,231,216,.66));
  scrollbar-width:thin;scrollbar-color:rgba(92,98,53,.25) transparent;
}
.capture-recognition-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:13px}
.capture-recognition-head span{color:#4d5430;font:600 .72rem/1 Inter,sans-serif;letter-spacing:.11em;text-transform:uppercase}
.capture-recognition-head small{color:#8d877a;font-size:.61rem;text-align:right;line-height:1.3}
.capture-flow-arrow{
  position:absolute;left:-36px;top:50%;width:44px;height:44px;display:grid;place-items:center;
  color:#81865f;font-size:1rem;transform:translateY(-50%) rotate(-90deg);pointer-events:none;
}
.capture-blocks{display:grid;gap:8px}
.capture-block{
  min-height:52px;display:flex;align-items:center;gap:11px;padding:9px 12px;
  border:1px solid rgba(129,120,96,.18);border-radius:13px;background:rgba(255,253,247,.76);
  box-shadow:0 5px 14px rgba(59,53,39,.045);min-width:0;
}
.capture-block.is-new{animation:capture-block-in .36s cubic-bezier(.2,.8,.25,1) both;animation-delay:calc(var(--block-order) * 35ms)}
@keyframes capture-block-in{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.capture-block-icon,.capture-route-icon{
  flex:0 0 auto;width:30px;height:30px;border-radius:10px;display:grid;place-items:center;
  color:#667044;background:#eef0dc;
}
.capture-block-icon svg,.capture-route-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}
.capture-block-copy,.capture-route-copy{display:flex;flex-direction:column;min-width:0}
.capture-block-copy small,.capture-route-copy small{color:#938c7f;font-size:.58rem;line-height:1.1;letter-spacing:.06em;text-transform:uppercase}
.capture-block-copy strong,.capture-route-copy strong{margin-top:3px;color:#3e412d;font:600 .78rem/1.24 Inter,sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.capture-destination{margin-top:8px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:8px!important}
.capture-route{
  min-height:52px!important;margin:0!important;padding:9px 12px!important;display:flex!important;align-items:center!important;gap:11px!important;
  border-radius:13px!important;background:rgba(255,253,247,.82)!important;border:1px solid rgba(129,120,96,.18)!important;
}
.capture-route-copy em{margin-left:5px;color:#8e887a;font:400 .62rem/1 Inter,sans-serif}
.route-change{align-self:stretch;min-width:58px;border-radius:13px!important;background:rgba(247,246,231,.92)!important}
.capture-options{margin-top:10px!important;padding-top:10px;border-top:1px dashed rgba(119,109,86,.20)}
.capture-adjustments-label{margin:0 0 7px;color:#8f887b;font:600 .59rem/1 Inter,sans-serif;text-transform:uppercase;letter-spacing:.09em}
.capture-options .smart-fields{gap:7px}
.capture-options .field>span{font-size:.62rem;margin-bottom:5px}
.capture-options .field input,.capture-options .field select{height:42px;padding:9px 10px;font-size:.78rem!important;border-radius:11px!important}
.capture-options .smart-preview{margin-top:7px;background:rgba(255,253,248,.58);font-size:.68rem}
.capture-priority{margin-top:0!important}
.capture-priority .priority-caption{margin-bottom:6px}
.capture-priority .priority-picker button{height:48px;border-radius:11px}
.route-picker{background:rgba(249,246,238,.96)!important}
.capture-actions{margin:0!important;display:grid!important;grid-template-columns:112px minmax(0,1fr);gap:10px!important}
.capture-actions button{min-height:48px;border-radius:14px!important}
.capture-actions .soft-button{display:flex;align-items:center;justify-content:center;gap:6px;color:#5f5c50;background:#f0ebe1!important}
.capture-submit{display:flex;align-items:center;justify-content:center;gap:8px;background:linear-gradient(135deg,#7d884d,#5c6737)!important;color:#fffdf6!important;box-shadow:0 10px 22px rgba(67,75,38,.18)}
.capture-submit span{width:21px;height:21px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#66713e;font-size:.72rem}

/* Agenda usa a altura disponível; o cabeçalho nunca fica atrás da barra superior. */
@media(min-width:900px){
  .app-shell.no-topbar .main-stage{padding-top:clamp(34px,5vh,54px)!important}
  .agenda-view.active{
    height:100%;min-height:0;display:flex!important;flex-direction:column;overflow:hidden!important;
    padding:0 0 16px!important;
  }
  .agenda-view .section-header{
    flex:0 0 auto;min-height:88px;padding:8px 4px 18px!important;margin:0!important;
    position:relative!important;inset:auto!important;background:transparent!important;z-index:2;
  }
  .agenda-view .section-header h1{line-height:1!important;margin:0 0 5px!important}
  .agenda-list{
    flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
    width:100%;max-width:940px!important;padding:8px 8px 0 0!important;scrollbar-width:thin;scrollbar-color:rgba(84,91,51,.22) transparent;
  }
  .agenda-complete-link{flex:0 0 auto;width:100%;max-width:940px!important;margin:14px auto 0!important}
  .appointment-card{width:100%;min-width:0;grid-template-columns:108px minmax(0,1fr)!important}
  .appointment-card::before{left:104px!important}
}

@media(min-width:900px) and (max-height:800px){
  .app-shell.no-topbar .main-stage{padding-top:26px!important;padding-bottom:20px!important}
  .agenda-view .section-header{min-height:74px;padding-top:4px!important;padding-bottom:13px!important}
  .agenda-view .section-header h1{font-size:2.8rem!important}
  .appointment-card{min-height:98px!important}
}

@media(max-width:899px){
  .habit-leaf{width:100px!important;height:58px!important;padding:8px 14px 9px 18px!important}
  .habit-leaf strong{max-width:70px!important;font-size:.7rem!important}
  #captureDialog .capture-sheet{width:min(700px,calc(100vw - 32px))!important;max-width:700px!important;overflow-y:auto!important}
  .capture-workspace{grid-template-columns:1fr;gap:14px}
  .capture-compose-panel{padding:22px 18px}
  .capture-flow-arrow{position:static;width:100%;height:24px;transform:none}
}

@media(max-width:599px){
  #captureDialog{
    inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
    margin:0!important;padding:0!important;
  }
  #captureDialog .capture-sheet{
    box-sizing:border-box;width:100vw!important;max-width:none!important;height:100dvh!important;min-height:100dvh!important;max-height:none!important;
    padding:calc(15px + env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))!important;
    border:0!important;border-radius:0!important;display:flex!important;flex-direction:column;gap:12px;overflow-y:auto!important;
  }
  .capture-head{min-height:42px;justify-content:flex-start}
  .capture-head span{font-size:1.32rem!important}
  .capture-head small{display:none}
  .capture-workspace{display:block}
  .capture-compose-panel{padding:10px 0 0;border:0;border-radius:0;background:transparent}
  .capture-question{margin:4px 0 14px;font-size:1.3rem}
  .capture-field textarea{
    min-height:56px!important;max-height:100px;padding:16px 18px!important;border-radius:999px!important;
    text-align:center;font-size:.92rem!important;line-height:1.35!important;
  }
  .capture-example{display:none}
  .capture-recognition{margin-top:10px;padding:0 0 4px;border:0;border-radius:0;background:transparent;overflow:visible}
  .capture-recognition-head{display:none}
  .capture-flow-arrow{height:30px;color:#899066}
  .capture-blocks{gap:7px}
  .capture-block,.capture-destination{width:min(290px,100%);margin-left:auto!important;margin-right:auto!important}
  .capture-block{min-height:48px;padding:8px 11px;background:rgba(255,253,248,.92)}
  .capture-block-icon,.capture-route-icon{width:28px;height:28px}
  .capture-destination{margin-top:7px!important}
  .capture-route{min-height:48px!important}
  .capture-options{width:min(320px,100%);margin-left:auto!important;margin-right:auto!important}
  .route-picker{width:min(360px,100%);margin-left:auto;margin-right:auto}
  .capture-actions{width:100%;grid-template-columns:64px minmax(0,1fr);margin-top:auto!important;padding-top:8px}
  .capture-actions .soft-button{font-size:0!important}
  .capture-actions .soft-button span{font-size:1rem}
}

@media(max-width:380px){
  .focus-card-bottom .feed-actions{grid-template-columns:minmax(0,1fr) 42px minmax(0,1fr)!important;gap:5px!important}
  .focus-card-bottom .feed-actions .feed-edit-button{width:42px!important;height:42px!important}
  .habit-leaf{width:88px!important;height:52px!important}
  .habit-leaf strong{max-width:61px!important;font-size:.64rem!important}
}

@media(prefers-reduced-motion:reduce){
  .capture-block.is-new,.feed-card.swiping .feed-edit-button{animation:none!important}
  .focus-card-bottom::before{transition:none!important}
}
