/* Melhorias Claude 104/105 · Novo lançamento do Pessoal (Juan): coluna simples que cresce e rola, valor total sempre livre,
   parcelas abertas na hora (em vidro), aviso do vencimento fora e subcategoria fácil (escolhida vira selo com "Trocar"). */

/* 1) Coluna simples, sem a grade de tamanho fixo que espremia a subcategoria */
html body dialog#entryDialog.cx-personal .cx-compose{display:flex!important;flex-direction:column!important;gap:10px!important;grid-template-columns:none!important;align-content:normal!important}
html body dialog#entryDialog.cx-personal .cx-compose>*{grid-column:auto!important;grid-row:auto!important;flex-shrink:0}
html body dialog#entryDialog.cx-personal .cx-row{gap:10px!important}
html body dialog#entryDialog.cx-personal #cashValueHint:empty{display:none}
html body dialog#entryDialog.cx-personal #cashValueHint{margin-top:2px}
html body dialog#entryDialog.cx-personal #cashPersonalOptions:not([hidden]){gap:6px 10px!important;margin-top:-2px}
/* sem "Vence dia 17 · data colocada em…": escolher o cartão já põe a data, e a Data fica à vista para mudar */
html body dialog#entryDialog.cx-personal #cashCardHint{display:none!important}

/* 2) Parcelas em vidro, todas abertas (uma por linha) */
html body dialog#entryDialog .cx-installments{display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:18px;border:1px solid rgba(255,255,255,.16);background:linear-gradient(160deg,rgba(255,255,255,.10),rgba(255,255,255,.03));box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 10px 30px -18px rgba(0,0,0,.6);-webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4)}
html body dialog#entryDialog .cx-installments[hidden]{display:none}
html body dialog#entryDialog .cx-plan-sum{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:2px 4px 4px}
html body dialog#entryDialog .cx-plan-sum>div{display:flex;flex-direction:column;gap:1px;min-width:0}
html body dialog#entryDialog .cx-plan-sum b{font-size:15px;font-variant-numeric:tabular-nums}
html body dialog#entryDialog .cx-plan-sum small{font-size:12px;opacity:.75}
html body dialog#entryDialog .cx-plan-sum em{font-style:normal;font-size:12px;font-weight:800;color:#ffb4bc}
html body dialog#entryDialog .cx-plan-even{flex:none;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.08);color:inherit;border-radius:999px;padding:7px 12px;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;min-height:36px;touch-action:manipulation}
html body dialog#entryDialog .cx-plan-even:hover{background:rgba(255,255,255,.16)}
html body dialog#entryDialog .cx-plan-list{display:flex;flex-direction:column;gap:6px;max-height:none!important;overflow:visible!important}
html body dialog#entryDialog .cx-plan-list .cx-parcel{display:grid!important;grid-template-columns:42px minmax(0,1fr) minmax(0,1fr)!important;align-items:center;gap:8px;flex:none}
html body dialog#entryDialog .cx-plan-list .cx-parcel>b{font-size:12.5px;font-variant-numeric:tabular-nums;opacity:.85}
html body dialog#entryDialog .cx-plan-list .cx-parcel :is(input[type=date],.cx-money){min-height:40px!important;height:40px!important;border-radius:12px!important}
html body dialog#entryDialog .cx-plan-list .cx-parcel.is-manual .cx-money{box-shadow:0 0 0 1.5px rgba(167,139,250,.75) inset}
html body dialog#entryDialog .cx-plan-list .cx-parcel.is-manual>b{color:#d9ceff;opacity:1}

/* 3) Subcategoria: título com "+ Nova"; escolhida vira selo com "Trocar" e a lista recolhe */
html body dialog#entryDialog .cx-sub-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:2px 2px -4px;font-size:12.5px;font-weight:700;opacity:.9}
html body dialog#entryDialog .cx-sub-new{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.07);color:inherit;border-radius:999px;padding:6px 12px;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;min-height:34px;touch-action:manipulation}
html body dialog#entryDialog .cx-sub-new svg{width:14px;height:14px}
html body dialog#entryDialog .cx-sub-new:hover{background:rgba(255,255,255,.15)}
html body dialog#entryDialog .cx-sub-field>span:first-child:not(.cx-search){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
html body dialog#entryDialog.cx-personal .cx-choices{flex:none!important;min-height:0!important;max-height:260px!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-mask-image:none;mask-image:none}
html body dialog#entryDialog.cx-personal form.cx-sub-picked .cx-choices,html body dialog#entryDialog.cx-personal form.cx-sub-picked #cashChoicePages{display:none!important}
html body dialog#entryDialog .cx-picked:not(:empty){display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;padding:8px 12px;border-radius:14px;border:1px solid rgba(95,227,171,.35);background:rgba(95,227,171,.08)}
html body dialog#entryDialog .cx-sub-change{margin-left:auto;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.08);color:inherit;border-radius:999px;padding:5px 12px;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;min-height:32px}
html body dialog#entryDialog .cx-sub-change:hover{background:rgba(255,255,255,.16)}

/* 4) No computador a coluna rola quando precisa e o "Adicionar à lista" fica sempre à vista */
@media(min-width:761px){
 html body dialog#entryDialog.cx-personal .cx-compose{overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain}
 html body dialog#entryDialog.cx-personal .cx-compose .cx-add{position:sticky;bottom:0;z-index:3;margin-top:auto}
}
@media(max-width:760px){
 html body dialog#entryDialog .cx-plan-list .cx-parcel{grid-template-columns:36px minmax(0,1.1fr) minmax(0,1fr)!important;gap:6px}
 html body dialog#entryDialog .cx-plan-sum{flex-wrap:wrap}
}

/* Tema claro */
html.tema-claro body dialog#entryDialog .cx-installments{border-color:rgba(60,40,120,.16);background:linear-gradient(160deg,rgba(255,255,255,.75),rgba(255,255,255,.45));box-shadow:inset 0 1px 0 #fff,0 10px 30px -20px rgba(60,40,120,.4)}
html.tema-claro body dialog#entryDialog :is(.cx-plan-even,.cx-sub-new,.cx-sub-change){border-color:rgba(60,40,120,.2);background:rgba(255,255,255,.7)}
html.tema-claro body dialog#entryDialog .cx-plan-sum em{color:#b4232f}
html.tema-claro body dialog#entryDialog .cx-plan-list .cx-parcel.is-manual>b{color:#5b3cc4}
html.tema-claro body dialog#entryDialog .cx-picked:not(:empty){border-color:rgba(15,138,95,.35);background:rgba(15,138,95,.07)}

/* 5) Categoria nova: lista do próprio site (sem o menu preto do navegador), abre ao tocar e filtra ao digitar */
html body dialog#entryDialog .cx-new .cx-field:has(#cashNewCat){position:relative}
html body dialog#entryDialog .cx-catpop{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;gap:2px!important;max-height:240px!important;overflow-y:auto!important;margin-top:-4px;padding:6px!important;border-radius:16px;border:1px solid rgba(255,255,255,.16);background:linear-gradient(160deg,rgba(40,36,60,.92),rgba(24,22,36,.92));box-shadow:0 18px 40px -16px rgba(0,0,0,.7),inset 0 1px 0 rgba(255,255,255,.12);-webkit-backdrop-filter:blur(18px) saturate(1.4);backdrop-filter:blur(18px) saturate(1.4);overscroll-behavior:contain}
html body dialog#entryDialog .cx-catpop[hidden]{display:none!important}
html body dialog#entryDialog .cx-catpop button{display:flex!important;align-items:center;gap:8px;width:100%;text-align:left;padding:10px 12px!important;min-height:42px;border-radius:12px!important;border:0!important;background:transparent!important;color:inherit;font-size:14px!important;font-weight:600!important;cursor:pointer}
html body dialog#entryDialog .cx-catpop button:hover,html body dialog#entryDialog .cx-catpop button:focus-visible{background:rgba(167,139,250,.18)!important;outline:none}
html body dialog#entryDialog .cx-catpop .cx-catnew{color:#c9bcff!important;border-top:1px solid rgba(255,255,255,.08)!important;border-radius:0 0 12px 12px!important}
html body dialog#entryDialog .cx-catpop .cx-catnew svg{width:14px;height:14px}
html body dialog#entryDialog .cx-catpop .cx-none{margin:6px 8px;font-size:12.5px;opacity:.7}
html.tema-claro body dialog#entryDialog .cx-catpop{background:linear-gradient(160deg,rgba(255,255,255,.96),rgba(246,243,255,.94));border-color:rgba(60,40,120,.16);box-shadow:0 18px 40px -18px rgba(60,40,120,.35),inset 0 1px 0 #fff}
html.tema-claro body dialog#entryDialog .cx-catpop button:hover{background:rgba(124,92,230,.12)!important}
html.tema-claro body dialog#entryDialog .cx-catpop .cx-catnew{color:#5b3cc4!important;border-top-color:rgba(60,40,120,.1)!important}

/* 6) Rascunho: compra parcelada numa linha (valor total); tocar abre as parcelas */
html body dialog#entryDialog details.cx-group{display:block!important;padding:0!important;overflow:hidden}
html body dialog#entryDialog details.cx-group>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:34px minmax(0,1fr) auto auto 30px 20px;align-items:center;gap:10px;padding:11px 10px 11px 12px;-webkit-tap-highlight-color:transparent}
html body dialog#entryDialog details.cx-group>summary::-webkit-details-marker{display:none}
html body dialog#entryDialog details.cx-group .cx-dot.cx-n{width:34px!important;height:26px!important;border-radius:9px!important;font-size:11px!important}
html body dialog#entryDialog details.cx-group .cx-group-chev svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .3s cubic-bezier(.22,1,.36,1)}
html body dialog#entryDialog details.cx-group[open] .cx-group-chev svg{transform:rotate(180deg)}
html body dialog#entryDialog details.cx-group[open]{border-color:rgba(167,139,250,.5)!important}
html body dialog#entryDialog .cx-group-body{display:flex;flex-direction:column;gap:6px;padding:0 8px 8px;animation:cxGroupOpen .3s cubic-bezier(.22,1,.36,1) both}
@keyframes cxGroupOpen{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
html body dialog#entryDialog .cx-group-body .cx-item{background:rgba(255,255,255,.04)!important;box-shadow:none!important;padding:8px 8px 8px 10px!important}
@media(max-width:760px){
 html body dialog#entryDialog details.cx-group>summary{grid-template-columns:30px minmax(0,1fr) auto 28px 16px;gap:4px 8px;padding:10px 8px 10px 10px}
 html body dialog#entryDialog details.cx-group>summary .cx-pill{grid-column:2/3;grid-row:2;justify-self:start}
}
/* parcelas abertas no rascunho: número sem encostar no nome */
html body dialog#entryDialog .cx-group-body .cx-item{grid-template-columns:28px minmax(0,1fr) auto auto 30px!important;gap:10px!important}
html body dialog#entryDialog .cx-group-body .cx-dot.cx-n{width:24px!important;height:24px!important;font-size:10.5px!important}
@media(max-width:760px){html body dialog#entryDialog .cx-group-body .cx-item{grid-template-columns:26px minmax(0,1fr) auto 28px!important;gap:4px 8px!important}}
/* Melhorias Claude 110 · quadro do valor da parcela: o campo (46px) era mais alto que a moldura (40px) e a borda
   vazava em cima e embaixo ("recortes"). Agora o campo ocupa exatamente a moldura. */
html body dialog#entryDialog.cx-dialog .cx-plan-list .cx-parcel span.cx-money{height:40px!important;min-height:40px!important;overflow:hidden;border-radius:12px!important}
html body dialog#entryDialog.cx-dialog .cx-plan-list .cx-parcel span.cx-money input{height:40px!important;min-height:40px!important;max-height:40px!important;box-sizing:border-box!important;margin:0!important;padding-top:0!important;padding-bottom:0!important;border-radius:12px!important;line-height:38px!important}
html body dialog#entryDialog.cx-dialog .cx-plan-list .cx-parcel.is-manual span.cx-money input{border-color:rgba(167,139,250,.85)!important;box-shadow:0 0 0 1px rgba(167,139,250,.55) inset!important}
