/* T709: the admin strategy editor (Pages/Fxs/FxsStrategyEditDialog.razor, FxsStrategyEditTab.razor) and the kit it shares with
   the AIBot drawer (Components/AdmStgRange, AdmRangeBar, AdmStgPicks, AdmStgBadge): the agreed prototype's Edit
   (docs/design/shared/strat.css) on the admin's tokens. Radzen's semantic palette and the admin's --adm-* surfaces only, so light
   and dark both hold; no colour literal. */

/* ---- the content modal: opens at a set height (AdmDialogs Height), the head and foot stay, the tab scrolls inside */
.adm-stg-modal .rz-dialog-content { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.adm-stg-dialog { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; color: var(--adm-ink); }
.adm-stg-main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; }
.adm-stg-head { flex: 0 0 auto; display: grid; gap: .6rem; padding: .25rem 1.25rem .85rem; border-bottom: 1px solid var(--adm-line); }
.adm-stg-head-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 1.1rem; min-width: 0; }
.adm-stg-name { flex: 1 1 16rem; min-width: min(16rem, 100%); }
.adm-stg-name .rz-form-field { width: 100%; }
.adm-stg-risk { flex: 0 0 8rem; }
.adm-stg-head-fields .adm-switch-label { min-height: 2.5rem; }
.adm-stg-body { display: grid; flex: 1 1 auto; grid-template-columns: 12.5rem minmax(0, 1fr); min-width: 0; min-height: 0; }
.adm-stg-nav { display: flex; flex-direction: column; gap: .2rem; min-height: 0; overflow: auto; padding: .85rem .6rem; border-right: 1px solid var(--adm-line); }
.adm-stg-nav button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .6rem; border: 0; border-radius: .5rem; background: transparent;
    color: var(--adm-ink); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.adm-stg-nav button:hover { background: var(--adm-hover); }
.adm-stg-nav button:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.adm-stg-nav button.on { background: color-mix(in srgb, var(--rz-primary) 13%, transparent); font-weight: 700; }
.adm-stg-n { display: inline-grid; place-items: center; flex: 0 0 auto; width: 1.35rem; height: 1.35rem; border: 1px solid var(--adm-line); border-radius: 50%;
    color: var(--adm-ink-muted); font-size: .72rem; font-weight: 700; }
.adm-stg-nav button.on .adm-stg-n { border-color: var(--rz-primary); background: var(--rz-primary); color: var(--rz-on-primary); }
.adm-stg-nav .adm-stg-dot, .adm-stg-nav .adm-stg-bad { margin-left: auto; }
.adm-stg-bad { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--rz-danger); color: var(--rz-on-danger);
    font-size: .72rem; font-weight: 800; }
.adm-stg-pane { min-width: 0; min-height: 0; overflow: auto; padding: .9rem 1.25rem 1.25rem; }
.adm-stg-pane-head { margin-bottom: .6rem; }
.adm-stg-sub { color: var(--adm-ink-muted); font-size: .84rem; line-height: 1.4; }
.adm-stg-steps { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1.1rem; }
.adm-stg-foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem .6rem; padding: .7rem 1.25rem;
    border-top: 1px solid var(--adm-line); background: var(--adm-surface); }
.adm-stg-count { margin-right: auto; color: var(--adm-ink-muted); font-size: .86rem; }
.adm-stg-count.has { color: var(--adm-ink); font-weight: 700; }
.adm-stg-error { flex: 1 1 100%; margin: 0; }

/* ---- groups and rows */
.adm-stg-group { margin-top: 1rem; }
.adm-stg-gh { display: grid; gap: .1rem; padding-bottom: .35rem; }
.adm-stg-gh > b { color: var(--adm-ink-title); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; }
.adm-stg-gh > span { color: var(--adm-ink-muted); font-size: .8rem; }
.adm-stg-row { display: grid; gap: .45rem; min-width: 0; padding: .75rem 0; border-top: 1px solid var(--adm-line); }
.adm-stg-label { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-width: 0; }
.adm-stg-label > b { font-size: .92rem; font-weight: 600; }
.adm-stg-label > small { margin-left: auto; color: var(--adm-ink-muted); font-size: .75rem; }
.adm-stg-tip { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; border: 1px solid var(--adm-line); border-radius: 50%;
    color: var(--adm-ink-muted); font-size: .66rem; font-weight: 700; cursor: help; }
.adm-stg-tip:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.adm-stg-dot { display: inline-block; flex: 0 0 auto; width: .5rem; height: .5rem; border-radius: 50%; background: var(--rz-primary); }
/* T709 (f): an optional number's Clear (back to not set), a small outlined button in the label line */
.adm-stg-clear { padding: .05rem .5rem; border: 1px solid var(--adm-line); border-radius: .35rem; background: transparent; color: var(--adm-ink-muted);
    font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; }
.adm-stg-clear:hover:not(:disabled) { border-color: var(--rz-danger); color: var(--rz-danger); }
.adm-stg-clear:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.adm-stg-clear:disabled { cursor: default; opacity: .6; }
.adm-stg-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; min-width: 0; }
.adm-stg-box { display: grid; gap: .2rem; min-width: 0; }
.adm-stg-box .rz-form-field { width: 100%; min-width: 0; }
.adm-stg-box.is-bad .rz-form-field-content { border-color: var(--rz-danger); box-shadow: 0 0 0 1px var(--rz-danger); }
.adm-stg-k3 { color: var(--adm-ink-muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.adm-stg-time { box-sizing: border-box; width: 9rem; min-height: 2.4rem; padding: .35rem .6rem; border: 1px solid var(--adm-line); border-radius: var(--rz-border-radius, .35rem);
    background: var(--adm-surface); color: var(--adm-ink); font: inherit; color-scheme: light dark; }
.adm-stg-time:focus { outline: 2px solid var(--rz-primary); outline-offset: 0; }
.adm-stg-shown { font-weight: 600; }
.adm-stg-off { padding: .6rem .75rem; border: 1px dashed var(--adm-line); border-radius: .5rem; }

/* ---- single values as chips: the selected chip is filled (UIX § 5); a minimum's step and its neighbours are marked (Q399-A) */
.adm-picks { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 100%; padding: 3px; border: 1px solid var(--adm-line); border-radius: .5rem;
    background: var(--adm-surface-tint); justify-self: start; }
.adm-picks > button { padding: .2rem .6rem; border: 0; border-radius: .38rem; background: transparent; color: var(--adm-ink-muted); font: inherit;
    font-size: .8rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.adm-picks > button:hover:not(:disabled) { color: var(--adm-ink); background: var(--adm-hover); }
.adm-picks > button:focus-visible { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.adm-picks > button.on { background: var(--rz-primary); color: var(--rz-on-primary); }
.adm-picks > button.is-step { outline: 1.5px solid var(--rz-primary); outline-offset: -2px; }
.adm-picks > button.is-near { outline: 1px dashed var(--adm-ink-muted); outline-offset: -2px; }
.adm-picks > button.on.is-step, .adm-picks > button.on.is-near { outline-color: var(--rz-on-primary); }
.adm-picks > button:disabled { cursor: default; }
.adm-picks.is-ro > button { cursor: default; }

/* ---- a range as a bar (Q374-A colours): track bands, the members' range bracket, the default mark, the axis */
.adm-rb { display: grid; gap: .15rem; min-width: 0; }
.adm-rb-bar { position: relative; height: 1.35rem; }
.adm-rb-trk { position: absolute; inset: .5rem 0 auto; height: .38rem; overflow: hidden; border-radius: .2rem; }
.adm-rb-trk > i { position: absolute; top: 0; bottom: 0; }
.adm-rb-neutral { background: var(--rz-base-400); }
.adm-rb-g { background: color-mix(in srgb, var(--rz-success) 55%, transparent); }
.adm-rb-y { background: color-mix(in srgb, var(--rz-warning) 70%, transparent); }
.adm-rb-r { background: color-mix(in srgb, var(--rz-danger) 38%, transparent); }
.adm-rb-rng { position: absolute; top: .18rem; height: 1rem; box-sizing: border-box; border: 2px solid var(--adm-ink); border-radius: .5rem; }
.adm-rb-def { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--rz-primary); }
.adm-rb-ax { display: flex; justify-content: space-between; gap: .5rem; color: var(--adm-ink-muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.adm-rb-m { text-align: center; }
.adm-rb-m b { color: var(--adm-ink); font-weight: 700; }
.adm-rb-key { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: .4rem 0 .2rem; padding: .5rem .7rem; border: 1px solid var(--adm-line); border-radius: .5rem;
    color: var(--adm-ink-muted); font-size: .76rem; }
.adm-rb-key > span { display: inline-flex; align-items: center; gap: .35rem; }
.adm-rb-key i { display: inline-block; width: 1rem; height: .45rem; border-radius: .2rem; }
.adm-rb-key i.adm-rb-key-rng { height: .6rem; box-sizing: border-box; border: 2px solid var(--adm-ink); border-radius: .35rem; }
.adm-rb-key i.adm-rb-key-def { width: 3px; height: .8rem; background: var(--rz-primary); }

/* ---- a value against its strategy (Q372-A): = when it matches, ≠ coloured by its band (Q374-A) with Reset */
.adm-badge-cmp { display: inline-flex; align-items: center; gap: .25rem; }
.adm-badge-cmp > b { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: .4rem; font-size: .8rem;
    --cmp: var(--adm-ink-muted); border: 1px solid color-mix(in srgb, var(--cmp) 45%, transparent); background: color-mix(in srgb, var(--cmp) 14%, transparent);
    color: color-mix(in srgb, var(--cmp) 70%, var(--adm-ink)); cursor: help; }
.adm-badge-cmp.is-g > b { --cmp: var(--rz-success); }
.adm-badge-cmp.is-y > b { --cmp: var(--rz-warning); }
.adm-badge-cmp.is-r > b { --cmp: var(--rz-danger); }
.adm-badge-cmp > button { padding: 0 .3rem; border: 0; background: none; color: var(--rz-link-color, var(--rz-primary)); font: inherit; font-size: .76rem;
    text-decoration: underline; cursor: pointer; }

/* ---- narrow: the tabs run across the top, the three boxes stack */
@media (max-width: 760px) {
    .adm-stg-main { display: block; overflow-y: auto; }
    .adm-stg-body { display: block; }
    .adm-stg-pane { overflow: visible; }
    .adm-stg-nav { position: sticky; top: 0; z-index: 2; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: .4rem .6rem; border-right: 0;
        border-bottom: 1px solid var(--adm-line); background: var(--adm-surface); }
    .adm-stg-head-fields { gap: .4rem .9rem; }
    .adm-stg-risk { flex: 1 1 8rem; }
    .adm-stg-nav button { width: auto; flex: 0 0 auto; padding: .4rem .55rem; }
    .adm-stg-nav .adm-stg-dot, .adm-stg-nav .adm-stg-bad { margin-left: .2rem; }
    .adm-stg-head, .adm-stg-pane, .adm-stg-foot { padding-inline: .85rem; }
    .adm-stg-label > small { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 520px) {
    .adm-stg-three { grid-template-columns: minmax(0, 1fr); }
    .adm-rb-ax > span:not(.adm-rb-m) { display: none; }
}

/* ---- the AIBot drawer: the account's own values (Components/AIBotAccountSettings.razor) and a pair's rules (AIBotPairRules.razor) */
.adm-aibot-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.adm-aibot-pane { margin-top: .5rem; padding: .25rem .9rem .9rem; border: 1px solid var(--adm-line); border-radius: .6rem; background: var(--adm-surface); }
.adm-aibot-pane > .adm-stg-gh { margin-top: .6rem; }
.adm-aibot-num .rz-form-field { width: min(16rem, 100%); }
.adm-aibot-save { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--adm-line); }
.adm-aibot-tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: .3rem .9rem; margin: .3rem 0 0; }
.adm-aibot-tpl > div { display: flex; justify-content: space-between; gap: .5rem; min-width: 0; padding: .3rem 0; border-bottom: 1px dashed var(--adm-line); font-size: .82rem; }
.adm-aibot-tpl dt { color: var(--adm-ink-muted); }
.adm-aibot-tpl dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.adm-aibot-rules { margin-top: .5rem; }
.adm-aibot-rules-table tbody th[scope="row"] { background: transparent; color: var(--adm-ink); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.adm-aibot-rules-table td { min-width: 12rem; }
.adm-aibot-cell { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.adm-aibot-cell .rz-form-field { width: 9.5rem; }
.adm-aibot-rules-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: .6rem; }

/* ---- T709 Q411-A / Q412-A: a strategy's picture or its initials on a tint (Components/AdmStgAvatar.razor), its ranking in the list
   (Pages/Fxs/FxsStrategies.razor) and the editor's Picture row (FxsStrategyEditDialog.razor) */
.adm-stg-av { flex: 0 0 auto; display: inline-grid; place-items: center; box-sizing: border-box; width: 1.9rem; height: 1.9rem;
    border-radius: .5rem; background: color-mix(in srgb, var(--rz-primary) 14%, var(--adm-surface)); color: var(--rz-primary);
    font-size: .72rem; font-weight: 800; letter-spacing: .02em; object-fit: cover; vertical-align: middle; }
.adm-stg-av.is-mine { background: var(--adm-surface-tint); color: var(--adm-ink); border: 1px dashed var(--adm-ink-muted); }
.adm-stg-av[hidden] { display: none; } /* a picture that failed to load gives way to the initials (AdmStgAvatar) */
.adm-stg-av.is-lg { width: 3.4rem; height: 3.4rem; border-radius: .75rem; font-size: 1.05rem; }
.adm-stg-nm { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; max-width: 100%; }
.adm-stg-nm > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.adm-stg-sort { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .75rem; }
.adm-stg-sort > span { color: var(--adm-ink-muted); font-size: .8rem; font-weight: 600; }
.adm-stg-score { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.adm-stg-pic { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; min-width: 0; }
.adm-stg-pic-text { display: grid; gap: .1rem; min-width: 0; }
.adm-stg-pic-text > small { color: var(--adm-ink-muted); font-size: .75rem; }
.adm-stg-pic-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
/* The file input is the label's own: the outlined label is the button a member sees, the input is read by screen readers. */
.adm-stg-upload { position: relative; display: inline-flex; align-items: center; gap: .35rem; box-sizing: border-box; min-height: 2.1rem; padding: .3rem .8rem;
    border: 1px solid var(--rz-primary); border-radius: var(--rz-border-radius, .35rem); color: var(--rz-primary); font-size: .85rem; font-weight: 600;
    cursor: pointer; }
.adm-stg-upload:hover { background: var(--adm-hover); }
.adm-stg-upload:focus-within { outline: 2px solid var(--rz-primary); outline-offset: 1px; }
.adm-stg-upload.is-busy { opacity: .6; pointer-events: none; }
.adm-stg-upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
