/* Loaded after page styles. Component states are shared; density stays surface-specific. */
:is(.fy-admin,.fy-public) .button{
 display:inline-flex;align-items:center;justify-content:center;gap:8px;
 border-radius:var(--fy-control-radius);touch-action:manipulation;
 transition:background-color calc(var(--fy-theme-motion) * .16s) ease,color calc(var(--fy-theme-motion) * .16s) ease,border-color calc(var(--fy-theme-motion) * .16s) ease;
}
.fy-admin .button{min-height:var(--fy-control-height);padding:8px 14px;font-size:var(--fy-font-ui)}
.fy-public .button{min-height:var(--fy-touch-target)}
:is(.fy-admin,.fy-public) .button.primary{background:var(--fy-accent);color:var(--fy-primary)}
:is(.fy-admin,.fy-public) .button.secondary{border-color:var(--fy-control-line);background:var(--fy-surface);color:var(--fy-primary)}
:is(.fy-admin,.fy-public) .button.danger{background:var(--fy-surface);color:var(--fy-danger);border-color:var(--fy-danger)}
:is(.fy-admin,.fy-public) :is(.button,.action):hover:not(:disabled){filter:none;border-color:currentColor}
:is(.fy-admin,.fy-public) :is(button,input,select,textarea):disabled{cursor:not-allowed;opacity:.65}
:is(.fy-admin,.fy-public) [aria-busy=true]{cursor:progress}
.fy-admin :is(input,textarea,select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]){
 border-color:var(--fy-control-line);border-radius:var(--fy-control-radius);color:var(--fy-text);
}
.fy-admin :is(input,textarea)[readonly]{background:var(--fy-surface-soft);color:var(--fy-muted)}
.fy-admin :is(input,textarea,select):disabled{background:var(--fy-surface-soft)}
.fy-admin :is(input,select,textarea)[aria-invalid=true]{border:2px solid var(--fy-danger)}
:is(.fy-admin,.fy-public) :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--fy-focus);outline-offset:3px}
.fy-admin .admin-sidebar :focus-visible,.fy-public .site-header :focus-visible{outline-color:var(--fy-accent)}
.fy-admin .admin-content{padding:var(--fy-theme-spacing)}
.fy-admin .data-table :is(th,td){padding:var(--fy-theme-cell-padding)}
.fy-admin .table-scroll{overscroll-behavior-x:contain;scrollbar-gutter:stable}
.fy-admin .state{font-size:var(--fy-font-meta);border-radius:4px;padding:4px 8px}
.fy-admin .state-published{color:var(--fy-success);background:#E8F4EB}
.fy-admin .state-draft{color:var(--fy-warning);background:#FBF4E5}
.fy-admin .state-law{color:var(--fy-primary);background:#EDF2F5}
.fy-admin dialog{border-radius:var(--fy-radius);overscroll-behavior:contain;box-shadow:var(--fy-shadow)}
.fy-admin .table-filter-popover,.fy-admin .field-help-popover{box-shadow:var(--fy-shadow)}
.fy-admin .editor-actions{padding-bottom:max(12px,env(safe-area-inset-bottom));gap:8px}
.fy-public .section{padding-block:calc(var(--fy-theme-spacing) * 2)}
.fy-date-picker{position:relative;display:inline-flex;align-items:stretch;width:100%;min-width:0;vertical-align:middle}
.fy-date-picker .fy-date-value,.fy-combobox-input{box-sizing:border-box;width:100%;min-width:0;min-height:var(--fy-control-height,42px);padding:8px 11px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:var(--fy-control-radius,6px);background:var(--fy-surface,#fff);color:var(--fy-text,#263943);font:inherit}
.fy-date-picker .fy-date-value{position:relative;z-index:1;padding-right:46px}
.fy-date-value[aria-invalid=true],.fy-combobox-input[aria-invalid=true]{border-color:var(--fy-danger,#9F2F2F);box-shadow:0 0 0 1px var(--fy-danger,#9F2F2F)}
.fy-date-picker .fy-date-native,.fy-combobox-native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;clip-path:inset(50%)!important;border:0!important}
.fy-date-trigger{position:absolute;z-index:2;inset-block:1px;right:1px;width:42px;display:grid;place-items:center;border:0;border-radius:0 var(--fy-control-radius,6px) var(--fy-control-radius,6px) 0;background:var(--fy-surface-soft,#F1F4F6);color:var(--fy-primary,#21495D);cursor:pointer}
.fy-date-trigger:hover{background:#E6EDF1}
.fy-calendar-icon{position:relative;width:16px;height:15px;border:1.5px solid currentColor;border-radius:3px}
.fy-calendar-icon::before{content:"";position:absolute;left:-1px;right:-1px;top:4px;border-top:1.5px solid currentColor}
.fy-calendar-icon::after{content:"";position:absolute;width:7px;height:2px;left:3px;top:-3px;border-inline:1.5px solid currentColor}
.fy-date-error{display:block;margin-top:4px;color:var(--fy-danger,#9F2F2F);font-size:12px;line-height:1.45}
.fy-date-error[hidden]{display:none}
.fy-calendar-popover,.fy-combobox-panel{position:fixed;z-index:1300;max-height:min(360px,60vh);overflow:auto;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:6px;background:var(--fy-surface,#fff);box-shadow:0 12px 30px rgb(0 0 0 / 16%);color:var(--fy-text,#263943)}
.fy-calendar-popover{padding:10px}
.fy-calendar-heading{display:grid;grid-template-columns:auto minmax(76px,1fr) minmax(62px,.8fr) auto;align-items:center;gap:6px;padding-bottom:9px;border-bottom:1px solid var(--fy-control-line,#B7C6CE);text-align:center}
.fy-calendar-select{min-width:0;min-height:36px;padding:5px 7px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:4px;background:var(--fy-surface,#fff);color:var(--fy-primary,#21495D);font:inherit;font-size:13px}
.fy-calendar-month-button{min-height:36px;padding:5px 9px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:4px;background:var(--fy-surface,#fff);color:var(--fy-primary,#21495D);font:inherit;cursor:pointer}
.fy-calendar-weekdays,.fy-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(32px,1fr));gap:3px;text-align:center}
.fy-calendar-weekdays{padding:8px 0 4px;color:var(--fy-muted,#566B75);font-size:12px}
.fy-calendar-grid{padding-bottom:2px}
.fy-calendar-day{min-height:36px;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--fy-text,#263943);font:inherit;cursor:pointer}
.fy-calendar-day:hover{border-color:var(--fy-control-line,#B7C6CE);background:var(--fy-surface-soft,#F1F4F6)}
.fy-calendar-day.is-today{border-color:var(--fy-primary,#21495D);font-weight:700}
.fy-calendar-day.is-selected,.fy-calendar-day[aria-selected=true]{background:var(--fy-primary,#21495D);color:#fff;font-weight:700}
.fy-combobox{position:relative;display:block;width:100%;min-width:0}
.fy-combobox-panel{padding:4px;overscroll-behavior:contain}
.fy-combobox-option{display:block;width:100%;min-height:40px;padding:8px 10px;border:0;border-radius:3px;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer}
.fy-combobox-option:hover,.fy-combobox-option.is-active{background:#E7F0F5;color:var(--fy-primary,#21495D)}
.fy-combobox-option[aria-selected=true]{font-weight:700}
.fy-combobox-empty,.fy-combobox-status{margin:0;padding:8px;color:var(--fy-muted,#566B75);font-size:12px;line-height:1.5}
.fy-combobox-status{padding:4px 0}
.fy-combobox-clear{position:absolute;top:2px;right:2px;min-height:calc(var(--fy-control-height,42px) - 4px);padding:4px 9px;border:0;background:transparent;color:var(--fy-primary,#21495D);font:inherit;font-size:12px;cursor:pointer}
.fy-combobox-input{padding-right:56px}
.fy-date-picker :is(button,input):focus-visible,.fy-combobox :is(button,input):focus-visible,.fy-calendar-popover :focus-visible,.fy-combobox-panel :focus-visible{outline:3px solid var(--fy-focus,#D9A42D);outline-offset:2px;z-index:1}
@media(max-width:950px){.fy-admin .admin-content{padding:min(var(--fy-theme-spacing),22px)}}
@media(max-width:700px){
 .fy-admin .admin-content{padding:min(var(--fy-theme-spacing),var(--fy-space-4))}
 .fy-admin :is(.button,.action),.fy-admin .regulation-workspace .data-table .action{min-height:var(--fy-touch-target)}
 .fy-date-trigger{width:44px}
 .fy-calendar-popover,.fy-combobox-panel{max-height:min(55vh,360px)}
 .fy-admin .choice-picker button,.fy-admin .choice-picker [role=option]{min-height:var(--fy-touch-target)}
 .fy-admin .pagination label,.fy-admin .pagination input{min-height:var(--fy-touch-target)}
}
@media(prefers-reduced-motion:reduce){:is(.fy-admin,.fy-public) .button{transition:none}}

.fy-date-range{min-width:0;margin:0;padding:10px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:6px;background:var(--fy-surface,#fff)}
.fy-date-range legend{padding-inline:4px;color:var(--fy-primary,#21495D);font-size:13px;font-weight:700}
.fy-date-range-fields{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:end;gap:8px}
.fy-date-range-fields>span{padding-bottom:10px;color:var(--fy-muted,#566B75)}
.fy-date-range-fields>label{display:grid;gap:4px;min-width:0;color:var(--fy-muted,#566B75);font-size:12px}
.fy-date-range-shortcuts{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.fy-date-range-shortcuts button,.fy-tree-match-mode button{min-height:32px;padding:5px 8px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:4px;background:var(--fy-surface,#fff);color:var(--fy-primary,#21495D);font:inherit;font-size:12px;cursor:pointer}
.fy-date-range-shortcuts button[aria-pressed=true],.fy-tree-match-mode button[aria-pressed=true]{border-color:var(--fy-primary,#21495D);background:#E8F0F4;color:var(--fy-primary,#21495D);font-weight:700}
.fy-date-range .field-help{display:block;margin-top:7px;color:var(--fy-muted,#566B75);font-size:11px;line-height:1.5}
.fy-date-range-error{margin:5px 0 0;color:var(--fy-danger,#9F2F2F);font-size:12px;line-height:1.45}
.fy-date-range-error[hidden]{display:none}

.fy-tree-search-label{display:block;margin-bottom:5px;color:var(--fy-text,#263943);font-size:12px;font-weight:700}
.fy-tree-search-row{position:relative;display:flex;min-width:0}
.fy-tree-search{box-sizing:border-box;width:100%;min-width:0;min-height:42px;padding:8px 100px 8px 11px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:5px;background:#fff;color:var(--fy-text,#263943);font:inherit}
.fy-tree-search-clear{position:absolute;inset-block:2px;right:2px;padding:4px 8px;border:0;border-radius:3px;background:transparent;color:var(--fy-primary,#21495D);font:inherit;font-size:12px;cursor:pointer}
.fy-tree-selected{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:6px;color:var(--fy-muted,#566B75);font-size:12px;line-height:1.45}
.fy-tree-selected-caption{flex:0 0 100%;font-weight:650}
.fy-tree-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:2px 5px;border:1px solid #C8D7DC;border-radius:3px;background:#F4F7F8;color:#274B5C}
.fy-tree-chip>span{overflow-wrap:anywhere}
.fy-tree-chip button{flex:0 0 auto;min-height:24px;padding:2px 5px;border:0;background:transparent;color:#31566A;font:inherit;font-size:11px;text-decoration:underline;cursor:pointer}
.fy-tree-menu{position:fixed;z-index:1400;max-height:min(470px,68vh);overflow:hidden;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:6px;background:#fff;box-shadow:0 12px 30px rgb(0 0 0 / 16%);color:var(--fy-text,#263943)}
.fy-tree-menu[hidden]{display:none}
.fy-tree-layout{display:grid;grid-template-columns:minmax(190px,.82fr) minmax(280px,1.18fr);min-height:260px;max-height:min(470px,68vh)}
.fy-tree-directory,.fy-tree-match-panel{min-width:0;max-height:min(470px,68vh);overflow:auto;overscroll-behavior:contain}
.fy-tree-directory{padding:8px;border-right:1px solid #D5E0E3;background:#F7F9FA}
.fy-tree-match-panel{display:flex;flex-direction:column;padding:10px}
.fy-tree-match-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:7px;border-bottom:1px solid #D5E0E3;color:var(--fy-primary,#21495D);font-size:13px}
.fy-tree-match-heading span{color:var(--fy-muted,#566B75);font-size:11px}
.fy-tree-results{display:grid;gap:3px;min-height:52px;max-height:245px;overflow:auto;padding-block:6px;overscroll-behavior:contain}
.fy-tree-branch{padding-left:4px;border-left:1px solid #D3DDE1}
.fy-tree-branch>summary{display:flex;align-items:center;gap:6px;min-height:36px;padding:4px 5px;list-style:none;color:#294C5B;font-size:12px;cursor:pointer}
.fy-tree-branch>summary::-webkit-details-marker{display:none}
.fy-tree-branch>summary:hover,.fy-tree-branch>summary:focus-visible{background:#EAF1F4}
.fy-tree-branch>summary small{margin-left:auto;color:var(--fy-muted,#566B75);font-size:11px}
.fy-tree-expander{width:8px;height:8px;flex:0 0 auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg)}
.fy-tree-branch[open]>summary .fy-tree-expander{transform:rotate(45deg)}
.fy-tree-node-label{min-width:0;overflow-wrap:anywhere}
.fy-tree-children{margin-left:11px;padding-left:7px;border-left:1px solid #D3DDE1}
.fy-tree-leaf,.fy-tree-parent-select{display:flex;width:100%;min-height:34px;align-items:center;gap:7px;padding:5px 7px;border:0;border-radius:3px;background:transparent;color:#31566A;text-align:left;font:inherit;font-size:12px;cursor:pointer}
.fy-tree-leaf:hover,.fy-tree-leaf:focus-visible,.fy-tree-parent-select:hover,.fy-tree-parent-select:focus-visible{background:#E5EEF3}
.fy-tree-leaf[aria-selected=true],.fy-tree-parent-select[aria-pressed=true]{background:#D9EAF7;color:#153F56;font-weight:700}
.fy-tree-leaf-mark,.fy-tree-result-mark{display:grid;width:17px;height:17px;flex:0 0 auto;place-items:center;border:1px solid #93A7B0;border-radius:3px;background:#fff}
.fy-tree-leaf[aria-selected=true] .fy-tree-leaf-mark,.fy-tree-result[aria-selected=true] .fy-tree-result-mark{border-color:#1D607E;background:#1D607E;color:#fff}
.fy-tree-leaf[aria-selected=true] .fy-tree-leaf-mark::before,.fy-tree-result[aria-selected=true] .fy-tree-result-mark::before{content:"✓";font-size:12px;line-height:1}
.fy-tree-parent-select{margin-left:22px;width:calc(100% - 22px);min-height:30px;color:#6B531E;font-size:11px}
.fy-tree-result{display:flex;width:100%;min-height:42px;align-items:center;gap:8px;padding:5px 7px;border:1px solid transparent;border-radius:4px;background:#fff;color:#243F4C;text-align:left;font:inherit;cursor:pointer}
.fy-tree-result:hover,.fy-tree-result.is-active{border-color:#B7CDD8;background:#EDF4F7}
.fy-tree-result[aria-selected=true]{border-color:#AFCCE0;background:#DCEBFA}
.fy-tree-result-copy{display:grid;min-width:0;gap:2px}
.fy-tree-result-copy strong{font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.fy-tree-result-copy small,.fy-tree-result>small{color:var(--fy-muted,#566B75);font-size:10px;line-height:1.35;overflow-wrap:anywhere}
.fy-tree-all{border-bottom:1px solid #D5E0E3;border-radius:0}
.fy-tree-empty{margin:0;padding:12px 7px;color:var(--fy-muted,#566B75);font-size:12px}
.fy-tree-empty[hidden]{display:none}
.fy-tree-match-mode{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:auto;padding-top:7px;border-top:1px solid #D5E0E3;color:var(--fy-muted,#566B75);font-size:11px}
.fy-tree-match-mode span{margin-right:auto}
.fy-tree-footer{display:flex;justify-content:flex-end;gap:7px;padding-top:7px}
.fy-tree-footer button{min-height:34px;padding:5px 9px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:4px;background:#fff;color:var(--fy-primary,#21495D);font:inherit;font-size:12px;cursor:pointer}
.fy-tree-footer [data-fy-tree-clear]{margin-right:auto;color:#7A4A2A}
.fy-tree-select :focus-visible{outline:3px solid var(--fy-focus,#D9A42D);outline-offset:2px;position:relative;z-index:1}
@media(max-width:640px){
 .fy-tree-layout{grid-template-columns:minmax(0,1fr);max-height:68vh}
 .fy-tree-directory{max-height:22vh;border-right:0;border-bottom:1px solid #D5E0E3}
 .fy-tree-match-panel{max-height:45vh}
 .fy-date-range-shortcuts button{min-height:36px}
}
@media(prefers-reduced-motion:reduce){.fy-tree-menu,.fy-calendar-popover{scroll-behavior:auto}}

.choice-picker.tree-choice{position:relative;display:grid;gap:4px;min-width:0;margin:4px 0;padding:0;border:0;background:transparent}
.choice-search-row{display:flex;align-items:stretch;min-width:0}
.choice-search-row input{box-sizing:border-box;flex:1 1 auto;width:100%;min-width:0;min-height:42px;padding:8px 11px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:var(--fy-control-radius,5px) 0 0 var(--fy-control-radius,5px);background:var(--fy-surface,#fff);color:var(--fy-text,#263943);font:inherit}
.choice-search-row [data-choice-open]{position:relative;display:grid;width:42px;min-width:42px;min-height:42px;place-items:center;border:1px solid var(--fy-control-line,#B7C6CE);border-left:0;border-radius:0 var(--fy-control-radius,5px) var(--fy-control-radius,5px) 0;background:var(--fy-surface-soft,#F1F4F6);color:var(--fy-primary,#21495D);cursor:pointer}
.choice-search-row [data-choice-open]>span{width:8px;height:8px;margin-top:-4px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg)}
.choice-search-row [data-choice-open][aria-expanded=true]>span{margin-top:4px;transform:rotate(225deg)}
.choice-picker.tree-choice [data-chosen]{display:flex;flex-wrap:wrap;gap:4px;min-width:0;margin:0}
.choice-picker.tree-choice [data-chosen]:has(>.muted:only-child){min-height:18px}
.choice-picker.tree-choice [data-chosen]>.muted{padding:1px 0;color:var(--fy-muted,#566B75);font-size:12px;font-weight:400}
.choice-picker.tree-choice .choice-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;min-width:0;padding:2px 4px 2px 8px;border:1px solid #B8CBD3;border-radius:4px;background:#F5F8F9;color:#294B5B;font-weight:400}
.choice-picker.tree-choice .choice-chip>span{min-width:0;overflow-wrap:anywhere}
.choice-picker.tree-choice .choice-chip>button{flex:0 0 28px;width:28px;min-height:28px;padding:0;border:0;color:#31566A;background:transparent}
.choice-picker.tree-choice .choice-empty-button{min-height:42px;padding:6px 9px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:4px;background:#fff;color:var(--fy-primary,#21495D);font:inherit}
.choice-tree-popover{position:relative;display:grid;grid-template-rows:auto auto auto minmax(80px,1fr);gap:6px;width:100%;max-width:100%;box-sizing:border-box;margin-top:4px;padding:10px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:6px;background:#fff;box-shadow:0 6px 18px rgb(0 0 0 / 12%);color:var(--fy-text,#263943)}
.choice-tree-popover[hidden]{display:none}
.choice-tree-tools{display:flex;flex-wrap:wrap;gap:6px}
.choice-tree-popover .choice-tree-tools button{min-height:34px;padding:5px 9px;border:1px solid var(--fy-control-line,#B7C6CE);border-radius:4px;background:#fff;color:var(--fy-primary,#21495D);font:inherit;font-size:12px}
.choice-tree-popover .choice-tree-tools [data-choice-close]{margin-left:auto}
.choice-tree-popover .field-help{margin:0;color:var(--fy-muted,#566B75);font-size:11px;line-height:1.45}
.choice-picker.tree-choice [role=tree]{min-height:80px;max-height:380px;overflow:auto;border:1px solid #B7C6CE;border-radius:4px;background:#fff;overscroll-behavior:contain}
.choice-picker.tree-choice [role=tree][hidden]{display:none}
.choice-picker.tree-choice [role=treeitem]{padding:0;color:#274757}
.choice-picker.tree-choice .choice-tree-row{display:flex;align-items:center;gap:7px;min-height:38px;padding:4px 7px 4px calc((var(--choice-depth) - 1) * 15px + 6px);cursor:pointer}
.choice-picker.tree-choice .choice-tree-row:hover,.choice-picker.tree-choice .choice-active>.choice-tree-row{background:#E7F0F4}
.choice-picker.tree-choice [aria-selected=true],.choice-picker.tree-choice [aria-checked=true]>.choice-tree-row{font-weight:700;background:#DCEAF0}
.choice-picker.tree-choice .choice-tree-row>button{width:28px;min-height:28px;padding:0;border:1px solid #D0DDE1;border-radius:3px;background:#fff;color:#294B5B}
.choice-picker.tree-choice .choice-tree-spacer{flex:0 0 28px;width:28px}
.choice-picker.tree-choice .choice-tree-check{display:grid;width:17px;height:17px;flex:0 0 17px;place-items:center;border:1px solid #93A7B0;border-radius:3px;background:#fff}
.choice-picker.tree-choice [aria-checked=true] .choice-tree-check,.choice-picker.tree-choice .is-selected{border-color:#1D607E;background:#1D607E;color:#fff}
.choice-picker.tree-choice .choice-tree-check.is-selected::before{content:"✓";font-size:12px}
.choice-picker.tree-choice .choice-tree-name{min-width:0;overflow-wrap:anywhere}
.choice-tree-popover [data-choice-status]{margin:0;color:var(--fy-muted,#566B75);font-size:12px;line-height:1.5}
.choice-picker.tree-choice :focus-visible,.choice-tree-popover :focus-visible{outline:3px solid var(--fy-focus,#D9A42D);outline-offset:2px}
.fy-public .library-tree-filter{display:flex;flex-direction:column;gap:8px;min-width:0;color:var(--fy-primary,#21495D);font-size:14px;font-weight:600}
@media(max-width:640px){.choice-picker.tree-choice [role=tree]{max-height:220px}.choice-picker.tree-choice .choice-tree-row{min-height:44px}.choice-picker.tree-choice .choice-tree-row>button{min-height:36px}.fy-admin .choice-tree-popover .choice-tree-tools button{min-height:44px}}
