/* ALEXPOCKET Personal — visual category picker (Money Keeper-inspired, original UI). */
.ap-tx-category{display:grid;gap:10px;min-width:0}
.ap-category-current{width:100%;min-width:0;display:grid;grid-template-columns:48px minmax(0,1fr) 22px;align-items:center;gap:11px;padding:11px 13px;border:1px solid #dfe7ef;border-radius:14px;background:linear-gradient(180deg,#fff,#fbfdfd);color:var(--ink);text-align:left;transition:border-color .15s,box-shadow .15s}
.ap-category-current:hover,.ap-category-current:focus-visible{border-color:#80d9ba;box-shadow:0 0 0 3px rgba(15,155,114,.09)}
.ap-category-current.has-selection{border-color:#9adfc5;background:#f7fffb}
.ap-category-current-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:color-mix(in srgb,var(--ap-category-color) 14%,white);color:var(--ap-category-color);font-size:23px;line-height:1}
.ap-category-current-copy{display:grid;gap:3px;min-width:0}
.ap-category-current-copy>small{color:var(--muted);font-size:11px;line-height:1.3}
.ap-category-current-copy>strong{font-size:15px;line-height:1.35;overflow-wrap:anywhere}
.ap-category-current-arrow{color:#8190a3;font-size:22px;text-align:center}
.ap-category-quick-block{display:grid;gap:9px}
.ap-category-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.ap-category-section-head strong{font-size:13px;color:var(--ink)}
.ap-category-section-head span{font-size:11px;color:var(--muted);text-align:right}
.ap-category-quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.ap-category-quick-item{min-width:0;min-height:91px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:7px;padding:10px 9px;border:1px solid var(--line);border-radius:13px;background:#fff;color:var(--ink);text-align:left;transition:border-color .12s,background .12s,transform .12s}
.ap-category-quick-item:hover{border-color:#aadfce;background:#fbfffd;transform:translateY(-1px)}
.ap-category-quick-item.active{border-color:#55c99e;background:#effcf6;box-shadow:inset 0 0 0 1px #55c99e}
.ap-category-icon{width:36px;height:36px;display:grid;place-items:center;flex:none;border-radius:11px;background:color-mix(in srgb,var(--ap-category-color,#64748b) 14%,white);color:var(--ap-category-color,#64748b);font-size:19px;line-height:1}
.ap-category-quick-copy{display:grid;gap:2px;min-width:0;width:100%}
.ap-category-quick-copy strong{font-size:12px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-category-quick-copy small{font-size:10px;line-height:1.25;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-category-browse-button{width:100%;min-height:43px;border:1px dashed #a8cdbf;border-radius:11px;background:#f8fffb;color:#087d5b;font-size:13px;font-weight:800}
.ap-category-browse-button:hover{background:#eafaf2;border-color:#64c9a1}
.ap-category-browser{display:grid;gap:11px;padding:12px;border:1px solid #dbe7e2;border-radius:15px;background:#fbfdfc;min-width:0}
.ap-category-browser[hidden]{display:none!important}
.ap-category-browser-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
.ap-category-search-wrap{min-width:0;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid #dce5e2;border-radius:11px;background:#fff;color:#7a899a}
.ap-category-search-wrap>span{font-size:21px;line-height:1}
.ap-category-search-wrap input{width:100%;min-width:0;min-height:42px;padding:8px 0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;font-size:13px}
.ap-category-close-browser{min-height:42px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:#fff;color:#64748b;font-size:12px;font-weight:750}
.ap-category-browser-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--ink)}
.ap-category-browser-heading>strong{font-size:13px}
.ap-category-browser-heading>span{font-size:11px;color:var(--muted)}
.ap-category-group-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ap-category-group-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:5px;min-width:0;padding:8px;border:1px solid var(--line);border-radius:12px;background:#fff}
.ap-category-group-main{min-width:0;display:grid;grid-template-columns:36px minmax(0,1fr) 14px;align-items:center;gap:8px;padding:2px;border:0;background:transparent;color:var(--ink);text-align:left}
.ap-category-group-main>span:nth-child(2){display:grid;gap:3px;min-width:0}
.ap-category-group-main strong{font-size:12px;line-height:1.3}
.ap-category-group-main small{font-size:10px;color:var(--muted)}
.ap-category-group-arrow{font-size:21px;color:#96a3b2}
.ap-category-group-select{align-self:end;padding:5px 7px;border:0;border-radius:7px;background:#f1f7f4;color:#087d5b;font-size:10px;font-weight:800;white-space:nowrap}
.ap-category-parent-heading{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px}
.ap-category-parent-heading>button:first-child{padding:7px 8px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#526176;font-size:11px;font-weight:750;white-space:nowrap}
.ap-category-parent-heading>div{display:flex;align-items:center;gap:7px;min-width:0}
.ap-category-parent-heading>div>span:last-child{display:grid;gap:2px;min-width:0}
.ap-category-parent-heading>div strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-category-parent-heading>div small{font-size:10px;color:var(--muted)}
.ap-category-use-parent{padding:7px 8px;border:0;border-radius:8px;background:#eafaf2;color:#087d5b;font-size:10px;font-weight:850;white-space:nowrap}
.ap-category-result-list{display:grid;gap:5px;max-height:280px;overflow:auto;padding-right:2px}
.ap-category-result{width:100%;min-width:0;display:grid;grid-template-columns:36px minmax(0,1fr) 18px;align-items:center;gap:9px;padding:7px 9px;border:1px solid transparent;border-radius:10px;background:#fff;color:var(--ink);text-align:left}
.ap-category-result:hover{border-color:#c6e8d9;background:#f8fffb}
.ap-category-result.active{border-color:#60c89e;background:#effcf6}
.ap-category-result>span:nth-child(2){display:grid;gap:2px;min-width:0}
.ap-category-result strong{font-size:12px;line-height:1.35}
.ap-category-result small{font-size:10px;color:var(--muted);line-height:1.3;overflow-wrap:anywhere}
.ap-category-result-check{color:#0b9b70;font-weight:900;text-align:center}
.ap-category-child-row{display:grid;grid-template-columns:minmax(0,1fr) 35px;align-items:center;gap:5px}
.ap-category-open-child{width:35px;height:35px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#64748b;font-size:21px}
.ap-category-empty{padding:14px;border:1px dashed #d7e1de;border-radius:10px;background:#fff;color:var(--muted);font-size:12px;line-height:1.55}
.ap-category-help{display:block;color:var(--muted);font-size:11px;line-height:1.45}
@media(max-width:600px){
  .ap-category-current{grid-template-columns:43px minmax(0,1fr) 18px;padding:10px;gap:9px}
  .ap-category-current-icon{width:42px;height:42px;font-size:21px}
  .ap-category-quick-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  .ap-category-quick-item{min-height:83px;padding:8px 6px;gap:6px;border-radius:11px}
  .ap-category-icon{width:32px;height:32px;border-radius:10px;font-size:17px}
  .ap-category-quick-copy strong{font-size:11px}
  .ap-category-quick-copy small{font-size:9px}
  .ap-category-browser{padding:9px}
  .ap-category-browser-toolbar{grid-template-columns:minmax(0,1fr) auto;gap:6px}
  .ap-category-close-browser{padding:0 8px;font-size:11px}
  .ap-category-group-grid{grid-template-columns:1fr}
  .ap-category-parent-heading{grid-template-columns:1fr auto}
  .ap-category-parent-heading>div{grid-column:1/-1;grid-row:1}
  .ap-category-parent-heading>button:first-child{grid-column:1;grid-row:2;justify-self:start}
  .ap-category-use-parent{grid-column:2;grid-row:2}
  .ap-category-result-list{max-height:34vh}
}

/* Category picker v1.0.1: visible selection, quick tiles and pins. */
.ap-category-current-wrap{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:7px;align-items:stretch;min-width:0}
.ap-category-current{cursor:pointer;min-height:68px}
.ap-category-current-copy{min-width:0;text-align:left}
.ap-category-current-copy small{display:block;color:var(--muted);font-size:10px;line-height:1.3}
.ap-category-current-copy strong{display:block;color:var(--ink);font-size:14px;line-height:1.35;overflow-wrap:anywhere}
.ap-category-current.has-selection .ap-category-current-copy strong{color:#0d7659}
.ap-category-clear{width:38px;min-height:50px;align-self:center;border:1px solid var(--line);border-radius:11px;background:#fff;color:#8b96a5;font-size:23px;line-height:1}
.ap-category-clear:hover{border-color:#efb4b4;background:#fff8f8;color:#b42318}
.ap-category-clear[hidden]{display:none!important}
.ap-category-quick-card{position:relative;min-width:0}
.ap-category-quick-item{width:100%;height:100%;padding-right:27px}
.ap-category-pin{position:absolute;top:5px;right:5px;display:grid;place-items:center;width:25px;height:25px;border:0;border-radius:8px;background:#f5f7fa;color:#9aa5b3;font-size:16px;line-height:1;cursor:pointer}
.ap-category-pin:hover,.ap-category-pin.pinned{background:#fff7dc;color:#b77908}
.ap-category-search-wrap{min-width:0;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid #dce5e2;border-radius:11px;background:#fff;color:#7a899a}
.ap-category-search-wrap>span{font-size:22px;line-height:1}
.ap-category-search-wrap input{width:100%;min-width:0;min-height:43px;padding:8px 0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;font-size:13px}
.ap-category-quick-grid:empty:after{content:"Chưa có danh mục gợi ý.";display:block;grid-column:1/-1;padding:12px;color:var(--muted);font-size:12px}
.ap-category-result{cursor:pointer}
.ap-category-group-main{cursor:pointer}
.ap-category-group-select{cursor:pointer}
.ap-category-use-parent{cursor:pointer}
.ap-category-close-browser{cursor:pointer}
.ap-category-open-child{cursor:pointer}
@media(max-width:600px){
  .ap-category-current-wrap{grid-template-columns:minmax(0,1fr) 34px;gap:5px}
  .ap-category-current{min-height:62px}
  .ap-category-clear{width:34px;min-height:44px}
  .ap-category-quick-item{padding-right:23px}
  .ap-category-pin{top:3px;right:3px;width:22px;height:22px;font-size:14px}
}

@media(max-width:600px){
  .ap-category-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ap-category-quick-item{min-height:78px}
  .ap-category-quick-copy strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow:hidden;text-overflow:ellipsis;line-height:1.25}
  .ap-category-quick-copy small{display:none}
}

/* Category picker accessibility and touch feedback. */
.ap-tx-category button:focus-visible,.ap-tx-category input:focus-visible{outline:3px solid rgba(13,148,105,.28);outline-offset:2px}
.ap-category-quick-item:active,.ap-category-group-main:active,.ap-category-result:active{transform:scale(.985)}
.ap-category-quick-item{cursor:pointer}
.ap-category-current{width:100%;text-align:left}
.ap-category-section-head{flex-wrap:wrap}
@media(prefers-reduced-motion:reduce){.ap-category-quick-item{transition:none}}
