/* Fee editors share the payout palette, with explicit dark-mode form surfaces. */
.fee-editor, .deposit-fee-create {
 --fee-accent: var(--accent);
 --fee-field-bg: color-mix(in srgb, var(--muted) 5%, var(--surface));
 --fee-error: #b91c1c;
 color: var(--text);
}
[data-theme="dark"] .fee-editor, [data-theme="dark"] .deposit-fee-create {
 --fee-accent: #b4adff; --fee-field-bg: var(--surface-2); --fee-error: #fca5a5;
 color-scheme: dark;
}
.fee-editor-host, .fee-editor { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.fee-editor-host, .fee-editor-host > .fee-editor { flex: 1 1 auto; }
.fee-editor > .modal-body { overflow-y: auto; }
.fee-editor .modal-header { border-bottom: 0; padding-bottom: .75rem; }
.fee-heading { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.fee-heading-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 14px; color: var(--fee-accent); background: color-mix(in srgb, var(--fee-accent) 12%, var(--surface)); }
.fee-editor .modal-title, .fee-editor h3, .fee-editor strong { color: var(--text); }
.fee-editor .modal-title { letter-spacing: -.02em; }
.fee-fields-grid, .fee-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.fee-main-fields { margin-top: 1.1rem; }
.fee-field { min-width: 0; }
.fee-editor .form-label, .deposit-fee-create .form-label { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); margin-bottom: .45rem; }
.fee-input-shell, .fee-month-controls {
 display: flex; align-items: center; min-width: 0; gap: .5rem; padding: 0 .8rem;
 border: 1px solid var(--border); border-radius: 12px; background: var(--fee-field-bg); transition: border-color .18s, box-shadow .18s;
}
.fee-input-shell:focus-within, .fee-month-controls:focus-within { border-color: var(--fee-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fee-accent) 15%, transparent); }
.fee-editor .fee-input-shell input, .deposit-fee-create .fee-input-shell input {
 min-width: 0; width: 100%; min-height: 46px; padding: .65rem 0; border: 0; border-radius: 0; background: transparent; color: var(--text);
 box-shadow: none; font-size: .95rem; font-weight: 550; font-variant-numeric: tabular-nums;
}
.fee-editor input[type="number"], .deposit-fee-create input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.fee-editor input::-webkit-inner-spin-button, .fee-editor input::-webkit-outer-spin-button,
.deposit-fee-create input::-webkit-inner-spin-button, .deposit-fee-create input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fee-input-unit { flex-shrink: 0; color: var(--muted); font-size: .72rem; font-weight: 500; }
.fee-input-inline label { flex-shrink: 0; color: var(--muted); font-size: .76rem; margin: 0; }
.fee-input-inline input { text-align: right; }
.fee-editor .errorlist, .deposit-fee-create .errorlist { margin: .4rem 0 0; padding-left: 1rem; color: var(--fee-error); font-size: .78rem; }
.fee-editor .alert-danger { color: var(--fee-error); background: color-mix(in srgb, var(--fee-error) 8%, var(--surface)); border-color: color-mix(in srgb, var(--fee-error) 25%, var(--border)); border-radius: 12px; }
.fee-editor .alert-danger .errorlist { margin: 0; }
.fee-editor [aria-invalid="true"] { outline: 1px solid var(--fee-error); outline-offset: 2px; }
.fee-month-controls { gap: .65rem; }
.fee-month-controls > i { color: var(--fee-accent); flex-shrink: 0; }
.fee-month-controls > input {
 flex: 1; width: 100%; min-width: 0; min-height: 44px; padding: .55rem 0; border: 0; border-radius: 0;
 background-color: transparent; color: var(--text); box-shadow: none; font: inherit; font-size: .88rem;
}
.fee-month-controls input::placeholder { color: var(--muted); }
.fee-editor select option { background: var(--surface); color: var(--text); }
.fee-editor .fee-state-control { min-width: 0; max-width: 55%; }
.fee-editor .fee-state-control select { cursor: pointer; min-height: 36px; padding: .4rem 2rem .4rem .7rem; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background-color: var(--fee-field-bg); font-size: .78rem; }
[data-theme="dark"] .fee-editor .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b6c2d9' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.fee-tiers-section { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.fee-section-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .85rem; }
.fee-section-heading h3 { margin: 0; font-size: .9rem; font-weight: 600; }
.fee-tier-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 40px; align-items: start; gap: .6rem; margin-top: .65rem; }
.fee-tier-row > button { margin-top: 3px; }
.fee-tier-row > .errorlist { grid-column: 1 / -1; }
.fee-tier-row[hidden], .fee-editor [hidden] { display: none !important; }
.fee-defaults { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; color: var(--muted); font-size: .75rem; margin: .65rem 0; }
.fee-inline-action, .fee-add-class, .fee-performance-action {
 display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 40px; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: transparent; font: inherit; font-size: .8rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .18s, border-color .18s;
}
.fee-performance-action { min-width: 40px; }
.fee-inline-action { color: var(--fee-accent); background: color-mix(in srgb, var(--fee-accent) 7%, var(--surface)); }
.fee-add-class { margin-top: .8rem; width: 100%; border-style: dashed; color: var(--muted); }
.fee-inline-action:hover, .fee-add-class:hover, .fee-performance-action:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.fee-editor button:focus-visible, .fee-editor a:focus-visible, .fee-performance-action:focus-visible { outline: 2px solid var(--fee-accent, var(--accent)); outline-offset: 3px; }
.fee-editor button { cursor: pointer; }
.fee-editor button:disabled { cursor: default; opacity: .5; }
.fee-editor .settings-form-actions { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.fee-editor .settings-icon-btn { color: var(--muted); }
.fee-editor .settings-icon-btn.is-danger:hover { color: var(--fee-error); }
.fee-metrics > div { border-radius: 14px; padding: 1.05rem 1.1rem; background: var(--fee-field-bg); border: 1px solid var(--border); }
.fee-metrics > div > span, .fee-eyebrow { display: block; font-size: .76rem; color: var(--muted); margin-bottom: .5rem; }
.fee-metrics strong { font-size: 1.55rem; letter-spacing: -.03em; font-weight: 600; }
.fee-metrics small, .fee-condition-summary small, .fee-calculation-heading small { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.fee-status { display: inline-flex; align-items: center; gap: .35rem; flex-shrink: 0; padding: .35rem .55rem; border-radius: 8px; font-size: .7rem; color: var(--muted); background: color-mix(in srgb, var(--muted) 8%, var(--surface)); }
.fee-class-list { display: grid; gap: .45rem; }
.fee-class-summary { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--fee-field-bg); border: 1px solid var(--border); border-radius: 12px; font-size: .87rem; font-variant-numeric: tabular-nums; }
.fee-class-summary > span, .fee-class-summary small { color: var(--muted); }
.fee-class-summary > strong { white-space: nowrap; }
.fee-browse { max-width: 340px; margin-bottom: 1rem; }
.fee-condition-summary { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: 1.25rem; border: 1px solid color-mix(in srgb, var(--fee-accent) 25%, var(--border)); border-radius: 16px; background: linear-gradient(115deg, color-mix(in srgb, var(--fee-accent) 9%, var(--surface)), var(--surface)); }
.fee-condition-summary strong { display: block; font-size: 2rem; font-weight: 600; letter-spacing: -.04em; }
.fee-unconfigured { font-size: 1.15rem; letter-spacing: -.02em; }
.fee-edit-fields { margin-top: 1rem; }
.fee-calculation { margin-top: 1.4rem; }
.fee-calculation-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; margin-bottom: .5rem; }
.fee-calculation-heading h3 { margin: 0; font-size: .85rem; }
.fee-calculation-heading > strong { font-size: 1.35rem; color: var(--fee-accent); }
.fee-calculation-inputs { margin: 1rem 0; font-size: .8rem; }
.fee-calculation-inputs > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .4rem; }
.fee-calculation-inputs dt { font-weight: 400; color: var(--muted); }
.fee-calculation-inputs dd { margin: 0; overflow-wrap: anywhere; }
.fee-candidates { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.fee-candidates li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; padding: .65rem .8rem; border-radius: 10px; font-size: .8rem; background: var(--fee-field-bg); }
.fee-candidates li.is-selected { background: color-mix(in srgb, var(--fee-accent) 10%, var(--surface)); }
.fee-candidates strong { display: flex; align-items: center; gap: .4rem; }
.fee-candidates small { color: var(--muted); font-weight: 400; }
.fee-candidates i { color: var(--fee-accent); }
.fee-timeline { list-style: none; margin: 0; padding: 0; }
.fee-history-row { position: relative; display: flex; align-items: center; gap: .85rem; padding: .85rem 0; }
.fee-history-row:not(:last-child)::after { content: ''; position: absolute; top: calc(50% + 7px); left: 5px; bottom: calc(-50% + 7px); width: 1px; background: var(--border); }
.fee-history-dot { flex: 0 0 11px; height: 11px; border: 3px solid color-mix(in srgb, var(--fee-accent) 25%, var(--surface)); background: var(--fee-accent); border-radius: 50%; }
.fee-history-value { color: var(--text); font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fee-history-value small { font-size: .7rem; font-weight: 400; color: var(--muted); }
.fee-history-value.is-removed { font-size: .76rem; font-weight: 400; color: var(--muted); }
.deposit-fee-create { grid-column: 1 / -1; padding: .8rem 0; border-top: 1px solid var(--border); }
.ops-card-top .dropdown { display: inline-block; margin-left: .35rem; }
.fee-action { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 40px; min-height: 40px; }
.fee-performance-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.2rem; }
.fee-mobile-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .5rem; margin-top: 1rem; }
.fee-mobile-actions > a, .fee-mobile-actions > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .65rem .25rem; min-width: 0; min-height: 54px; font-size: .7rem; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); text-decoration: none; overflow-wrap: anywhere; }
.fee-mobile-actions i { font-size: 1rem; }
@media (max-width: 575.98px) {
 .fee-editor .modal-header, .fee-editor .modal-body { padding: 1rem; }
 .fee-heading { gap: .6rem; }
 .fee-heading-icon { flex-basis: 34px; height: 34px; border-radius: 10px; }
 .fee-editor .modal-title { font-size: 1rem; }
 .fee-editor .modal-header .fee-status { display: none; }
 .fee-fields-grid, .fee-metrics { gap: .65rem; }
 .fee-tier-row { gap: .35rem; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 36px; }
 .fee-tier-row > button { width: 36px; }
 .fee-tier-row .fee-input-shell { padding: 0 .45rem; gap: .3rem; }
 .fee-tier-row .fee-input-shell input { font-size: .82rem; }
 .fee-tier-row .fee-input-inline label, .fee-tier-row .fee-input-unit { font-size: .65rem; }
 .fee-condition-summary { padding: 1rem; }
 .fee-metrics > div { padding: .85rem; }
 .fee-metrics strong { font-size: 1.3rem; }
 .fee-history-row { gap: .65rem; }
 .fee-performance-heading > a { width: 100%; }
 .fee-performance-action { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
 .fee-editor *, .fee-performance-action, .deposit-fee-create * { transition: none !important; }
}
