/* Category management follows the supplied list → form → group manager flow. */
.category-reference{background:white}
.category-reference .dialog-head,.category-reference .category-kind-tabs{background:var(--accent);color:white}
.category-reference .dialog-head button{color:inherit;grid-column:3;grid-row:1}
.category-reference .dialog-head [data-close]{grid-column:1}
.category-toolbar{flex-shrink:0;background:white}
.category-kind-tabs{display:flex;padding:3px 16px 10px;gap:18px}
.category-kind-tabs button{flex:1;border-radius:24px;min-height:36px;color:inherit;font-size:14px}
.category-kind-tabs button.active{background:white;color:var(--accent);font-weight:650}
.category-ledger-label{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;font-size:11px;color:var(--muted);margin:8px 14px}
.category-ledger-label select{margin:0;width:auto;max-width:210px;padding:6px 12px;min-height:36px}
.category-reference .dialog-body{padding:0 12px 8px}
.category-reference .category-order-group{margin:4px 0 10px}
.category-reference .category-order-group>summary{min-height:38px;padding:0 6px;gap:5px;background:var(--soft,#f0f8e8);border-radius:8px;font-size:11px;color:var(--muted)}
.category-reference .category-order-group>summary:before{font-size:18px;flex-basis:9px}
.category-reference .fold-content{padding:2px 6px 0;min-width:0}
.category-reference .category-order-list,.category-reference .category-order-group,.category-reference [data-category-children]{min-width:0;max-width:100%}
.category-count{padding-right:7px}
.category-swipe-row{position:relative;overflow:hidden;border-radius:8px;background:white;width:100%;min-width:0}
.category-swipe-row.swipe-open,.category-swipe-row.swipe-tracking{background:var(--accent)}
.category-swipe-content,.category-group-row{display:flex;align-items:center;background:white;min-height:52px;position:relative}
.category-swipe-content{touch-action:pan-y;transition:transform .14s ease-out}
.swipe-open .category-swipe-content{transform:translateX(-76px)}
.category-item-open{display:flex;align-items:center;gap:10px;min-width:0;flex:1;text-align:left;padding:5px 2px;font-size:14px;min-height:52px}
.category-item-open>span:last-child{overflow-wrap:anywhere;min-width:0}
.category-item-open small{display:block;font-size:11px;color:var(--muted)}
.category-symbol{width:38px;height:38px;display:grid;place-items:center;flex-shrink:0;font-size:27px}
.category-swipe-delete{position:absolute;inset:0 0 0 auto;width:76px;color:white;display:flex;align-items:center;justify-content:center;gap:5px;font-size:26px;visibility:hidden}
.category-swipe-delete small{font-size:12px}.swipe-open .category-swipe-delete{visibility:visible}
.category-reference .metadata-handle{color:var(--accent);min-width:44px;min-height:48px}
.category-reference .category-swipe-content{min-width:0;width:100%;min-height:44px}
.category-reference .category-swipe-content .category-item-open{min-height:44px;padding:4px 0;gap:8px;font-size:13px}
.category-reference .category-swipe-content .category-symbol{width:32px;height:32px;border-radius:10px}
.category-reference .category-swipe-content .category-symbol .app-icon{font-size:26px}
.category-reference .category-swipe-content .metadata-handle{flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:10px;font-size:19px}
.category-reference .category-drop-end{min-height:8px;padding:0 10px;font-size:11px}
.category-reference .category-drop-end:not(:empty){min-height:44px;padding:12px;color:var(--muted)}
.category-reference .metadata-footer{padding:8px 12px max(10px,env(safe-area-inset-bottom));border-top:1px solid var(--soft,#f0f8e8)}
.category-reference .metadata-footer>button:first-child{background:white;color:var(--text,var(--ink));font-size:15px;font-weight:500}
.category-form .dialog-head{background:var(--accent);color:white}
.category-form .dialog-head button{color:inherit}
.category-form .dialog-body{padding:12px;background:white}
.category-name-row{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.category-name-row>label{min-width:0;flex:1;margin:0;font-size:11px;color:var(--muted)}
.category-name-row input{border:0;border-bottom:1px solid var(--line);border-radius:0;margin:0;padding:5px 0;font-size:16px;background:transparent}
.category-group-label{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--muted)}
.category-group-label button{color:var(--accent);min-width:44px;min-height:44px;font-size:24px}
.category-group-pills{display:flex;gap:8px;overflow:auto;scrollbar-width:none;padding:0 0 12px}
.category-group-pills button{flex-shrink:0;border-radius:12px;padding:8px 12px;min-height:40px;background:var(--soft,#f0f8e8);font-size:12px}
.category-group-pills button[aria-pressed=true]{background:var(--accent);color:white}
.category-icon-library h3{background:var(--soft,#f0f8e8);color:var(--muted);font-size:11px;padding:7px 4px;font-weight:400;margin:0 0 6px}
.category-icon-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:18px}
.category-icon-grid button{background:var(--soft,#f0f8e8);border:2px solid transparent;border-radius:15px;height:64px;font-size:30px}
.category-icon-grid button[aria-pressed=true]{border-color:var(--accent);background:var(--soft,#f0f8e8)}
.category-archive{margin-top:16px}
.category-detail-symbol{font-size:38px;flex-shrink:0}
@media(max-width:360px){.category-reference .category-item-open{font-size:13px}.category-icon-grid{gap:8px}.category-icon-grid button{height:54px;font-size:28px}.category-form .dialog-body{padding:10px}}
@media(prefers-reduced-motion:reduce){.category-swipe-content{transition:none}}

dialog.category-reference .metadata-footer>button:first-child:not(.danger){background:white;color:var(--ink);font-weight:500}
.swipe-tracking .category-swipe-content{transition:none}
