/* Use the platform header, form-panel, button and active color-mode tokens. */
.system-models-modal {
    box-sizing: border-box;
    width: min(760px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: var(--layoutBorderWidth) solid var(--layoutBorderColor);
    border-radius: 10px;
    background: var(--frameBackground);
    color: var(--frameColor);
    font: inherit;
    box-shadow: 0 18px 60px var(--overlayBackground);
    overflow: hidden;
    color-scheme: dark;
}
:is([layout-mode='lite'], [layout-mode='medium']) .system-models-modal { color-scheme: light; }
.system-models-modal::backdrop { background: var(--overlayBackground); }
[data-system-models-open][hidden], .system-models-modal:not([open]), .system-models-modal [hidden] { display: none !important; }
.system-models-modal .frame-main {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 34px);
    margin: 0;
    pointer-events: auto;
}
.system-models-modal.new-layout .frame-main > .drilldown-wrapper { flex: none; margin: 0; }
.system-models-modal.new-layout .frame-main > .drilldown-wrapper > .stat-drilldown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 24px;
    border-bottom: var(--layoutBorderWidth) solid var(--layoutBorderColor);
}
.system-models-modal .drilldown-wrapper .drilldown-label { flex: 1; padding: 0; }
.system-models-modal.new-layout .stat-drilldown .tabs-header { flex: none; min-width: 0; }
.system-models-modal .summary-header { font-size: 16px; }
.system-models-modal .icons .button { width: 32px; min-height: 32px; padding: 0; font-size: 20px; }
.system-models-modal.new-layout .frame-main .frame-panels { flex: 1 1 auto; min-width: 0; min-height: 0; height: auto; overflow: auto; }
.system-models-modal.new-layout .frame-main .frame-panels .frame-panel { flex: 1 0 100%; min-width: 0; height: auto; overflow: visible; border: 0; }
.system-models-modal.new-layout .frame-main .frame-panels .frame-panel .form-panel { min-width: 0; max-width: none; flex: none; padding: 24px; gap: 24px; font-weight: 400; }
.system-models-modal .system-models-roles { display: grid; gap: 24px; }
.system-models-modal.new-layout .frame-main .frame-panels .frame-panel .form-panel label { min-width: 0; align-items: stretch; text-align: left; }
.system-models-modal small, .system-models-modal p { color: var(--subColor); font-size: 12px; line-height: 1.5; }
.system-models-modal p { margin: 0; }
.system-models-modal input, .system-models-modal select { height: 40px; margin: 0; padding: 9px 12px; font: inherit; }
.system-models-modal option { background: var(--frameBackground); color: var(--frameColor); }
.system-models-modal input[aria-invalid='true'] { border-color: var(--failedColor); }
.system-models-modal details { border-top: var(--layoutBorderWidth) solid var(--layoutBorderColor); padding-top: 18px; }
.system-models-modal summary { cursor: pointer; font-weight: 500; }
.system-models-modal [data-model-profiles] { display: grid; gap: 24px; padding-top: 18px; }
.system-models-modal fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.system-models-modal legend { margin-bottom: 12px; font-weight: 500; overflow-wrap: anywhere; }
.system-models-modal .system-model-rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.system-models-modal .system-model-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.system-models-modal .system-model-context { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.system-models-modal .system-model-note { margin-top: 14px; }
.system-models-modal .frame-actions { flex: none; padding: 16px 24px; border-top: var(--layoutBorderWidth) solid var(--layoutBorderColor); }
.system-models-modal .frame-actions .row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 0; }
.system-models-modal .button { min-height: 40px; margin: 0; font: inherit; background: var(--ctaBackground); border-color: var(--ctaBackground); }
.system-models-modal .button.dark { background: var(--inputBackground); color: var(--frameColor); border-color: var(--layoutBorderColor); }
.system-models-modal .button:disabled { opacity: .5; cursor: default; }
.system-models-modal [data-system-model-status]:empty { display: none; }
.system-models-modal [data-system-model-status] { margin: 0 0 12px; }
.system-models-modal [data-system-model-status].is-error { color: var(--failedColor); }
.system-models-modal :is(input, select, button, summary):focus-visible { outline: 2px solid var(--activeLabelColor); outline-offset: 2px; }
@media (max-width: 600px) {
    .system-models-modal .system-model-rates, .system-models-modal .system-model-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-models-modal.new-layout .frame-main > .drilldown-wrapper > .stat-drilldown, .system-models-modal .frame-actions { padding: 16px; }
    .system-models-modal.new-layout .frame-main .frame-panels .frame-panel .form-panel { padding: 20px 16px; }
}
