/* GCS 3.2.16: one button component, including the existing .btn aliases. */
:root{--button-primary:#263568;--button-primary-hover:#1e2b58;--button-text:#2b3f65;--button-line:#d5ddeb;--button-soft:#edf2f8;--button-danger:#a52c3d;--button-danger-soft:#fff1f2;--button-focus:#b68616;--button-radius:8px;--button-height-sm:32px;--button-height-md:40px;--button-height-lg:48px}
html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage,.danger-button){--button-height:var(--button-height-md);--button-px:14px;--button-font:.875rem;position:relative;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:var(--button-height);height:auto;min-width:0;max-width:100%;padding:8px var(--button-px);border:1px solid var(--button-line);border-radius:var(--button-radius);background:#fff;color:var(--button-text);font-family:var(--font-body,Inter,system-ui,sans-serif);font-size:var(--button-font)!important;font-weight:500;line-height:1.25;text-align:center;text-decoration:none;vertical-align:middle;white-space:normal;overflow-wrap:normal;word-break:normal;box-shadow:none;cursor:pointer;touch-action:manipulation;transition:background-color .12s,border-color .12s,color .12s}
html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage,.danger-button)[hidden]{display:none!important}
html:root body :is(.btn.primary,.btn-primary,.home-button-primary,.btn.report-mini-btn.save,.btn[data-ui-variant=primary]){background:var(--button-primary);color:#fff;border-color:var(--button-primary)}
html:root body :is(.btn.secondary,.btn-secondary,.home-button-outline,.btn[data-ui-variant=outline]){background:#fff;color:var(--button-text);border-color:var(--button-line)}
html:root body .btn[data-ui-variant=secondary]{background:var(--button-soft);color:var(--button-text);border-color:transparent}
html:root body :is(.btn[data-ui-variant=ghost],.btn[data-ui-variant=icon],.icon-btn,.finance-icon-btn,.report-comment-button,.report-attachment-manage){background:transparent;color:var(--button-text);border-color:transparent}
html:root body :is(.btn.danger,.btn-danger,.danger-button,.btn.meeting-danger,.btn.library-delete,.btn[data-ui-variant=danger]){background:var(--button-danger-soft);color:var(--button-danger);border-color:#eccbd1}
@media(hover:hover){
  html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage,.danger-button):not(:disabled):not([aria-disabled=true]):hover{background:#e9eff7;border-color:#b7c5da;color:#213962;box-shadow:none}
  html:root body :is(.btn.primary,.btn-primary,.home-button-primary,.btn.report-mini-btn.save,.btn[data-ui-variant=primary]):not(:disabled):not([aria-disabled=true]):hover{background:var(--button-primary-hover);border-color:var(--button-primary-hover);color:#fff}
  html:root body :is(.btn.danger,.btn-danger,.danger-button,.btn.meeting-danger,.btn.library-delete,.btn[data-ui-variant=danger]):not(:disabled):not([aria-disabled=true]):hover{background:#fbe2e6;border-color:#d69ca6;color:#8f2031}
}
html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage,.danger-button):not(:disabled):not([aria-disabled=true]):active{filter:brightness(.94)}
html:root body :is(button,a[href],summary):focus-visible{outline:3px solid var(--button-focus);outline-offset:3px}
html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage,.danger-button):is(:disabled,[aria-disabled=true]){opacity:.5;cursor:not-allowed;box-shadow:none;filter:none}
html:root body :is(.btn,.home-button)[data-ui-size=sm],html:root body :is(.btn-sm,.btn.small,.btn.activity-small){--button-height:var(--button-height-sm);--button-px:10px;--button-font:.8125rem;padding-block:6px}
html:root body :is(.btn,.home-button)[data-ui-size=lg],html:root body .btn-lg{--button-height:var(--button-height-lg);--button-px:20px;--button-font:1rem;padding-block:10px}
html:root body :is(.btn-icon-only,.icon-btn,.finance-icon-btn,.report-comment-button,.report-attachment-manage){width:var(--button-height);min-width:var(--button-height);padding:7px;flex:0 0 auto}
html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage) svg{width:18px;height:18px;flex:0 0 18px;vertical-align:middle}
html:root body .btn-icon{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions){display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions)>.btn{width:auto;flex:0 1 auto}
html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions) form{margin:0;max-width:100%}
html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions) .btn:not(.primary):not(.btn-primary):not([data-ui-variant=primary]){--button-height:var(--button-height-sm);--button-px:9px;background:transparent;border-color:transparent;box-shadow:none}
html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions) .btn[data-ui-variant=danger]{color:var(--button-danger)}
html:root body :is(.btn,button)[aria-busy=true]{cursor:progress;opacity:.8}
html:root body .btn[aria-busy=true]::before{content:'';display:block;width:14px;height:14px;flex:0 0 14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:button-spin .75s linear infinite}
html:root body .btn-icon-only[aria-busy=true]>svg{display:none}
@keyframes button-spin{to{transform:rotate(360deg)}}
.btn-action-menu{display:inline-block;position:relative;flex:0 0 auto;margin:0;padding:0;border:0;background:none}
.btn-action-menu>summary{list-style:none}
.btn-action-menu>summary::-webkit-details-marker{display:none}
html:root body .btn-action-menu:not([open])>.btn-action-menu-panel{display:none}
.btn-action-menu-panel{box-sizing:border-box;position:fixed;z-index:1200;width:208px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;padding:6px;border:1px solid var(--button-line);border-radius:10px;background:#fff;box-shadow:0 8px 24px #1c2b491f}
html:root body .report-context-menu .btn{justify-content:flex-start;width:100%;border:0;background:transparent;text-align:left;--button-height:var(--button-height-sm)}
html:root body .report-context-menu .btn.danger{color:var(--button-danger)}
html:root body .btn-action-menu-panel>.btn{display:flex;justify-content:flex-start;width:100%;max-width:100%;min-height:36px;margin:0;padding:9px 10px;border:0;background:transparent;text-align:left}
html:root body .btn-action-menu-panel>.btn:not(:disabled):not([aria-disabled=true]):hover{background:var(--button-soft)}
html:root body .btn-action-menu-panel>.btn[data-ui-variant=danger]{color:var(--button-danger)}
@media(max-width:760px){
  :root{--button-height-sm:44px;--button-height-md:44px;--button-height-lg:48px}
  html:root body :is(.btn,.home-button,.icon-btn,.finance-icon-btn,.report-mini-btn,.report-comment-button,.report-attachment-manage,.danger-button){min-height:44px}
  html:root body :is(.inline-actions,.screen-report-actions,.task-hero-actions,.library-hero-actions,.meeting-actions,.form-actions,.bottom-actions){flex-wrap:wrap;gap:8px;min-width:0}
  html:root body :is(.cash-modal footer,.library-modal footer,.modal-form footer,.meeting-actions,.form-actions)>.btn:is(.primary,.btn-primary,[data-ui-variant=primary]){flex:1 1 160px}
  html:root body .btn-action-menu-panel>.btn{min-height:44px}
}
@media(prefers-reduced-motion:reduce){html:root body .btn{transition:none}html:root body .btn[aria-busy=true]::before{animation:none}}
@media(forced-colors:active){html:root body .btn{border:1px solid ButtonText}html:root body .btn:disabled{color:GrayText}html:root body .btn:focus-visible{outline-color:Highlight}}

@media(max-width:480px){
  html:root body :is(.task-hero-actions,.library-hero-actions,.screen-report-actions)>.btn:is(.primary,.btn-primary,[data-ui-variant=primary]){flex:1 1 100%;width:100%}
}

/* Preserve permission/visibility flags on action groups with explicit display rules. */
html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions,.inline-actions,.screen-report-actions,.task-hero-actions,.library-hero-actions,.meeting-actions,.form-actions,.bottom-actions)[hidden]{display:none!important}

/* Compact actions keep a full square hit target and visible pointer feedback. */
html:root body .btn.btn-icon-only{width:var(--button-height);min-width:var(--button-height);padding:7px;flex:0 0 auto}
@media(hover:hover){
  html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions) .btn:not(.primary):not(.btn-primary):not([data-ui-variant=primary]):not(:disabled):not([aria-disabled=true]):hover{background:var(--button-soft);border-color:transparent}
  html:root body :is(.actions,.row-actions,.task-actions,.financial-item-actions,.library-card-actions,.meeting-row-actions,.source-row-actions) .btn[data-ui-variant=danger]:not(:disabled):not([aria-disabled=true]):hover{background:var(--button-danger-soft);color:var(--button-danger)}
}
