/* Approved Nexo controls shared by forms, selectors and actions. */
:root { --option-height: 44px; --option-inner-height: 34px; --control-radius: 17px; --nexo-control-fill: #f7f9fb; --nexo-control-line: #ccd8e3; }

#form[data-finance-type="goal"] input[name="name"]::placeholder { font-size: 13px; }
#app .profile-field input,
#form label :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range]),textarea),
#form .filter-picker > .control-trigger,
#mobile-filters-form .control-trigger,
#nexo-feedback textarea,
.mobile-tx-search,
.filter-picker:not(.cashflow-month-picker):not(.workspace-picker) > .control-trigger,
.goal-form-options > summary {
 min-height: var(--option-height); border: 1px solid var(--nexo-control-line);
 border-radius: var(--control-radius); background: var(--nexo-control-fill); box-shadow: none;
}
#app .profile-field input { height: var(--option-height); }
#form label:has(.required-marker) :is(input,textarea,.control-trigger) { border-color: #a6bed3; }
#app .profile-field input:focus-visible,
#form label :is(input,textarea):focus-visible,
.goal-form-options > summary:focus-visible { outline: 2px solid #446989; outline-offset: 2px; }
#form .invoice-debit-choice { border-radius: 999px; }
#form label:has(> input[name="removePhoto"]) {
 display: flex;
 align-items: center;
 gap: 8px;
}
#form .goal-form-options > summary {
 justify-content: flex-end;
 padding: 0;
 border: 0;
 background: transparent;
 color: var(--option-ink);
 font-size: var(--option-font);
}
.goal-form-options .goal-monthly-plan { flex: 1; min-width: 0; padding: 10px 20px; }
.goal-monthly-plan > :is(strong,span) { display: block; }
.goal-monthly-plan > strong { color: var(--ink); font-weight: 600; }
#form :is(.goal-saved-value > strong,.goal-monthly-plan) {
 border-radius: 999px;
 border: 1px solid var(--nexo-control-line);
}
.goal-options-icon {
 display: grid;
 place-items: center;
 flex: 0 0 var(--option-height);
 height: var(--option-height);
 border: 1px solid var(--nexo-control-line);
 border-radius: 50%;
 background: var(--control-glass);
}
.goal-form-options[open] > summary .goal-options-icon > svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) ,(min-width:801px) {
 .goal-options-icon > svg { transition: transform 320ms var(--expand-ease); }
 @supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  .goal-form-options::details-content {
   interpolate-size: allow-keywords;
   block-size: 0;
   opacity: 0;
   overflow: clip;
   transition: block-size 320ms var(--expand-ease), opacity 240ms ease, content-visibility 320ms allow-discrete;
  }
  .goal-form-options[open]::details-content { block-size: auto; opacity: 1; }
  .goal-form-options[open] > :not(summary) { animation: none; }
 }
}
.category-filter-children:not([hidden]) { display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; }
.control-options .category-filter-children > button {
 display: flex; align-items: center; justify-content: space-between; gap: 8px;
 width: 100%; height: auto; min-height: var(--option-height); padding: 8px 10px;
 border: 1px solid #dce6ef; text-align: left; white-space: normal;
}
.category-filter-children .option-label { min-width: 0; overflow-wrap: anywhere; }
.filter-picker[data-picker="category"] .control-menu-footer {
 display: grid;
 gap: 4px;
}
.filter-picker[data-picker="category"] .control-menu-footer > button {
 display: grid;
 grid-template-columns: 18px minmax(0, 1fr);
 column-gap: 8px;
 row-gap: 3px;
 height: auto;
 padding: 9px 12px;
 border-radius: 20px !important;
}
.filter-picker[data-picker="category"] .control-menu-footer > button > small {
 grid-column: 2;
 padding: 0;
 line-height: 1.35;
}
.control-options .category-filter-children > button[aria-checked=true] {
 background: var(--menu-selected); border-color: var(--menu-selected-border);
}
/* The segment track is the height reference for standalone actions. */
:is(button,a):is(.primary,.secondary), button.category-add-child, .family-visitor-controls .universal-picker > .control-trigger {
 box-sizing: border-box; height: 40px !important; min-height: 40px !important;
 padding-block: 5px; border-radius: var(--control-radius);
}
.segmented {
 box-sizing: border-box; height: var(--option-height) !important; min-height: var(--option-height) !important;
}
.shell .segmented {
 display: inline-grid;
 grid-auto-flow: column;
 grid-auto-columns: minmax(min-content, 1fr);
}
.shell :is(.analytics-toolbar > .segmented,.analytics-rank-switch,.goal-status-tabs) {
 align-items: center;
 align-content: center;
 padding-block: 4px;
}
.shell :is(.analytics-toolbar > .segmented,.analytics-rank-switch,.goal-status-tabs) > button {
 min-height: var(--option-inner-height);
 margin-block: 0;
 padding-block: 0;
}
.shell .segmented,
.shell .segmented > button,
.refined-filters .filter-picker > .control-trigger,
#mobile-filters-form .filter-picker > .control-trigger,
#sidebar #nav > button { border-radius: 999px !important; }
.shell .toolbar > .segmented:only-child { width: 100%; }
.shell .transaction-period-toolbar .segmented { flex: 1; }
@media (max-width: 800px) {
 .shell .toolbar > .segmented:only-child { grid-auto-columns: minmax(0, 1fr); }
 .shell .toolbar > .segmented:only-child > button {
  min-width: 0; padding-inline: 3px; white-space: normal; line-height: 1.2;
 }
}
@media (max-width: 800px) {
 .shell > header,
 .shell > header .header-account-trigger,
 .shell > header #privacy,
 .overview-intro .overview-privacy,
 .mobile-filter-toggle,
 .mobile-tx-search,
 .mobile-tx-calendar .control-trigger,
 .mobile-tx-months > button,
 .mobile-tx-tabs,
 .mobile-tx-tabs > button { border-radius: 999px !important; }
}
button.primary { background-color: var(--red); color: #fff; }
:is(button,a):is(.primary,.secondary):not(.tx-sheet-icon-action) { border-radius: 999px !important; }
button.secondary:not(.tx-sheet-icon-action) { background-color: #fff; border: 2px solid var(--red); color: var(--red); }
#form input[type=checkbox][role=switch], input[type=checkbox][role=switch] {
 appearance: none; -webkit-appearance: none; position: relative;
 width: 40px; height: 22px; min-height: 22px; flex: 0 0 40px;
 padding: 0;
 border: 0; border-radius: 999px; background: #ccd8e3; cursor: pointer;
}
input[type=checkbox][role=switch]::before {
 content: ""; position: absolute; inset: 50% auto auto 2px; width: 18px; height: 18px; border-radius: 50%;
 translate: 0 -50%;
 background: #fff; box-shadow: 0 1px 3px #1b29383b; transition: transform .18s ease;
}
#form input[type=checkbox][role=switch]:checked, input[type=checkbox][role=switch]:checked { background: #142033; }
input[type=checkbox][role=switch]:checked::before { transform: translateX(18px); }
input[type=checkbox][role=switch]:focus-visible { outline: 2px solid #446989; outline-offset: 2px; }
input[type=checkbox][role=switch]:disabled { opacity: .55; cursor: default; }
@media (prefers-reduced-motion:reduce)  and (max-width:800px){
 input[type=checkbox][role=switch]::before { transition: none; }
}

/* Close controls keep the hit area and use color for interaction feedback. */
:is(dialog button[aria-label^="Fechar"],button.info-close) {
 border: 0; background: transparent; box-shadow: none; color: var(--text-secondary);
}
:is(dialog button[aria-label^="Fechar"],button.info-close):is(:hover,:active,:focus-visible) {
 outline: none; border: 0; background: transparent; box-shadow: none; color: var(--red);
}
#modalTitle:focus { outline: none; }
#modalFormHelp:not(:empty) { display: inline-flex; align-items: center; flex-shrink: 0; }
#modalFormHelp:empty { display: none; }

@media (max-width: 800px) {
 .cloud-loading > body > #mobileNav { display: none; }
 html, body { overscroll-behavior-y: none; }
}

/* Profile labels and values use the same reading size. */
#app .profile-field > span,
#app .profile-field input { font-size: 14px !important; }
@media (max-width: 800px), (pointer: coarse) {
 #app .profile-field:focus-within > span,
 #app .profile-field input:focus { font-size: 16px !important; }
}

#form .finance-select-with-help { display: grid; gap: 8px; margin-bottom: 16px; }
#form [data-link-help]:empty { display: none; }

.page-title-with-info { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; }
.page-title-with-info > h1 { min-width: 0; }

/* Carry the mobile dock's glass and selection into the app controls. */
:root {
 --control-glass: linear-gradient(155deg,#ffffffeb,#edf4faf2);
 --control-glass-border: #ccdbe7;
 --control-glass-inset: inset 0 1px 1px #fff;
 --control-lens-shadow: 0 4px 10px -4px #31465c40;
}
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
 :root { --control-glass: linear-gradient(155deg,#ffffffae,#eaf1f99e); }
}
.shell .segmented, .shell .mobile-tx-tabs {
 position: relative;
 isolation: isolate;
 background: var(--control-glass) !important;
 border: 1px solid var(--control-glass-border);
 box-shadow: var(--control-glass-inset);
 -webkit-backdrop-filter: blur(24px) saturate(1.65);
 backdrop-filter: blur(24px) saturate(1.65);
}
.control-lens {
 position: absolute;
 z-index: -1;
 pointer-events: none;
 border-radius: 999px;
 background: #fff;
 box-shadow: var(--control-lens-shadow);
}
.shell :is(.segmented,.mobile-tx-tabs)[data-lens-room] { overflow: visible; }
.shell :is(.segmented,.mobile-tx-tabs) > button:hover {
 background: #ffffff90;
 color: var(--ink);
}
.shell :is(.segmented,.mobile-tx-tabs):has(> .control-lens) > button:is(.selected,[aria-pressed="true"],[aria-selected="true"]) {
 background: transparent;
 border-color: transparent;
 box-shadow: none;
}
:is(.shell,dialog) .filter-picker:not(.workspace-picker,.header-account-picker,.cashflow-month-picker) > .control-trigger,
#app .profile-field input,
#form label :is(input:not([type=checkbox],[type=radio],[type=hidden],[type=file],[type=range]),textarea),
#nexo-feedback textarea,
.shell :is(.mobile-filter-toggle,.mobile-tx-search) {
 border-radius: 999px !important;
 background: var(--control-glass);
 box-shadow: inset 0 1px 1px #fff;
}
#form label textarea, #nexo-feedback textarea { border-radius: 24px !important; }
.toolbar > #search,
.shell .mobile-tx-search {
 background: var(--nexo-control-fill);
 border: 1px solid var(--nexo-control-line);
 border-radius: 999px !important;
 color: var(--option-ink);
}
.toolbar > #search::placeholder,
#mobile-tx-search::placeholder { color: var(--option-ink); opacity: 1; }
@media (max-width: 800px) {
 .shell .mobile-tx-search {
  min-height: 40px;
  gap: 8px;
  padding-inline: 10px;
 }
 .mobile-tx-search > svg { width: 16px; height: 16px; }
 .mobile-tx-search > #mobile-tx-search { min-height: 38px; }
 #mobile-tx-search::placeholder { font-size: .9rem; }
}
#form label:has(.required-marker) :is(input,textarea,.control-trigger) {
 background: linear-gradient(155deg,#edf4fa,#e2edf5);
}
:is(.shell,dialog) .filter-picker:not(.workspace-picker,.header-account-picker) > .control-menu {
 background: var(--control-glass);
 -webkit-backdrop-filter: blur(24px) saturate(1.65);
 backdrop-filter: blur(24px) saturate(1.65);
}
:is(.shell,dialog) .filter-picker:not(.workspace-picker,.header-account-picker) .control-options { padding: 5px 6px 8px; }
:is(.shell,dialog) .filter-picker:not(.workspace-picker,.header-account-picker) .control-options button {
 border-radius: 999px !important;
}
:is(.shell,dialog) .filter-picker:not(.workspace-picker,.header-account-picker) .control-options button[aria-checked="true"] {
 background: #fff;
 border-color: transparent;
 box-shadow: var(--control-lens-shadow);
}
body > dialog::backdrop {
 -webkit-backdrop-filter: blur(var(--overlay-blur));
 backdrop-filter: blur(var(--overlay-blur));
}
#mobile-filters-dialog::backdrop {
 -webkit-backdrop-filter: none;
 backdrop-filter: none;
}
@media (prefers-reduced-motion: no-preference) ,(min-width:801px) {
 body > dialog[open]:not(#mobile-tx-sheet,#mobile-filters-dialog,#nie-chat-dialog) { animation: control-dialog-enter var(--overlay-time) var(--expand-ease); }
 body > dialog[open]:not(#mobile-filters-dialog,#nie-chat-dialog)::backdrop { animation: control-backdrop-enter var(--overlay-time) var(--expand-ease); }
 #mobile-filters-dialog[open] { animation: filter-center-enter var(--overlay-time) var(--expand-ease); }
 #mobile-filters-dialog[open]::backdrop { animation: filter-tint-enter var(--overlay-time) var(--expand-ease); }
 @keyframes filter-center-enter { from { opacity: 0; scale: .98; } to { opacity: 1; scale: 1; } }
 @keyframes filter-tint-enter { from { opacity: 0; } }
 .shell :is(.mobile-tx-results,.statement-history)[open] > :not(summary) {
  animation: nexo-expand-enter 260ms var(--expand-ease) both;
 }
 @keyframes control-dialog-enter {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: none; }
 }
 @keyframes control-backdrop-enter {
  from { opacity: 0; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
 }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
 .shell :is(.segmented,.mobile-tx-tabs),
 :is(.shell,dialog) .filter-picker:not(.workspace-picker,.header-account-picker) > .control-menu {
  background: #edf4fa !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
 }
}
