/* M5 layout v2: presentation only. Uses existing theme colors. */
.fd-workbench.fd-layout-v2{padding:18px 22px!important;background:var(--bg,#f4f6f9)!important}
.fd-layout-v2 *{box-sizing:border-box}
.fd-layout-v2 .fd-top h3{font-size:18px;line-height:1.4}
.fd-layout-v2 .fd-flow{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;background:transparent;padding:8px 0;margin:0;font-size:12px;color:var(--muted,var(--ink));border-bottom:1px solid var(--line)}
.fd-layout-v2 .fd-flow>b{white-space:nowrap;color:var(--ink)}
.fd-layout-v2 .fd-mechanism{max-width:66%;text-align:left}
.fd-layout-v2 .fd-mechanism>summary{cursor:pointer;text-align:right;color:var(--primary,#2771b7)}
.fd-layout-v2 .fd-mechanism[open]{line-height:1.8}
.fd-layout-v2 [data-d=status]{min-height:18px;margin:7px 0 10px}
.fd-layout-v2 .fd-grid{gap:16px;align-items:start}
.fd-layout-v2 .fd-main,.fd-layout-v2 .fd-side{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px;min-width:0}
.fd-layout-v2 .fd-main>.fd-controls:first-child{margin:0 0 10px;gap:10px;font-size:12px}
.fd-layout-v2 input[type=month]{padding:6px 8px;min-height:34px;width:136px;font-size:12px}
.fd-layout-v2 .fd-chart-toolbar{margin:0;padding:9px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);gap:10px}
.fd-layout-v2 .fd-chart-toolbar>label{font-size:12px;white-space:nowrap;display:flex;align-items:center;gap:5px}
.fd-layout-v2 .fd-chart-toolbar>.fd-tabs{width:104px;flex-shrink:0}
.fd-layout-v2 .fd-toolbar-caption{font-size:12px}
.fd-layout-v2 .fd-chart-toolbar>.btn{font-size:12px;min-height:32px;padding:6px 10px;white-space:nowrap}
.fd-layout-v2 [data-d=intervalStatus]{flex-basis:100%;font-size:11px;margin:0}
.fd-layout-v2 .fd-picker{position:relative;z-index:20;margin-right:auto}
.fd-layout-v2 .fd-picker>summary{list-style:none;display:flex;align-items:center;gap:10px;cursor:pointer;min-height:34px;padding:6px 11px;border:1px solid var(--line);border-radius:7px;font-size:13px;font-weight:650;background:var(--card);color:var(--ink)}
.fd-layout-v2 .fd-picker>summary::-webkit-details-marker{display:none}
.fd-layout-v2 .fd-picker[open]>summary{border-color:var(--primary,#2771b7);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary,#2771b7) 12%,transparent)}
.fd-layout-v2 .fd-selection-badge{min-width:22px;border-radius:5px;padding:1px 5px;font-size:11px;text-align:center;color:var(--primary,#2771b7);background:color-mix(in srgb,var(--primary,#2771b7) 10%,var(--card))}
.fd-layout-v2 .fd-picker-panel{position:absolute;top:calc(100% + 8px);left:0;width:min(560px,calc(100vw - 76px));max-height:65vh;overflow:auto;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 32px #0002;padding:14px}
.fd-layout-v2 .fd-picker-panel>p:first-child{margin:0 0 10px}
.fd-layout-v2 .fd-bulk{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:9px;border-bottom:1px solid var(--line);margin-bottom:5px}
.fd-layout-v2 .fd-bulk-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.fd-layout-v2 .fd-bulk-actions button{appearance:none;margin:0;border:0;border-radius:5px;min-width:62px;min-height:32px;padding:6px 10px;white-space:nowrap;font-size:12px;font-weight:600;line-height:20px;color:var(--primary,#2771b7);background:color-mix(in srgb,var(--primary,#2771b7) 7%,var(--card))}
.fd-layout-v2 .fd-bulk-actions button:hover:not(:disabled){background:color-mix(in srgb,var(--primary,#2771b7) 16%,var(--card))}
.fd-layout-v2 button:disabled{opacity:.5;cursor:default}
.fd-layout-v2 .fd-model-option{display:grid;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:38px;padding:7px 6px;border-radius:6px;cursor:pointer;font-size:12px}
.fd-layout-v2 .fd-model-option:hover{background:color-mix(in srgb,var(--primary,#2771b7) 6%,var(--card))}
.fd-layout-v2 .fd-model-option:has(input:checked){background:color-mix(in srgb,var(--primary,#2771b7) 8%,var(--card))}
.fd-layout-v2 .fd-model-option input{margin:0;accent-color:var(--primary,#2771b7);width:15px;height:15px}
.fd-layout-v2 .fd-model-name{line-height:1.5}
.fd-layout-v2 .fd-model-score{font-variant-numeric:tabular-nums;color:var(--muted,var(--ink));font-size:11px;white-space:nowrap}
.fd-layout-v2 .fd-legend{max-height:66px;overflow:auto;padding:8px 0;gap:6px 14px;font-size:11px;line-height:1.5;margin:0}
.fd-layout-v2 .fd-main>.fd-top{margin:5px 0}
.fd-layout-v2 .fd-main>.fd-top .fd-note{font-size:11px}
.fd-layout-v2 [data-d=months]{border-top:1px solid var(--line);margin-top:4px}
.fd-layout-v2 .fd-main>details{border-top:1px solid var(--line);padding-top:10px;font-size:12px}
.fd-layout-v2 summary{cursor:pointer}
.fd-layout-v2 .fd-side{position:sticky;top:0;padding:12px}
.fd-layout-v2 .fd-tabs{border:0;background:color-mix(in srgb,var(--ink) 5%,var(--card));padding:3px;gap:3px;border-radius:7px}
.fd-layout-v2 .fd-tabs button{white-space:nowrap;min-height:30px;font-size:12px;padding:6px 5px;border-radius:5px;background:transparent}
.fd-layout-v2 .fd-tabs button[aria-pressed=true]{background:var(--card);color:var(--primary,#2771b7);box-shadow:0 1px 4px #0002}
.fd-layout-v2 .fd-panel{padding-top:7px}
.fd-layout-v2 .fd-panel>.fd-note{font-size:11px;line-height:1.6;margin:5px 0 8px}
.fd-layout-v2 .fd-weight-list{max-height:27vh;overflow:auto;border-bottom:1px solid var(--line)}
.fd-layout-v2 .fd-weight-list table{font-size:11px}
.fd-layout-v2 .fd-weight-list th{position:sticky;top:0;background:var(--card);z-index:1;font-size:11px}
.fd-layout-v2 .fd-weight-list td{padding:7px 3px!important;line-height:1.5}
.fd-layout-v2 .fd-weight{width:59px;font-size:12px;padding:5px 4px;min-height:30px}
.fd-layout-v2 .fd-weight-list small{color:var(--muted,var(--ink))}
.fd-layout-v2 .fd-side .btn{font-size:12px;min-height:34px;padding:7px 8px;border-radius:7px}
.fd-layout-v2 [data-d=autoWeight]{width:100%;background:transparent;border:1px solid var(--line);color:var(--primary,#2771b7);margin-top:4px}
.fd-layout-v2 .fd-summary{border:0;border-radius:7px;background:color-mix(in srgb,var(--primary,#2771b7) 5%,var(--card));padding:10px;margin:12px 0 8px;font-size:12px}
.fd-layout-v2 .fd-summary div:last-child{padding-top:7px;margin-top:7px;border-top:1px solid var(--line);font-size:14px}
.fd-layout-v2 [data-d=save]{font-weight:700;min-height:38px}
.fd-layout-v2 .fd-side>.fd-note{font-size:10px;margin:8px 0 0;line-height:1.6}
.fd-layout-v2 :focus-visible{outline:2px solid var(--primary,#2771b7);outline-offset:2px}
@media(max-width:850px){.fd-workbench.fd-layout-v2{padding:12px!important}.fd-layout-v2 .fd-grid{grid-template-columns:1fr}.fd-layout-v2 .fd-side{position:static}.fd-layout-v2 .fd-flow{flex-wrap:wrap;gap:6px}.fd-layout-v2 .fd-mechanism{max-width:100%}.fd-layout-v2 .fd-picker-panel{width:min(560px,calc(100vw - 56px))}.fd-layout-v2 .fd-weight-list{max-height:240px}}
@media(min-width:851px){
 .fd-layout-v2 .fd-side{display:flex;flex-direction:column;max-height:calc(100dvh - 142px);overflow:hidden}
 .fd-layout-v2 .fd-side>*{flex-shrink:0}
 .fd-layout-v2 .fd-side>[data-panel]{flex:1 1 auto;min-height:0;overflow:auto;padding-right:3px}
 .fd-layout-v2 .fd-weight-list{max-height:none;overflow:visible}
 .fd-layout-v2 .fd-summary{margin:7px 0 3px;padding:7px 9px}
 .fd-layout-v2 .fd-summary div{margin:2px 0}
 .fd-layout-v2 .fd-summary div:last-child{padding-top:5px;margin-top:5px}
 .fd-layout-v2 .fd-side>.fd-save{margin-top:5px;min-height:32px;padding:6px 8px}
 .fd-layout-v2 .fd-side>[data-d=save]{min-height:36px}
}
.fd-layout-v2 .fd-weight-model{display:inline-block;max-width:115px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
@media(min-width:851px){
 .fd-layout-v2 .fd-side>[data-panel=weight]{display:flex;flex-direction:column;overflow:hidden}
 .fd-layout-v2 [data-panel=weight]>*{flex-shrink:0}
 .fd-layout-v2 [data-panel=weight]>.fd-weight-list{flex:1 1 auto;min-height:54px;overflow:auto}
 .fd-layout-v2 [data-d=weightNote]{font-size:10px;margin:4px 0;line-height:1.4}
}
.fd-layout-v2 .fd-secondary-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.fd-layout-v2 .fd-secondary-actions .btn{padding:6px 2px;font-size:11px;min-height:32px}
.fd-layout-v2 .fd-summary{display:grid;grid-template-columns:1fr 1fr;gap:5px 10px}
.fd-layout-v2 .fd-summary>small{grid-column:1/-1}
.fd-layout-v2 .fd-summary div{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0!important;font-size:11px}
.fd-layout-v2 .fd-summary div:last-child{border:0;padding:0;margin:0;font-size:12px}

/* The model comparison can expand. Keep each editor and its actions reachable. */
@media(min-width:851px){
 .fd-layout-v2 .fd-side{display:block;max-height:calc(100dvh - 28px);overflow:auto;overscroll-behavior:contain}
 .fd-layout-v2 .fd-side>[data-panel]{overflow:visible}
 .fd-layout-v2 .fd-side>[data-panel=weight]{display:block;overflow:visible}
}
/* Plot frame: theme-aware, restrained and separated from controls. */
.fd-layout-v2 [data-d=chart]{border:1px solid color-mix(in srgb,var(--ink) 18%,var(--line));border-radius:10px;padding:8px 5px 2px;margin:8px 0;background:var(--card);box-shadow:0 2px 8px #00000006;overflow:hidden}
