/* Central 5.6 — contenção responsiva, hábitos confiáveis e Livre ajustável. */

html,body{
  width:100%!important;max-width:100%!important;overflow-x:hidden!important;
  overscroll-behavior-x:none!important;touch-action:pan-y;-webkit-text-size-adjust:100%;
}
body{position:relative!important}
.app-shell,.main-stage,.view,.section-header,.capture-workspace,.capture-compose-panel,.capture-recognition,
.capture-blocks,.capture-destination,.route-picker,.sheet,.field,.two-fields,.smart-fields,.finance-view,
.finance-balance-group,.finance-ledger,.finance-list,.agenda-view,.agenda-list,.free-view,.free-board{
  box-sizing:border-box!important;min-width:0!important;max-width:100%;
}
.app-shell{overflow-x:hidden!important;overscroll-behavior-x:none!important}
.main-stage,.view.active{overflow-x:hidden!important}
button,input,textarea,select{box-sizing:border-box;max-width:100%}
input,textarea,select{min-width:0}
.route-overrides{flex-wrap:wrap!important;overflow:visible!important}

/* O ícone volta a ser uma engrenagem limpa, sem deformação do traço. */
.settings-button{box-sizing:border-box!important;padding:7px!important;display:grid!important;place-items:center!important}
.settings-button svg{display:block!important;width:23px!important;height:23px!important;overflow:visible;stroke-width:1.45!important}
.settings-button svg *{vector-effect:non-scaling-stroke}

/* A barra da Agenda tem texto no centro óptico e seta independente. */
.agenda-complete-link{
  position:relative!important;box-sizing:border-box!important;width:calc(100% - 4px)!important;max-width:960px!important;
  min-width:0!important;min-height:58px!important;margin:13px auto 12px!important;padding:14px 52px!important;
  display:grid!important;place-items:center!important;text-align:center!important;line-height:1.3!important;white-space:normal!important;
}
.agenda-complete-link span{position:absolute!important;right:20px!important;top:50%!important;transform:translateY(-50%)!important;line-height:1!important}

/* O menu do post-it usa somente tamanhos e cores já pertencentes ao Livre. */
.note-context{
  z-index:20000!important;box-sizing:border-box!important;width:min(292px,calc(100% - 16px))!important;
  padding:10px!important;border-radius:20px!important;background:rgba(255,253,247,.96)!important;
  border:1px solid rgba(113,101,79,.22)!important;box-shadow:0 22px 54px rgba(49,42,31,.20)!important;
  overflow:auto!important;overscroll-behavior:contain;
}
.note-context-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 3px 9px;border-bottom:1px solid rgba(115,103,82,.15)}
.note-context-head strong{font:400 1.05rem/1 "DM Serif Display",Georgia,serif;color:#343727}
.note-context-head button{box-sizing:border-box!important;width:30px!important;height:30px!important;padding:0!important;display:grid!important;place-items:center!important;text-align:center!important;border-radius:50%!important;background:#eee8de!important;font-size:1.05rem!important}
.note-context-group{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:10px;padding:10px 3px 4px}
.note-context-group>span{color:#7c7569;font-size:.68rem;text-transform:uppercase;letter-spacing:.08em}
.note-size-options{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.note-size-options button{
  box-sizing:border-box!important;width:100%!important;min-height:34px!important;padding:6px!important;text-align:center!important;
  border:1px solid rgba(115,103,82,.18)!important;border-radius:10px!important;background:#f4efe6!important;color:#5c594d;font-size:.72rem!important;
}
.note-size-options button.active{background:#e6e9c9!important;border-color:#89945e!important;color:#454d2c;box-shadow:inset 0 0 0 1px rgba(88,99,48,.12)}
.note-color-options{display:flex;align-items:center;justify-content:space-between;gap:7px}
.note-color-options button{
  box-sizing:border-box!important;width:30px!important;height:30px!important;min-height:30px!important;padding:0!important;
  border:1px solid rgba(85,76,61,.18)!important;border-radius:50%!important;box-shadow:0 3px 8px rgba(61,52,39,.08)!important;
}
.note-color-options button[data-note-color="yellow"]{background:var(--yellow)!important}
.note-color-options button[data-note-color="pink"]{background:var(--pink)!important}
.note-color-options button[data-note-color="purple"]{background:var(--purple)!important}
.note-color-options button[data-note-color="mint"]{background:var(--mint)!important}
.note-color-options button[data-note-color="cream"]{background:var(--cream)!important}
.note-color-options button.active{outline:2px solid #737b4d!important;outline-offset:2px!important}
.note-layer-options{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:10px 3px;border-bottom:1px solid rgba(115,103,82,.15)}
.note-layer-options button{
  box-sizing:border-box!important;width:100%!important;min-height:38px!important;padding:8px!important;text-align:center!important;
  border-radius:11px!important;background:#efecdf!important;color:#575a42;font-size:.68rem!important;line-height:1.25!important;
}
.note-context-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding-top:9px}
.note-context-actions button{
  box-sizing:border-box!important;width:100%!important;min-height:40px!important;padding:9px 8px!important;text-align:center!important;
  border-radius:11px!important;background:#f5f0e7!important;font-size:.69rem!important;line-height:1.2!important;
}
.note-context-actions .danger-text{color:#934f49!important;background:#f5e9e5!important}

.free-note[data-size="small"]{width:94px!important;min-height:90px!important;padding:13px 9px!important}
.free-note[data-size="medium"]{width:122px!important;min-height:116px!important;padding:17px 11px!important}
.free-note[data-size="large"]{width:154px!important;min-height:146px!important;padding:20px 13px!important}
.free-note[data-size="small"] p{font-size:1rem!important}
.free-note[data-size="medium"] p{font-size:1.2rem!important}
.free-note[data-size="large"] p{font-size:1.4rem!important}
.free-note.selected{z-index:var(--local-z)!important}
.free-note.dragging{z-index:19000!important}

/* Formulários nunca podem alargar o bottom sheet; no iPhone 16px também evita o zoom ao focar. */
dialog.modal[open],dialog.welcome-modal[open]{box-sizing:border-box!important;max-width:100vw!important;overflow-x:hidden!important}
.modal .sheet,.welcome-modal>*{box-sizing:border-box!important;max-width:100%!important;overflow-x:hidden}
.field input,.field textarea,.field select,.capture-block-editor input,.capture-block-editor select{
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
}
#financeRepeatDateField{box-sizing:border-box!important;width:100%!important;max-width:100%!important;overflow:hidden!important}
#financeRepeatDateInput{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important}
input[type="date"]::-webkit-date-and-time-value,input[type="time"]::-webkit-date-and-time-value{text-align:left;min-width:0}

/* Decisão no Feed: o cartão inteiro responde ao gesto, com leitura imediata. */
.feed-card[data-task-id]{
  --decision-progress:0;position:relative!important;isolation:isolate;overflow:hidden!important;
  cursor:grab;touch-action:pan-y!important;overscroll-behavior-x:contain;
  user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
  will-change:transform;transition:transform .2s cubic-bezier(.22,.75,.28,1)!important;
}
.feed-card[data-task-id].swipe-held,.feed-card[data-task-id].swiping{cursor:grabbing}
.feed-card[data-task-id].swiping{transition:none!important}
.feed-card[data-task-id].swipe-returning{transition:transform .2s cubic-bezier(.22,.75,.28,1)!important}
.feed-decision-overlay{
  position:absolute;inset:0;z-index:80;display:grid;place-items:center;pointer-events:none;
  border-radius:inherit;overflow:hidden;transform:scaleX(var(--decision-progress));opacity:1;
  transition:transform .12s linear,background-color .18s ease;will-change:transform;
}
.feed-card.swiping .feed-decision-overlay{transition:none}
.feed-card.swipe-complete .feed-decision-overlay{
  transform-origin:left center;background:linear-gradient(135deg,#7d8950 0%,#596535 56%,#465127 100%);
}
.feed-card.swipe-later .feed-decision-overlay{
  transform-origin:right center;background:linear-gradient(135deg,#fffefa 0%,#fffdf8 58%,#f4efe5 100%);
  box-shadow:inset 0 0 0 1px rgba(104,94,74,.20);
}
.feed-decision-label{
  grid-area:1/1;max-width:86%;text-align:center;opacity:clamp(0,calc((var(--decision-progress) - .34) * 2.2),1);
  transform:translateY(6px) scale(.96);transition:opacity .1s linear,transform .18s ease;
  font:400 clamp(2.75rem,8vw,5.7rem)/.95 "DM Serif Display",Georgia,serif;letter-spacing:-.035em;
}
.feed-card.swipe-ready .feed-decision-label,.feed-card.swipe-committing .feed-decision-label{transform:translateY(0) scale(1)}
.decision-complete{display:none;color:#fffdf4;text-shadow:0 2px 18px rgba(27,34,13,.18)}
.decision-later{display:none;color:#303326;text-shadow:0 1px rgba(255,255,255,.8)}
.feed-card.swipe-complete .decision-complete{display:block}
.feed-card.swipe-later .decision-later{display:block}
.feed-card.swipe-committing .feed-decision-overlay{transition:transform .16s cubic-bezier(.2,.75,.3,1),background-color .16s ease}
.feed-card.swipe-committing{box-shadow:0 20px 54px rgba(48,54,29,.18)!important}

@media(max-width:899px){
  .feed-decision-label{font-size:clamp(2.65rem,14vw,4.4rem)}
}

@media(max-width:899px){
  input,textarea,select,.field input,.field textarea,.field select,.capture-block-editor input,.capture-block-editor select{
    font-size:16px!important;
  }
  .view.active{width:100%!important;max-width:100%!important}
  .agenda-view.active{padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important}
  .agenda-complete-link{width:100%!important;margin-inline:auto!important;padding-inline:46px!important;font-size:.88rem!important}
  .agenda-complete-link span{right:17px!important}
  .capture-sheet,.modal .sheet{width:min(100%,calc(100vw - 16px))!important;margin-inline:auto!important}
  .capture-block,.capture-destination{max-width:100%!important}
  .capture-block.is-editing{grid-template-columns:30px minmax(0,1fr) 36px!important}
  .capture-block-save{min-width:34px!important}
  .smart-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
}

@media(max-width:380px){
  .agenda-view.active{padding-left:11px!important;padding-right:11px!important}
  .agenda-complete-link{min-height:54px!important;padding-inline:40px!important;font-size:.82rem!important}
  .appointment-card{grid-template-columns:80px minmax(0,1fr)!important}
  .appointment-main{padding-left:16px!important;padding-right:9px!important}
  .appointment-main .recurrence-chip,.appointment-main .reminder-chip{font-size:.59rem!important}
  .smart-fields{grid-template-columns:1fr!important}
  .note-context{width:min(280px,calc(100% - 12px))!important;padding:8px!important}
  .note-context-group{grid-template-columns:54px minmax(0,1fr)!important}
  .free-note[data-size="small"]{width:84px!important;min-height:80px!important}
  .free-note[data-size="medium"]{width:108px!important;min-height:104px!important}
  .free-note[data-size="large"]{width:136px!important;min-height:130px!important}
}

@media(min-width:900px){
  .free-note[data-size="small"]{width:128px!important;min-height:120px!important;padding:18px 13px!important}
  .free-note[data-size="medium"]{width:164px!important;min-height:152px!important;padding:22px 16px!important}
  .free-note[data-size="large"]{width:208px!important;min-height:192px!important;padding:26px 19px!important}
  .free-note[data-size="small"] p{font-size:1.2rem!important}
  .free-note[data-size="medium"] p{font-size:1.5rem!important}
  .free-note[data-size="large"] p{font-size:1.72rem!important}
  .note-context{width:304px!important}
}

@media(prefers-reduced-motion:reduce){
  .habit-leaf.is-completing{animation:none!important}
  .feed-card[data-task-id],.feed-decision-overlay,.feed-decision-label{transition-duration:.01ms!important}
}
